UNPKG

77.4 kBJavaScriptView Raw
1/*!
2 * form-create v1.6.5 elementUI
3 * (c) 2018-2019 xaboy
4 * Github https://github.com/xaboy/form-create
5 * Released under the MIT License.
6 */
7!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t(e.formCreate={},e.Vue)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n={}.toString,r=function(e){return n.call(e).slice(8,-1)},i=Array.isArray||function(e){return"Array"==r(e)},o=function(e){return"object"==typeof e?null!==e:"function"==typeof e},a=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},u=function(e){return Object(a(e))},s=Math.ceil,c=Math.floor,l=function(e){return isNaN(e=+e)?0:(e>0?c:s)(e)},f=Math.min,h=function(e){return e>0?f(l(e),9007199254740991):0},p=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},d=function(e){try{return!!e()}catch(e){return!0}},v=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),m="object"==typeof window&&window&&window.Math==Math?window:"object"==typeof self&&self&&self.Math==Math?self:Function("return this")(),y=m.document,g=o(y)&&o(y.createElement),k=function(e){return g?y.createElement(e):{}},b=!v&&!d(function(){return 7!=Object.defineProperty(k("div"),"a",{get:function(){return 7}}).a}),w=function(e){if(!o(e))throw TypeError(String(e)+" is not an object");return e},_=Object.defineProperty,x={f:v?_:function(e,t,n){if(w(e),t=p(t,!0),w(n),b)try{return _(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}},O=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},V=function(e,t,n){var r=p(t);r in e?x.f(e,r,O(0,n)):e[r]=n};function S(e,t){return e(t={exports:{}},t.exports),t.exports}var N,E,A,P=v?function(e,t,n){return x.f(e,t,O(1,n))}:function(e,t,n){return e[t]=n,e},C=function(e,t){try{P(m,e,t)}catch(n){m[e]=t}return t},F=S(function(e){var t=m["__core-js_shared__"]||C("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.0.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),I=0,$=Math.random(),j=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++I+$).toString(36))},D=!d(function(){return!String(Symbol())}),R=F("wks"),T=m.Symbol,L=function(e){return R[e]||(R[e]=D&&T[e]||(D?T:j)("Symbol."+e))},M=L("species"),B=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[M])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},q=L("species"),H=function(e){return!d(function(){var t=[];return(t.constructor={})[q]=function(){return{foo:1}},1!==t[e](Boolean).foo})},G={}.propertyIsEnumerable,z=Object.getOwnPropertyDescriptor,U={f:z&&!G.call({1:2},1)?function(e){var t=z(this,e);return!!t&&t.enumerable}:G},W="".split,K=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==r(e)?W.call(e,""):Object(e)}:Object,J=function(e){return K(a(e))},Y={}.hasOwnProperty,X=function(e,t){return Y.call(e,t)},Z=Object.getOwnPropertyDescriptor,Q={f:v?Z:function(e,t){if(e=J(e),t=p(t,!0),b)try{return Z(e,t)}catch(e){}if(X(e,t))return O(!U.f.call(e,t),e[t])}},ee=F("native-function-to-string",Function.toString),te=m.WeakMap,ne="function"==typeof te&&/native code/.test(ee.call(te)),re=F("keys"),ie=function(e){return re[e]||(re[e]=j(e))},oe={},ae=m.WeakMap;if(ne){var ue=new ae,se=ue.get,ce=ue.has,le=ue.set;N=function(e,t){return le.call(ue,e,t),t},E=function(e){return se.call(ue,e)||{}},A=function(e){return ce.call(ue,e)}}else{var fe=ie("state");oe[fe]=!0,N=function(e,t){return P(e,fe,t),t},E=function(e){return X(e,fe)?e[fe]:{}},A=function(e){return X(e,fe)}}var he,pe={set:N,get:E,has:A,enforce:function(e){return A(e)?E(e):N(e,{})},getterFor:function(e){return function(t){var n;if(!o(t)||(n=E(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},de=S(function(e){var t=pe.get,n=pe.enforce,r=String(ee).split("toString");F("inspectSource",function(e){return ee.call(e)}),(e.exports=function(e,t,i,o){var a=!!o&&!!o.unsafe,u=!!o&&!!o.enumerable,s=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof t||X(i,"name")||P(i,"name",t),n(i).source=r.join("string"==typeof t?t:"")),e!==m?(a?!s&&e[t]&&(u=!0):delete e[t],u?e[t]=i:P(e,t,i)):u?e[t]=i:C(t,i)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||ee.call(this)})}),ve=Math.max,me=Math.min,ye=function(e,t){var n=l(e);return n<0?ve(n+t,0):me(n,t)},ge=(he=!1,function(e,t,n){var r,i=J(e),o=h(i.length),a=ye(n,o);if(he&&t!=t){for(;o>a;)if((r=i[a++])!=r)return!0}else for(;o>a;a++)if((he||a in i)&&i[a]===t)return he||a||0;return!he&&-1}),ke=function(e,t){var n,r=J(e),i=0,o=[];for(n in r)!X(oe,n)&&X(r,n)&&o.push(n);for(;t.length>i;)X(r,n=t[i++])&&(~ge(o,n)||o.push(n));return o},be=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],we=be.concat("length","prototype"),_e={f:Object.getOwnPropertyNames||function(e){return ke(e,we)}},xe={f:Object.getOwnPropertySymbols},Oe=m.Reflect,Ve=Oe&&Oe.ownKeys||function(e){var t=_e.f(w(e)),n=xe.f;return n?t.concat(n(e)):t},Se=function(e,t){for(var n=Ve(t),r=x.f,i=Q.f,o=0;o<n.length;o++){var a=n[o];X(e,a)||r(e,a,i(t,a))}},Ne=/#|\.prototype\./,Ee=function(e,t){var n=Pe[Ae(e)];return n==Fe||n!=Ce&&("function"==typeof t?d(t):!!t)},Ae=Ee.normalize=function(e){return String(e).replace(Ne,".").toLowerCase()},Pe=Ee.data={},Ce=Ee.NATIVE="N",Fe=Ee.POLYFILL="P",Ie=Ee,$e=Q.f,je=function(e,t){var n,r,i,o,a,u=e.target,s=e.global,c=e.stat;if(n=s?m:c?m[u]||C(u,{}):(m[u]||{}).prototype)for(r in t){if(o=t[r],i=e.noTargetGet?(a=$e(n,r))&&a.value:n[r],!Ie(s?r:u+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Se(o,i)}(e.sham||i&&i.sham)&&P(o,"sham",!0),de(n,r,o,e)}},De=L("isConcatSpreadable"),Re=!d(function(){var e=[];return e[De]=!1,e.concat()[0]!==e}),Te=H("concat"),Le=function(e){if(!o(e))return!1;var t=e[De];return void 0!==t?!!t:i(e)};je({target:"Array",proto:!0,forced:!Re||!Te},{concat:function(e){var t,n,r,i,o,a=u(this),s=B(a,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(o=-1===t?a:arguments[t],Le(o)){if(c+(i=h(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<i;n++,c++)n in o&&V(s,c,o[n])}else{if(c>=9007199254740991)throw TypeError("Maximum allowed index exceeded");V(s,c++,o)}return s.length=c,s}});var Me=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Be=function(e,t){var n=1==e,r=2==e,i=3==e,o=4==e,a=6==e,s=5==e||a,c=t||B;return function(t,l,f){for(var p,d,v=u(t),m=K(v),y=function(e,t,n){if(Me(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};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)}}(l,f,3),g=h(m.length),k=0,b=n?c(t,g):r?c(t,0):void 0;g>k;k++)if((s||k in m)&&(d=y(p=m[k],k,v),e))if(n)b[k]=d;else if(d)switch(e){case 3:return!0;case 5:return p;case 6:return k;case 2:b.push(p)}else if(o)return!1;return a?-1:i||o?o:b}},qe=Be(2);je({target:"Array",proto:!0,forced:!H("filter")},{filter:function(e){return qe(this,e,arguments[1])}});var He=Be(1);je({target:"Array",proto:!0,forced:!H("map")},{map:function(e){return He(this,e,arguments[1])}});var Ge=Math.max,ze=Math.min;je({target:"Array",proto:!0,forced:!H("splice")},{splice:function(e,t){var n,r,i,o,a,s,c=u(this),f=h(c.length),p=ye(e,f),d=arguments.length;if(0===d?n=r=0:1===d?(n=0,r=f-p):(n=d-2,r=ze(Ge(l(t),0),f-p)),f+n-r>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(i=B(c,r),o=0;o<r;o++)(a=p+o)in c&&V(i,o,c[a]);if(i.length=r,n<r){for(o=p;o<f-r;o++)s=o+n,(a=o+r)in c?c[s]=c[a]:delete c[s];for(o=f;o>f-r+n;o--)delete c[o-1]}else if(n>r)for(o=f-r;o>p;o--)s=o+n-1,(a=o+r-1)in c?c[s]=c[a]:delete c[s];for(o=0;o<n;o++)c[o+p]=arguments[o+2];return c.length=f-r+n,i}});var Ue=Object.keys||function(e){return ke(e,be)};je({target:"Object",stat:!0,forced:d(function(){Ue(1)})},{keys:function(e){return Ue(u(e))}});var We,Ke,Je=[].forEach,Ye=Be(0),Xe=!(Ke=[]["forEach"])||!d(function(){Ke.call(null,We||function(){throw 1},1)})?function(e){return Ye(this,e,arguments[1])}:Je;for(var Ze in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var Qe=m[Ze],et=Qe&&Qe.prototype;if(et&&et.forEach!==Xe)try{P(et,"forEach",Xe)}catch(e){et.forEach=Xe}}function tt(e){return(tt="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 nt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rt(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 it(e,t,n){return t&&rt(e.prototype,t),n&&rt(e,n),e}function ot(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(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){ot(e,t,n[t])})}return e}function ut(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&&ct(e,t)}function st(e){return(st=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ct(e,t){return(ct=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lt(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 ft(e,t,n){return(ft="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=st(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 ht(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 pt=L("toStringTag"),dt="Arguments"==r(function(){return arguments}()),vt={};vt[L("toStringTag")]="z";var mt="[object z]"!==String(vt)?function(){return"[object "+(void 0===(e=this)?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),pt))?n:dt?r(t):"Object"==(i=r(t))&&"function"==typeof t.callee?"Arguments":i)+"]";var e,t,n,i}:vt.toString,yt=Object.prototype;mt!==yt.toString&&de(yt,"toString",mt,{unsafe:!0});var gt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return function(e,t){if(w(e),!o(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n,r),t?e.call(n,r):n.__proto__=r,n}}():void 0),kt=function(e,t,n){var r,i=t.constructor;return i!==n&&"function"==typeof i&&(r=i.prototype)!==n.prototype&&o(r)&&gt&&gt(e,r),e},bt=L("match"),wt=function(e){var t;return o(e)&&(void 0!==(t=e[bt])?!!t:"RegExp"==r(e))},_t=function(){var e=w(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},xt=m,Ot=function(e){return"function"==typeof e?e:void 0},Vt=L("species"),St=L("match"),Nt=x.f,Et=_e.f,At=m.RegExp,Pt=At.prototype,Ct=/a/g,Ft=/a/g,It=new At(Ct)!==Ct;if(Ie("RegExp",v&&(!It||d(function(){return Ft[St]=!1,At(Ct)!=Ct||At(Ft)==Ft||"/a/i"!=At(Ct,"i")})))){for(var $t=function(e,t){var n=this instanceof $t,r=wt(e),i=void 0===t;return!n&&r&&e.constructor===$t&&i?e:kt(It?new At(r&&!i?e.source:e,t):At((r=e instanceof $t)?e.source:e,r&&i?_t.call(e):t),n?this:Pt,$t)},jt=function(e){e in $t||Nt($t,e,{configurable:!0,get:function(){return At[e]},set:function(t){At[e]=t}})},Dt=Et(At),Rt=0;Rt<Dt.length;)jt(Dt[Rt++]);Pt.constructor=$t,$t.prototype=Pt,de(m,"RegExp",$t)}!function(e){var t=function(e,t){return arguments.length<2?Ot(xt[e])||Ot(m[e]):xt[e]&&xt[e][t]||m[e]&&m[e][t]}(e),n=x.f;v&&t&&!t[Vt]&&n(t,Vt,{configurable:!0,get:function(){return this}})}("RegExp");var Tt=/./.toString,Lt=d(function(){return"/a/b"!=Tt.call({source:"a",flags:"b"})}),Mt="toString"!=Tt.name;(Lt||Mt)&&de(RegExp.prototype,"toString",function(){var e=w(this);return"/".concat(e.source,"/","flags"in e?e.flags:!v&&e instanceof RegExp?_t.call(e):void 0)},{unsafe:!0});var Bt=function(e,t,n){return t+(n?function(e,t,n){var r,i,o=String(a(e)),u=l(t),s=o.length;return u<0||u>=s?n?"":void 0:(r=o.charCodeAt(u))<55296||r>56319||u+1===s||(i=o.charCodeAt(u+1))<56320||i>57343?n?o.charAt(u):r:n?o.slice(u,u+2):i-56320+(r-55296<<10)+65536}(e,t,!0).length:1)},qt=RegExp.prototype.exec,Ht=String.prototype.replace,Gt=qt,zt=function(){var e=/a/,t=/b*/g;return qt.call(e,"a"),qt.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Ut=void 0!==/()??/.exec("")[1];(zt||Ut)&&(Gt=function(e){var t,n,r,i,o=this;return Ut&&(n=new RegExp("^"+o.source+"$(?!\\s)",_t.call(o))),zt&&(t=o.lastIndex),r=qt.call(o,e),zt&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),Ut&&r&&r.length>1&&Ht.call(r[0],n,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)}),r});var Wt=Gt,Kt=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return Wt.call(e,t)},Jt=L("species"),Yt=!d(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}),Xt=!d(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]}),Zt=function(e,t,n,r){var i=L(e),o=!d(function(){var t={};return t[i]=function(){return 7},7!=""[e](t)}),a=o&&!d(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[Jt]=function(){return n}),n[i](""),!t});if(!o||!a||"replace"===e&&!Yt||"split"===e&&!Xt){var u=/./[i],s=n(i,""[e],function(e,t,n,r,i){return t.exec===Wt?o&&!i?{done:!0,value:u.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),c=s[0],l=s[1];de(String.prototype,e,c),de(RegExp.prototype,i,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)}),r&&P(RegExp.prototype[i],"sham",!0)}},Qt=Math.max,en=Math.min,tn=Math.floor,nn=/\$([$&`']|\d\d?|<[^>]*>)/g,rn=/\$([$&`']|\d\d?)/g;Zt("replace",2,function(e,t,n){return[function(n,r){var i=a(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,i){var o=n(t,e,this,i);if(o.done)return o.value;var a=w(e),u=String(this),s="function"==typeof i;s||(i=String(i));var c=a.global;if(c){var f=a.unicode;a.lastIndex=0}for(var p=[];;){var d=Kt(a,u);if(null===d)break;if(p.push(d),!c)break;""===String(d[0])&&(a.lastIndex=Bt(u,h(a.lastIndex),f))}for(var v,m="",y=0,g=0;g<p.length;g++){d=p[g];for(var k=String(d[0]),b=Qt(en(l(d.index),u.length),0),_=[],x=1;x<d.length;x++)_.push(void 0===(v=d[x])?v:String(v));var O=d.groups;if(s){var V=[k].concat(_,b,u);void 0!==O&&V.push(O);var S=String(i.apply(void 0,V))}else S=r(k,u,b,_,O,i);b>=y&&(m+=u.slice(y,b)+S,y=b+k.length)}return m+u.slice(y)}];function r(e,n,r,i,o,a){var s=r+e.length,c=i.length,l=rn;return void 0!==o&&(o=u(o),l=nn),t.call(a,l,function(t,a){var u;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(s);case"<":u=o[a.slice(1,-1)];break;default:var l=+a;if(0===l)return t;if(l>c){var f=tn(l/10);return 0===f?t:f<=c?void 0===i[f-1]?a.charAt(1):i[f-1]+a.charAt(1):t}u=i[l-1]}return void 0===u?"":u})}});var on=m.navigator,an=on&&on.userAgent||"",un=[].slice,sn=function(e){return function(t,n){var r=arguments.length>2,i=!!r&&un.call(arguments,2);return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};function cn(e){t.nextTick(e)}function ln(e,n,r){t.set(e,n,r)}function fn(e,n){t.delete(e,n)}function hn(e){return Array.isArray(e)&&e.length>0}je({global:!0,bind:!0,forced:/MSIE .\./.test(an)},{setTimeout:sn(m.setTimeout),setInterval:sn(m.setInterval)});var pn=Object.prototype.toString;function dn(e){return null==e}function vn(e){return null==e?"":"object"===tt(e)?JSON.stringify(e,null,2):String(e)}function mn(e,t){for(var n in t)ln(e,n,t[n]);return e}function yn(e,t){var n=null;return function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];null!==n&&clearTimeout(n),n=setTimeout(function(){return e.apply(void 0,i)},t)}}function gn(e){return"[object Date]"===pn.call(e)}function kn(e){return"[object Object]"===pn.call(e)}function bn(e){return"[object Function]"===pn.call(e)}function wn(e){return"[object String]"===pn.call(e)}function _n(e){return"[object Boolean]"===pn.call(e)}function xn(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return 0===t.indexOf("-")&&(t=t.substr(1)),t}function On(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function Vn(e){return"object"===tt(e)&&null!==e&&1===e.nodeType&&!kn(e)}function Sn(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))||kn(i)){var o=void 0===e[r];n?(n=!1,o&&ln(e,r,[])):o&&ln(e,r,{}),Sn(e[r],i)}else ln(e,r,i)}return e}var Nn=0;function En(){return++Nn}function An(e){if(gn(e))return e;var t=new Date(e);return"Invalid Date"===t.toString()?e:t}function Pn(e){e.preventDefault()}function Cn(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}var Fn={data:function(){return{rules:{},components:{},cptData:{},buttonProps:{},resetProps:{},trueData:{},jsonData:{},$f:{},isShow:!0,unique:1}},components:tr,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){fn(this.cptData,e),fn(this.trueData,e),fn(this.jsonData,e),void 0!==this.components[e]&&fn(this.components,e)},_buttonProps:function(e){this.$set(this,"buttonProps",Sn(this.buttonProps,e))},_resetProps:function(e){this.$set(this,"resetProps",Sn(this.resetProps,e))},__init:function(){},_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)}},beforeDestroy:function(){this._fComponent.reload([])}},In="FormCreate",$n=function(){return{name:In,mixins:[Fn],props:{rule:{type:Array,required:!0,default:function(){return{}}},option:{type:Object,default:function(){return{}},required:!1},value:Object},render:function(){return this._fComponent.render()},beforeCreate:function(){var e=this.$options.propsData,t=e.rule,n=e.option,r=new rr(t,n);this._fComponent=r,r._type="rule",r.beforeBoot(this)},created:function(){var e=this._fComponent;e.boot(),this.$f=e.fCreateApi,this.$emit("input",e.fCreateApi)},mounted:function(){var e=this,t=this._fComponent;t.mounted(this),this.$watch("rule",function(n){t.reload(n),e.$emit("input",e.$f)}),this.$watch("option",function(t){cn(function(){e._sync()})},{deep:!0}),this.__init(),this.$emit("input",this.$f)}}};function jn(e){return{name:"".concat(In,"Core"),mixins:[Fn],render:function(){return e.render()},beforeCreate:function(){this._fComponent=e,e._type="rules",e.beforeBoot(this)},created:function(){e.boot(),this.$f=e.fCreateApi},mounted:function(){var t=this;e.mounted(this),this.$watch("rules",function(e){t._fComponent.reload(e)}),this.$watch("option",function(e){cn(function(){t._sync()})},{deep:!0}),this.__init()}}}var Dn=function(){function e(t,n,r,i,o){nt(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){dn(e[t])&&ln(e,t,r[t])});var i={col:Mn(e.col),props:Ln(e.props),emitEvent:Tn(e.field,e.emitPrefix,e.emit,t),validate:Rn(e.validate),options:Rn(e.options)};i.event=mn(e.event,i.emitEvent),i.on=(o=e.on,a=i.emitEvent,Object.keys(a).length>0&&mn(o,a),o),Object.keys(i).forEach(function(t){ln(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;return e}(n,t,o);this.rule=a,this.noValue=o,this.type=vn(a.type).toLowerCase(),this.isDef=!0,this.vm=t,this.el={},this.watch=[],this.root=[],this.orgChildren=[],!a.field&&o?(this.field="_def_"+En(),this.isDef=!1):this.field=a.field,this.init();var u=En();this.id=u,this.unique="fc_"+u,this.key="key_"+u,this.refName="__"+this.field+this.id,dn(a.props.elementId)&&ln(a.props,"elementId",this.unique),this.refresh(),this.render=new r(t,this,i)}return it(e,[{key:"refresh",value:function(){var e=this.rule;return this.parseValue=this.toFormValue(e.value),this.orgChildren=hn(e.children)?ht(e.children):[],this.deleted=!1,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){ln(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;this.el=t.$refs[this.refName]||{},void 0===this.defaultValue&&(this.defaultValue=this.toValue(t.$refs[e]&&!dn(t.$refs[e].initialValue)?t.$refs[e].initialValue:Sn({},{value:this.rule.value}).value))}},{key:"$emit",value:function(e){var t,n;e="fc:".concat(e);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];"template"===this.type&&this.rule.template?(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 Rn(e){return Array.isArray(e)?e:[]}function Tn(e,t,n,r){var i={};return Array.isArray(n)?(n.forEach(function(n){var o=xn("".concat(e,"-").concat(n)).replace("_","-"),a=t?"".concat(t,"-").toLowerCase()+xn(n):t;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 Ln(e){return dn(e.hidden)&&ln(e,"hidden",!1),dn(e.visibility)&&ln(e,"visibility",!1),e}function Mn(e){return On(e)?{span:e}:(void 0===e.span&&ln(e,"span",24),e)}var Bn=function(){function e(t){nt(this,e),this.setVm(t)}return it(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 wn(e)?e={domProps:{innerHTML:e}}:e&&bn(e.get)&&(e=e.get()),e}(t),bn(r=n)?r():r||[]);return i.context=this.vm,i}}],[{key:"use",value:function(t){Object.keys(t).forEach(function(n){e.prototype[n]=function(e,r){return this.make(t[n],e,r)}})}}]),e}();var qn=function(){function e(){nt(this,e),this.init()}return it(e,[{key:"class",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return dn(e)?this:(Array.isArray(e)?e.forEach(function(e){ln(t._data.class,vn(e),!0)}):kn(e)?ln(this._data,"class",mn(this._data.class,e)):ln(this._data.class,vn(e),void 0===n||n),this)}},{key:"directives",value:function(e){return dn(e)?this:(ln(this._data,"directives",this._data.directives.concat((t=e,Array.isArray(t)?t:[t]))),this);var t}},{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){qn.prototype[e]=function(t){return ln(this._data,e,t),this}}),["scopedSlots","nativeOn","on","domProps","props","attrs","style"].forEach(function(e){qn.prototype[e]=function(t,n){return dn(t)?this:(kn(t)?ln(this._data,e,mn(this._data[e],t)):ln(this._data[e],vn(t),n),this)}});var Hn=/[A-Z]/;function Gn(e,t){return!Hn.test(e)&&(wn(t)||(n=t,"[object Number]"===pn.call(n)));var n}var zn=yn(function(e){return e()},1),Un=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};nt(this,e),this.vm=t,this.handler=n,this.options=r,this.vNode=new Bn(t),this.vData=new qn,this.cache=null,this.$tickEvent=[],this.init()}return it(e,[{key:"init",value:function(){}},{key:"cacheParse",value:function(t,n){var r=this.handler,i=r.noValue,o=r.noCache;this.cache&&!0!==i&&!0!==o||(this.cache=n?e.prototype.parse.call(this,t):this.parse(t));var a=ht(this.$tickEvent);return this.$tickEvent=[],a.length&&cn(function(){a.forEach(function(e){return e()})}),this.cache}},{key:"sync",value:function(e){bn(e)&&this.$tickEvent.push(e),this.clearCache(),this.vm._sync()}},{key:"clearCache",value:function(){this.cache=null;var e=this.handler.rule.children;hn(e)&&e.forEach(function(e){return!wn(e)&&e.__handler__.render.clearCache()})}},{key:"childrenParse",value:function(e){var t=this.handler,n=t.rule,r=t.orgChildren,i=t.vm,o=n.children,a=[];return hn(o)?(r.forEach(function(e){-1===o.indexOf(e)&&i._fComponent.removeField(e.__field__)}),a=o.map(function(t){return wn(t)?[t]:t.__handler__?t.__handler__.render.cacheParse(e,!0):void zn(function(){return i._fComponent.reload()})}),this.handler.orgChildren=ht(o)):r.length>0&&(r.forEach(function(e){i._fComponent.removeField(e.__field__)}),this.handler.orgChildren=[]),a}},{key:"parse",value:function(e){var n=this.handler,r=n.type,i=n.rule,o=n.refName,a=n.key,u=n.noValue;if("template"===r&&i.template){if(void 0===t.compile)return console.error("使用的 Vue 版本不支持 compile\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com"),[];dn(i.vm)&&(i.vm=new t);var s=t.compile(i.template,{}).render.call(i.vm);return void 0===s.data&&(s.data={}),mn(s.data,i),s.key=a,[s]}if(u){i.ref=o,dn(i.key)&&(i.key="def"+En());var c=this.vNode.make(r,at({},i),this.childrenParse(e));return c.key=a,[c]}return 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;Object.keys(this.vData._data).forEach(function(t){void 0!==o[t]&&e.vData[t](o[t])});var s=this.vData.props({value:this.vm._formData(i)}).ref(n).key(r+"fc"+i).on(u).on("input",function(t){e.onInput(t)});return s.attrs(Object.keys(a).reduce(function(e,t){return Gn(t,a[t])&&(e[t]=a[t]),e},{})),dn(a.size)&&s.props({size:this.options.form.size}),s}},{key:"onInput",value:function(e){e=dn(e)?"":e;var t=this.handler,n=this.handler,r=n.field,i=n.vm,o=t.toValue(e);i._changeFormData(r,e),i._change(r,JSON.stringify(o))&&(t.setValue(o),t.watchFormValue(e),t.render.sync())}}]),e}();function Wn(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(n){function r(){return nt(this,r),lt(this,st(r).apply(this,arguments))}return ut(r,Un),it(r,[{key:"parse",value:function(n){var r=this.inputProps();return t&&r.key(this.handler.key),[this.vNode[e](r.get(),this.childrenParse(n))]}}]),r}()}var Kn="element",Jn="form-create-style",Yn={};function Xn(e,t,n){var r=Yn.componentList,i=vn(t.type).toLowerCase(),o=Zn(i)?r[i]:{handler:Dn,render:Un,noValue:!0};return new o.handler(e,t,o.render,n,o.noValue)}function Zn(e){return void 0!==Yn.componentList[e]}var Qn="undefined"!=typeof window&&window.Vue?window.Vue:t;function er(e){e.watch.forEach(function(e){return e()}),e.watch=[],e.deleted=!0}var tr={"form-create":Qn.extend($n())};function nr(e,t){return t?Qn.component(vn(e),t):e?tr[vn(e)]:at({},tr)}var rr=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};nt(this,e),this.fRender=void 0,this.fCreateApi=void 0,this.$parent=void 0,this.id=En(),this.validate={},this.__init(t,n),function(){if(null===document.getElementById(Jn)){var e=document.createElement("style");e.id=Jn,e.innerText=Yn.style,document.getElementsByTagName("head")[0].appendChild(e)}}(),this.$tick=yn(function(e){return e()},150)}return it(e,[{key:"__init",value:function(e,t){this.options=function(e){_n(e.sumbitBtn)&&ln(e,"sumbitBtn",{show:e.sumbitBtn}),_n(e.resetBtn)&&ln(e,"resetBtn",{show:e.resetBtn});var t=Sn(mn(Yn.getConfig(),{mounted:function(e){},onReload:function(e){},onSubmit:function(e,t){},el:null,switchMaker:!0}),e);return ln(t,"el",t.el?Vn(t.el)?t.el:document.querySelector(t.el):window.document.body),t}(t),this.rules=Array.isArray(e)?e:[],this.origin=ht(this.rules),this.handlers={},this.formData={},this.trueData={},this.components={},this.fieldList=[],this.switchMaker=this.options.switchMaker}},{key:"render",value:function(){return this.fRender.render(this.vm)}},{key:"beforeBoot",value:function(e){this.vm=e,this.createHandler(this.rules),this.fRender=new Yn.formRender(this)}},{key:"boot",value:function(){var e=this.vm;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),void 0===this.fCreateApi&&(this.fCreateApi=Yn.getGlobalApi(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?(ln(this.formData,n,e.parseValue),ln(this.validate,n,t.validate),ln(this.trueData,n,t)):!0===r&&ln(this.components,n,t)}},{key:"notField",value:function(e){return void 0===this.handlers[e]}},{key:"createHandler",value:function(e,t){var n=this;return e.map(function(r,i){if(!t||!wn(r)){if(!r.type)return console.error("未定义生成规则的 type 字段\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");var o,a=function(e){return bn(e.getRule)?e.getRule():e}(r);if(r.__handler__){if((o=r.__handler__).vm!==n.vm&&!o.deleted)return console.error("第".concat(i+1,"条规则正在其他的 <form-create> 中使用")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");o.vm=n.vm,o.render.vm=n.vm,o.render.vNode.setVm(n.vm),o.refresh()}else o=Xn(n.vm,a,n.options);var u=o.rule.children;return n.notField(o.field)?(n.switchMaker&&(e[i]=a,t||(n.origin[i]=a),r=a),n.setHandler(o),r.__handler__||function(e,t){Object.defineProperties(e,{__field__:{value:t.field,enumerable:!1,configurable:!1},__handler__:{value:t,enumerable:!1,configurable:!1}})}(r,o),hn(u)&&n.createHandler(u,!0),t||n.fieldList.push(o.field),o):console.error("".concat(a.field," 字段已存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com")}}).filter(function(e){return e}).forEach(function(t){t.root=e}),e}},{key:"create",value:function(e){var t=(new(e.extend(jn(this)))).$mount();return this.options.el.appendChild(t.$el),t}},{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;Object.keys(this.handlers).forEach(function(e){var n=t.handlers[e];0===n.watch.length&&t.addHandlerWatch(n),n.mounted()}),Object.keys(e.cptData).forEach(function(n){var r=t.handlers[n].toValue(e.cptData[n]);e.jsonData[n]=JSON.stringify(r),e._changeValue(n,r)}),n&&(i&&i(this.fCreateApi),this.$emit("mounted",this.fCreateApi)),o&&o(this.fCreateApi),this.$emit("reload",this.fCreateApi)}},{key:"$emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i,o;this.$parent?(i=this.$parent).$emit.apply(i,["fc:".concat(e)].concat(n)):(o=this.vm).$emit.apply(o,[e].concat(n))}},{key:"removeField",value:function(e){if(void 0!==this.handlers[e]){var t=this.fieldList.indexOf(e);er(this.handlers[e]),fn(this.handlers,e),fn(this.validate,e),-1!==t&&this.fieldList.splice(t,1),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(function(){return r.cptData[n]},function(i){if(void 0===t.handlers[n])return er(e);var o=e.toValue(i),a=JSON.stringify(o);r._change(n,a)&&(e.setValue(o),e.watchFormValue(i))},{deep:!0}),o=r.$watch(function(){return r.trueData[n].value},function(i){if(void 0!==i){if(void 0===t.handlers[n])return er(e);var o=JSON.stringify(i);r._change(n,o)&&(e.watchValue(i),cn(function(){return e.render.sync()}))}},{deep:!0});e.watch.push(i,o);var a=function(){void 0===t.handlers[n]?er(e):t.$tick(function(){return e.render.sync()})};Object.keys(r._trueData(n)).forEach(function(t){"value"!==t&&e.watch.push(r.$watch(function(){return r.trueData[n][t]},a,{deep:!0}))})}}},{key:"reload",value:function(e){var t=this,n=this.vm;if(!e)return this.reload(this.rules);this.origin.length||this.fCreateApi.refresh(),this.origin=ht(e),Object.keys(this.handlers).forEach(function(e){return t.removeField(e)}),this.__init(e,this.options),this.beforeBoot(n),this.boot(),n.__init(),cn(function(){t.mounted(n,!1)}),n.$f=this.fCreateApi}},{key:"getFormRef",value:function(){return this.vm.$refs[this.fRender.refName]}}],[{key:"create",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=new e(t,Vn(n)?{el:n}:n);i.create(Qn);return i.$parent=r,i.fCreateApi}},{key:"install",value:function(t){var n=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.create(t,n,this)};n.maker=e.maker,n.version="1.6.5",n.ui=Kn,n.component=nr,t.prototype.$formCreate=n,t.component(In,t.extend($n())),Qn=t}},{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e(t,Vn(n)?{el:n}:n),i=(new(Qn.extend(jn(r)))).$mount();return{mount:function(e){return e&&Vn(e)&&ln(r.options,"el",e),r.options.el.appendChild(i.$el),r.fCreateApi},remove:function(){r.options.el.removeChild(i.$el)},$f:r.fCreateApi}}}]),e}();rr.version="1.6.5",rr.ui=Kn,rr.component=nr;var ir=function(){function e(t){nt(this,e);var n=t.id,r=t.vm,i=t.fieldList,o=t.handlers;this.vm=r,this.handlers=o,this.renderSort=i,this._fc=t,this.vNode=new Bn(r),this.vData=new qn,this.unique=n,this.refName="cForm".concat(n),this.cacheUnique=0}return it(e,[{key:"getRender",value:function(e){return this.handlers[e].render}},{key:"render",value:function(e){var t=this;if(e.isShow){this.vNode.setVm(e),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({model:this._fc.formData,rules:this._fc.validate,key:"form"+this.unique}).ref(this.refName).nativeOn({submit:Pn}).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)}).filter(function(e){return void 0!==e});return r.length>0&&r.push(this.makeFormBtn(n)),this.vNode.form(this.propsData,r.length>0?[this.vNode.row(mn({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=Zn(r)||i.col.labelWidth||i.title?i.col.labelWidth:1;s=On(s)?s+"px":s;var 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(),f=this.vNode.formItem(l,t);return!0===this.propsData.props.inline?[f]:this.makeCol(i,n,[f])}},{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=dn(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;bn(r.click)?r.click(e):e.resetFields()}},style:{width:this.vm.resetProps.width}},[this.vm.resetProps.innerText])])}},{key:"makeSubmitBtn",value:function(e,t){var n=this,r=this._fc.options.submitBtn,i=dn(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;bn(r.click)?r.click(e):e.submit()}},style:{width:this.vm.resetProps.width}},[this.vm.buttonProps.innerText])])}}]),e}();function or(e){return function(t,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new ur(e,t,n,r,i)}}function ar(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 ur(e,r,i,o,a);return bn(t)?t(u):u.props(n,t),u}}var ur=function(e){function t(e,n,r,i){var o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return nt(this,t),(o=lt(this,st(t).call(this))).rule=mn({event:{},validate:[],options:[],col:{},children:[],emit:[],template:null,emitPrefix:null},{type:e,title:n,field:r,value:i}),o.props({hidden:!1,visibility:!1}),kn(a)&&o.props(a),o}return ut(t,qn),it(t,[{key:"type",value:function(e){return this.props("type",e),this}},{key:"get",value:function(){return this._data}},{key:"getRule",value:function(){return mn(this.rule,this.get())}},{key:"setValue",value:function(e){return ln(this.rule,"value",e),this}}]),t}();["emitPrefix","className","defaultSlot"].forEach(function(e){ur.prototype[e]=function(t){return ln(this.rule,e,t),this}});["event","col"].forEach(function(e){ur.prototype[e]=function(t){return ln(this.rule,e,mn(this.rule[e],t)),this}});["validate","options","children","emit"].forEach(function(e){ur.prototype[e]=function(t){return Array.isArray(t)||(t=[t]),ln(this.rule,e,this.rule[e].concat(t)),this}});var sr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"parse",value:function(){return[]}}]),t}(),cr=ot({},"hidden",function(e,t){return or("hidden")("",e,t)}),lr={handler:Dn,render:sr,name:"hidden",maker:cr},fr={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;dn(e.disabled)&&ln(e,"disabled",!1)}},{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){ft(st(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),render:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.rule,i=r.options,o=r.props,a=t.key;return[this.vNode.checkboxGroup(this.inputProps().key(a).get(),function(){return i.map(function(t,r){var i=at({},t),a="button"===o.type;return delete i.value,e.vNode[a?"checkboxBtn":"checkbox"]({props:i,key:(a?"b":"i")+"copt".concat(r).concat(n)})})})]}}]),t}(),name:"checkbox"},hr={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(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 nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.unique,r=t.rule,i=r.options,o=r.props;return[this.vNode.radioGroup(this.inputProps().get(),function(){return i.map(function(t,r){var i=at({},t),a="button"===o.type;return delete i.value,e.vNode[a?"radioBtn":"radio"]({props:i,key:(a?"b":"i")+"ropt".concat(r).concat(n)})})})]}}]),t}(),name:"radio"},pr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;e.autosize&&e.autosize.minRows&&ln(e,"rows",e.autosize.minRows||2)}},{key:"toFormValue",value:function(e){return vn(e)}}]),t}(),dr=["password","url","email","text","textarea"].reduce(function(e,t){return e[t]=ar("input",t),e},{});dr.idate=ar("input","date");var vr={handler:pr,render:Wn("input"),name:"input",maker:dr},mr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule;Array.isArray(e.data)||ln(e,"data",[])}},{key:"watchFormValue",value:function(e){ft(st(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),yr="autoComplete",gr={auto:or(yr)},kr={handler:mr,render:Wn(yr,!0),name:yr,maker:gr},br="[\t\n\v\f\r                 \u2028\u2029\ufeff]",wr=RegExp("^"+br+br+"*"),_r=RegExp(br+br+"*$"),xr=v?Object.defineProperties:function(e,t){w(e);for(var n,r=Ue(t),i=r.length,o=0;i>o;)x.f(e,n=r[o++],t[n]);return e},Or=m.document,Vr=Or&&Or.documentElement,Sr=ie("IE_PROTO"),Nr=function(){},Er=function(){var e,t=k("iframe"),n=be.length;for(t.style.display="none",Vr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),Er=e.F;n--;)delete Er.prototype[be[n]];return Er()},Ar=Object.create||function(e,t){var n;return null!==e?(Nr.prototype=w(e),n=new Nr,Nr.prototype=null,n[Sr]=e):n=Er(),void 0===t?n:xr(n,t)};oe[Sr]=!0;var Pr=_e.f,Cr=Q.f,Fr=x.f,Ir=m.Number,$r=Ir.prototype,jr="Number"==r(Ar($r)),Dr="trim"in String.prototype,Rr=function(e){var t,n,r,i,o,u,s,c,l,f,h=p(e,!1);if("string"==typeof h&&h.length>2)if(43===(t=(h=Dr?h.trim():(l=h,f=3,l=String(a(l)),1&f&&(l=l.replace(wr,"")),2&f&&(l=l.replace(_r,"")),l)).charCodeAt(0))||45===t){if(88===(n=h.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(h.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+h}for(u=(o=h.slice(2)).length,s=0;s<u;s++)if((c=o.charCodeAt(s))<48||c>i)return NaN;return parseInt(o,r)}return+h};if(Ie("Number",!Ir(" 0o1")||!Ir("0b1")||Ir("+0x1"))){for(var Tr,Lr=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof Lr&&(jr?d(function(){$r.valueOf.call(n)}):"Number"!=r(n))?kt(new Ir(Rr(t)),n,Lr):Rr(t)},Mr=v?Pr(Ir):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Br=0;Mr.length>Br;Br++)X(Ir,Tr=Mr[Br])&&!X(Lr,Tr)&&Fr(Lr,Tr,Cr(Ir,Tr));Lr.prototype=$r,$r.constructor=Lr,de(m,"Number",Lr)}je({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var qr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"toFormValue",value:function(e){var t=parseFloat(e);return Number.isNaN(t)&&(t=0),t}}]),t}(),Hr={number:or("inputNumber")},Gr={handler:qr,render:Wn("inputNumber"),name:"inputNumber",maker:Hr},zr={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(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){ft(st(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),render:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(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)},function(e,t,n){return[e&&bn(e)?e.call(n,t):e]}(t.slot,e.vm.$createElement,r))})})]}}]),t}(),name:"select",maker:{selectMultiple:ar("select",!0,"multiple"),selectOne:ar("select",!1,"multiple")}},Ur={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule;e.props.data||ln(e.props,"data",[]),e.props.options||ln(e.props,"options",[]),Array.isArray(this.rule.value)||ln(e,"value",[])}},{key:"toFormValue",value:function(e){return Array.isArray(e)?e:[]}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),this.vm._changeFormData(this.field,this.toFormValue(this.el.value))}}]),t}(),render:Wn("cascader"),name:"cascader"},Wr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule;ln(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}(),Kr={sliderRange:ar("slider",!0,"range")},Jr={handler:Wr,render:Wn("slider"),name:"slider",maker:Kr};function Yr(e){return gn(e)?Cn("hh:mm:ss",e):e}function Xr(e){return new Date("2018-02-14 "+e)}var Zr=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;e.type||ln(e,"type","time")}},{key:"toFormValue",value:function(e){var t,n=Array.isArray(e);return!0===this.rule.props.isRange?t=n&&2===e.length?e.map(function(e){return e?Yr(An(e)):""}):"":(n&&(e=e[0]),t=e?Yr(An(e)):""),Array.isArray(t)?t.map(function(e){return e?Xr(e):""}):t?Xr(t):""}},{key:"toValue",value:function(e){var t=this.el.formatToString(e);return!0!==this.rule.props.isRange||t||(t=["",""]),t}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),this.rule.value=this.el.displayValue,this.vm._changeFormData(this.field,this.toFormValue(this.el.displayValue))}}]),t}();function Qr(e){return gn(e)?Cn("hh:mm:ss",e):e}!function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;e.type||ln(e,"type","time"),dn(e.confirm)&&ln(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?Qr(An(e)):""}):["",""]:(n&&(e=e[0]),t=e?Qr(An(e)):""),t}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),this.rule.value=this.el.publicStringValue,this.vm._changeFormData(this.field,this.toFormValue(this.el.publicStringValue))}}])}();var ei={handler:Zr,render:Wn("timePicker",!0),name:"timePicker",maker:{time:ar("timePicker",function(e){return e.props.isRange=!1}),timeRange:ar("timePicker",function(e){return e.props.isRange=!0})}},ti=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;ln(e,"type",e.type?vn(e.type).toLowerCase():"date")}},{key:"toFormValue",value:function(e){var t,n=Array.isArray(e),r=this.rule.props;return t=-1!==["daterange","datetimerange","dates"].indexOf(r.type)?n?e.map(function(e){return e?An(e):""}):"dates"===r.type?[]:["",""]:"date"===r.type&&!0===r.multiple?vn(e):(t=n?e[0]||"":e)?An(t):""}},{key:"toValue",value:function(e){var t=this.rule.props.type,n=this.el.formatToString(e);return n||-1===["daterange","datetimerange"].indexOf(t)?n:["",""]}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this);var e=this.el.formatToString(this.vm._formData(this.field));this.rule.value=e,this.setValue(e)}}]),t}(),ni=(function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;ln(e,"type",e.type?vn(e.type).toLowerCase():"date"),dn(e.startDate)&&ln(e,"startDate",An(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?An(e):""}):["",""]:"date"===r.type&&!0===r.multiple?vn(e):(t=n?e[0]||"":e)?An(t):""}},{key:"toValue",value:function(){return this.el.publicStringValue}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),this.rule.value=this.el.publicStringValue,this.vm._changeFormData(this.field,this.toFormValue(this.el.publicStringValue))}}])}(),["date","dateRange","dateTime","dateTimeRange","year","month"].reduce(function(e,t){return e[t]=ar("datePicker",t.toLowerCase()),e},{}),Wn("datePicker",!0)),ri={handler:ti,render:ni,name:"datePicker",maker:["year","month","date","dates","week","datetime","datetimeRange","dateRange"].reduce(function(e,t){return e[t]=ar("datePicker",t.toLowerCase()),e},{})},ii={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"toFormValue",value:function(e){var t=parseFloat(e);return Number.isNaN(t)&&(t=0),t}}]),t}(),render:Wn("rate"),name:"rate"},oi=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"watchFormValue",value:function(e){ft(st(t.prototype),"watchFormValue",this).call(this,e),this.render.sync()}}]),t}(),ai={color:or("colorPicker")},ui={handler:oi,render:Wn("colorPicker",!0),name:"colorPicker",maker:ai},si={handler:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e=this.rule.props;dn(e.nodeKey)&&ln(e,"nodeKey","id"),dn(e.props)&&ln(e,"props",{label:"title"}),dn(e.defaultExpandAll)&&ln(e,"defaultExpandAll",!0)}},{key:"toValue",value:function(e){return this.el.getCheckedKeys()}},{key:"watchValue",value:function(e){ft(st(t.prototype),"watchValue",this).call(this,e),this.updateValue(e)}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),this.updateValue(this.rule.value)}},{key:"updateValue",value:function(e){this.el.setCheckedKeys(e),this.setValue(this.el.getCheckedKeys())}}]),t}(),render:function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"parse",value:function(){var e=this,t=this.handler,n=t.rule,r=t.refName,i=t.unique,o=this.vData.on(n.event).on({check:function(){var t;e.handler.setValue(e.handler.el.getCheckedKeys()),n.event.check&&(t=n.event).check.apply(t,arguments)}}).props(n.props).ref(r).key("fip".concat(i)).get(),a=this.inputProps().props({type:"text",value:""+this.handler.rule.value,disable:!0,readonly:!0}).key("fipit"+i).class("__fc_h").ref("".concat(r,"it")).on("input",function(){}).get();return[this.vNode.tree(o),this.vNode.input(a)]}}]),t}(),name:"tree"},ci=L("species"),li=[].push,fi=Math.min,hi=!d(function(){return!RegExp(4294967295,"y")});function pi(e){return Array.isArray(e)?e:e?[e]:[]}Zt("split",2,function(e,t,n){var r;return r="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,n){var r=String(a(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!wt(e))return t.call(r,e,i);for(var o,u,s,c=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,h=new RegExp(e.source,l+"g");(o=Wt.call(h,r))&&!((u=h.lastIndex)>f&&(c.push(r.slice(f,o.index)),o.length>1&&o.index<r.length&&li.apply(c,o.slice(1)),s=o[0].length,f=u,c.length>=i));)h.lastIndex===o.index&&h.lastIndex++;return f===r.length?!s&&h.test("")||c.push(""):c.push(r.slice(f)),c.length>i?c.slice(0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=a(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var a=w(e),u=String(this),s=function(e,t){var n,r=w(e).constructor;return void 0===r||null==(n=w(r)[ci])?t:Me(n)}(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(hi?"y":"g"),f=new s(hi?a:"^(?:"+a.source+")",l),p=void 0===i?4294967295:i>>>0;if(0===p)return[];if(0===u.length)return null===Kt(f,u)?[u]:[];for(var d=0,v=0,m=[];v<u.length;){f.lastIndex=hi?v:0;var y,g=Kt(f,hi?u:u.slice(v));if(null===g||(y=fi(h(f.lastIndex+(hi?0:v)),u.length))===d)v=Bt(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}]},!hi);var di=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){this.parseValue=[];var e=this.rule.props;e.fileList=[],e.showFileList=!1,dn(e.uploadType)&&ln(e,"uploadType","file"),e.modalTitle||ln(e,"modalTitle","预览"),"file"===e.uploadType&&dn(e.handleIcon)&&ln(e,"handleIcon",!1),ln(this.rule,"value",pi(this.rule.value))}},{key:"toFormValue",value:function(e){var t=this,n=pi(e);return this.parseValue.splice(0,this.parseValue.length),n.forEach(function(e){return t.push(e)}),ln(this.rule.props,"fileList",this.parseValue),this.parseValue}},{key:"mounted",value:function(){ft(st(t.prototype),"mounted",this).call(this),ln(this.rule.props,"fileList",this.parseValue),this.changeParseValue(this.el.uploadFiles||[])}},{key:"push",value:function(e){var t;this.parseValue.push({url:e,name:(t=e,vn(t).split("/").pop())})}},{key:"toValue",value:function(e){if(dn(e))return[];var t=e.map(function(e){return e.url}).filter(function(e){return void 0!==e});return 1===this.rule.props.limit?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.fileList.forEach(function(e){n=n&&(void 0===e.percentage||"success"===e.status)}),n&&ft(st(t.prototype),"watchValue",this).call(this,e)}}]),t}(),vi=new Bn({}),mi=function(e,t){return dn(e.width)&&(e.width="30%"),{name:"fc-modal",data:function(){return at({visible:!0},e)},render:function(){return vi.setVm(this),vi.modal({props:this.$data,on:{close:this.onClose,closed:this.onClosed}},[t(vi,this)])},methods:{onClose:function(){this.visible=!1},onClosed:function(){this.$el.parentNode.removeChild(this.$el)}}}};function yi(e,t){var n=(new(Qn.extend(mi(e,t)))).$mount();window.document.body.appendChild(n.$el)}function gi(e,t){yi({title:t},function(t){return t.make("img",{style:{width:"100%"},attrs:{src:e}})})}var ki=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"init",value:function(){var e=this,t=this.handler;this.uploadOptions=mn(at({},this.options.upload),this.handler.rule.props),this.issetIcon=this.uploadOptions.allowRemove||this.uploadOptions.handleIcon,this.propsData=this.vData.props(this.uploadOptions).class("fc-upload-con",!0).props("onSuccess",function(){return e.onSuccess.apply(e,arguments)}).ref(t.refName).key("fip".concat(t.unique)).get()}},{key:"onSuccess",value:function(e,t,n){var r=this.uploadOptions.onSuccess.call(null,e,t,n);if(dn(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.uploadFiles)}},{key:"onHandle",value:function(e){var t=this.uploadOptions.onHandle;if(t)return t(e);gi(e,this.uploadOptions.modalTitle)}},{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="el-icon-view");var i=this.vm._formData(r),o=this.uploadOptions.showFileList?[]:ht(i.map(function(t,r){return dn(t.percentage)||!1===t.showProgress||"success"===t.status?void 0===t.status||"success"===t.status?e.makeUploadView(t.url,"upview".concat(r).concat(n),r):void 0:e.makeProgress(t,"uppg".concat(r).concat(n))})),a=!this.uploadOptions.limit||this.uploadOptions.limit>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,ft(st(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"]},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),class:["el-icon-tickets"]})),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"]},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"]},[this.vNode.progress({key:"upp".concat(t),props:{percentage:e.percentage,type:"circle",width:54}})])}},{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"]},[this.vNode.icon({key:"upi".concat(e),class:["el-icon-upload2"]})])]:[])}},{key:"makeRemoveIcon",value:function(e,t,n){var r=this;return this.vNode.icon({key:"upri".concat(t).concat(n),class:["el-icon-delete"],on:{click:function(){if(!0!==r.uploadOptions.disabled){var e=r.handler.el.uploadFiles[n];r.handler.el.handleRemove(e)}}}})}},{key:"makeHandleIcon",value:function(e,t,n){var r=this;return this.vNode.icon({key:"uphi".concat(t).concat(n),class:["el-icon-view"],on:{click:function(){!0!==r.uploadOptions.disabled&&r.onHandle(e)}}})}}]),t}(),bi={image:["image",0],file:["file",0],uploadFileOne:["file",1],uploadImageOne:["image",1]},wi=Object.keys(bi).reduce(function(e,t){return e[t]=ar("upload",function(e){return e.props({uploadType:bi[t][0],limit:bi[t][1]})}),e},{});wi.uploadImage=wi.image,wi.uploadFile=wi.file;var _i={handler:di,render:ki,name:"upload",maker:wi};var xi=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Dn),it(t,[{key:"init",value:function(){var e,t;e=this.rule,(t=e.props).type||ln(t,"type","input"),t.icon||ln(t,"icon","el-icon-upload2"),t.height||ln(t,"height","370px"),dn(t.spin)&&ln(t,"spin",!0),t.title||ln(t,"title","请选择"+e.title),t.maxLength||ln(t,"maxLength",0),t.okBtnText||ln(t,"okBtnText","确定"),t.closeBtnText||ln(t,"closeBtnText","关闭"),t.modalTitle||ln(t,"modalTitle","预览"),t.handleIcon,ln(t,"handleIcon",("file"!==t.type||void 0!==t.handleIcon)&&(!0===t.handleIcon||void 0===t.handleIcon?"el-icon-view":t.handleIcon)),void 0===t.allowRemove&&ln(t,"allowRemove",!0)}},{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 1!=this.rule.props.maxLength?e:void 0===e[0]?"":e[0]}},{key:"watchValue",value:function(e){ft(st(t.prototype),"watchValue",this).call(this,e),this.render.onChange(e),this.render.sync()}},{key:"watchFormValue",value:function(e){ft(st(t.prototype),"watchFormValue",this).call(this,e),this.parseValue=e,this.render.sync()}}]),t}(),Oi={onOpen:"on-open",onChange:"on-change",onCancel:"on-cancel",onOk:"on-ok"},Vi=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(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(){this.init();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()}).on("input",function(){}).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"],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"]},[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"]},[e.vNode.icon({key:"iff".concat(t).concat(r),class:["el-icon-tickets"]}),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.maxLenth>0&&this.handler.parseValue.length>=t.maxLenth)){var n=this.handler.unique;return this.vNode.make("div",{key:"ifbd3".concat(n),class:["fc-upload-btn"],on:{click:function(){!0!==t.disabled&&e.showModel()}}},[this.vNode.icon({key:"ifbi3".concat(n),class:[this._props.icon]})])}}},{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"]},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),class:["el-icon-delete"],on:{click:function(){!0!==r._props.disabled&&!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),class:[vn(i.handleIcon)],on:{click:function(){!0!==i.disabled&&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);gi(e,this._props.modalTitle)}},{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(),n=this._props,r=n.width,i=n.height,o=n.src,a=n.title,u=n.okBtnText,s=n.closeBtnText;t&&yi({width:r,title:a},function(t,n){return e.handler.$modal=n,[t.make("iframe",{attrs:{src:o},style:{height:i,border:"0 none",width:"100%"},on:{load:function(t){try{if(!0===e.options.iframeHelper){var r=t.path[0].contentWindow;r["".concat(e.handler.field,"_change")]=function(t){e.handler.setValue(t)},r.form_create_helper={close:function(t){e.valid(t),n.onClose()},set:function(t,n){e.valid(t),r["".concat(t,"_change")](n)},get:function(t){return e.valid(t),e.handler.rule.value}}}}catch(t){}}}}),t.make("div",{slot:"footer"},[t.button({on:{click:function(){n.onClose(),e.onCancel()}}},[vn(s)]),t.button({props:{type:"primary"},on:{click:function(){!1!==e.onOk()&&n.onClose()}}},[vn(u)])])]})}}]),t}();Object.keys(Oi).forEach(function(e){Vi.prototype[e]=function(){var t=this.handler.rule.event[Oi[e]];if(t)return t(this.handler.getValue())}});var Si={frameInputs:["input",0],frameFiles:["file",0],frameImages:["image",0],frameInputOne:["input",1],frameFileOne:["file",1],frameImageOne:["image",1]},Ni=Object.keys(Si).reduce(function(e,t){return e[t]=ar("frame",function(e){return e.props({type:Si[t][0],maxLength:Si[t][1]})}),e},{});Ni.frameInput=Ni.frameInputs,Ni.frameFile=Ni.frameFiles,Ni.frameImage=Ni.frameImages;var Ei={handler:xi,render:Vi,name:"frame",maker:Ni},Ai=function(e){function t(){return nt(this,t),lt(this,st(t).apply(this,arguments))}return ut(t,Un),it(t,[{key:"parse",value:function(){var e=this.handler.rule,t=dn(e.props.slot)?e.slot:e.props.slot;return kn(t)||(t={}),[this.vNode.switch(this.inputProps().scopedSlots({open:function(){return t.open},close:function(){return t.close}}).style({margin:"4.5px 0px"}).get())]}}]),t}(),Pi={sliderRange:ar("switch",!0,"range")},Ci={handler:Dn,render:Ai,name:"switch",maker:Pi},Fi=x.f,Ii=Function.prototype,$i=Ii.toString,ji=/^\s*function ([^ (]*)/;function Di(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(wn(e)&&(e=JSON.parse(e)),e instanceof ur)return t?e:e.getRule();if(kn(e)){var n=function(e){var t=new ur;return Object.keys(e).forEach(function(n){-1===Object.keys(t._data).indexOf(n)?t.rule[n]=e[n]:t._data[n]=e[n]}),t}(e);return t?n:n.getRule()}if(Array.isArray(e)){var r=e.map(function(e){return Di(e,t)});return Object.defineProperty(r,"find",{value:Ri,enumerable:!1,configurable:!1}),r}return e}function Ri(e){var t=[];for(var n in this){var r=this[n]instanceof ur?this[n].rule:this[n];if(r.field===e)return this[n];hn(r.children)&&(t=t.concat(r.children))}if(t.length>0)return Ri.call(t,e)}!v||"name"in Ii||Fi(Ii,"name",{configurable:!0,get:function(){try{return $i.call(this).match(ji)[1]}catch(e){return""}}});var Ti,Li={hidden:lr,checkbox:fr,radio:hr,input:vr,autocomplete:kr,inputnumber:Gr,select:zr,cascader:Ur,slider:Jr,timepicker:ei,datepicker:ri,rate:ii,colorpicker:ui,tree:si,upload:_i,frame:Ei,switch:Ci},Mi={modal:"el-dialog",progress:"el-progress",button:"el-button",icon:"i",slider:"el-slider",rate:"el-rate",upload:"el-upload",cascader:"el-cascader",colorPicker:"el-color-picker",timePicker:"el-time-picker",datePicker:"el-date-picker",switch:"el-switch",option:"el-option",select:"el-select",checkbox:"el-checkbox",checkboxGroup:"el-checkbox-Group",checkboxBtn:"el-checkbox-button",radio:"el-radio",radioGroup:"el-radio-group",radioBtn:"el-radio-button",inputNumber:"el-input-number",input:"el-input",formItem:"el-form-Item",form:"el-form",col:"el-col",row:"el-row",tree:"el-tree",autoComplete:"el-autocomplete"};Yn=Ti={componentList:Li,formRender:ir,style:".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 img{width:100%;height:100%;display:inline-block;vertical-align: top;}.fc-upload .el-upload{display: block;}.fc-upload-btn{border: 1px dashed #c0ccda;cursor: pointer;}.fc-upload .fc-upload-con{display:inline-block;}.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; }.form-create .el-form-item .el-rate{margin-top:10px;}.form-create .el-form-item .el-tree{margin-top:7px;}.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)}}",getConfig:function(){return{form:{inline:!1,labelPosition:"right",labelSuffix:void 0,hideRequiredAsterisk:!1,labelWidth:"125px",showMessage:!0,inlineMessage:!1,statusIcon:!1,validateOnRuleChange:!0,disabled:!1,size:void 0},row:{gutter:0,type:void 0,align:void 0,justify:void 0,tag:"div"},upload:{onPreview:function(e){},onRemove:function(e,t){},onSuccess:function(){},onError:function(e,t,n){},onProgress:function(e,t,n){},onChange:function(e,t){},beforeUpload:function(e){},beforeRemove:function(e,t){},allowRemove:!0,handleIcon:!0},submitBtn:{type:"primary",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-upload",width:"100%",autofocus:!1,nativeType:"button",innerText:"提交",show:!0,col:void 0,click:void 0},resetBtn:{type:"default",size:"medium",plain:!1,round:!1,circle:!1,loading:!1,disabled:!1,icon:"el-icon-refresh",width:"100%",autofocus:!1,nativeType:"button",innerText:"重置",show:!1,col:void 0,click:void 0},iframeHelper:!1}},getGlobalApi:function(e){var t=e.vm;function n(n){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n?Array.isArray(n)||(n=[n]):n=r?Object.keys(e.handlers):t._formField(),n}return{formData:function(){var n=this,r=e.handlers;return Object.keys(r).reduce(function(e,i){var o=r[i];return!0===o.noValue?o.$emit("input",function(t){e[i]=t},n):e[i]=Sn({},{value:t._value(i)}).value,e},{})},getValue:function(n){n=vn(n);var r=e.handlers[n];if(!dn(r)){var i=void 0;return!0===r.noValue?r.$emit("input",function(e){i=e},this):i=Sn({},{value:t._value(n)}).value,i}},setValue:function(e,t){var n=this,r=e;kn(e)||(r=ot({},e,t)),Object.keys(r).forEach(function(e){n.changeValue(e,r[e])})},changeValue:function(n,r){var i=this;n=vn(n);var o=e.handlers[n];void 0!==o&&(bn(r)?r(t._trueData(n),function(e){i.changeField(n,e)}):!0===o.noValue?o.$emit("set-value",r,this):o.setValue(r))},changeField:function(e,t){this.setValue(e,t)},removeField:function(n){var r=e.handlers[n];if(r){var i=r.root.map(function(e){return e.__field__}).indexOf(vn(n));-1!==i&&(r.root.splice(i,1),t._refresh())}},validate:function(t,n){e.getFormRef().validate(function(e){!0===e?t&&t():n&&n()})},validateField:function(n,r){t.cptData[n]&&e.getFormRef().validateField(n,r)},resetFields:function(t){var r=this,i=e.handlers;n(t,!0).forEach(function(e){var t=i[e];t&&(t.noValue?t.$emit("reset-field",r):t.reset())}),this.refresh()},destroy:function(){t.$el.parentNode.removeChild(t.$el),t.$destroy()},fields:function(){return t._formField()},append:function(t,n){var r=e.fieldList,i=r.indexOf(vn(n));if(t.field&&-1!==r.indexOf(vn(t.field)))return console.error("".concat(t.field," 字段已存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");if(dn(n))i=r.length;else if(-1===i)return;e.rules.splice(i+1,0,t)},prepend:function(t,n){var r=e.fieldList,i=r.indexOf(vn(n));if(t.field&&-1!==r.indexOf(vn(t.field)))return console.error("".concat(t.field," 字段已存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");if(dn(n))i=0;else{if(-1===i)return;i--}e.rules.splice(i+1,0,t)},submit:function(t,n){var r=this;this.validate(function(){var n=r.formData();bn(t)?t(n,r):e.options.onSubmit&&e.options.onSubmit(n)},function(){return n&&n()})},hidden:function(r){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n(r).forEach(function(n){var r=e.handlers[n];e.handlers[n]&&(t.$set(t._trueData(n).props,"hidden",!!i),r.render.sync())})},visibility:function(r){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];n(r).forEach(function(n){var r=e.handlers[n];r&&(t.$set(t._trueData(n).props,"visibility",!!i),r.render.sync())})},disabled:function(r){var i=this,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o=!!o,n(r,!0).forEach(function(n){var r=e.handlers[n];r&&(r.noValue?r.$emit("disabled",o,i):t.$set(t._trueData(n).props,"disabled",o),r.render.sync())})},clearValidateState:function(t){n(t).forEach(function(t){var n=e.handlers[t];n&&n.clearMsg()})},model:function(){return at({},t.trueData)},component:function(){return at({},t.components)},bind:function(e){var r={},i={};return n(e).forEach(function(e){var n=t._trueData(e);if(!n)return console.error("".concat(e," 字段不存在")+"\ngithub:https://github.com/xaboy/form-create\ndocument:http://www.form-create.com");i[e]={get:function(){return n.value},set:function(e){t.$set(n,"value",e)},enumerable:!0,configurable:!0}}),Object.defineProperties(r,i),r},submitStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t._buttonProps(e)},resetStatus:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t._resetProps(e)},btn:{loading:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._buttonProps({loading:e})},finish:function(){this.loading(!1)},disabled:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._buttonProps({disabled:e})},show:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._buttonProps({show:e})}},resetBtn:{loading:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._resetProps({loading:e})},finish:function(){this.loading(!1)},disabled:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._resetProps({disabled:e})},show:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t._resetProps({show:e})}},closeModal:function(t){var n=e.handlers[t];n&&n.$modal&&(n.$modal.onClose(),n.$modal=null)},set:function(e,n,r){t.$set(e,n,r)},reload:function(t){e.reload(t)},options:function(n){Sn(e.options,n),t._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(){t._refresh()},show:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t.isShow=!!e}}},install:function(e){e.maker=function(e){var t={};Object.keys(e).forEach(function(n){var r=e[n],i=dn(r.maker);(i||void 0===r.maker[r.name])&&(t[r.name]=or(r.name)),i||mn(t,r.maker)});var n=or("");return mn(t,{create:function(e,t,r){var i=n("",t);return i.rule.type=e,i.rule.title=r,i},createTmp:function(e,t,r,i){var o=n("",r);return o.rule.type="template",o.rule.template=e,o.rule.title=i,o.rule.vm=t,o}}),t.template=t.createTmp,t.parse=Di,t}(Li),Bn.use(Mi)}},Ti.install(rr),"undefined"!=typeof window&&(window.formCreate=rr,window.Vue&&function(e){!0!==e._installedFormCreate&&(e._installedFormCreate=!0,e.use(rr))}(Vue));var Bi=rr.maker;e.maker=Bi,e.default=rr,Object.defineProperty(e,"__esModule",{value:!0})});
8//# sourceMappingURL=form-create.elm.min.js.map