CRMEB/public/static/plug/form-create/form-create.min.js
2019-02-21 12:02:36 +08:00

9 lines
72 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*!
* form-create v1.5.5
* (c) 2018-2019 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("iview")):"function"==typeof define&&define.amd?define(["exports","vue","iview"],t):t(e.formCreate={},e.Vue,e.iview)}(this,function(e,t,n){"use strict";function r(e,t){return e(t={exports:{}},t.exports),t.exports}t=t&&t.hasOwnProperty("default")?t.default:t,n=n&&n.hasOwnProperty("default")?n.default:n;var i=r(function(e){var t=e.exports={version:"2.6.3"};"number"==typeof __e&&(__e=t)}),o=(i.version,r(function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)})),a=r(function(e){var t=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:i.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),u=0,s=Math.random(),c=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++u+s).toString(36))},l=r(function(e){var t=a("wks"),n=o.Symbol,r="function"==typeof n;(e.exports=function(e){return t[e]||(t[e]=r&&n[e]||(r?n:c)("Symbol."+e))}).store=t}),h=function(e){return"object"==typeof e?null!==e:"function"==typeof e},f=function(e){if(!h(e))throw TypeError(e+" is not an object!");return e},p=function(e){try{return!!e()}catch(e){return!0}},d=!p(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),v=o.document,m=h(v)&&h(v.createElement),y=function(e){return m?v.createElement(e):{}},g=!d&&!p(function(){return 7!=Object.defineProperty(y("div"),"a",{get:function(){return 7}}).a}),k=function(e,t){if(!h(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!h(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!h(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},b=Object.defineProperty,_={f:d?Object.defineProperty:function(e,t,n){if(f(e),t=k(t,!0),f(n),g)try{return b(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},O=d?function(e,t,n){return _.f(e,t,w(1,n))}:function(e,t,n){return e[t]=n,e},x=l("unscopables"),N=Array.prototype;null==N[x]&&O(N,x,{});var V=function(e){N[x][e]=!0},S=function(e,t){return{value:t,done:!!e}},I={},E={}.toString,P=function(e){return E.call(e).slice(8,-1)},F=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==P(e)?e.split(""):Object(e)},A=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},C=function(e){return F(A(e))},j={}.hasOwnProperty,D=function(e,t){return j.call(e,t)},R=r(function(e){var t=c("src"),n=Function.toString,r=(""+n).split("toString");i.inspectSource=function(e){return n.call(e)},(e.exports=function(e,n,i,a){var u="function"==typeof i;u&&(D(i,"name")||O(i,"name",n)),e[n]!==i&&(u&&(D(i,t)||O(i,t,e[n]?""+e[n]:r.join(String(n)))),e===o?e[n]=i:a?e[n]?e[n]=i:O(e,n,i):(delete e[n],O(e,n,i)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[t]||n.call(this)})}),$=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},L=function(e,t,n){if($(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},T=function(e,t,n){var r,a,u,s,c=e&T.F,l=e&T.G,h=e&T.S,f=e&T.P,p=e&T.B,d=l?o:h?o[t]||(o[t]={}):(o[t]||{}).prototype,v=l?i:i[t]||(i[t]={}),m=v.prototype||(v.prototype={});for(r in l&&(n=t),n)u=((a=!c&&d&&void 0!==d[r])?d:n)[r],s=p&&a?L(u,o):f&&"function"==typeof u?L(Function.call,u):u,d&&R(d,r,u,e&T.U),v[r]!=u&&O(v,r,s),f&&m[r]!=u&&(m[r]=u)};o.core=i,T.F=1,T.G=2,T.S=4,T.P=8,T.B=16,T.W=32,T.U=64,T.R=128;var M,q=T,B=Math.ceil,H=Math.floor,U=function(e){return isNaN(e=+e)?0:(e>0?H:B)(e)},G=Math.min,z=function(e){return e>0?G(U(e),9007199254740991):0},W=Math.max,J=Math.min,Y=a("keys"),X=function(e){return Y[e]||(Y[e]=c(e))},Z=(M=!1,function(e,t,n){var r,i=C(e),o=z(i.length),a=function(e,t){return(e=U(e))<0?W(e+t,0):J(e,t)}(n,o);if(M&&t!=t){for(;o>a;)if((r=i[a++])!=r)return!0}else for(;o>a;a++)if((M||a in i)&&i[a]===t)return M||a||0;return!M&&-1}),K=X("IE_PROTO"),Q=function(e,t){var n,r=C(e),i=0,o=[];for(n in r)n!=K&&D(r,n)&&o.push(n);for(;t.length>i;)D(r,n=t[i++])&&(~Z(o,n)||o.push(n));return o},ee="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),te=Object.keys||function(e){return Q(e,ee)},ne=d?Object.defineProperties:function(e,t){f(e);for(var n,r=te(t),i=r.length,o=0;i>o;)_.f(e,n=r[o++],t[n]);return e},re=o.document,ie=re&&re.documentElement,oe=X("IE_PROTO"),ae=function(){},ue=function(){var e,t=y("iframe"),n=ee.length;for(t.style.display="none",ie.appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),ue=e.F;n--;)delete ue.prototype[ee[n]];return ue()},se=Object.create||function(e,t){var n;return null!==e?(ae.prototype=f(e),n=new ae,ae.prototype=null,n[oe]=e):n=ue(),void 0===t?n:ne(n,t)},ce=_.f,le=l("toStringTag"),he=function(e,t,n){e&&!D(e=n?e:e.prototype,le)&&ce(e,le,{configurable:!0,value:t})},fe={};O(fe,l("iterator"),function(){return this});var pe=function(e,t,n){e.prototype=se(fe,{next:w(1,n)}),he(e,t+" Iterator")},de=function(e){return Object(A(e))},ve=X("IE_PROTO"),me=Object.prototype,ye=Object.getPrototypeOf||function(e){return e=de(e),D(e,ve)?e[ve]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?me:null},ge=l("iterator"),ke=!([].keys&&"next"in[].keys()),be=function(){return this},_e=function(e,t,n,r,i,o,a){pe(n,t,r);var u,s,c,l=function(e){if(!ke&&e in d)return d[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},h=t+" Iterator",f="values"==i,p=!1,d=e.prototype,v=d[ge]||d["@@iterator"]||i&&d[i],m=v||l(i),y=i?f?l("entries"):m:void 0,g="Array"==t&&d.entries||v;if(g&&(c=ye(g.call(new e)))!==Object.prototype&&c.next&&(he(c,h,!0),"function"!=typeof c[ge]&&O(c,ge,be)),f&&v&&"values"!==v.name&&(p=!0,m=function(){return v.call(this)}),(ke||p||!d[ge])&&O(d,ge,m),I[t]=m,I[h]=be,i)if(u={values:f?m:l("values"),keys:o?m:l("keys"),entries:y},a)for(s in u)s in d||R(d,s,u[s]);else q(q.P+q.F*(ke||p),t,u);return u}(Array,"Array",function(e,t){this._t=C(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,S(1)):S(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values");I.Arguments=I.Array,V("keys"),V("values"),V("entries");var we,Oe,xe,Ne;we="keys",Oe=function(){return function(e){return te(de(e))}},xe=(i.Object||{})[we]||Object[we],(Ne={})[we]=Oe(xe),q(q.S+q.F*p(function(){xe(1)}),"Object",Ne);for(var Ve=l("iterator"),Se=l("toStringTag"),Ie=I.Array,Ee={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},Pe=te(Ee),Fe=0;Fe<Pe.length;Fe++){var Ae,Ce=Pe[Fe],je=Ee[Ce],De=o[Ce],Re=De&&De.prototype;if(Re&&(Re[Ve]||O(Re,Ve,Ie),Re[Se]||O(Re,Se,Ce),I[Ce]=Ie,je))for(Ae in _e)Re[Ae]||R(Re,Ae,_e[Ae],!0)}function $e(e){return($e="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 Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Me(e,t,n){return t&&Te(e.prototype,t),n&&Te(e,n),e}function qe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Be(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){qe(e,t,n[t])})}return e}function He(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&&Ge(e,t)}function Ue(e){return(Ue=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ge(e,t){return(Ge=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ze(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function We(e,t,n){return(We="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Ue(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function Je(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var Ye={f:{}.propertyIsEnumerable},Xe=Object.getOwnPropertyDescriptor,Ze={f:d?Xe:function(e,t){if(e=C(e),t=k(t,!0),g)try{return Xe(e,t)}catch(e){}if(D(e,t))return w(!Ye.f.call(e,t),e[t])}},Ke=function(e,t){if(f(e),!h(t)&&null!==t)throw TypeError(t+": can't set as prototype!")},Qe={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{(n=L(Function.call,Ze.f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return Ke(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:Ke}.set,et=function(e,t,n){var r,i=t.constructor;return i!==n&&"function"==typeof i&&(r=i.prototype)!==n.prototype&&h(r)&&Qe&&Qe(e,r),e},tt=ee.concat("length","prototype"),nt={f:Object.getOwnPropertyNames||function(e){return Q(e,tt)}},rt=l("match"),it=function(e){var t;return h(e)&&(void 0!==(t=e[rt])?!!t:"RegExp"==P(e))},ot=function(){var e=f(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},at=l("species"),ut=_.f,st=nt.f,ct=o.RegExp,lt=ct,ht=ct.prototype,ft=/a/g,pt=/a/g,dt=new ct(ft)!==ft;if(d&&(!dt||p(function(){return pt[l("match")]=!1,ct(ft)!=ft||ct(pt)==pt||"/a/i"!=ct(ft,"i")}))){ct=function(e,t){var n=this instanceof ct,r=it(e),i=void 0===t;return!n&&r&&e.constructor===ct&&i?e:et(dt?new lt(r&&!i?e.source:e,t):lt((r=e instanceof ct)?e.source:e,r&&i?ot.call(e):t),n?this:ht,ct)};for(var vt=function(e){e in ct||ut(ct,e,{configurable:!0,get:function(){return lt[e]},set:function(t){lt[e]=t}})},mt=st(lt),yt=0;mt.length>yt;)vt(mt[yt++]);ht.constructor=ct,ct.prototype=ht,R(o,"RegExp",ct)}!function(e){var t=o[e];d&&t&&!t[at]&&_.f(t,at,{configurable:!0,get:function(){return this}})}("RegExp");var gt=function(e){return function(t,n){var r,i,o=String(A(t)),a=U(n),u=o.length;return a<0||a>=u?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===u||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}}(!0),kt=function(e,t,n){return t+(n?gt(e,t).length:1)},bt=l("toStringTag"),_t="Arguments"==P(function(){return arguments}()),wt=RegExp.prototype.exec,Ot=function(e,t){var n,r,i,o,a=e.exec;if("function"==typeof a){var u=a.call(e,t);if("object"!=typeof u)throw new TypeError("RegExp exec method returned something other than an Object or null");return u}if("RegExp"!==(void 0===(n=e)?"Undefined":null===n?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(r=Object(n),bt))?i:_t?P(r):"Object"==(o=P(r))&&"function"==typeof r.callee?"Arguments":o))throw new TypeError("RegExp#exec called on incompatible receiver");return wt.call(e,t)},xt=RegExp.prototype.exec,Nt=String.prototype.replace,Vt=xt,St=function(){var e=/a/,t=/b*/g;return xt.call(e,"a"),xt.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),It=void 0!==/()??/.exec("")[1];(St||It)&&(Vt=function(e){var t,n,r,i,o=this;return It&&(n=new RegExp("^"+o.source+"$(?!\\s)",ot.call(o))),St&&(t=o.lastIndex),r=xt.call(o,e),St&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),It&&r&&r.length>1&&Nt.call(r[0],n,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)}),r});var Et=Vt;q({target:"RegExp",proto:!0,forced:Et!==/./.exec},{exec:Et});var Pt=l("species"),Ft=!p(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),At=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}(),Ct=function(e,t,n){var r=l(e),i=!p(function(){var t={};return t[r]=function(){return 7},7!=""[e](t)}),o=i?!p(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[Pt]=function(){return n}),n[r](""),!t}):void 0;if(!i||!o||"replace"===e&&!Ft||"split"===e&&!At){var a=/./[r],u=n(A,r,""[e],function(e,t,n,r,o){return t.exec===Et?i&&!o?{done:!0,value:a.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),s=u[0],c=u[1];R(String.prototype,e,s),O(RegExp.prototype,r,2==t?function(e,t){return c.call(e,this,t)}:function(e){return c.call(e,this)})}},jt=Math.max,Dt=Math.min,Rt=Math.floor,$t=/\$([$&`']|\d\d?|<[^>]*>)/g,Lt=/\$([$&`']|\d\d?)/g;Ct("replace",2,function(e,t,n,r){return[function(r,i){var o=e(this),a=null==r?void 0:r[t];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(e,t){var o=r(n,e,this,t);if(o.done)return o.value;var a=f(e),u=String(this),s="function"==typeof t;s||(t=String(t));var c=a.global;if(c){var l=a.unicode;a.lastIndex=0}for(var h=[];;){var p=Ot(a,u);if(null===p)break;if(h.push(p),!c)break;""===String(p[0])&&(a.lastIndex=kt(u,z(a.lastIndex),l))}for(var d,v="",m=0,y=0;y<h.length;y++){p=h[y];for(var g=String(p[0]),k=jt(Dt(U(p.index),u.length),0),b=[],_=1;_<p.length;_++)b.push(void 0===(d=p[_])?d:String(d));var w=p.groups;if(s){var O=[g].concat(b,k,u);void 0!==w&&O.push(w);var x=String(t.apply(void 0,O))}else x=i(g,u,k,b,w,t);k>=m&&(v+=u.slice(m,k)+x,m=k+g.length)}return v+u.slice(m)}];function i(e,t,r,i,o,a){var u=r+e.length,s=i.length,c=Lt;return void 0!==o&&(o=de(o),c=$t),n.call(a,c,function(n,a){var c;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,r);case"'":return t.slice(u);case"<":c=o[a.slice(1,-1)];break;default:var l=+a;if(0===l)return n;if(l>s){var h=Rt(l/10);return 0===h?n:h<=s?void 0===i[h-1]?a.charAt(1):i[h-1]+a.charAt(1):n}c=i[l-1]}return void 0===c?"":c})}}),d&&"g"!=/./g.flags&&_.f(RegExp.prototype,"flags",{configurable:!0,get:ot});var Tt=/./.toString,Mt=function(e){R(RegExp.prototype,"toString",e,!0)};p(function(){return"/a/b"!=Tt.call({source:"a",flags:"b"})})?Mt(function(){var e=f(this);return"/".concat(e.source,"/","flags"in e?e.flags:!d&&e instanceof RegExp?ot.call(e):void 0)}):"toString"!=Tt.name&&Mt(function(){return Tt.call(this)});var qt=Date.prototype,Bt=qt.toString,Ht=qt.getTime;function Ut(e){t.nextTick(e)}function Gt(e,n,r){t.set(e,n,r)}function zt(e,n){t.delete(e,n)}new Date(NaN)+""!="Invalid Date"&&R(qt,"toString",function(){var e=Ht.call(this);return e==e?Bt.call(this):"Invalid Date"});var Wt=Object.prototype.toString;function Jt(e){return null==e}function Yt(e){return null==e?"":"object"===$e(e)?JSON.stringify(e,null,2):String(e)}function Xt(e,t){for(var n in t)Gt(e,n,t[n]);return e}function Zt(e){return"[object Date]"===Wt.call(e)}function Kt(e){return"[object Object]"===Wt.call(e)}function Qt(e){return"[object Function]"===Wt.call(e)}function en(e){return"[object String]"===Wt.call(e)}function tn(e){return"[object Boolean]"===Wt.call(e)}function nn(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function rn(e){return Array.isArray(e)?e:[e]}function on(e){return"object"===$e(e)&&null!==e&&1===e.nodeType&&!Kt(e)}function an(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1;for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];if((n=Array.isArray(i))||Kt(i)){var o=void 0===e[r];n?(n=!1,o&&Gt(e,r,[])):o&&Gt(e,r,{}),an(e[r],i)}else Gt(e,r,i)}return e}var un=0;function sn(){return++un}var cn=_.f,ln=Function.prototype,hn=/^\s*function ([^ (]*)/;"name"in ln||d&&cn(ln,"name",{configurable:!0,get:function(){try{return(""+this).match(hn)[1]}catch(e){return""}}});var fn=l("species"),pn=Math.min,dn=[].push,vn=!p(function(){});Ct("split",2,function(e,t,n,r){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var r=String(this);if(void 0===e&&0===t)return[];if(!it(e))return n.call(r,e,t);for(var i,o,a,u=[],s=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,l=void 0===t?4294967295:t>>>0,h=new RegExp(e.source,s+"g");(i=Et.call(h,r))&&!((o=h.lastIndex)>c&&(u.push(r.slice(c,i.index)),i.length>1&&i.index<r.length&&dn.apply(u,i.slice(1)),a=i[0].length,c=o,u.length>=l));)h.lastIndex===i.index&&h.lastIndex++;return c===r.length?!a&&h.test("")||u.push(""):u.push(r.slice(c)),u.length>l?u.slice(0,l):u}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),a=null==n?void 0:n[t];return void 0!==a?a.call(n,o,r):i.call(String(o),n,r)},function(e,t){var o=r(i,e,this,t,i!==n);if(o.done)return o.value;var a=f(e),u=String(this),s=function(e,t){var n,r=f(e).constructor;return void 0===r||null==(n=f(r)[fn])?t:$(n)}(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(vn?"y":"g"),h=new s(vn?a:"^(?:"+a.source+")",l),p=void 0===t?4294967295:t>>>0;if(0===p)return[];if(0===u.length)return null===Ot(h,u)?[u]:[];for(var d=0,v=0,m=[];v<u.length;){h.lastIndex=vn?v:0;var y,g=Ot(h,vn?u:u.slice(v));if(null===g||(y=pn(z(h.lastIndex+(vn?0:v)),u.length))===d)v=kt(u,v,c);else{if(m.push(u.slice(d,v)),m.length===p)return m;for(var k=1;k<=g.length-1;k++)if(m.push(g[k]),m.length===p)return m;v=d=y}}return m.push(u.slice(d)),m}]});var mn=function(){function e(t,n,r,i,o){Le(this,e);var a=function(e,t,n){var r={validate:[],event:{},col:{},emit:[],props:[],on:{},options:[],title:"",value:"",field:"",className:""};Object.keys(r).forEach(function(t){Jt(e[t])&&Gt(e,t,r[t])});var i={col:bn(e.col),props:kn(e.props),emitEvent:gn(e.field,e.emitPrefix,e.emit,t),validate:yn(e.validate),options:yn(e.options)};i.event=Xt((u=e.event,Object.keys(u).forEach(function(e){var t=0===Yt(e).indexOf("on-")?e:"on-".concat(e);t!==e&&Gt(u,t,u[e])}),u),i.emitEvent),i.on=(o=e.on,a=i.emitEvent,Object.keys(a).length>0&&Xt(o,a),o),Object.keys(i).forEach(function(t){Gt(e,t,i[t])}),e.field||n||console.error("规则的 field 字段不能空\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");var o,a;var u;return e}(n,t,o);this.rule=a,this.noValue=o,this.type=Yt(a.type).toLowerCase(),this.isDef=!0,this.vm=t,this.el={},this.watch=[],this.root=[],this.origin=[],!a.field&&o?(this.field="_def_"+sn(),this.isDef=!1):this.field=a.field,this.init();var u=sn();this.id=u,this.unique="fc_"+u,this.key="key_"+u,this.refName="__"+this.field+this.id,Jt(a.props.elementId)&&Gt(a.props,"elementId",this.unique),this.refresh(),this.render=new r(t,this,i)}return Me(e,[{key:"refresh",value:function(){return this.parseValue=this.toFormValue(this.rule.value),this}},{key:"init",value:function(){}},{key:"toFormValue",value:function(e){return e}},{key:"toValue",value:function(e){return e}},{key:"setValue",value:function(e){this.rule.value=e,this.vm._changeValue(this.field,e)}},{key:"getValue",value:function(){return this.vm._value(this.field)}},{key:"watchValue",value:function(e){Gt(this.rule,"value",e),this.vm._changeFormData(this.field,this.toFormValue(e))}},{key:"watchFormValue",value:function(e){}},{key:"reset",value:function(){this.vm._changeValue(this.field,this.defaultValue),this.clearMsg()}},{key:"clearMsg",value:function(){var e="fItem"+this.refName,t=this.vm.$refs[e];t&&(t.validateMessage="",t.validateState="",t.validateDisabled=!0)}},{key:"mounted",value:function(){var e="fItem"+this.refName,t=this.vm,n=this.rule.children;this.el=t.$refs[this.refName]||{},this.defaultValue=this.toValue(t.$refs[e]&&!Jt(t.$refs[e].initialValue)?t.$refs[e].initialValue:an({},{value:this.rule.value}).value),Array.isArray(n)&&n.length>0&&n.forEach(function(e){return!en(e)&&e.__handler__.mounted()})}},{key:"$emit",value:function(e){for(var t,n,r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];"template"===this.type?(t=this.rule.vm).$emit.apply(t,[e].concat(i)):!0===this.noValue&&this.el.$emit&&(n=this.el).$emit.apply(n,[e].concat(i))}}]),e}();function yn(e){return Array.isArray(e)?e:[]}function gn(e,t,n,r){var i={};return Array.isArray(n)?(n.forEach(function(n){var o=nn("".concat(e,"-").concat(n)).replace("_","-"),a=t?"".concat(t,"-").toLowerCase()+nn(n):t;i["on-".concat(n)]=i[n]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.$emit.apply(r,[o].concat(t)),a&&o!==a&&r.$emit.apply(r,[a].concat(t))}}),i):i}function kn(e){return Jt(e.hidden)&&Gt(e,"hidden",!1),Jt(e.visibility)&&Gt(e,"visibility",!1),e}function bn(e){return""!==(t=e)&&!isNaN(parseFloat(t))&&isFinite(t)?{span:e}:(void 0===e.span&&Gt(e,"span",24),e);var t}var _n=function(){function e(t){Le(this,e),this.setVm(t)}return Me(e,[{key:"setVm",value:function(e){this.vm=e,this.$h=e.$createElement}},{key:"make",value:function(e,t,n){var r,i=this.$h(e,function(e){return en(e)?e={domProps:{innerHTML:e}}:e&&Qt(e.get)&&(e=e.get()),e}(t),Qt(r=n)?r():r||[]);return i.context=this.vm,i}}]),e}(),wn={modal:"Modal",progress:"i-progress",button:"i-button",icon:"Icon",span:"span",slider:"Slider",rate:"Rate",upload:"Upload",cascader:"Cascader",colorPicker:"Color-Picker",timePicker:"Time-Picker",datePicker:"Date-Picker",switch:"i-switch",option:"i-option",select:"i-select",checkbox:"Checkbox",checkboxGroup:"Checkbox-Group",radio:"Radio",radioGroup:"Radio-Group",inputNumber:"Input-Number",input:"i-input",formItem:"Form-Item",form:"i-form",col:"i-col",row:"row",tree:"Tree",AutoComplete:"AutoComplete"};Object.keys(wn).forEach(function(e){_n.prototype[e]=function(t,n){return this.make(wn[e],t,n)}});var On=function(){function e(){Le(this,e),this.init()}return Me(e,[{key:"class",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Jt(e)?this:(Array.isArray(e)?e.forEach(function(e){Gt(t._data.class,Yt(e),!0)}):Kt(e)?Gt(this._data,"class",Xt(this._data.class,e)):Gt(this._data.class,Yt(e),void 0===n||n),this)}},{key:"directives",value:function(e){return Jt(e)?this:(Gt(this._data,"directives",this._data.directives.concat(rn(e))),this)}},{key:"init",value:function(){return this._data={class:{},style:{},attrs:{},props:{},domProps:{},on:{},nativeOn:{},directives:[],scopedSlots:{},slot:void 0,key:void 0,ref:void 0},this}},{key:"get",value:function(){return this._prev=this._data,this.init(),this._prev}}]),e}();["ref","key","slot"].forEach(function(e){On.prototype[e]=function(t){return Gt(this._data,e,t),this}}),["scopedSlots","nativeOn","on","domProps","props","attrs","style"].forEach(function(e){On.prototype[e]=function(t,n){return Jt(t)?this:(Kt(t)?Gt(this._data,e,Xt(this._data[e],t)):Gt(this._data[e],Yt(t),n),this)}});var xn=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Le(this,e),this.vm=t,this.handler=n,this.options=r,this.vNode=new _n(t),this.vData=new On,this.cache=null,this.$tickEvent=[],this.init()}return Me(e,[{key:"init",value:function(){}},{key:"cacheParse",value:function(e,t){var n=this.handler,r=n.noValue,i=n.noCache;this.cache&&!0!==r&&!0!==i||(this.cache=t?t.parse.call(this,e):this.parse(e));var o=Je(this.$tickEvent);return this.$tickEvent=[],o.length&&Ut(function(){o.forEach(function(e){return e()})}),this.cache}},{key:"sync",value:function(e){Qt(e)&&this.$tickEvent.push(e),this.clearCache(),this.vm._sync()}},{key:"clearCache",value:function(){this.cache=null;var e=this.handler.rule.children;Array.isArray(e)&&e.length>0&&e.forEach(function(e){return!en(e)&&e.__handler__.render.clearCache()})}},{key:"parse",value:function(e){var n=this,r=this.handler,i=r.type,o=r.rule,a=r.refName,u=r.key,s=r.noValue,c=r.origin,l=r.root,h=r.vm;if("template"===o.type){if(void 0!==t.compile){Jt(o.vm)&&(o.vm=new t);var f=t.compile(o.template,{}).render.call(o.vm);return void 0===f.data&&(f.data={}),Xt(f.data,o),f.key=u,[f]}return console.error("使用的 Vue 版本不支持 compile\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com"),[]}if(s){o.ref=a,Jt(o.key)&&(o.key="def"+sn());var p=this.vNode.make(i,Be({},o),function(){var t=[],r=o.children||[];return Array.isArray(r)&&r.length>0&&(t=r.map(function(t){return en(t)?[t]:(t.__handler__||h._fComponent.createHandler([t],!0),t.__handler__.render.cacheParse(e,n))})),t});return p.key=u,[p]}return c.forEach(function(e){-1===l.indexOf(e)&&h._fComponent.removeField(e.__field__)}),this.handler.origin=Je(l),e.makeComponent(this.handler.render)}},{key:"inputProps",value:function(){var e=this,t=this.handler,n=t.refName,r=t.key,i=t.field,o=t.rule,a=o.props,u=o.event,s=this.vData.props(a).props({value:this.vm._formData(i)}).ref(n).key(r+"fc"+i).on(u).on("input",function(t){e.onInput(t)});return Jt(a.size)&&s.props({size:this.options.form.size}),s}},{key:"onInput",value:function(e){var t=this.handler,n=this.handler,r=n.field,i=n.vm,o=t.toValue(e);i._changeFormData(r,e),t.setValue(o),i._change(r,JSON.stringify(e)),t.watchFormValue(e)}}]),e}();function Nn(e){return function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Sn(e,t,n,r,i)}}function Vn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"type";return function(r,i,o){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=new Sn(e,r,i,o,a);return Qt(t)?t(u):u.props(n,t),u}}var Sn=function(e){function t(e,n,r,i){var o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return Le(this,t),(o=ze(this,Ue(t).call(this))).rule=Xt({event:{},validate:[],options:[],col:{},children:[],emit:[],template:null,emitPrefix:null},{type:e,title:n,field:r,value:i}),o.props({hidden:!1,visibility:!1}),Kt(a)&&o.props(a),o}return He(t,On),Me(t,[{key:"type",value:function(e){return this.props("type",e),this}},{key:"get",value:function(){return this._data}},{key:"getRule",value:function(){return Xt(this.rule,this.get())}},{key:"setValue",value:function(e){return Gt(this.rule,"value",e),this}}]),t}();["emitPrefix","className","defaultSlot"].forEach(function(e){Sn.prototype[e]=function(t){return Gt(this.rule,e,t),this}});["event","col"].forEach(function(e){Sn.prototype[e]=function(t){return Gt(this.rule,e,Xt(this.rule[e],t)),this}});["validate","options","children","emit"].forEach(function(e){Sn.prototype[e]=function(t){return Array.isArray(t)||(t=[t]),Gt(this.rule,e,this.rule[e].concat(t)),this}});var In={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[]}}]),t}(),name:"hidden",maker:qe({},"hidden",function(e,t){return Nn("hidden")("",e,t)})},En=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule.props;e.autosize&&e.autosize.minRows&&Gt(e,"rows",e.autosize.minRows||2)}},{key:"toFormValue",value:function(e){return Yt(e)}}]),t}(),Pn=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.input(this.inputProps().get())]}}]),t}(),Fn=["password","url","email","text","textarea"].reduce(function(e,t){return e[t]=Vn("input",t),e},{});Fn.idate=Vn("input","date");var An={render:Pn,handler:En,name:"input",maker:Fn},Cn={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"toFormValue",value:function(e){return this.rule.options.filter(function(t){return t.value===e}).reduce(function(e,t){return t.label},"")}},{key:"toValue",value:function(e){return this.rule.options.filter(function(t){return t.label===e}).reduce(function(e,t){return t.value},"")}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.rule.options;return[this.vNode.radioGroup(this.inputProps().get(),function(){return r.map(function(t,r){var i=Be({},t);return delete i.value,e.vNode.radio({props:i,key:"ropt".concat(r).concat(n)})})})]}}]),t}(),name:"radio"},jn={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"toFormValue",value:function(e){return e?Array.isArray(e)||(e=[e]):e=[],this.rule.options.filter(function(t){return-1!==e.indexOf(t.value)}).map(function(e){return e.label})}},{key:"toValue",value:function(e){var t=this.rule.options.filter(function(t){return-1!==e.indexOf(t.label)}).map(function(e){return e.value});return 1===this.rule.options.length?void 0===t[0]?"":t[0]:t}},{key:"watchFormValue",value:function(e){We(Ue(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.rule.options,i=t.key;return[this.vNode.checkboxGroup(this.inputProps().key(i).get(),function(){return r.map(function(t,r){var i=Be({},t);return delete i.value,e.vNode.checkbox({props:i,key:"copt".concat(r).concat(n)})})})]}}]),t}(),name:"checkbox"},Dn={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){void 0===this.rule.slot&&Gt(this.rule,"slot",{})}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this.handler.rule,t=Jt(e.props.slot)?e.slot:e.props.slot;return[this.vNode.switch(this.inputProps().scopedSlots({open:function(){return t.open},close:function(){return t.close}}).style({margin:"4.5px 0px"}).get())]}}]),t}(),name:"switch"},Rn={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"toFormValue",value:function(e){var t=Array.isArray(e);return!0===this.rule.props.multiple?!0===t?e:[e]:!0===t?e[0]||"":e}},{key:"watchFormValue",value:function(e){We(Ue(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.rule;return[this.vNode.select(this.inputProps().get(),function(){return r.options.map(function(t,i){return e.vNode.option({props:t,key:"sopt".concat(i).concat(n)},Cr(t.slot,e.vm.$createElement,r))})})]}}]),t}(),name:"select",maker:{selectMultiple:Vn("select",!0,"multiple"),selectOne:Vn("select",!1,"multiple")}},$n={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule.props;Gt(e,"type",e.type?Yt(e.type).toLowerCase():"date"),Jt(e.startDate)&&Gt(e,"startDate",jr(e.startDate))}},{key:"toFormValue",value:function(e){var t,n=Array.isArray(e),r=this.rule.props;return t=-1!==["daterange","datetimerange"].indexOf(r.type)?n?e.map(function(e){return e?jr(e):""}):["",""]:"date"===r.type&&!0===r.multiple?Yt(e):(t=n?e[0]||"":e)?jr(t):""}},{key:"toValue",value:function(){return this.el.publicStringValue}},{key:"mounted",value:function(){We(Ue(t.prototype),"mounted",this).call(this),this.rule.value=this.el.publicStringValue,this.vm._changeFormData(this.field,this.toFormValue(this.el.publicStringValue))}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this.handler,t=e.key,n=e.rule,r=e.vm;return[this.vNode.datePicker(this.inputProps().key(t).get(),Cr(n.defaultSlot,r.$createElement,n))]}}]),t}(),name:"datePicker",maker:["date","dateRange","dateTime","dateTimeRange","year","month"].reduce(function(e,t){return e[t]=Vn("datePicker",t.toLowerCase()),e},{})};function Ln(e){return Zt(e)?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date,n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};for(var r in/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return e}("hh:mm:ss",e):e}var Tn={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule.props;e.type||Gt(e,"type","time"),Jt(e.confirm)&&Gt(e,"confirm",!0)}},{key:"toFormValue",value:function(e){var t,n=Array.isArray(e);return"timerange"===this.rule.props.type?t=n?e.map(function(e){return e?Ln(jr(e)):""}):["",""]:(n&&(e=e[0]),t=e?Ln(jr(e)):""),t}},{key:"mounted",value:function(){We(Ue(t.prototype),"mounted",this).call(this),this.rule.value=this.el.publicStringValue,this.vm._changeFormData(this.field,this.toFormValue(this.el.publicStringValue))}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e=this.handler,t=e.key,n=e.rule,r=e.vm;return[this.vNode.timePicker(this.inputProps().key(t).get(),Cr(n.defaultSlot,r.$createElement,n))]}}]),t}(),maker:{time:Vn("timePicker","time"),timeRange:Vn("timePicker","timerange")},name:"timePicker"},Mn="\t\n\v\f\r    \u2028\u2029\ufeff",qn="["+Mn+"]",Bn=RegExp("^"+qn+qn+"*"),Hn=RegExp(qn+qn+"*$"),Un=function(e,t,n){var r={},i=p(function(){return!!Mn[e]()||"…"!="…"[e]()}),o=r[e]=i?t(Gn):Mn[e];n&&(r[n]=o),q(q.P+q.F*i,"String",r)},Gn=Un.trim=function(e,t){return e=String(A(e)),1&t&&(e=e.replace(Bn,"")),2&t&&(e=e.replace(Hn,"")),e},zn=Un,Wn=nt.f,Jn=Ze.f,Yn=_.f,Xn=zn.trim,Zn=o.Number,Kn=Zn,Qn=Zn.prototype,er="Number"==P(se(Qn)),tr="trim"in String.prototype,nr=function(e){var t=k(e,!1);if("string"==typeof t&&t.length>2){var n,r,i,o=(t=tr?t.trim():Xn(t,3)).charCodeAt(0);if(43===o||45===o){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+t}for(var a,u=t.slice(2),s=0,c=u.length;s<c;s++)if((a=u.charCodeAt(s))<48||a>i)return NaN;return parseInt(u,r)}}return+t};if(!Zn(" 0o1")||!Zn("0b1")||Zn("+0x1")){Zn=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof Zn&&(er?p(function(){Qn.valueOf.call(n)}):"Number"!=P(n))?et(new Kn(nr(t)),n,Zn):nr(t)};for(var rr,ir=d?Wn(Kn):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),or=0;ir.length>or;or++)D(Kn,rr=ir[or])&&!D(Zn,rr)&&Yn(Zn,rr,Jn(Kn,rr));Zn.prototype=Qn,Qn.constructor=Zn,R(o,"Number",Zn)}q(q.S,"Number",{isNaN:function(e){return e!=e}});var ar={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"toFormValue",value:function(e){var t=parseFloat(e);return Number.isNaN(t)&&(t=0),t}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.inputNumber(this.inputProps().get())]}}]),t}(),name:"inputNumber",maker:{number:Nn("inputNumber")}},ur={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"watchFormValue",value:function(e){We(Ue(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.colorPicker(this.inputProps().key(this.handler.key).get())]}}]),t}(),name:"colorPicker",maker:{color:Nn("colorPicker")}};function sr(e){return Array.isArray(e)?e:e?[e]:[]}var cr=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule.props;Gt(e,"defaultFileList",[]),Jt(e.showUploadList)&&Gt(e,"showUploadList",!1),Jt(e.uploadType)&&Gt(e,"uploadType","file"),void 0===e.maxLength&&Gt(e,"maxLength",0),void 0===e.action&&Gt(e,"action",""),"file"===e.uploadType&&void 0===e.handleIcon&&Gt(e,"handleIcon",!1),Gt(this.rule,"value",sr(this.rule.value)),this.parseValue=[]}},{key:"toFormValue",value:function(e){var t=this,n=sr(e);return this.parseValue.splice(0,this.parseValue.length),n.forEach(function(e){return t.push(e)}),Gt(this.rule.props,"defaultFileList",this.parseValue),this.parseValue}},{key:"mounted",value:function(){We(Ue(t.prototype),"mounted",this).call(this),Gt(this.rule.props,"defaultFileList",this.parseValue),this.changeParseValue(this.el.fileList||[])}},{key:"push",value:function(e){var t;this.parseValue.push({url:e,name:(t=e,Yt(t).split("/").pop())})}},{key:"toValue",value:function(e){if(Jt(e))return[];var t=e.map(function(e){return e.url}).filter(function(e){return void 0!==e});return 1===this.rule.props.maxLength?t[0]||"":t}},{key:"changeParseValue",value:function(e){this.parseValue=e,this.vm._changeFormData(this.field,e)}},{key:"watchValue",value:function(e){var n=!0;this.rule.props.defaultFileList.forEach(function(e){n=n&&(void 0===e.percentage||"finished"===e.status)}),n&&We(Ue(t.prototype),"watchValue",this).call(this,e)}}]),t}(),lr=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"init",value:function(){var e=this,t=this.handler;this.uploadOptions=Xt(Be({},this.options.upload),this.handler.rule.props),this.issetIcon=this.uploadOptions.allowRemove||this.uploadOptions.handleIcon,this.propsData=this.vData.props(this.uploadOptions).props("onSuccess",function(){return e.onSuccess.apply(e,arguments)}).props("onRemove",function(){return e.onRemove.apply(e,arguments)}).ref(t.refName).key("fip".concat(t.unique)).get()}},{key:"onRemove",value:function(){var e;this.handler.changeParseValue(this.handler.el.fileList),this.uploadOptions.onRemove&&(e=this.uploadOptions).onRemove.apply(e,arguments),this.sync()}},{key:"onSuccess",value:function(e,t,n){var r=this.uploadOptions.onSuccess.call(null,e,t,n);if(Jt(r)){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}else t.url=r,t.showProgress=!1;this.handler.changeParseValue(this.handler.el.fileList)}},{key:"defaultOnHandle",value:function(e){var t=this;this.vm.$Modal.remove(),setTimeout(function(){t.vm.$Modal.info({title:"预览",render:function(t){return t("img",{attrs:{src:e},style:"width: 100%",key:"ifmd"+sn()})},showCancel:!0,closable:!0,scrollable:!0})},301)}},{key:"onHandle",value:function(e){var t=this.uploadOptions.onHandle;if(t)return t(e);this.defaultOnHandle(e)}},{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.field;this.init(),!0===this.uploadOptions.handleIcon&&(this.uploadOptions.handleIcon="ios-eye-outline");var i=this.vm._formData(r),o=this.uploadOptions.showUploadList?[]:Je(i.map(function(t,r){return t.showProgress?e.makeProgress(t,"uppg".concat(r).concat(n)):void 0===t.status||"finished"===t.status?e.makeUploadView(t.url,"upview".concat(r).concat(n),r):void 0})),a=!this.uploadOptions.maxLength||this.uploadOptions.maxLength>i.length;return o.push(this.makeUploadBtn(n,a)),[this.vNode.make("div",{key:"div4".concat(n),class:{"fc-upload":!0,"fc-hide-btn":!a}},o)]}},{key:"cacheParse",value:function(e){return this.cache=null,We(Ue(t.prototype),"cacheParse",this).call(this,e)}},{key:"makeUploadView",value:function(e,t,n){var r=this;return this.vNode.make("div",{key:"div1".concat(t),class:{"fc-files":!0}},function(){var i=[];return"image"===r.handler.rule.props.uploadType?i.push(r.vNode.make("img",{key:"img".concat(t),attrs:{src:e}})):i.push(r.vNode.icon({key:"file".concat(t),props:{type:Fr.fileIcon,size:40}})),r.issetIcon&&i.push(r.makeIcons(e,t,n)),i})}},{key:"makeIcons",value:function(e,t,n){var r=this;return this.vNode.make("div",{key:"div2".concat(t),class:{"fc-upload-cover":!0}},function(){var i=[];return r.uploadOptions.handleIcon&&i.push(r.makeHandleIcon(e,t,n)),!0===r.uploadOptions.allowRemove&&i.push(r.makeRemoveIcon(e,t,n)),i})}},{key:"makeProgress",value:function(e,t){return this.vNode.make("div",{key:"div3".concat(t),class:{"fc-files":!0}},[this.vNode.progress({key:"upp".concat(t),props:{percent:e.percentage,hideInfo:!0},style:{width:"90%"}})])}},{key:"makeUploadBtn",value:function(e,t){return this.vNode.upload(this.propsData,!0===t?[this.vNode.make("div",{key:"div5".concat(e),class:{"fc-upload-btn":!0}},[this.vNode.icon({key:"upi".concat(e),props:{type:"file"===this.handler.rule.props.uploadType?"ios-cloud-upload-outline":Fr.imgUpIcon,size:20}})])]:[])}},{key:"makeRemoveIcon",value:function(e,t,n){var r=this;return this.vNode.icon({key:"upri".concat(t).concat(n),props:{type:"ios-trash-outline"},nativeOn:{click:function(){var e=r.handler.el.fileList,t=e[n];e.splice(n,1),r.onRemove(t,e)}}})}},{key:"makeHandleIcon",value:function(e,t,n){var r=this;return this.vNode.icon({key:"uphi".concat(t).concat(n),props:{type:Yt(this.uploadOptions.handleIcon)},nativeOn:{click:function(){r.onHandle(e)}}})}}]),t}(),hr={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},fr=Object.keys(hr).reduce(function(e,t){return e[t]=Vn("upload",function(e){return e.props({uploadType:hr[t][0],maxLength:hr[t][1]})}),e},{});fr.uploadImage=fr.image,fr.uploadFile=fr.file;var pr={handler:cr,render:lr,maker:fr,name:"upload"},dr={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule;e.props.data||Gt(e.props,"data",[]),Array.isArray(this.rule.value)||Gt(e,"value",[])}},{key:"toFormValue",value:function(e){return Array.isArray(e)?e:[]}},{key:"mounted",value:function(){We(Ue(t.prototype),"mounted",this).call(this),this.vm._changeFormData(this.field,this.toFormValue(this.el.value))}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.cascader(this.inputProps().get())]}}]),t}(),name:"cascader"},vr={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"toFormValue",value:function(e){var t=parseFloat(e);return Number.isNaN(t)&&(t=0),t}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.rate(this.inputProps().get())]}}]),t}(),name:"rate"},mr={handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule;Gt(e.props,"min",void 0===e.props.min?0:parseFloat(e.props.min)||0)}},{key:"toFormValue",value:function(e){var t=this.rule,n=Array.isArray(e),r=t.props,i=r.min;return!0===r.range?n?e:[i,parseFloat(e)||i]:n?parseFloat(e[0])||i:parseFloat(e)}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.slider(this.inputProps().get())]}}]),t}(),name:"slider",maker:{sliderRange:Vn("slider",!0,"range")}};var yr=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e,t;e=this.rule,(t=e.props).type||Gt(t,"type","input"),t.icon||Gt(t,"icon",Fr.fileUpIcon),t.width||Gt(t,"width","500px"),t.height||Gt(t,"height","370px"),Jt(t.spin)&&Gt(t,"spin",!0),t.title||Gt(t,"title","请选择"+e.title),t.maxLength||Gt(t,"maxLength",0),t.handleIcon,Gt(t,"handleIcon",("file"!==t.type||void 0!==t.handleIcon)&&(!0===t.handleIcon||void 0===t.handleIcon?"ios-eye-outline":t.handleIcon)),void 0===t.allowRemove&&Gt(t,"allowRemove",!0),this.multiple=1!=this.rule.props.maxLength}},{key:"toFormValue",value:function(e){var t,n=e,r=Array.isArray(n);return t=""===n?[]:r?n:[n],this.parseValue=t,t}},{key:"toValue",value:function(e){return!0===this.multiple?e:void 0===e[0]?"":e[0]}},{key:"watchValue",value:function(e){We(Ue(t.prototype),"watchValue",this).call(this,e),this.render.onChange(e),this.render.sync()}},{key:"watchFormValue",value:function(e){We(Ue(t.prototype),"watchFormValue",this).call(this,e),this.parseValue=e,this.render.sync()}}]),t}(),gr={onOpen:"on-open",onChange:"on-change",onCancel:"on-cancel",onOk:"on-ok"},kr=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"init",value:function(){this._props=this.handler.rule.props,this.issetIcon=!1!==this._props.handleIcon||!0===this._props.allowRemove}},{key:"parse",value:function(){var e=this._props.type;return"image"===e?this.makeGroup(this.makeImage()):"file"===e?this.makeGroup(this.makeFile()):this.makeInput()}},{key:"makeInput",value:function(e){var t=this,n=this.handler.unique,r=this.inputProps().props({type:"text",value:this.handler.parseValue.toString(),icon:this._props.icon,readonly:!0,clearable:!0}).on("on-click",function(){t.showModel()}).key("ifit"+n).style({display:!0===e?"none":"inline-block"}).get();return[this.vNode.input(r)]}},{key:"makeGroup",value:function(e){var t=this.handler.unique,n=this.handler.field;return[this.vNode.make("div",{key:"ifgp1".concat(t),class:{"fc-upload fc-frame":!0},ref:this.handler.refName,props:{value:this.vm._formData(n)}},e),this.makeInput(!0)]}},{key:"makeImage",value:function(){var e=this,t=this.handler.unique,n=this.handler.parseValue.map(function(n,r){return e.vNode.make("div",{key:"ifid1".concat(t).concat(r),class:{"fc-files":!0}},[e.vNode.make("img",{key:"ifim".concat(t).concat(r),attrs:{src:n}}),e.makeIcons(n,t,r)])});return n.push(this.makeBtn()),n}},{key:"makeFile",value:function(){var e=this,t=this.handler.unique,n=this.handler.parseValue.map(function(n,r){return e.vNode.make("div",{key:"iffd2".concat(t).concat(r),class:{"fc-files":!0}},[e.vNode.icon({key:"iff".concat(t).concat(r),props:{type:Fr.fileIcon,size:40}}),e.makeIcons(n,t,r)])});return n.push(this.makeBtn()),n}},{key:"makeBtn",value:function(){var e=this,t=this.handler.rule.props;if(!(t.maxLength>0&&this.handler.parseValue.length>=t.maxLength)){var n=this.handler.unique;return this.vNode.make("div",{key:"ifbd3".concat(n),class:{"fc-upload-btn":!0},on:{click:function(){e.showModel()}}},[this.vNode.icon({key:"ifbi3".concat(n),props:{type:this._props.icon,size:20}})])}}},{key:"makeSpin",value:function(){if(!0===this._props.spin){var e=this.handler.unique;return this.vNode.make("Spin",{props:{fix:!0},key:"ifsp"+e,class:{"fc-spin":!0}},[this.vNode.icon({props:{type:"load-c",size:18},class:{"fc-spin-icon-load":!0},key:"ifspi"+e}),this.vNode.make("div",{domProps:{innerHTML:"加载中..."},key:"ifspd"+e})])}}},{key:"makeIcons",value:function(e,t,n){var r=this;if(!0===this.issetIcon)return this.vNode.make("div",{key:"ifis".concat(t).concat(n),class:{"fc-upload-cover":!0}},function(){var i=[];return!1!==r._props.handleIcon&&i.push(r.makeHandleIcon(e,t,n)),!0===r._props.allowRemove&&i.push(r.makeRemoveIcon(e,t,n)),i})}},{key:"makeRemoveIcon",value:function(e,t,n){var r=this;return this.vNode.icon({key:"ifri".concat(t).concat(n),props:{type:"ios-trash-outline"},nativeOn:{click:function(){!1!==r.onRemove(e)&&(r.handler.parseValue.splice(n,1),r.sync())}}})}},{key:"makeHandleIcon",value:function(e,t,n){var r=this,i=this._props;return this.vNode.icon({key:"ifhi".concat(t).concat(n),props:{type:toString(i.handleIcon)},nativeOn:{click:function(){r.onHandle(e)}}})}},{key:"onRemove",value:function(e){var t=this.handler.rule.event["on-remove"];if(t)return t(e,this.handler.getValue())}},{key:"onHandle",value:function(e){var t=this.handler.rule.event["on-handle"];if(t)return t(e);this.defaultOnHandle(e)}},{key:"valid",value:function(e){if(e!==this.handler.field)throw new Error("无效的表单字段\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com")}},{key:"showModel",value:function(){var e=this,t=!1!==this.onOpen(),r=this._props,i=r.width,o=r.height,a=r.src,u=r.title;t&&(this.vm.$Modal.remove(),setTimeout(function(){e.vm.$Modal.confirm({title:u,render:function(){return[e.makeSpin(),e.vNode.make("iframe",{attrs:{src:a},style:{height:o,border:"0 none",width:"100%"},on:{load:function(t){if(!0===e._props.spin){var r=document.getElementsByClassName("fc-spin")[0];r&&r.parentNode.removeChild(r)}try{if(!0===e.options.iframeHelper){var i=t.path[0].contentWindow;i["".concat(e.handler.field,"_change")]=function(t){e.handler.setValue(t)},i.form_create_helper={close:function(t){e.valid(t),n.Modal.remove()},set:function(t,n){e.valid(t),i["".concat(t,"_change")](n)},get:function(t){return e.valid(t),e.handler.rule.value}}}}catch(t){}}},key:"ifmd"+sn()})]},onOk:function(){return e.onOk()},onCancel:function(){return e.onCancel()},showCancel:!0,closable:!0,scrollable:!0,width:i})},301))}}]),t}();kr.prototype.defaultOnHandle=pr.render.prototype.defaultOnHandle,Object.keys(gr).forEach(function(e){kr.prototype[e]=function(){var t=this.handler.rule.event[gr[e]];if(t)return t(this.handler.getValue())}});var br={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},_r=Object.keys(br).reduce(function(e,t){return e[t]=Vn("frame",function(e){return e.props({type:br[t][0],maxLength:br[t][1]})}),e},{});_r.frameInput=_r.frameInputs,_r.frameFile=_r.frameFiles,_r.frameImage=_r.frameImages;var wr={handler:yr,render:kr,name:"frame",maker:_r};var Or=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e,t;e=this.rule,void 0===(t=e.props).data&&Gt(t,"data",[]),void 0===t.type&&Gt(t,"type","checked"),void 0===t.multiple&&Gt(t,"multiple",!1),this._data={},this.data(this.rule.props.data),Gt(this.rule,"value",this._parseValue())}},{key:"_parseValue",value:function(){var e=this;this.rule.value.forEach("selected"===this.rule.props.type?function(t){return e.selected(t)}:function(t){return e.checked(t)});var t=[];return"selected"===this.rule.props.type?Object.keys(this._data).forEach(function(n){var r=e._data[n];!0===r.selected&&t.push(r.id)}):Object.keys(this._data).forEach(function(n){var r=e._data[n];!0===r.checked&&t.push(r.id)}),t}},{key:"toFormValue",value:function(e){return e=rn(e),this.choose(e),this.parseValue=e,e}},{key:"choose",value:function(e){var t=this.rule,n=this._data;"selected"===t.props.type?Object.keys(n).forEach(function(t){Gt(n[t],"selected",-1!==e.indexOf(n[t].id))}):Object.keys(n).forEach(function(t){Gt(n[t],"checked",-1!==e.indexOf(n[t].id))})}},{key:"checked",value:function(e){void 0!==this._data[e]&&Gt(this._data[e],"checked",!0)}},{key:"selected",value:function(e){void 0!==this._data[e]&&Gt(this._data[e],"selected",!0)}},{key:"toValue",value:function(e){var t,n=e;return(t=this.rule).props.multiple||"selected"!==t.props.type?n:n[0]||""}},{key:"watchFormValue",value:function(e){this.choose(e)}},{key:"selectedValue",value:function(e){var t=[];return e.forEach(function(e){!0===e.selected&&t.push(e.id)}),t}},{key:"checkedValue",value:function(e){var t=[];return e.forEach(function(e){!0===e.checked&&t.push(e.id)}),t}},{key:"_toValue",value:function(){return"selected"===this.rule.props.type?this.selectedValue(this.el.getSelectedNodes()):this.checkedValue(this.el.getCheckedNodes())}},{key:"data",value:function(e){var t=this;e.forEach(function(e){t._data[e.id]=e,void 0!==e.children&&Array.isArray(e.children)&&t.data(e.children)})}}]),t}(),xr="on-select-change",Nr="on-check-change",Vr=function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){var e,t=this,n=this.handler,r=n.rule,i=n.refName,o=n.field,a=n.unique,u=this.vData.on(r.event).on((e={},qe(e,xr,function(e){t.vm._changeFormData(o,t.handler._toValue()),r.event[xr]&&r.event[xr](e)}),qe(e,Nr,function(e){t.vm._changeFormData(o,t.handler._toValue()),r.event[Nr]&&r.event[Nr](e)}),e)).props(r.props).ref(i).key("fip".concat(a)).get(),s=this.inputProps().props({type:"text",value:this.handler.parseValue.toString(),disable:!0}).key("fipit"+a).style({display:"none"}).ref("".concat(i,"it")).get();return[this.vNode.tree(u),this.vNode.input(s)]}}]),t}(),Sr={treeSelected:"selected",treeChecked:"checked"},Ir={hidden:In,input:An,radio:Cn,checkbox:jn,switch:Dn,select:Rn,datepicker:$n,timepicker:Tn,inputnumber:ar,colorpicker:ur,upload:pr,cascader:dr,rate:vr,slider:mr,frame:wr,tree:{handler:Or,render:Vr,name:"tree",maker:Object.keys(Sr).reduce(function(e,t){return e[t]=Vn("tree",Sr[t]),e},{})},autocomplete:{handler:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,mn),Me(t,[{key:"init",value:function(){var e=this.rule;Array.isArray(e.data)||Gt(e,"data",[])}}]),t}(),render:function(e){function t(){return Le(this,t),ze(this,Ue(t).apply(this,arguments))}return He(t,xn),Me(t,[{key:"parse",value:function(){return[this.vNode.AutoComplete(this.inputProps().key(this.handler.key).get())]}}]),t}(),name:"autoComplete",maker:{auto:Nn("autoComplete")}}},Er={_v:2,resetBtnType:"ghost",resetBtnIcon:"refresh",submitBtnIcon:"ios-upload",fileIcon:"document-text",fileUpIcon:"folder",imgUpIcon:"image"},Pr={_v:3,resetBtnType:"default",resetBtnIcon:"md-refresh",submitBtnIcon:"ios-share",fileIcon:"md-document",fileUpIcon:"ios-folder-open",imgUpIcon:"md-images"},Fr=void 0===n?Er:n.version&&3==n.version.split(".")[0]?Pr:Er;var Ar=".form-create{padding:25px;} .fc-upload-btn,.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 rgba(0,0,0,.1);margin-right: 4px;box-sizing: border-box;}.__fc_h{display:none;}.__fc_v{visibility:hidden;} .fc-files>.ivu-icon{vertical-align: middle;}.fc-files img{width:100%;height:100%;display:inline-block;vertical-align: top;}.fc-upload .ivu-upload{display: inline-block;}.fc-upload-btn{border: 1px dashed #c0ccda;}.fc-upload-btn>ivu-icon{vertical-align:sub;}.fc-upload .fc-upload-cover{opacity: 0; position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); transition: opacity .3s;}.fc-upload .fc-upload-cover i{ color: #fff; font-size: 20px; cursor: pointer; margin: 0 2px; }.fc-files:hover .fc-upload-cover{opacity: 1; }.fc-hide-btn .ivu-upload .ivu-upload{display:none;}.fc-upload .ivu-upload-list{margin-top: 0;}.fc-spin-icon-load{animation: ani-fc-spin 1s linear infinite;} @-webkit-keyframes ani-fc-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes ani-fc-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}";function Cr(e,t,n){return[e&&Qt(e)?e.call(n,t):e]}function jr(e){if(Zt(e))return e;var t=new Date(e);return"Invalid Date"===t.toString()?e:t}function Dr(e,t,n){var r=Yt(t.type).toLowerCase(),i=Rr(r)?Ir[r]:{handler:mn,render:xn,noValue:!0};return new i.handler(e,t,i.render,n,i.noValue)}function Rr(e){return void 0!==Ir[e]}function $r(e){e.preventDefault()}var Lr=function(){function e(t){Le(this,e);var n=t.id,r=t.vm,i=t.fieldList,o=t.handlers,a=t.formData,u=t.validate;this.vm=r,this.handlers=o,this.renderSort=i,this.form={model:a,rules:u,key:"form"+n},this._fc=t,this.vNode=new _n(r),this.vData=new On,this.unique=n,this.refName="cForm".concat(n),this.cacheUnique=0}return Me(e,[{key:"getRender",value:function(e){return this.handlers[e].render}},{key:"render",value:function(e){var t=this;if(this.vNode.setVm(e),e.isShow){this.cacheUnique!==e.unique&&(this.renderSort.forEach(function(e){t.getRender(e).clearCache()}),this.cacheUnique=e.unique),this.propsData=this.vData.props(this._fc.options.form).props(this.form).ref(this.refName).nativeOn({submit:$r}).class("form-create",!0).key(this.unique).get();var n=this.unique,r=this.renderSort.map(function(e){var n=t.getRender(e);if("hidden"!==n.handler.type)return t.makeComponent(n)});return r.length>0&&r.push(this.makeFormBtn(n)),this.vNode.form(this.propsData,[this.vNode.row(Xt({props:this._fc.options.row||{}},{key:"row"+n}),r)])}}},{key:"makeComponent",value:function(e){return this.makeFormItem(e.handler,e.cacheParse(this),"fItem".concat(e.handler.key).concat(this.unique))}},{key:"makeFormItem",value:function(e,t,n){var r=e.type,i=e.rule,o=e.unique,a=e.field,u=e.refName,s=Rr(r)||i.col.labelWidth||i.title?i.col.labelWidth:1,c=i.className,l=this.vData.props({prop:a,label:i.title,labelFor:o,rules:i.validate,labelWidth:s,required:i.props.required}).key(n).ref("fItem"+u).class(c).get(),h=this.vNode.formItem(l,t);return!0===this.propsData.props.inline?[h]:this.makeCol(i,n,[h])}},{key:"makeCol",value:function(e,t,n){return this.vNode.col({props:e.col,class:{__fc_h:!0===e.props.hidden,__fc_v:!0===e.props.visibility},key:"".concat(t,"col1")},n)}},{key:"makeFormBtn",value:function(e){var t=[],n=!1!==this.vm.buttonProps&&!1!==this.vm.buttonProps.show,r=!1!==this.vm.resetProps&&!1!==this.vm.resetProps.show;return n&&t.push(this.makeSubmitBtn(e,r?19:24)),r&&t.push(this.makeResetBtn(e,4)),this.vNode.col({props:{span:24},key:"".concat(this.unique,"col2")},t)}},{key:"makeResetBtn",value:function(e,t){var n=this,r=this._fc.options.resetBtn,i=Jt(this._fc.options.resetBtn.col)?{span:t,push:1}:r.col;return this.vNode.col({props:i,key:"".concat(this.unique,"col3")},[this.vNode.button({key:"frsbtn".concat(e),props:this.vm.resetProps,on:{click:function(){var e=n._fc.fCreateApi;Qt(r.click)?r.click(e):e.resetFields()}}},[this.vm.resetProps.innerText])])}},{key:"makeSubmitBtn",value:function(e,t){var n=this,r=this._fc.options.submitBtn,i=Jt(this._fc.options.submitBtn.col)?{span:t}:r.col;return this.vNode.col({props:i,key:"".concat(this.unique,"col4")},[this.vNode.button({key:"fbtn".concat(e),props:this.vm.buttonProps,on:{click:function(){var e=n._fc.fCreateApi;Qt(r.click)?r.click(e):e.submit()}}},[this.vm.buttonProps.innerText])])}}]),e}();function Tr(){return{data:function(){return{rules:{},components:{},cptData:{},buttonProps:{},resetProps:{},trueData:{},jsonData:{},$f:{},isShow:!0,watchs:[],unique:1}},methods:{_formField:function(){return Object.keys(this.trueData)},_changeFormData:function(e,t){-1!==Object.keys(this.cptData).indexOf(e)&&this.$set(this.cptData,e,t)},_changeValue:function(e,t){this.$set(this.trueData[e],"value",t)},_value:function(e){return void 0===this.trueData[e]?void 0:this.trueData[e].value},_trueData:function(e){return this.trueData[e]},_formData:function(e){return this.cptData[e]},_removeField:function(e){zt(this.cptData,e),zt(this.trueData,e),zt(this.jsonData,e),void 0!==this.components[e]&&zt(this.components,e)},_buttonProps:function(e){this.$set(this,"buttonProps",an(this.buttonProps,e))},_resetProps:function(e){this.$set(this,"resetProps",an(this.resetProps,e))},__init:function(){var e=this,t=this._fComponent._type;this[t].forEach(function(n,r){var i=e.$watch("".concat(t,".").concat(r,".value"),function(t){if(void 0===e.trueData[n.field])return i();e._changeValue(n.field,t)});e.watchs.push(i)})},_unWatch:function(){this.watchs.forEach(function(e){return e()}),this.watchs=[]},_refresh:function(){this.unique+=1},_sync:function(){this.unique+=1,this._fComponent.fRender.cacheUnique=this.unique},_change:function(e,t){return this.jsonData[e]!==t&&(this.jsonData[e]=t,!0)}}}}var Mr="FormCreate",qr=function(){return{name:Mr,mixins:[Tr()],props:{rule:{type:Array,required:!0,default:function(){return{}}},option:{type:Object,default:function(){return{}},required:!1},value:Object},render:function(){return this._fComponent.fRender.render(this._fComponent.vm)},created:function(){var e=new Gr(this.rule,this.option);this._fComponent=e,e._type="rule",e.boot(this),this.$emit("input",e.fCreateApi)},mounted:function(){var e=this,t=this._fComponent;t.mounted(this),this.$f=t.fCreateApi,this.$watch("rule",function(n){t.reload(n,e.unique),e.$emit("input",e.$f)}),this.$watch("option",function(t){Ut(function(){e._sync()})},{deep:!0}),this.$emit("input",this.$f),this.__init()}}};var Br=function(){var e={};Object.keys(Ir).forEach(function(t){var n=Ir[t],r=Jt(n.maker);(r||void 0===n.maker[n.name])&&(e[n.name]=Nn(n.name)),r||Xt(e,n.maker)});var t=Nn("");return Xt(e,{create:function(e,n){var r=t("",n);return r.rule.type=e,r},createTmp:function(e,n,r){var i=t("",r);return i.rule.type="template",i.rule.template=e,i.rule.vm=n,i}}),e.template=e.createTmp,e}();var Hr="form-create-style";function Ur(e){tn(e.sumbitBtn)&&Gt(e,"sumbitBtn",{show:e.sumbitBtn}),tn(e.resetBtn)&&Gt(e,"resetBtn",{show:e.resetBtn});var t=an({el:null,iframeHelper:!1,switchMaker:!0,form:{inline:!1,labelPosition:"right",labelWidth:125,showMessage:!0,autocomplete:"off",size:void 0},row:{gutter:0,type:void 0,align:void 0,justify:void 0,className:void 0},upload:{beforeUpload:function(){},onProgress:function(e,t,n){},onSuccess:function(e,t,n){},onError:function(e,t,n){},onPreview:function(e){},onRemove:function(e,t){},onFormatError:function(e,t){},onExceededSize:function(e,t){},handleIcon:"ios-eye-outline",allowRemove:!0},submitBtn:{type:"primary",size:"large",shape:void 0,long:!0,htmlType:"button",disabled:!1,icon:Fr.submitBtnIcon,innerText:"提交",loading:!1,show:!0,col:void 0,click:void 0},resetBtn:{type:Fr.resetBtnType,size:"large",shape:void 0,long:!0,htmlType:"button",disabled:!1,icon:Fr.resetBtnIcon,innerText:"重置",loading:!1,show:!1,col:void 0,click:void 0},mounted:function(e){},onReload:function(e){},onSubmit:function(e,t){}},e);return Gt(t,"el",t.el?on(t.el)?t.el:document.querySelector(t.el):window.document.body),t}var Gr=function(){function e(t){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Le(this,e),this.fRender=void 0,this.fCreateApi=void 0,this.id=sn(),this.reloading=!1,this.__init(t,o),function(){if(null===document.getElementById(Hr)){var e=document.createElement("style");e.id=Hr,e.innerText=Ar,document.getElementsByTagName("head")[0].appendChild(e)}}(),this.$tick=(n=function(e){return e()},r=150,i=null,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];null!==i&&clearTimeout(i),i=setTimeout(function(){return n.apply(void 0,t)},r)})}return Me(e,[{key:"__init",value:function(e,t){this.options=Ur(t),this.rules=Array.isArray(e)?e:[],this.origin=Je(this.rules),this.handlers={},this.formData={},this.validate={},this.trueData={},this.components={},this.fieldList=[],this.switchMaker=this.options.switchMaker}},{key:"boot",value:function(e){this.vm=e,this.createHandler(this.rules),e.$set(e,"cptData",this.formData),e.$set(e,"trueData",this.trueData),e.$set(e,"buttonProps",this.options.submitBtn),e.$set(e,"resetProps",this.options.resetBtn),e.$set(e,"rules",this.rules),e.$set(e,"components",this.components),this.fRender=new Lr(this),void 0===this.fCreateApi&&(this.fCreateApi=function(e){var t=this,n=e.vm;function r(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?Array.isArray(t)||(t=[t]):t=r?Object.keys(e.handlers):n._formField(),t}return{formData:function(){return n._formField().reduce(function(e,t){return e[t]=n._value(t),e},{})},getValue:function(e){if(e=Yt(e),void 0===n._formField(e))throw new Error("".concat(e," 字段不存在!")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");return n._value(e)},setValue:function(e,t){var n=this,r=e;Kt(e)||(r=qe({},e,t)),Object.keys(r).forEach(function(e){n.changeField(e,r[e])})},changeValue:function(e,t){this.changeField(e,t)},changeField:function(r,i){r=Yt(r);var o=e.handlers[r];void 0!==o&&(Qt(i)?i(n._trueData(r),function(e){t.changeField(r,e)}):o.setValue(i))},removeField:function(t){var r=e.handlers[t];if(r){var i=r.root.map(function(e){return e.__field__}).indexOf(Yt(t));-1!==i&&(r.root.splice(i,1),n._refresh())}},validate:function(t,n){e.getFormRef().validate(function(e){!0===e?t&&t():n&&n()})},validateField:function(t,n){e.notField(t)||e.getFormRef().validateField(t,n)},resetFields:function(t){var n=this,i=e.handlers;r(t,!0).forEach(function(e){var t=i[e];t&&(t.noValue?t.$emit("reset-field",n):t.reset())}),this.refresh()},destroy:function(){n.$el.parentNode.removeChild(n.$el),n.$destroy()},fields:function(){return n._formField()},append:function(t,n){var r=e.fieldList,i=r.indexOf(Yt(n));if(Jt(n))i=r.length;else if(-1===i)return;e.rules.splice(i+1,0,t)},prepend:function(t,n){var r=e.fieldList.indexOf(Yt(n));if(Jt(n))r=0;else{if(-1===r)return;r--}e.rules.splice(r+1,0,t)},submit:function(t,n){var r=this;this.validate(function(){var n=r.formData();Qt(t)?t(n,r):e.options.onSubmit&&e.options.onSubmit(n)},function(){return n&&n()})},hidden:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(t).forEach(function(t){e.handlers[t]&&n.$set(n._trueData(t).rule.props,"hidden",!!i)})},visibility:function(t){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];r(t).forEach(function(t){e.handlers[t]&&n.$set(n._trueData(t).rule.props,"visibility",!!i)})},disabled:function(t){var i=this,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o=!!o,r(t,!0).forEach(function(t){var r=e.handlers[t];r&&(r.noValue?r.$emit("disabled",o,i):n.$set(n._trueData(t).rule.props,"disabled",o),r.render.sync())})},clearValidateState:function(t){r(t).forEach(function(t){var n=e.handlers[t];n&&n.clearMsg()})},model:function(e){var t={},i=this.fields();return r(e).forEach(function(e){if(-1===i.indexOf(e))return console.error("".concat(e," 字段不存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");t[e]=n._trueData(e)}),t},component:function(){return Be({},n.components)},bind:function(e){var t={},i={},o=this.fields();return r(e).forEach(function(e){if(-1===o.indexOf(e))return console.error("".concat(e," 字段不存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");var t=n._trueData(e);i[e]={get:function(){return t.value},set:function(e){n.$set(t,"value",e)},enumerable:!0,configurable:!0}}),Object.defineProperties(t,i),t},submitStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n._buttonProps(e)},resetStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n._resetProps(e)},btn:{loading:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n._buttonProps({loading:e})},finish:function(){this.loading(!1)},disabled:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n._buttonProps({disabled:e})}},resetBtn:{loading:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n._resetProps({loading:e})},finish:function(){this.loading(!1)},disabled:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];n._resetProps({disabled:e})}},closeModal:function(){n.$Modal.remove()},set:function(e,t,r){n.$set(e,t,r)},reload:function(t){return e.reload(t)},options:function(t){an(e.options,t),n._sync()},onSuccess:function(e){this.onSubmit(e)},onSubmit:function(e){this.options({onSubmit:e})},sync:function(t,n){e.handlers[t]&&e.handlers[t].render.sync(n)},refresh:function(){n._refresh()},show:function(e){n.isShow=!!e}}}(this)),this.fCreateApi.rule=this.rules,this.fCreateApi.config=this.options}},{key:"setHandler",value:function(e){var t=e.rule,n=e.field,r=e.isDef;this.handlers[n]=e,!0!==e.noValue?(Gt(this.formData,n,e.parseValue),Gt(this.validate,n,t.validate),Gt(this.trueData,n,{value:e.rule.value,rule:t})):!0===r&&Gt(this.components,n,t)}},{key:"notField",value:function(e){return void 0===this.handlers[e]}},{key:"createHandler",value:function(e,t){var n=this;e.forEach(function(r,i){if(!t||!en(r)){if(!r.type)return console.error("未定义生成规则的 type 字段\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");var o=function(e){return Qt(e.getRule)?e.getRule():e}(r),a=r.__handler__?r.__handler__.refresh():Dr(n.vm,o,n.options),u=a.rule.children;if(!n.notField(a.field))return console.error("".concat(o.field," 字段已存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");n.switchMaker&&(e[i]=o,t||(n.origin[i]=o),r=o),n.setHandler(a),r.__handler__||function(e,t){Object.defineProperties(e,{__field__:{value:t.field,enumerable:!1,configurable:!1},__handler__:{value:t,enumerable:!1,configurable:!1}})}(r,a),Array.isArray(u)&&u.length>0&&n.createHandler(u,!0),t||n.fieldList.push(a.field)}}),e.forEach(function(t){t.__handler__.root=e,t.__handler__.origin=Je(e)})}},{key:"create",value:function(e){var t,n=(new(e.extend((t=this,{name:"".concat(Mr,"Core"),mixins:[Tr()],render:function(){return t.fRender.render(t.vm)},created:function(){this._fComponent=t,this._fComponent._type="rules",t.boot(this)},mounted:function(){var e=this;t.mounted(this),this.$f=t.fCreateApi,this.__init(),this.$watch("rules",function(t){e._fComponent.reload(t,e.unique)})}})))).$mount();return this.options.el.appendChild(n.$el),n}},{key:"mounted",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.vm=e;var r=this.options,i=r.mounted,o=r.onReload;setTimeout(function(){Ut(function(){Object.keys(t.handlers).forEach(function(n){var r=t.handlers[n];void 0!==e._formData(n)&&t.addHandlerWatch(r),r.mounted()}),n&&i&&i(t.fCreateApi),o&&o(t.fCreateApi)})})}},{key:"removeField",value:function(e){if(void 0!==this.handlers[e]){var t=this.handlers[e].watch,n=this.fieldList.indexOf(e);zt(this.handlers,e),zt(this.validate,e),-1!==n&&this.fieldList.splice(n,1),t&&t.forEach(function(e){return e()}),this.vm._removeField(e)}}},{key:"addHandlerWatch",value:function(e){var t=this;if(!0!==e.noValue){var n=e.field,r=this.vm,i=r.$watch("cptData.".concat(n),function(o){if(void 0!==t.handlers[n]){var a=e.toValue(o),u=JSON.stringify(a);r._change(n,u)&&(e.setValue(a),e.watchFormValue(o))}else i()},{deep:!0}),o=r.$watch("trueData.".concat(n,".value"),function(i){if(void 0!==i)if(void 0!==t.handlers[n]){var a=JSON.stringify(i);r._change(n,a)&&(e.watchValue(i),Ut(function(){return e.render.sync()}))}else o()},{deep:!0});e.watch.push(i,o);var a=function(){void 0!==t.handlers[n]&&t.$tick(function(){return e.render.sync()})};Object.keys(r._trueData(n).rule).forEach(function(t){"value"!==t&&e.watch.push(r.$watch("trueData.".concat(n,".rule.").concat(t),a,{deep:!0}))})}}},{key:"isNotChange",value:function(e){var t=this;return e.reduce(function(e,n,r){return e&&n===t.origin[r]},!0)&&this.origin.reduce(function(t,n,r){return t&&n===e[r]},!0)}},{key:"reload",value:function(e,t){var n=this,r=this.vm;if(e){if(this.isNotChange(e))return void this.fCreateApi.refresh();this.origin.length||this.fCreateApi.refresh(),this.origin=Je(e),r._unWatch(),Object.keys(this.handlers).forEach(function(e){return n.removeField(e)}),this.__init(e,this.options),this.boot(r),r.__init(),Ut(function(){(Jt(t)||r.unique===t)&&n.mounted(r,!1)}),r.$f=this.fCreateApi}else this.reload(this.rules,t)}},{key:"getFormRef",value:function(){return this.vm.$refs[this.fRender.refName]}}],[{key:"create",value:function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,o=new e(n,on(r)?{el:r}:r);o.create(i);return o.fCreateApi}},{key:"install",value:function(t){t.prototype.$formCreate=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.create(n,r,t)},t.prototype.$formCreate.version="1.5.5",t.prototype.$formCreate.maker=Br,t.component(Mr,t.extend(qr()))}}]),e}();function zr(e){!0!==e._installedFormCreate&&(e._installedFormCreate=!0,e.use(Gr))}Gr.maker=Br,Gr.version="1.5.5","undefined"!=typeof window&&(window.formCreate=Gr,window.Vue&&zr(Vue)),e.install=zr,e.default=Gr,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=form-create.min.js.map