text: /*!
   * @form-create/ant-design-vue v1.0.16
   * (c) 2018-2020 xaboy
   * Github https://github.com/xaboy/form-create
   * Released under the MIT License.
   */
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("moment")):"function"==typeof define&&define.amd?define(["exports","vue","moment"],t):t((e=e||self).formCreate={},e.Vue,e.moment)}(this,function(exports,Vue,moment){"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(r,!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _extends(){return(_extends=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)}Vue=Vue&&Vue.hasOwnProperty("default")?Vue.default:Vue,moment=moment&&moment.hasOwnProperty("default")?moment.default:moment;var normalMerge=["attrs","props","domProps"],toArrayMerge=["class","style","directives"],functionalMerge=["on","nativeOn"],mergeJsxProps=function(e){return e.reduce(function(e,t){for(var r in t)if(e[r])if(-1!==normalMerge.indexOf(r))e[r]=_extends({},e[r],t[r]);else if(-1!==toArrayMerge.indexOf(r)){var n=e[r]instanceof Array?e[r]:[e[r]],i=t[r]instanceof Array?t[r]:[t[r]];e[r]=n.concat(i)}else if(-1!==functionalMerge.indexOf(r))for(var a in t[r])if(e[r][a]){var o=e[r][a]instanceof Array?e[r][a]:[e[r][a]],s=t[r][a]instanceof Array?t[r][a]:[t[r][a]];e[r][a]=o.concat(s)}else e[r][a]=t[r][a];else if("hook"==r)for(var u in t[r])e[r][u]=e[r][u]?mergeFn(e[r][u],t[r][u]):t[r][u];else e[r]=t[r];else e[r]=t[r];return e},{})},mergeFn=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}},helper=mergeJsxProps;function $set(e,t,r){Vue.set(e,t,r)}function $del(e,t){Vue.delete(e,t)}function isValidChildren(e){return Array.isArray(e)&&e.length>0}var _toString=Object.prototype.toString;function isUndef(e){return null==e}function toString(e){return null==e?"":"object"===_typeof(e)?JSON.stringify(e,null,2):String(e)}function extend(e,t){for(var r in t)$set(e,r,t[r]);return e}function debounce(e,t){var r=null;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];null!==r&&clearTimeout(r),r=setTimeout(function(){return e.apply(void 0,i)},t)}}function isType(e,t){return _toString.call(e)==="[object "+t+"]"}function isPlainObject(e){return isType(e,"Object")}function isFunction(e){return isType(e,"Function")}function isString(e){return isType(e,"String")}function isBool(e){return isType(e,"Boolean")}function toLine(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function toArray(e){return Array.isArray(e)?e:isUndef(e)||""===e?[]:[e]}function isElement(e){return"object"===_typeof(e)&&null!==e&&1===e.nodeType&&!isPlainObject(e)}function deepExtend(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=!1;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i];if((n=Array.isArray(a))||isPlainObject(a)){var o=void 0===e[i];if(n)n=!1,o&&$set(e,i,[]);else if(a._clone){if(a=a._clone(),!r){$set(e,i,a);continue}a=a.getRule(),o&&$set(e,i,{})}else o&&$set(e,i,{});deepExtend(e[i],a,r)}else $set(e,i,a)}return e}function deepExtendArgs(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.forEach(function(t){e=deepExtend(e,t)}),e}var id=0;function uniqueId(){return++id}function preventDefault(e){e.preventDefault()}function hasSlot(e,t){return 0!==e.length&&e.some(function(e){if(e.data){if(!e.data.slot&&"default"===t||e.data.slot===t)return!0}else if("default"===t)return!0;return!1})}function errMsg(e){return"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com"+(e||"")}function styleInject(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var css=".fc-upload-btn, .fc-files {\n    display: inline-block;\n    width: 104px;\n    height: 104px;\n    text-align: center;\n    line-height: 104px;\n    border: 1px solid #c0ccda;\n    border-radius: 4px;\n    overflow: hidden;\n    background: #fff;\n    position: relative;\n    box-shadow: 2px 2px 5px rgba(0, 0, 0, .1);\n    margin-right: 4px;\n    box-sizing: border-box;\n}\n\n.form-create .form-create .ant-form-item {\n    margin-bottom: 22px;\n}\n\n.form-create .form-create .ant-form-item .ant-form-item {\n    margin-bottom: 0px;\n}\n\n.form-create .form-create .ant-form-item.ant-form-item-with-help {\n    margin-bottom: 3px;\n}\n\n.form-create .form-create .ant-form-item .ant-form-item.ant-form-item-with-help {\n    margin-bottom: -22px;\n}\n\n.__fc_h {\n    display: none;\n}\n\n.__fc_v {\n    visibility: hidden;\n}\n\n.fc-files img {\n    width: 100%;\n    height: 100%;\n    display: inline-block;\n    vertical-align: top;\n}\n\n.fc-upload .fc-upload-cover {\n    opacity: 0;\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    background: rgba(0, 0, 0, .6);\n    transition: opacity .3s;\n}\n\n.fc-upload .fc-upload-cover i {\n    color: #fff;\n    font-size: 20px;\n    cursor: pointer;\n    margin: 0 2px;\n}\n\n.fc-files:hover .fc-upload-cover {\n    opacity: 1;\n}\n\n.fc-upload .ant-upload {\n    display: block;\n}\n\n.fc-hide-btn .ant-upload {\n    display: none;\n}\n",style={"fc-upload-btn":"fc-upload-btn","fc-files":"fc-files","form-create":"form-create","ant-form-item":"ant-form-item","ant-form-item-with-help":"ant-form-item-with-help",__fc_h:"__fc_h",__fc_v:"__fc_v","fc-upload":"fc-upload","fc-upload-cover":"fc-upload-cover","ant-upload":"ant-upload","fc-hide-btn":"fc-hide-btn"};styleInject(css);var parseFile=function(e,t){return{url:e,name:getFileName(e),status:"done",uid:t+1}},getFileName=function(e){return toString(e).split("/").pop()},parseUpload=function(e){return{url:e.url,file:e}},upload={name:"fc-antd-update",props:{limit:{type:Number,default:0},ctx:{type:Object,default:function(){return{props:{}}}},children:{type:Array,default:function(){return[]}},value:{type:Array,default:function(){return[]}},onSuccess:{type:Function,required:!0},onHandle:{type:Function,default:function(e){this.previewImage=e.url,this.previewVisible=!0}},modalTitle:String},data:function(){var e=this.value.map(parseFile);return{defaultUploadList:e,previewImage:"",previewVisible:!1,uploadList:e.map(parseUpload)}},watch:{value:function(e){var t=e.map(parseFile);this.$refs.upload.sFileList=t,this.uploadList=t.map(parseUpload)}},methods:{initChildren:function(){hasSlot(this.children,"default")||this.children.push(this.makeBtn())},makeBtn:function(){var e=this.$createElement;return e("div",[e("AIcon",{attrs:{type:"plus"}})])},handleChange:function(e){var t=e.file,r=e.fileList,n=this.uploadList;"done"===t.status?(this.onSuccess(t,r),t.url&&n.push({url:t.url,file:r[r.length-1]}),this.input()):"removed"===t.status&&(n.forEach(function(e,r){e.file===t&&n.splice(r,1)}),this.input())},input:function(){this.$emit("input",this.uploadList.map(function(e){return e.url}))}},render:function(){var e=this,t=arguments[0],r=!this.limit||this.limit>this.uploadList.length;this.initChildren();var n=_objectSpread2({},this.ctx);return n.on=deepExtend({},n.on||{}),t("div",{class:_defineProperty({},style["fc-hide-btn"],!r)},[t("AUpload",helper([{},n,{on:{preview:this.onHandle.bind(this),change:this.handleChange},ref:"upload",attrs:{defaultFileList:this.defaultUploadList}}]),[this.children]),t("aModal",{attrs:{title:this.modalTitle,footer:null},model:{value:e.previewVisible,callback:function(t){e.previewVisible=t}}},[t("img",{style:"width: 100%",attrs:{src:this.previewImage}})])])}},NAME="fc-antd-frame",frame={name:NAME,props:{type:{type:String,default:"input"},field:{type:String,default:""},helper:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},src:{type:String,required:!0},icon:{type:String,default:"folder"},width:{type:[Number,String],default:500},height:{type:[Number,String],default:370},maxLength:{type:Number,default:0},okBtnText:{type:String,default:"确定"},closeBtnText:{type:String,default:"关闭"},modalTitle:String,handleIcon:{type:[String,Boolean],default:void 0},title:String,allowRemove:{type:Boolean,default:!0},onOpen:{type:Function,default:function(){}},onOk:{type:Function,default:function(){}},onCancel:{type:Function,default:function(){}},onLoad:{type:Function,default:function(){}},onBeforeRemove:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},onHandle:{type:Function,default:function(e){this.previewImage=this.getSrc(e),this.previewVisible=!0}},modal:{type:Object,default:function(){return{}}},srcKey:{type:[String,Number]},value:[Array,String,Number,Object],footer:{type:Boolean,default:!0},reload:{type:Boolean,default:!0},closeBtn:{type:Boolean,default:!0},okBtn:{type:Boolean,default:!0}},data:function(){return{fileList:toArray(this.value),unique:uniqueId(),previewVisible:!1,frameVisible:!1,previewImage:""}},watch:{value:function(e){this.fileList=toArray(e)},fileList:function(e){var t=1===this.maxLength?e[0]||"":e;this.$emit("input",t),this.$emit("change",t)}},methods:{key:function(e){return NAME+e+this.unique},closeModel:function(e){this.$emit(e?"$close":"$ok"),this.reload&&(this.$off("$ok"),this.$off("$close")),this.frameVisible=!1},showModel:function(){this.disabled||!1===this.onOpen()||(this.frameVisible=!0)},makeInput:function(){var e=this,t=this.$createElement,r={type:"text",value:this.fileList.map(function(t){return e.getSrc(t)}).toString(),readonly:!0};return t("AInput",helper([{},{props:r},{key:this.key("input")}]),[t("AIcon",{attrs:{type:this.icon},slot:"addonAfter",on:{click:this.showModel}}),this.fileList.length?t("AIcon",{attrs:{type:"close-circle"},slot:"suffix",on:{click:function(){return e.fileList=[]}}}):null])},makeGroup:function(e){var t=this.$createElement;return(!this.maxLength||this.fileList.length<this.maxLength)&&e.push(this.makeBtn()),t("div",{class:style["fc-upload"],key:this.key("group")},_toConsumableArray(e))},makeItem:function(e,t){return(0,this.$createElement)("div",{class:style["fc-files"],key:this.key("file"+e)},_toConsumableArray(t))},valid:function(e){if(e!==this.field)throw new Error("frame 无效的字段值")},makeIcons:function(e,t){var r=this.$createElement;if(!1!==this.handleIcon||!0===this.allowRemove){var n=[];return("file"!==this.type&&!1!==this.handleIcon||"file"===this.type&&this.handleIcon)&&n.push(this.makeHandleIcon(e,t)),this.allowRemove&&n.push(this.makeRemoveIcon(e,t)),r("div",{class:style["fc-upload-cover"],key:this.key("uc")},[n])}},makeHandleIcon:function(e,t){var r=this;return(0,this.$createElement)("AIcon",{attrs:{type:!0===this.handleIcon||void 0===this.handleIcon?"eye-o":this.handleIcon},on:{click:function(){return r.handleClick(e)}},key:this.key("hi"+t)})},makeRemoveIcon:function(e,t){var r=this;return(0,this.$createElement)("AIcon",{attrs:{type:"delete"},on:{click:function(){return r.handleRemove(e)}},key:this.key("ri"+t)})},makeFiles:function(){var e=this,t=this.$createElement;return this.makeGroup(this.fileList.map(function(r,n){return e.makeItem(n,[t("AIcon",{attrs:{type:"file"},on:{click:function(){return e.handleClick(r)}}}),e.makeIcons(r,n)])}))},makeImages:function(){var e=this,t=this.$createElement;return this.makeGroup(this.fileList.map(function(r,n){return e.makeItem(n,[t("img",{attrs:{src:e.getSrc(r)}}),e.makeIcons(r,n)])}))},makeBtn:function(){var e=this,t=this.$createElement;return t("div",{class:style["fc-upload-btn"],on:{click:function(){return e.showModel()}},key:this.key("btn")},[t("AIcon",{attrs:{type:this.icon,theme:"filled"}})])},handleClick:function(e){if(!this.disabled)return this.onHandle(e)},handleRemove:function(e){this.disabled||!1!==this.onBeforeRemove(e)&&(this.fileList.splice(this.fileList.indexOf(e),1),this.onRemove(e))},getSrc:function(e){return isUndef(this.srcKey)?e:e[this.srcKey]},frameLoad:function(e){var t=this;this.onLoad(e);try{if(!0===this.helper)e.currentTarget.contentWindow.form_create_helper={close:function(e){t.valid(e),t.closeModel()},set:function(e,r){t.valid(e),t.disabled||t.$emit("input",r)},get:function(e){return t.valid(e),t.value},onOk:function(e){return t.$on("$ok",e)},onClose:function(e){return t.$on("$close",e)}}}catch(e){console.log(e)}},makeFooter:function(){var e=this,t=this.$createElement,r=this.$props,n=r.okBtnText,i=r.closeBtnText,a=r.closeBtn,o=r.okBtn,s=[];return r.footer?(a&&s.push(t("AButton",{on:{click:function(){return!1!==e.onCancel()&&e.closeModel(!0)}}},[i])),o&&s.push(t("AButton",{attrs:{type:"primary"},on:{click:function(){return!1!==e.onOk()&&e.closeModel()}}},[n])),s):s}},render:function(){var e,t=this,r=arguments[0],n=this.type;e="input"===n?this.makeInput():"image"===n?this.makeImages():this.makeFiles();var i=this.$props,a=i.width,o=void 0===a?"30%":a,s=i.height,u=i.src,l=i.title;return r("div",[e,r("aModal",{attrs:{title:i.modalTitle,footer:null},model:{value:t.previewVisible,callback:function(e){t.previewVisible=e}}},[r("img",{attrs:{alt:"example",src:this.previewImage},style:"width: 100%"})]),r("aModal",helper([{},{props:_objectSpread2({width:o,title:l},this.modal)},{attrs:{visible:this.frameVisible},on:{cancel:function(){return t.closeModel(!0)}}}]),[this.frameVisible||!this.reload?r("iframe",{attrs:{src:u,frameborder:"0"},style:{height:s,border:"0 none",width:"100%"},on:{load:this.frameLoad}}):null,r("div",{slot:"footer"},[this.makeFooter()])])])}},formCreateName="FormCreate";function $FormCreate(e,t){return{name:formCreateName,componentName:formCreateName,props:{rule:{type:Array,required:!0},option:{type:Object,default:function(){return{}},required:!1},value:Object},data:function(){return{formData:void 0,buttonProps:void 0,resetProps:void 0,$f:void 0,isShow:!0,unique:1}},components:t,render:function(){return this.formCreate.render()},methods:{_buttonProps:function(e){this.$set(this,"buttonProps",deepExtend(this.buttonProps,e))},_resetProps:function(e){this.$set(this,"resetProps",deepExtend(this.resetProps,e))},_refresh:function(){++this.unique}},watch:{option:"_refresh",rule:function(e){this.formCreate.handle.reloadRule(e)}},beforeCreate:function(){var t=this.$options.propsData,r=t.rule,n=t.option;this.formCreate=new e(r,n),this.formCreate.beforeCreate(this)},created:function(){this.formCreate.created(),this.$f=this.formCreate.api(),this.$emit("input",this.$f)},mounted:function(){this.formCreate.mounted(),this.$emit("input",this.$f)},beforeDestroy:function(){this.formCreate.handle.reloadRule([]),this.formCreate.handle.$render.clearCacheAll()}}}var normalMerge$1=["attrs","props","domProps"],toArrayMerge$1=["class","style","directives"],functionalMerge$1=["on","nativeOn"],mergeJsxProps$1=function(e,t){return e.reduce(function(e,t){for(var r in t)if(e[r])if(-1!==normalMerge$1.indexOf(r))e[r]=_objectSpread2({},e[r],{},t[r]);else if(-1!==toArrayMerge$1.indexOf(r)){var n=e[r]instanceof Array?e[r]:[e[r]],i=t[r]instanceof Array?t[r]:[t[r]];e[r]=[].concat(_toConsumableArray(n),_toConsumableArray(i))}else if(-1!==functionalMerge$1.indexOf(r))for(var a in t[r])if(e[r][a]){var o=e[r][a]instanceof Array?e[r][a]:[e[r][a]],s=t[r][a]instanceof Array?t[r][a]:[t[r][a]];e[r][a]=[].concat(_toConsumableArray(o),_toConsumableArray(s))}else e[r][a]=t[r][a];else if("hook"===r)for(var u in t[r])e[r][u]?e[r][u]=mergeFn$1(e[r][u],t[r][u]):e[r][u]=t[r][u];else e[r]=t[r];else e[r]=t[r];return e},t)},mergeFn$1=function(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}};function defVData(){return{props:{},on:{}}}var VData=function(){function e(){_classCallCheck(this,e),this.init()}return _createClass(e,[{key:"merge",value:function(e){return mergeJsxProps$1([e],this._data),this}},{key:"class",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return isUndef(e)?this:(Array.isArray(e)?this.merge({class:e}):isPlainObject(e)?this.merge(e):this.merge({class:_defineProperty({},toString(e),!!t)}),this)}},{key:"init",value:function(){return this._data=defVData(),this}},{key:"get",value:function(){var e=this,t=Object.keys(this._data).reduce(function(t,r){var n=e._data[r];return void 0===n?t:Array.isArray(n)&&!n.length?t:isPlainObject(n)&&!Object.keys(n).length&&"props"!==r?t:(t[r]=n,t)},{});return this.init(),t}}]),e}(),keyList=["ref","key","slot"],objList=["scopedSlots","nativeOn","on","domProps","props","attrs","style","directives"];keyList.forEach(function(e){VData.prototype[e]=function(t){return this.merge(_defineProperty({},e,t)),this}}),objList.forEach(function(e){VData.prototype[e]=function(t,r){return isUndef(t)?this:(isPlainObject(t)?this.merge(_defineProperty({},e,t)):this.merge(_defineProperty({},e,_defineProperty({},toString(t),r))),this)}});var vdataField=objList.concat(keyList,"class");function baseRule(){return{validate:[],options:[],col:{},children:[],control:[],emit:[],template:void 0,emitPrefix:void 0,native:void 0,info:void 0}}function creatorFactory(e){return function(t,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Creator(e,t,r,n,i)}}function creatorTypeFactory(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return function(n,i,a){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=new Creator(e,n,i,a,o);return isFunction(t)?t(s):s.props(r,t),s}}var Creator=function(e){function t(e,r,n,i){var a,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return _classCallCheck(this,t),extend((a=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this)))._data,baseRule()),extend(a._data,{type:e,title:r,field:n,value:i}),isPlainObject(o)&&a.props(o),a}return _inherits(t,VData),_createClass(t,[{key:"type",value:function(e){return this.props("type",e),this}},{key:"_clone",value:function(){var e=new this.constructor;return e._data=deepExtend({},this._data),e}},{key:"getRule",value:function(){return this._data}},{key:"event",value:function(){return this.on.apply(this,arguments),this}}]),t}(),keyAttrs=["emitPrefix","className","value","name","title","native","info","hidden","visibility","inject","model"];keyAttrs.forEach(function(e){Creator.prototype[e]=function(t){return $set(this._data,e,t),this}});var objAttrs=["col"];objAttrs.forEach(function(e){Creator.prototype[e]=function(t){return $set(this._data,e,extend(this._data[e],t)),this}});var arrAttrs=["validate","options","children","emit","control"];arrAttrs.forEach(function(e){Creator.prototype[e]=function(t){return Array.isArray(t)||(t=[t]),$set(this._data,e,this._data[e].concat(t)),this}});var PREFIX="[[FORM-CREATE-PREFIX-",SUFFIX="-FORM-CREATE-SUFFIX]]";function toJson(e){return JSON.stringify(deepExtend([],e,!0),function(e,t){if(!t||!0!==t._isVue){if("function"!=typeof t)return t;if(t.__inject&&(t=t.__origin),!t.__emit)return PREFIX+t+SUFFIX}})}function makeFn(fn){return eval("(function(){return "+fn+" })()")}function parseJson(e,t){return JSON.parse(e,function(e,r){if(isUndef(r)||!r.indexOf)return r;try{if(r.indexOf(SUFFIX)>0&&0===r.indexOf(PREFIX))return makeFn(-1===(r=r.replace(SUFFIX,"").replace(PREFIX,"")).indexOf("function")&&0!==r.indexOf("(")?"function "+r:r);if(!t&&r.indexOf("function")>-1)return makeFn(r)}catch(e){return void console.error("[form-create]解析失败:".concat(r))}return r})}function enumerable(e){return{value:e,enumerable:!1,configurable:!1}}function copyRule(e,t){return copyRules([e],t)[0]}function copyRules(e,t){return deepExtend([],e,t)}var commonMaker=creatorFactory("");function create(e,t,r){var n=commonMaker("",t);return n._data.type=e,n._data.title=r,n}function createTmp(e,t,r,n){var i=commonMaker("",r);return i._data.type="template",i._data.template=e,i._data.title=n,i._data.vm=t,i}function makerFactory(){var e={};return extend(e,{create:create,createTmp:createTmp}),e.template=createTmp,e.parse=parse,e}function parse(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isString(e)&&(e=parseJson(e)),e instanceof Creator)return t?e:e.getRule();if(isPlainObject(e)){var r=ruleToMaker(e);return t?r:r.getRule()}if(Array.isArray(e)){var n=e.map(function(e){return parse(e,t)});return Object.defineProperties(n,{find:enumerable(findField),model:enumerable(model)}),n}return e}function findField(e,t){var r=[];for(var n in this){var i=this[n]instanceof Creator?this[n]._data:this[n];if(i.field===e)return!0===t?i:this[n];isValidChildren(i.children)&&(r=r.concat(i.children))}if(r.length>0)return findField.call(r,e)}function model(e){var t=this;Object.keys(e).forEach(function(r){var n=t.find(r,!0);n&&(n.value=e[r])})}function ruleToMaker(e){var t=new Creator;return Object.keys(e).forEach(function(r){t._data[r]=e[r]}),t}function parseVData(e){return isString(e)?e={domProps:{innerHTML:e}}:e&&isFunction(e.get)&&(e=e.get()),e}function getVNode(e){return isFunction(e)?e():e||[]}var VNode=function(){function e(t){_classCallCheck(this,e),t&&this.setVm(t)}return _createClass(e,[{key:"setVm",value:function(e){this.vm=e,this.$h=e.$createElement}},{key:"make",value:function(e,t,r){var n=this.$h(e,parseVData(t),getVNode(r));return n.context=this.vm,n}}],[{key:"use",value:function(t){Object.keys(t).forEach(function(r){e.prototype[toString(r).toLocaleLowerCase()]=e.prototype[r]=function(e,n){return this.make(t[r],e,n)}})}}]),e}();VNode.use({fragment:"fcFragment"});var BaseParser=function(){function e(t,r,n){_classCallCheck(this,e),this.rule=r,this.vData=new VData,this.vNode=new VNode,this.id=n,this.watch=[],this.originType=r.type,this.type=toString(r.type).toLocaleLowerCase(),this.isDef=!0,this.el=void 0,r.field?this.field=r.field:(this.field="_def_"+uniqueId(),this.isDef=!1),this.name=r.name,this.key="key_"+n,this.refName="__"+this.field+this.id,this.formItemRefName="fi"+this.refName,this.root=[],this.ctrlRule=null,this.modelEvent="input",this.update(t),this.init()}return _createClass(e,[{key:"update",value:function(e){this.$handle=e,this.$render=e.$render,this.vm=e.vm,this.options=e.options,this.vNode.setVm(this.vm),this.deleted=!1}},{key:"init",value:function(){}},{key:"toFormValue",value:function(e){return e}},{key:"toValue",value:function(e){return e}}]),e}(),$de=debounce(function(e){return e()},1),Render=function(){function e(t){_classCallCheck(this,e),this.$handle=t,this.fc=t.fc,this.vm=t.vm,this.options=t.options,this.$form=t.$form,this.vNode=new VNode(this.vm),this.vData=new VData,this.cache={},this.renderList={}}return _createClass(e,[{key:"clearCache",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.cache[e.id]){this.cacheStatus(e)&&this.$handle.refresh();var r=this.cache[e.id].parent;this.cache[e.id]=null,r&&t&&this.clearCache(r,t)}}},{key:"clearCacheAll",value:function(){this.cache={}}},{key:"setCache",value:function(e,t,r){this.cache[e.id]={vnode:t,use:!1,parent:r}}},{key:"cacheStatus",value:function(e){return this.cache[e.id]&&(!0===this.cache[e.id].use||this.cache[e.id].parent)}},{key:"getCache",value:function(e){var t=this.cache[e.id];return t.use=!0,t.vnode}},{key:"initOrgChildren",value:function(){var e=this.$handle.parsers;this.orgChildren=Object.keys(e).reduce(function(t,r){var n=e[r].rule.children;return t[r]=isValidChildren(n)?_toConsumableArray(n):[],t},{})}},{key:"run",value:function(){var e=this;if(this.vm.isShow){this.$form.beforeRender();var t=this.$handle.sortList.map(function(t){return e.renderParser(e.$handle.parsers[t])}).filter(function(e){return void 0!==e});return this.$form.render(t)}}},{key:"setGlobalConfig",value:function(e){if(this.options.global){var t=this.options.global;t["*"]&&this.toData(e,t["*"]),t[e.type]?this.toData(e,t[e.type]):t[e.originType]&&this.toData(e,t[e.originType])}}},{key:"renderTemplate",value:function(e){var t=this,r=e.id,n=e.rule,i=e.key;if(isUndef(_vue.compile))return console.error("使用的 Vue 版本不支持 compile"+errMsg()),[];if(!this.renderList[r]){var a=n.vm;isUndef(n.vm)?a=new _vue:isFunction(n.vm)&&(a=n.vm(this.$handle.getInjectData(n))),this.renderList[r]={vm:a,template:_vue.compile(n.template)}}var o=this.renderList[r],s=o.vm,u=o.template;setTemplateProps(s,e,this.$handle.fCreateApi),s.$off("input"),s.$on("input",function(r){t.onInput(e,r)});var l=u.render.call(s);return isUndef(l.data)&&(l.data={}),l.key=i,l}},{key:"renderParser",value:function(e,t){if("hidden"!==e.type){if(!this.cache[e.id]||"template"===e.type){e.vData.get(),this.setGlobalConfig(e);var r,n=e.type,i=e.rule,a=this.$form;if("template"===n&&i.template){if(r=this.renderTemplate(e),t&&isUndef(i.native))return this.setCache(e,r,t),r}else if(this.$handle.isNoVal(e)){if(r=this.defaultRender(e,this.renderChildren(e)),t&&isUndef(i.native))return this.setCache(e,r,t),r}else{var o=this.renderChildren(e);r=e.render?e.render(o):this.defaultRender(e,o)}return!0!==i.native&&(r=a.container(r,e)),this.setCache(e,r,t),r}return this.getCache(e)}}},{key:"toData",value:function(e,t){return vdataField.forEach(function(r){void 0!==t[r]&&e.vData[r](t[r])}),e.vData}},{key:"parserToData",value:function(e){return this.toData(e,e.rule)}},{key:"inputVData",value:function(e,t){var r=this,n=e.refName,i=e.key;this.parserToData(e);var a=e.vData.ref(n).key("fc_item"+i).props("formCreate",this.$handle.fCreateApi).on("fc.subForm",function(t){return r.$handle.addSubForm(e,t)}),o=this.$handle.modelEvent(e);return t||a.on(o.event||o,function(t){r.onInput(e,t)}).props(o.prop||"value",this.$handle.getFormData(e)),this.$form.inputVData&&this.$form.inputVData(e,t),a}},{key:"onInput",value:function(e,t){this.$handle.onInput(e,t)}},{key:"renderChildren",value:function(e){var t=this,r=e.rule.children,n=this.orgChildren[e.id];return isValidChildren(r)?(this.orgChildren[e.id].forEach(function(e){-1===r.indexOf(e)&&!isString(e)&&e.__fc__&&t.$handle.removeField(e.__fc__)}),r.map(function(r){return isString(r)?r:r.__fc__?t.renderParser(r.__fc__,e):void(!t.$handle.isset(r)&&r.type&&$de(function(){return t.$handle.reloadRule()}))})):(n.forEach(function(e){!isString(e)&&e.__fc__&&t.$handle.removeField(e.__fc__)}),this.orgChildren[e.id]=[],[])}},{key:"defaultRender",value:function(e,t){var r=this.inputVData(e);return this.vNode[e.type]?this.vNode[e.type](r,t):this.vNode[e.originType]?this.vNode[e.originType](r,t):this.vNode.make(e.originType,r,t)}}]),e}();function setTemplateProps(e,t,r){if(e.$props){var n=t.rule,i=Object.keys(e.$props);i.forEach(function(t){void 0!==n.props[t]&&(e.$props[t]=n.props[t])}),-1!==i.indexOf("value")&&(e.$props.value=t.rule.value),e.$props.formCreate=r}}function Api(e){function t(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?Array.isArray(t)||(t=[t]):t=r?Object.keys(e.fieldList):e.fields(),t}return{formData:function(){var t=e.fieldList;return Object.keys(t).reduce(function(e,r){var n=t[r];return e[n.field]=deepExtend({},{value:n.rule.value}).value,e},{})},getValue:function(t){var r=e.fieldList[t];if(r)return deepExtend({},{value:r.rule.value}).value},setValue:function(t,r){var n=t;isPlainObject(t)||(n=_defineProperty({},t,r)),Object.keys(n).forEach(function(t){var r=e.fieldList[t];r&&(r.rule.value=n[t])})},changeValue:function(e,t){this.setValue(e,t)},changeField:function(e,t){this.setValue(e,t)},removeField:function(t){var r=e.getParser(t);if(r){var n=r.root.indexOf(r.rule.__origin__);if(-1!==n)return r.root.splice(n,1),-1===e.sortList.indexOf(r.id)&&this.reload(),r.rule.__origin__}},destroy:function(){e.vm.$el.parentNode.removeChild(e.vm.$el),e.vm.$destroy()},fields:function(){return e.fields()},append:function(t,r,n){var i,a=Object.keys(e.fieldList),o=e.sortList.length;if(t.field&&-1!==a.indexOf(t.field))return console.error("".concat(t.field," 字段已存在")+errMsg());var s=e.getParser(r);s?n?(i=s.rule.children,o=s.rule.children.length):(o=s.root.indexOf(s.rule.__origin__),i=s.root):i=e.rules,i.splice(o+1,0,t)},prepend:function(t,r,n){var i,a=Object.keys(e.fieldList),o=0;if(t.field&&-1!==a.indexOf(t.field))return console.error("".concat(t.field," 字段已存在")+errMsg());var s=e.getParser(r);s?n?i=s.rule.children:(o=s.root.indexOf(s.rule.__origin__),i=s.root):i=e.rules,i.splice(o,0,t)},hidden:function(r,n){t(n,!0).forEach(function(t){var n=e.getParser(t);n&&($set(n.rule,"hidden",!!r),e.$render.clearCache(n,!0))}),e.refresh()},hiddenStatus:function(t){var r=e.getParser(t);if(r)return!!r.rule.hidden},visibility:function(r,n){t(n,!0).forEach(function(t){var n=e.getParser(t);n&&($set(n.rule,"visibility",!!r),e.$render.clearCache(n,!0))}),e.refresh()},visibilityStatus:function(t){var r=e.getParser(t);if(r)return!!r.rule.visibility},disabled:function(r,n){t(n,!0).forEach(function(t){var n=e.fieldList[t];n&&e.vm.$set(n.rule.props,"disabled",!!r)})},model:function(){return Object.keys(e.trueData).reduce(function(t,r){return t[r]=e.trueData[r].rule,t},{})},component:function(){return Object.keys(e.customData).reduce(function(t,r){return t[r]=e.customData[r].rule,t},{})},bind:function(){var t={},r={};return Object.keys(e.fieldList).forEach(function(t){var n=e.fieldList[t];r[t]={get:function(){return n.rule.value},set:function(e){n.rule.value=e},enumerable:!0,configurable:!0}}),Object.defineProperties(t,r),t},submitBtnProps:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.vm._buttonProps(t)},resetBtnProps:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.vm._resetProps(t)},set:function(t,r,n){e.vm.$set(t,r,n)},reload:function(t){e.reloadRule(t)},updateOptions:function(t){deepExtend(e.options,t),this.refresh(!0)},onSubmit:function(e){this.updateOptions({onSubmit:e})},sync:function(t){var r=e.getParser(t);r&&(e.$render.clearCache(r,!0),e.refresh())},refresh:function(t){t&&e.$render.clearCacheAll(),e.refresh()},hideForm:function(t){e.vm.isShow=!t},changeStatus:function(){return e.changeStatus},clearChangeStatus:function(){e.changeStatus=!1},updateRule:function(t,r,n){var i=e.getParser(t);if(i)return n?Object.keys(r).forEach(function(e){i.rule[e]=r[e]}):deepExtend(i.rule,r),i.rule.__origin__},getRule:function(t){var r=e.getParser(t);if(r)return r.rule},updateRules:function(e,t){var r=this;Object.keys(e).forEach(function(n){r.updateRule(n,e[n],t)})},updateValidate:function(t,r,n){var i=e.getParser(t);i&&(i.rule.validate=n?i.rule.validate.concat(r):r)},updateValidates:function(e,t){var r=this;Object.keys(e).forEach(function(n){r.updateValidate(n,e[n],t)})},method:function(e,t){var r=this.el(e);if(!r||!r[t])throw new Error("方法不存在"+errMsg());return function(){return r[t].apply(r,arguments)}},toJson:function(){return toJson(this.rule)},on:function(){var t;(t=e.vm).$on.apply(t,arguments)},once:function(){var t;(t=e.vm).$once.apply(t,arguments)},off:function(){var t;(t=e.vm).$off.apply(t,arguments)},trigger:function(e,t){for(var r=this.el(e),n=arguments.length,i=new Array(n>2?n-2:0),a=2;a<n;a++)i[a-2]=arguments[a];r&&r.$emit.apply(r,[t].concat(i))},el:function(t){var r=e.getParser(t);if(r)return r.el},validate:function(t){var r,n=this,i=!1,a=_objectSpread2({},{___this:{validate:function(t){e.$form.validate(function(e){t&&t(e)})}}},{},e.subForm),o=Object.keys(a).filter(function(e){var t=a[e];return Array.isArray(t)?t.length:!isUndef(t)}),s=o.length,u=function(e,a){e?r>1?r--:s>1?s--:t(!0):(i||(t(!1),i=!0),a&&n.clearValidateState(a,!1))};o.forEach(function(e){var t=a[e];Array.isArray(t)?(r=t.length,t.forEach(function(t){t.validate(function(t){return u(t,e)})})):t&&(r=1,t.validate(u))})},validateField:function(t,r){e.fieldList[t]&&e.$form.validateField(t,r)},resetFields:function(r){var n=e.fieldList;t(r,!0).forEach(function(t){var r=n[t];r&&"hidden"!==r.type&&(e.$form.resetField(r),e.refreshControl(r),e.$render.clearCache(r,!0))})},submit:function(t,r){var n=this;this.validate(function(i){if(i){var a=n.formData();isFunction(t)?t(a,n):(e.options.onSubmit&&e.options.onSubmit(a,n),e.fc.$emit("on-submit",a,n))}else r&&r(n)})},clearValidateState:function(r){var n=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t(r).forEach(function(t){i&&n.clearSubValidateState(t);var r=e.fieldList[t];r&&e.$form.clearValidateState(r)})},clearSubValidateState:function(r){t(r).forEach(function(t){var r=e.subForm[t];r&&(Array.isArray(r)?r.forEach(function(e){e.clearValidateState()}):r&&r.clearValidateState())})},getSubForm:function(t){return e.subForm[t]},btn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._buttonProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._buttonProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._buttonProps({show:!!t})}},resetBtn:{loading:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._resetProps({loading:!!t})},disabled:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._resetProps({disabled:!!t})},show:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e.vm._resetProps({show:!!t})}},closeModal:function(t){var r=e.fieldList[t];r&&r.closeModel&&r.closeModel()}}}function getRule(e){return isFunction(e.getRule)?e.getRule():e}var Handle=function(){function e(t){_classCallCheck(this,e);var r=this.fc=t,n=r.vm,i=r.rules,a=r.options;this.watching=!1,this.vm=n,this.options=a,this.validate={},this.formData={},this.subForm={},this.fCreateApi=void 0,this.__init(i),this.$form=new t.drive.formRender(this),this.$render=new Render(this),this.loadRule(this.rules,!1),this.$render.initOrgChildren(),this.$form.init()}return _createClass(e,[{key:"__init",value:function(e){this.fieldList={},this.trueData={},this.parsers={},this.customData={},this.sortList=[],this.rules=e,this.origin=_toConsumableArray(this.rules),this.changeStatus=!1,this.issetRule=[]}},{key:"modelEvent",value:function(e){var t=this.fc.modelEvents;return t[e.type]||t[e.originType]||e.rule.model||e.modelEvent}},{key:"isset",value:function(e){return this.issetRule.indexOf(e)>-1}},{key:"loadRule",value:function(e,t){var r=this;e.map(function(n,i){if(!t||!isString(n)){if(!n.type)return console.error("未定义生成规则的 type 字段"+errMsg());var a;if(n.__fc__)if((a=n.__fc__).deleted||a.vm===r.vm&&!r.parsers[a.id]){a.update(r);var o=a.rule;r.parseOn(o),r.parseProps(o)}else e[i]=n=copyRule(n),a=r.createParser(r.parseRule(n));else a=r.createParser(r.parseRule(n));var s=a.rule.children,u=a.rule;return r.notField(a.field)?(r.setParser(a),n.__fc__||bindParser(n,a),isValidChildren(s)&&r.loadRule(s,!0),t||r.sortList.push(a.id),r.isNoVal(a)||Object.defineProperty(a.rule,"value",r.valueHandle(a)),a):(r.issetRule.push(n),console.error("".concat(u.field," 字段已存在")+errMsg()))}}).filter(function(e){return e}).forEach(function(t){t.root=e})}},{key:"valueHandle",value:function(e){var t=this;return{enumerable:!0,get:function(){return e.toValue(t.getFormData(e))},set:function(r){t.isChange(e,r)&&(t.$render.clearCache(e,!0),t.setFormData(e,e.toFormValue(r)),t.valueChange(e,r),t.refresh())}}}},{key:"createParser",value:function(e){return new(this.fc.parsers[toString(e.type).toLocaleLowerCase()]||BaseParser)(this,e,""+uniqueId())}},{key:"parseRule",value:function(e){var t=defRule(),r=getRule(e);return Object.defineProperties(r,{__origin__:enumerable(e)}),Object.keys(t).forEach(function(e){isUndef(r[e])&&$set(r,e,t[e])}),r.field&&void 0!==this.options.formData[r.field]&&(r.value=this.options.formData[r.field]),r.options=parseArray(r.options),this.parseOn(r),this.parseProps(r),r}},{key:"parseOn",value:function(e){this.parseInjectEvent(e,e.on||{}),this.watching||this.margeEmit(e)}},{key:"margeEmit",value:function(e){var t=this.parseEmit(e);Object.keys(t).length>0&&extend(e.on,t)}},{key:"parseProps",value:function(e){this.parseInjectEvent(e,e.props||{})}},{key:"parseInjectEvent",value:function(e,t){var r=this;return(this.options.injectEvent||e.inject)&&Object.keys(t).forEach(function(n){isFunction(t[n])&&(t[n]=r.inject(e,t[n]))}),t}},{key:"getInjectData",value:function(e,t){var r=this.vm.$options.propsData,n=r.option,i=r.rule;return{$f:this.fCreateApi,rule:i,self:e.__origin__,option:n,inject:t||i.inject||{}}}},{key:"inject",value:function(e,t,r){if(t.__inject){if(this.watching)return t;t=t.__origin}var n=this,i=function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return a.unshift(n.getInjectData(e,r)),t.apply(void 0,a)};return i.__inject=!0,i.__origin=t,i}},{key:"parseEmit",value:function(e){var t=this,r={},n=e.emit,i=e.emitPrefix,a=e.field,o=e.name;if(!Array.isArray(n))return r;var s=i||(a||o);return s?(n.forEach(function(n){var i,a=n;if(isPlainObject(n)&&(a=n.name,i=n.inject),a){var o=toLine("".concat(s,"-").concat(a)).replace("_","-"),u=function(){for(var e,r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];(e=t.vm).$emit.apply(e,[o].concat(n))};u.__emit=!0,r[a]=t.options.injectEvent||void 0!==n.inject?t.inject(e,u,i):u}}),r):r}},{key:"run",value:function(){return this.vm.unique>0?this.$render.run():(this.vm.unique=1,[])}},{key:"setParser",value:function(e){var t=e.id,r=e.field,n=e.name,i=e.rule;this.parsers[t]||(this.parsers[t]=e,n&&$set(this.customData,n,e),this.isNoVal(e)||(this.fieldList[r]=e,$set(this.formData,r,e.toFormValue(i.value)),$set(this.validate,r,i.validate||[]),$set(this.trueData,r,e)))}},{key:"addSubForm",value:function(e,t){this.subForm[e.field]=t}},{key:"notField",value:function(e){return void 0===this.fieldList[e]}},{key:"isChange",value:function(e,t){return JSON.stringify(e.rule.value)!==JSON.stringify(t)}},{key:"valueChange",value:function(e){this.validateControl(e)}},{key:"onInput",value:function(e,t){var r;!this.isNoVal(e)&&this.isChange(e,r=e.toValue(t))&&(this.$render.clearCache(e),this.setFormData(e,t),this.changeStatus=!0,this.valueChange(e),this.vm.$emit("change",e.field,r,this.fCreateApi))}},{key:"getParser",value:function(e){return this.fieldList[e]||this.customData[e]||this.parsers[e]}},{key:"created",value:function(){var e=this,t=this.vm;if(t.$set(t,"buttonProps",this.options.submitBtn),t.$set(t,"resetProps",this.options.resetBtn),t.$set(t,"formData",this.formData),void 0===this.fCreateApi&&(this.fCreateApi=Api(this)),this.fCreateApi.rule=this.rules,this.fCreateApi.config=this.options,this.fCreateApi.form){var r=this.fCreateApi.form;Object.keys(r).forEach(function(e){delete r[e]})}else Object.defineProperty(this.fCreateApi,"form",{value:{},writable:!1,enumerable:!0});Object.defineProperties(this.fCreateApi.form,Object.keys(this.fCreateApi.formData()).reduce(function(t,r){var n=e.getParser(r),i=e.valueHandle(n);return i.configurable=!0,t[r]=i,t},{}))}},{key:"addParserWitch",value:function(e){var t=this,r=this.vm;Object.keys(e.rule).forEach(function(n){if(-1===["field","type","value","vm","template","name","config","control"].indexOf(n)&&void 0!==e.rule[n])try{e.watch.push(r.$watch(function(){return e.rule[n]},function(r,i){void 0!==i&&(t.watching=!0,"validate"===n?t.validate[e.field]=r:"props"===n?t.parseProps(e.rule):"on"===n?t.parseOn(e.rule):"emit"===n&&t.margeEmit(e.rule),t.$render.clearCache(e),t.watching=!1)},{deep:"children"!==n,immediate:!0}))}catch(e){}})}},{key:"refreshControl",value:function(e){!this.isNoVal(e)&&e.rule.control&&this.validateControl(e)}},{key:"validateControl",value:function(e){var t=this,r=getControl(e),n=r.length,i=e.ctrlRule;if(n){for(var a=function(n){var a=r[n];if((a.handle||function(e){return e===a.value})(e.rule.value,t.fCreateApi)){if(i){if(i.children===a.rule)return{v:void 0};removeControl(e)}var o={type:"fcFragment",native:!0,children:a.rule};return e.root.splice(e.root.indexOf(e.rule.__origin__)+1,0,o),e.ctrlRule=o,t.vm.$emit("control",e.rule.__origin__,t.fCreateApi),t.refresh(),{v:void 0}}},o=0;o<n;o++){var s=a(o);if("object"===_typeof(s))return s.v}i&&(removeControl(e),this.vm.$emit("control",e.rule.__origin__,this.fCreateApi),this.refresh())}}},{key:"mountedParser",value:function(){var e=this,t=this.vm;Object.keys(this.parsers).forEach(function(r){var n=e.parsers[r];0===n.watch.length&&e.addParserWitch(n),e.refreshControl(n),n.el=t.$refs[n.refName]||{},void 0===n.defaultValue&&(n.defaultValue=deepExtend({},{value:n.rule.value}).value),n.mounted&&n.mounted()})}},{key:"mounted",value:function(){var e=this.options.mounted;this.mountedParser(),e&&e(this.fCreateApi),this.fc.$emit("mounted",this.fCreateApi)}},{key:"reload",value:function(){var e=this.options.onReload;this.mountedParser(),e&&e(this.fCreateApi),this.fc.$emit("on-reload",this.fCreateApi)}},{key:"removeField",value:function(e,t){var r=e.id,n=e.field,i=this.sortList.indexOf(r);return delParser(e,t),$del(this.parsers,r),-1!==i&&this.sortList.splice(i,1),this.fieldList[n]||($del(this.validate,n),$del(this.formData,n),$del(this.customData,n),$del(this.fieldList,n),$del(this.trueData,n)),this.subForm[e.field]&&$del(this.subForm,n),e}},{key:"refresh",value:function(){this.vm._refresh()}},{key:"reloadRule",value:function(e){var t=this,r=this.vm;if(!e)return this.reloadRule(this.rules);this.origin.length||this.fCreateApi.refresh(),this.origin=_toConsumableArray(e);var n=_objectSpread2({},this.parsers),i=this.fCreateApi.formData();this.__init(e),this.loadRule(e,!1),Object.keys(n).filter(function(e){return void 0===t.parsers[e]}).forEach(function(e){return t.removeField(n[e],i[n[e].field])}),this.$render.initOrgChildren(),this.formData=_objectSpread2({},this.formData),this.created(),r.$f=this.fCreateApi,this.$render.clearCacheAll(),this.refresh(),r.$nextTick(function(){t.reload()})}},{key:"setFormData",value:function(e,t){$set(this.formData,e.field,t)}},{key:"getFormData",value:function(e){return this.formData[e.field]}},{key:"fields",value:function(){return Object.keys(this.formData)}},{key:"isNoVal",value:function(e){return!e.isDef}}]),e}();function delParser(e,t){e.ctrlRule&&removeControl(e),e.watch.forEach(function(e){return e()}),e.watch=[],e.deleted=!0,e.root=[],Object.defineProperty(e.rule,"value",{value:t})}function parseArray(e){return Array.isArray(e)?e:[]}function getControl(e){var t=e.rule.control||[];return isPlainObject(t)?[t]:t}function removeControl(e){var t=e.root.indexOf(e.ctrlRule);-1!==t&&e.root.splice(t,1),e.ctrlRule=null}function defRule(){return{validate:[],col:{},emit:[],props:{},on:{},options:[],title:void 0,value:null,field:"",name:void 0,className:void 0}}function bindParser(e,t){Object.defineProperties(e,{__field__:enumerable(t.field),__fc__:enumerable(t)})}var NAME$1="fcFragment",fragment={name:NAME$1,functional:!0,props:{children:Array},render:function(e,t){return t.children}},_vue="undefined"!=typeof window&&window.Vue?window.Vue:Vue;function createFormCreate(e){var t=_defineProperty({},fragment.name,fragment),r={},n=makerFactory(),i=e.getConfig(),a={},o={};function s(e,t){e=toString(e),r[e.toLocaleLowerCase()]=t,p.maker[e]=creatorFactory(e)}function u(){return function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),t}()}function l(e,r){var n=(e=toString(e)).toLocaleLowerCase();return"form-create"===n||"formcreate"===n?f():void 0===r?t[e]:void(t[e]=r)}function c(e,t){isBool(t.submitBtn)&&(t.submitBtn={show:t.submitBtn}),isBool(t.resetBtn)&&(t.resetBtn={show:t.resetBtn});var r=deepExtend(e,t);return $set(r,"el",r.el?isElement(r.el)?r.el:document.querySelector(r.el):window.document.body),r}function f(){return _vue.extend($FormCreate(p,t))}function h(t){extend(t,{version:e.version,ui:e.ui,maker:n,component:l,setParser:s,createParser:u,data:a,copyRule:copyRule,copyRules:copyRules,$form:function(){return f()},parseJson:function(e){return parseJson(e)}})}function d(e,t){var r=new _vue({data:function(){return{rule:e,option:isElement(t)?{el:t}:t}},render:function(){return(0,arguments[0])("form-create",helper([{ref:"fc"},{props:this.$data}]))}});return r.$mount(),r}var p=function(){function t(n){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t),this.fCreateApi=void 0,this.drive=e,this.parsers=r,this.modelEvents=o,this.vm=void 0,this.rules=Array.isArray(n)?n:[],this.options=c(deepExtend({formData:{}},i),a)}return _createClass(t,[{key:"beforeCreate",value:function(e){this.vm=e,this.handle=new Handle(this)}},{key:"created",value:function(){this.handle.created()}},{key:"api",value:function(){return this.handle.fCreateApi}},{key:"render",value:function(){return this.handle.run()}},{key:"mounted",value:function(){this.handle.mounted()}},{key:"$emit",value:function(e){for(var t,r,n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];this.$parent&&(t=this.$parent).$emit.apply(t,["fc:".concat(e)].concat(i)),(r=this.vm).$emit.apply(r,[e].concat(i))}}],[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=d(e,t),i=n.$refs.fc.formCreate;return i.parent=r,i.options.el.appendChild(n.$el),i.handle.fCreateApi}},{key:"install",value:function(e,r){if(r&&isPlainObject(r)&&c(i,r),!0!==e._installedFormCreate){e._installedFormCreate=!0;var n=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.create(e,r,this)};h(n),e.prototype.$formCreate=n,e.component(formCreateName,f()),e.component(fragment.name,_vue.extend(fragment)),_vue=e}}},{key:"init",value:function(e){var t=d(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=t.$refs.fc.formCreate;return{mount:function(e){return e&&isElement(e)&&(r.options.el=e),r.options.el.appendChild(t.$el),r.handle.fCreateApi},remove:function(){r.options.el.removeChild(t.$el)},destroy:function(){this.remove(),t.$destroy()},$f:r.handle.fCreateApi}}}]),t}();return h(p),e.components.forEach(function(e){p.component(e.name,e)}),e.parsers.forEach(function(e){var t=e.name,r=e.parser;p.setParser(t,r)}),Object.keys(e.makers).forEach(function(t){p.maker[t]=e.makers[t]}),e.modelEvents&&Object.keys(e.modelEvents).forEach(function(t){return r=t,n=e.modelEvents[t],void(o[r.toLocaleLowerCase()]=n);var r,n}),{FormCreate:p,install:p.install}}var BaseForm=function(){function e(t){_classCallCheck(this,e),this.$handle=t,this.vm=t.vm,this.drive=this.$handle.fc.drive,this.options=t.options,this.vNode=new VNode(this.vm),this.vData=new VData,this.unique=uniqueId(),this.refName="cForm".concat(this.unique)}return _createClass(e,[{key:"getFormRef",value:function(){return this.vm.$refs[this.refName]}},{key:"init",value:function(){this.$render=this.$handle.$render}},{key:"getGetCol",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"col",r=e.rule[t]||{},n={},i={},a=this.options.global;return a?(a["*"]&&(n=a["*"][t]||{}),a[e.type]?i=a[e.type][t]||{}:a[e.originType]&&(i=a[e.originType][t]||{}),r=deepExtendArgs({},n,i,r)):r}},{key:"beforeRender",value:function(){}},{key:"render",value:function(){}},{key:"inputVData",value:function(){}}]),e}(),NAME$2="fc-antd-group",group={name:NAME$2,props:{rule:Object,rules:Array,button:{type:Boolean,default:!0},formCreate:Object,max:{type:Number,default:0},min:{type:Number,default:0},value:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},fontSize:{type:Number,default:28}},data:function(){return{option:deepExtendArgs({},this.formCreate.config||{},{submitBtn:!1,resetBtn:!1,mounted:void 0,onReload:void 0}),len:0,cacheRule:{},group$f:{},fieldRule:{}}},computed:{formRule:function(){return this.rule?[this.rule]:this.rules?this.rules:[]},formData:function(){var e=this;return Object.keys(this.fieldRule).map(function(t){var r=Object.keys(e.fieldRule[t]);return e.rule?void 0===r[0]?null:e.fieldRule[t][r[0]].value:r.reduce(function(r,n){return r[n]=e.fieldRule[t][n].value,r},{})})}},watch:{disabled:function(e){var t=this.group$f;Object.keys(t).forEach(function(r){t[r].disabled(e)})},formData:function(e){this.$emit("input",e),this.$emit("change",e)},value:{handler:function(e){var t=this,r=Object.keys(this.cacheRule),n=r.length,i=n-e.length;if(i<0){for(var a=i;a<0;a++)this.addRule();for(var o=0;o<n;o++)this.setValue(this.group$f[r[o]],e[o])}else{if(i>0){for(var s=0;s<i;s++)this.removeRule(r[n-s-1]);this.subForm()}e.forEach(function(n,i){t.setValue(t.group$f[r[i]],e[i])})}},deep:!0,immediate:!0}},methods:{setValue:function(e,t){if(this.rule){var r=e.fields();if(!r[0])return;e.setValue(r[0],t)}else e.setValue(t)},addRule:function(e){var t=this,r=this.copyRule();this.$set(this.cacheRule,++this.len,r),e&&this.$nextTick(function(){return t.$emit("add",r,Object.keys(t.cacheRule).length-1)})},add$f:function(e,t,r){this.group$f[t]=r,this.setValue(r,this.value[e]),this.syncData(t,r),this.subForm(),this.$emit("itemMounted",r,Object.keys(this.cacheRule).indexOf(t))},subForm:function(){var e=this;this.$emit("fc.subForm",Object.keys(this.group$f).map(function(t){return e.group$f[t]}))},syncData:function(e,t){var r=this;this.$set(this.fieldRule,e,{}),t.fields().forEach(function(n){r.fieldRule[e][n]=t.getRule(n)})},removeRule:function(e,t){var r=this,n=Object.keys(this.cacheRule).indexOf(e);this.$delete(this.cacheRule,e),this.$delete(this.fieldRule,e),this.$delete(this.group$f,e),t&&this.$nextTick(function(){return r.$emit("remove",n)})},copyRule:function(){return copyRules(this.formRule)},add:function(){!this.disabled&&this.addRule(!0)},del:function(e){this.disabled||(this.removeRule(e,!0),this.subForm())},addIcon:function(e){return(0,this.$createElement)("AIcon",{key:"a".concat(e),attrs:{type:"plus-circle"},style:"font-size:".concat(this.fontSize,"px;cursor:").concat(this.disabled?"not-allowed;color:#c9cdd4":"pointer",";"),on:{click:this.add}})},delIcon:function(e){var t=this;return(0,this.$createElement)("AIcon",{key:"d".concat(e),attrs:{type:"minus-circle"},style:"font-size:".concat(this.fontSize,"px;cursor:").concat(this.disabled?"not-allowed;color:#c9cdd4":"pointer;color:#606266",";"),on:{click:function(){return t.del(e)}}})},makeIcon:function(e,t,r){var n=this;return this.$scopedSlots.button?this.$scopedSlots.button({total:e,index:t,vm:this,key:r,del:function(){return n.del(r)},add:this.add}):0===t?[0!==this.max&&e>=this.max?null:this.addIcon(r),0===this.min||e>this.min?this.delIcon(r):null]:t>=this.min?this.delIcon(r):void 0}},created:function(){for(var e=0;e<this.value.length;e++)this.addRule()},render:function(){var e=this,t=arguments[0],r=Object.keys(this.cacheRule),n=this.button;return 0===r.length?this.$scopedSlots.default?this.$scopedSlots.default({vm:this,add:this.add}):t("AIcon",{key:"a_def",attrs:{type:"plus-circle"},style:"font-size:".concat(this.fontSize,"px;vertical-align:middle;color:").concat(this.disabled?"#c9cdd4;cursor: not-allowed":"#606266;cursor:pointer",";"),on:{click:this.add}}):t("div",{key:"con"},[r.map(function(i,a){var o=e.cacheRule[i];return t("ARow",{attrs:{align:"middle",type:"flex"},key:i,style:"background-color:#f5f7fa;padding:10px;border-radius:5px;margin-bottom:10px;"},[t("ACol",{attrs:{span:n?20:24}},[t("FormCreate",{on:{mounted:function(t){return e.add$f(a,i,t)},"on-reload":function(t){return e.syncData(i,t)}},attrs:{rule:o,option:e.option}})]),n?t("ACol",{attrs:{span:2,pull:1,push:1}},[e.makeIcon(r.length,a,i)]):null])})])}},components=[upload,frame,group],Parser=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){return this.vNode.checkbox(this.$render.inputVData(this).props({options:this.rule.options}),e)}}]),t}(),name="checkbox",checkbox={parser:Parser,name:name},FORMAT_TYPE={date:"YYYY-MM-DD",month:"YYYY-MM",week:"YYYY-wo",range:"YYYY-MM-DD HH:mm:ss"},_getType=function(e){return-1===["date","month","week","range"].indexOf(e)?"date":e},toMoment=function(e){return e instanceof moment?e:moment(e)},Parser$1=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"toFormValue",value:function(e){var t=this.getType(),r=Array.isArray(e);return"range"===t?r?e.map(function(e){return e?toMoment(e):null}):[]:r?(e[0]?toMoment(e[0]):null)||null:e?toMoment(e):null}},{key:"toValue",value:function(e){var t=this.getFormat();return Array.isArray(e)?e.map(function(e){return e?e.format(t):e}):e?e.format(t):e}},{key:"getFormat",value:function(){return this.rule.props.format||(this.el?this.el.format:"")||FORMAT_TYPE[_getType(this.rule.props.type)]}},{key:"getType",value:function(){return _getType(this.rule.props.type)}},{key:"render",value:function(e){var t=this.getType()+"Picker";return this.vNode[t](this.$render.inputVData(this),[e])}}]),t}(),name$1="datePicker",datePicker={parser:Parser$1,name:name$1},Parser$2=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){var t=this.$render.inputVData(this).props("field",this.field);return this.vNode.frame(t,e)}},{key:"closeModel",value:function(){this.el.closeModel&&this.el.closeModel()}}]),t}(),name$2="frame",frame$1={parser:Parser$2,name:name$2},name$3="hidden",parser=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(){return[]}}]),t}(),hidden={parser:parser,name:name$3},Parser$3=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){var t=this.rule.props.type;-1===["textarea","search"].indexOf(t)&&(t="input");var r="textarea"===t?"ATextarea":"search"===t?"AInputSearch":"AInput";return this.vNode.make(r,this.$render.inputVData(this),[e])}}]),t}(),name$4="input",input={parser:Parser$3,name:name$4},Parser$4=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){return this.vNode.radio(this.$render.inputVData(this).props({options:this.rule.options}),e)}}]),t}(),name$5="radio",radio={parser:Parser$4,name:name$5},Parser$5=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){return this.vNode.select(this.$render.inputVData(this).props("options",this.rule.options),e)}},{key:"toFormValue",value:function(e){return isUndef(e)?void 0:e}}]),t}(),name$6="select",select={parser:Parser$5,name:name$6},toMoment$1=function(e,t){return e instanceof moment?e:moment(e,t)},Parser$6=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"toFormValue",value:function(e){return e?toMoment$1(e,this.getFormat()):null}},{key:"toValue",value:function(e){return e?e.format(this.getFormat()):e}},{key:"getFormat",value:function(){return this.rule.props.format||(this.el?this.el.format:"")||"HH:mm:ss"}}]),t}(),name$7="timePicker",timePicker={parser:Parser$6,name:name$7},parser$1=function(e){function t(e,r,n){var i;_classCallCheck(this,t),(i=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e,r,n))).modelEvent="check";var a=i.rule.props;return a.replaceFields?a.replaceFields.key||(a.replaceFields.key="id"):a.replaceFields={key:"id"},i}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){var t=this.$render.inputVData(this).props("checkedKeys",this.$handle.getFormData(this)).props("checkable",!0).get();return this.vNode.tree(t,[e])}}]),t}(),name$8="tree",tree={parser:parser$1,name:name$8},parser$2=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseParser),_createClass(t,[{key:"render",value:function(e){var t=this,r=this.$render.inputVData(this).get();return this.vNode.upload({props:_objectSpread2({},r.props,{ctx:r,children:e,value:this.$handle.getFormData(this)}),on:{input:function(e){t.$render.onInput(t,e)}}})}},{key:"toFormValue",value:function(e){return toArray(e)}},{key:"toValue",value:function(e){return 1===this.rule.props.limit?e[0]||"":e}}]),t}(),name$9="upload",upload$1={parser:parser$2,name:name$9},parsers=[checkbox,datePicker,frame$1,hidden,input,radio,select,timePicker,tree,upload$1],UNDEF=void 0;function getConfig(){return{form:{hideRequiredMark:!1,layout:"horizontal",labelAlign:"right",labelCol:{span:4},wrapperCol:{span:20},colon:UNDEF,validateOnRuleChange:!0},row:{gutter:0,type:UNDEF,align:UNDEF,justify:UNDEF},info:{type:"popover",placement:"topLeft",icon:"question-circle-o"},submitBtn:{disabled:!1,ghost:!1,icon:"upload",loading:!1,shape:UNDEF,size:UNDEF,type:"primary",block:!0,innerText:"提交",htmlType:UNDEF,show:!0,col:UNDEF,click:UNDEF},resetBtn:{disabled:!1,ghost:!1,icon:"sync",loading:!1,shape:UNDEF,size:UNDEF,type:"default",block:!0,innerText:"重置",htmlType:UNDEF,show:!1,col:UNDEF,click:UNDEF}}}var nodes={button:"a-button",icon:"a-icon",slider:"a-slider",rate:"a-rate",upload:"fc-antd-update",cascader:"a-cascader",timePicker:"a-time-picker",datePicker:"a-date-picker",rangePicker:"a-range-picker",weekPicker:"a-week-picker",monthPicker:"a-month-picker",switch:"a-switch",select:"a-select",checkbox:"a-checkbox-group",radio:"a-radio-group",inputNumber:"a-input-number",search:"a-input-search",textarea:"a-textarea",formItem:"a-form-model-item",form:"a-form-model",frame:"fc-antd-frame",col:"a-col",row:"a-row",tree:"a-tree",autoComplete:"a-auto-complete",group:"fc-antd-group"};function isTooltip(e){return"tooltip"===e.type}var Form=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,_getPrototypeOf(t).apply(this,arguments))}return _inherits(t,BaseForm),_createClass(t,[{key:"inputVData",value:function(e){!e.rule.props.size&&this.options.form.size&&e.vData.props("size",this.options.form.size)}},{key:"validate",value:function(e){this.getFormRef().validate(function(t){e&&e(t)})}},{key:"validateField",value:function(e,t){this.getFormRef().validateField(e,t)}},{key:"resetField",value:function(e){this.vm.$refs[e.formItemRefName].resetField()}},{key:"clearValidateState",value:function(e){var t=this.vm.$refs[e.formItemRefName];t&&(t.validateMessage="",t.validateState="")}},{key:"beforeRender",value:function(){this.propsData=this.vData.props(this.options.form).props({model:this.$handle.formData,rules:this.$handle.validate,key:"form"+this.unique}).ref(this.refName).nativeOn({submit:preventDefault}).class(this.options.form.className).class("form-create",!0).key(this.unique).get()}},{key:"render",value:function(e){return e.length>0&&e.push(this.makeFormBtn()),this.vNode.form(this.propsData,[!1===this.options.row?e:this.makeRow(e)])}},{key:"makeRow",value:function(e){var t={},r=this.options.row||{};return r.class&&(t[r.class]=!0),this.vNode.row({props:r||{},key:"fr"+this.unique,class:t},e)}},{key:"container",value:function(e,t){return this.makeFormItem(t,e)}},{key:"getItemCol",value:function(e,t){var r=this.getGetCol(e,t);return Object.keys(r).length?r:void 0}},{key:"makeFormItem",value:function(e,t){var r="fItem".concat(e.key).concat(this.unique),n="vertical"===this.propsData.props.layout,i=e.rule,a=e.field,o=e.formItemRefName,s=this.getGetCol(e),u=this.propsData.props,l=u.layout,c=u.col,f=this.vData.props({prop:a,labelCol:n?{}:this.getItemCol(e,"labelCol"),wrapperCol:n?{}:this.getItemCol(e,"wrapperCol"),rules:i.validate,required:i.props.required}).key(r).ref(o).class(i.className).get(),h=this.vNode.formItem(f,[t,this.makeFormPop(e,r)]);return"inline"===l||!1===c?h:this.makeCol(s,e,r,[h])}},{key:"makeFormPop",value:function(e,t){var r=e.rule;if(r.title){var n=this.options.info||{},i=[r.title],a=isTooltip(n);return r.info&&i.push(this.vNode.make(a?"ATooltip":"APopover",{props:_objectSpread2({},n,_defineProperty({},a?"title":"content",r.info)),key:"pop".concat(t)},[this.vNode.icon({props:{type:n.icon||"question-circle-o",size:16}})])),this.vNode.make("span",{slot:"label"},i)}}},{key:"makeCol",value:function(e,t,r,n){var i;void 0===e.span&&(e.span=24);var a=(_defineProperty(i={},style.__fc_h,!!t.rule.hidden),_defineProperty(i,style.__fc_v,!!t.rule.visibility),i);return e.class&&(a[e.class]=!0),this.vNode.col({props:e,class:a,key:"".concat(r,"col1")},n)}},{key:"makeFormBtn",value:function(){var e=[],t=!1!==this.vm.buttonProps&&!1!==this.vm.buttonProps.show,r=!1!==this.vm.resetProps&&!1!==this.vm.resetProps.show;return t&&e.push(this.makeSubmitBtn(r?19:24)),r&&e.push(this.makeResetBtn(4)),"inline"===this.propsData.props.layout?e:e.length?this.vNode.col({props:{span:24},key:"".concat(this.unique,"col2")},e):[]}},{key:"makeResetBtn",value:function(e){var t=this,r=this.vm.resetProps,n=r.col||{span:e,push:1};return this.vNode.col({props:n,key:"".concat(this.unique,"col3")},[this.vNode.button({key:"frsbtn".concat(this.unique),props:r,on:{click:function(){var e=t.$handle.fCreateApi;isFunction(r.click)?r.click(e):e.resetFields()}}},[r.innerText])])}},{key:"makeSubmitBtn",value:function(e){var t=this,r=this.vm.buttonProps,n=r.col||{span:e};return this.vNode.col({props:n,key:"".concat(this.unique,"col4")},[this.vNode.button({key:"fbtn".concat(this.unique),props:r,on:{click:function(){var e=t.$handle.fCreateApi;isFunction(r.click)?r.click(e):e.submit()}}},[r.innerText])])}}]),t}(),name$a="datePicker",datePicker$1=["date","month","week"].reduce(function(e,t){return e[t]=creatorTypeFactory(name$a,t),e},{dateRange:creatorTypeFactory(name$a,"range"),datetimeRange:creatorTypeFactory(name$a,function(e){return e.props({type:"range",showTime:!0})})}),name$b="frame",types={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},maker=Object.keys(types).reduce(function(e,t){return e[t]=creatorTypeFactory(name$b,function(e){return e.props({type:types[t][0],maxLength:types[t][1]})}),e},{});maker.frameInput=maker.frameInputs,maker.frameFile=maker.frameFiles,maker.frameImage=maker.frameImages;var name$c="input",maker$1=["password","url","email","text","textarea","search"].reduce(function(e,t){return e[t]=creatorTypeFactory(name$c,t),e},{});maker$1.idate=creatorTypeFactory(name$c,"date");var name$d="select",select$1={selectMultiple:creatorTypeFactory(name$d,"multiple","mode"),selectTags:creatorTypeFactory(name$d,"tags","mode"),selectCombobox:creatorTypeFactory(name$d,"combobox","mode")},name$e="slider",slider={sliderRange:creatorTypeFactory(name$e,!0,"range")},name$f="upload",types$1={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},maker$2=Object.keys(types$1).reduce(function(e,t){return e[t]=creatorTypeFactory(name$f,function(e){return e.props({uploadType:types$1[t][0],maxLength:types$1[t][1]})}),e},{});maker$2.uploadImage=maker$2.image,maker$2.uploadFile=maker$2.file;var maker$3=_objectSpread2({},datePicker$1,{},maker,{},maker$1,{},select$1,{},slider,{},maker$2),names=["autoComplete","cascader","datePicker","frame","inputNumber","radio","rate","switch","rate","slider","timePicker"];names.forEach(function(e){maker$3[e]=creatorFactory(e)}),maker$3.auto=maker$3.autoComplete,maker$3.number=maker$3.inputNumber,maker$3.time=maker$3.timePicker,maker$3.hidden=function(e,t){return creatorFactory("hidden")("",e,t)};var modelEvents={input:"change.value",switch:{prop:"checked",event:"change"}};["autoComplete","cascader","inputNumber","rate","slider","change","timePicker","datePicker","select"].forEach(function(e){return modelEvents[e]="change"}),VNode.use(nodes);var drive={ui:"ant-design-vue",version:"".concat("1.0.16"),formRender:Form,components:components,parsers:parsers,makers:maker$3,getConfig:getConfig,modelEvents:modelEvents},_createFormCreate=createFormCreate(drive),FormCreate=_createFormCreate.FormCreate,install=_createFormCreate.install;"undefined"!=typeof window&&(window.formCreate=FormCreate,window.Vue&&install(window.Vue));var maker$4=FormCreate.maker;exports.default=FormCreate,exports.maker=maker$4,Object.defineProperty(exports,"__esModule",{value:!0})});
  //# sourceMappingURL=form-create.min.js.map
  