From 5fadbbaf41dee00a2174e11f148bcb36634d0562 Mon Sep 17 00:00:00 2001 From: paulogiacomelli Date: Mon, 11 Apr 2022 16:46:17 -0600 Subject: [PATCH 1/2] PF-1314: Cleave should update the value on mounted in case the data was set from outside sources --- dist/vfg.js | 2 +- src/fields/optional/fieldCleave.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/vfg.js b/dist/vfg.js index 227ae7ac..2f40ab4a 100644 --- a/dist/vfg.js +++ b/dist/vfg.js @@ -4,4 +4,4 @@ * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueFormGenerator=e():t.VueFormGenerator=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=114)}([function(t,e,n){"use strict";function r(t,e,n,r,i,o,u,a){t=t||{};var s=typeof t.default;"object"!==s&&"function"!==s||(t=t.default);var c="function"==typeof t?t.options:t;e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),o&&(c._scopeId=o);var l;if(u?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(u)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var f=c.render;c.render=function(t,e){return l.call(e),f(t,e)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:t,options:c}}e.a=r},function(t,e,n){"use strict";function r(t){return m()(t)?null!=O.default[t]?O.default[t]:(console.warn("'"+t+"' is not a validator function!"),null):t}function i(t,e,n){var r=w()(n.context,"schema.attributes",{}),i=e.value||"input";m()(i)&&(r=w()(r,i)||r),b()(r,function(e,n){t.setAttribute(n,e)})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(52),u=n.n(o),a=n(207),s=n.n(a),c=n(215),l=n.n(c),f=n(84),d=n.n(f),h=n(2),p=n.n(h),v=n(18),m=n.n(v),g=n(6),y=n.n(g),_=n(25),b=n.n(_),x=n(8),w=n.n(x),O=n(86),j=n(19);e.default={props:["vfg","model","schema","formOptions","disabled"],beforeDestroy:function(){this.visibilityChanged()},created:function(){this.visibilityChanged()},data:function(){return{errors:[],debouncedValidateFunc:null,debouncedFormatFunc:null,modelChanged:!1}},directives:{attributes:{bind:i,updated:i,componentUpdated:i}},computed:{value:{cache:!1,get:function(){var t=void 0;return t=y()(w()(this.schema,"get"))?this.schema.get(this.model):w()(this.model,this.schema.model),this.formatValueToField(t)},set:function(t){var e=this.value;t=this.formatValueToModel(t),y()(t)?t(t,e):this.updateModelValue(t,e)}}},methods:{visibilityChanged:function(){var t=this.schema,e=Object(j.isFieldVisible)(this.model,t,this);this.$emit("visibility-changed",{field:t,visible:e})},validate:function(t){var e=this;this.clearValidationErrors();var n=w()(this.formOptions,"validateAsync",!1),i=[];if(this.schema.validator&&!0!==this.schema.readonly&&!0!==this.disabled){var o=[];p()(this.schema.validator)?b()(this.schema.validator,function(t){o.push(r(t).bind(e))}):o.push(r(this.schema.validator).bind(this)),b()(o,function(t){if(n)i.push(t(e.value,e.schema,e.model));else{var r=t(e.value,e.schema,e.model);r&&y()(r.then)?r.then(function(t){t&&(e.errors=e.errors.concat(t));var n=0===e.errors.length;e.$emit("validated",n,e.errors,e)}):r&&(i=i.concat(r))}})}var a=function(n){var r=[];b()(s()(n),function(t){p()(t)&&t.length>0?r=r.concat(t):m()(t)&&r.push(t)}),y()(e.schema.onValidated)&&e.schema.onValidated.call(e,e.model,r,e.schema);var i=0===r.length;return t||e.$emit("validated",i,r,e),e.errors=r,r};return n?u.a.all(i).then(a):a(i)},debouncedValidate:function(){y()(this.debouncedValidateFunc)||(this.debouncedValidateFunc=d()(this.validate.bind(this),w()(this.schema,"validateDebounceTime",w()(this.formOptions,"validateDebounceTime",500)))),this.debouncedValidateFunc()},onDataAccept:function(){y()(this.schema.onDataAccept)&&this.schema.onDataAccept.call(this,this.model,this.value,this.schema,this.modelChanged)},updateModelValue:function(t,e){var n=!1;y()(this.schema.set)?(this.schema.set(this.model,t),n=!0):this.schema.model&&(this.setModelValueByPath(this.schema.model,t),n=!0),n&&(this.modelChanged=!0,this.$emit("model-updated",t,this.schema.model),y()(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,t,e,this.schema),(!0===w()(this.formOptions,"validateAfterChanged",!1)||!0===w()(this.formOptions,"validateAfterFailure",!1)&&this.errors.length)&&(w()(this.schema,"validateDebounceTime",w()(this.formOptions,"validateDebounceTime",0))>0?this.debouncedValidate():this.validate()))},clearValidationErrors:function(){this.errors.splice(0)},setModelValueByPath:function(t,e){var n=t.replace(/\[(\w+)\]/g,".$1");n=n.replace(/^\./,"");for(var r=this.model,i=n.split("."),o=0,u=i.length;o1&&void 0!==arguments[1]&&arguments[1],n=w()(this.formOptions,"fieldIdPrefix","");return Object(j.slugifyFormID)(t,n)+(e?"-"+l()():"")},getFieldClasses:function(){return w()(this.schema,"fieldClasses",[])},formatValueToField:function(t){return t},formatValueToModel:function(t){return t}}}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e){var n=t.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var r=n(57)("wks"),i=n(58),o=n(4).Symbol,u="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=r},function(t,e,n){function r(t){if(!o(t))return!1;var e=i(t);return e==a||e==s||e==u||e==c}var i=n(45),o=n(7),u="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",c="[object Proxy]";t.exports=r},function(t,e){function n(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}t.exports=n},function(t,e,n){function r(t,e,n){var r=null==t?void 0:i(t,e);return void 0===r?n:r}var i=n(153);t.exports=r},function(t,e,n){var r=n(17);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var r=n(224),i=n(48),o=n(229),u=n(76),a=Object.prototype,s=a.hasOwnProperty,c=r(function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n1&&void 0!==arguments[1]?arguments[1]:{};return p()(t.fields,function(n){void 0===y()(e,n.model)&&void 0!==n.default&&(s()(n.default)?m()(e,n.model,n.default(n,t,e)):d()(n.default)||l()(n.default)?m()(e,n.model,u()(n.default)):m()(e,n.model,n.default))}),e},x=function(t){var e=[];return p()(t.fields,function(t){!0===t.multi&&e.push(t)}),e},w=function(t,e){var n={},r=x(t);return p()(r,function(t){var r=void 0,i=!0,o=t.model;p()(e,function(t){var e=y()(t,o);i?(r=e,i=!1):r!==e&&(r=void 0)}),m()(n,o,r)}),n},O=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return void 0!==t.id?e+t.id:e+(t.inputName||t.label||t.model||"").toString().trim().toLowerCase().replace(/ |_/g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-]+)/g,"")},j=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().trim().replace(/ /g,"-").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"").replace(/([^a-zA-Z0-9-_/./:]+)/g,"")},k=function(t,e,n){var r=e.visible;return s()(e.visible)&&(r=e.visible.call(_,t,e,n)),i()(e.visible)&&(r=!0),r}},function(t,e,n){var r=n(21);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){function r(t,e){return(a(t)?i:o)(t,u(e))}var i=n(66),o=n(146),u=n(152),a=n(2);t.exports=r},function(t,e,n){var r=n(27),i=r(Object.keys,Object);t.exports=i},function(t,e){function n(t,e){return function(n){return t(e(n))}}t.exports=n},function(t,e){function n(){return!1}t.exports=n},function(t,e,n){var r=n(159),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e,n){function r(t,e){for(var n=t.length;n--;)if(i(t[n][0],e))return n;return-1}var i=n(48);t.exports=r},function(t,e,n){function r(t,e,n,r){var u=!n;n||(n={});for(var a=-1,s=e.length;++a=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(17),i=n(4).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){var r=n(126),i=n(59);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){var r=n(55),i=n(34);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(57)("keys"),i=n(58);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(16).f,i=n(23),o=n(5)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(34);t.exports=function(t){return Object(r(t))}},function(t,e,n){n(130);for(var r=n(4),i=n(13),o=n(14),u=n(5)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s3?0:(t-t%10!=10)*t%10]}};var b={D:function(t){return t.getDate()},DD:function(t){return a(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return a(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return a(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return a(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return a(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return a(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return a(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return a(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return a(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return a(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+a(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},x={D:[l,function(t,e){t.day=e}],Do:[new RegExp(l.source+h.source),function(t,e){t.day=parseInt(e,10)}],M:[l,function(t,e){t.month=e-1}],YY:[l,function(t,e){var n=new Date,r=+(""+n.getFullYear()).substr(0,2);t.year=""+(e>68?r-1:r)+e}],h:[l,function(t,e){t.hour=e}],m:[l,function(t,e){t.minute=e}],s:[l,function(t,e){t.second=e}],YYYY:[d,function(t,e){t.year=e}],S:[/\d/,function(t,e){t.millisecond=100*e}],SS:[/\d{2}/,function(t,e){t.millisecond=10*e}],SSS:[f,function(t,e){t.millisecond=e}],d:[l,v],ddd:[h,v],MMM:[h,u("monthNamesShort")],MMMM:[h,u("monthNames")],a:[h,function(t,e,n){var r=e.toLowerCase();r===n.amPm[0]?t.isPm=!1:r===n.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,e){"Z"===e&&(e="+00:00");var n,r=(e+"").match(/([\+\-]|\d\d)/gi);r&&(n=60*r[1]+parseInt(r[2],10),t.timezoneOffset="+"===r[0]?n:-n)}]};x.dd=x.d,x.dddd=x.ddd,x.DD=x.D,x.mm=x.m,x.hh=x.H=x.HH=x.h,x.MM=x.M,x.ss=x.s,x.A=x.a,s.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},s.format=function(t,e,n){var r=n||s.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");e=s.masks[e]||e||s.masks.default;var i=[];return e=e.replace(p,function(t,e){return i.push(e),"??"}),e=e.replace(c,function(e){return e in b?b[e](t,r):e.slice(1,e.length-1)}),e.replace(/\?\?/g,function(){return i.shift()})},s.parse=function(t,e,n){var r=n||s.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=s.masks[e]||e,t.length>1e3)return!1;var i=!0,o={};if(e.replace(c,function(e){if(x[e]){var n=x[e],u=t.search(n[0]);~u?t.replace(n[0],function(e){return n[1](o,e,r),t=t.substr(u+e.length),e}):i=!1}return x[e]?"":e.slice(1,e.length-1)}),!i)return!1;var u=new Date;!0===o.isPm&&null!=o.hour&&12!=+o.hour?o.hour=+o.hour+12:!1===o.isPm&&12==+o.hour&&(o.hour=0);var a;return null!=o.timezoneOffset?(o.minute=+(o.minute||0)-+o.timezoneOffset,a=new Date(Date.UTC(o.year||u.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0))):a=new Date(o.year||u.getFullYear(),o.month||0,o.day||1,o.hour||0,o.minute||0,o.second||0,o.millisecond||0),a},void 0!==t&&t.exports?t.exports=s:void 0!==(r=function(){return s}.call(e,n,e,t))&&(t.exports=r)}()},function(t,e,n){"use strict";var r=n(52),i=n.n(r),o=n(2),u=n.n(o),a=n(6),s=n.n(a),c=n(25),l=n.n(c),f=n(8),d=n.n(f),h=n(71),p=n(165),v=n(19);e.a={name:"formGenerator",components:{formGroup:p.a},mixins:[h.a],props:{schema:Object,model:Object,options:{type:Object,default:function(){return{validateAfterLoad:!1,validateAfterChanged:!1,fieldIdPrefix:"",validateAsync:!1,validationErrorClass:"error",validationSuccessClass:""}}},multiple:{type:Boolean,default:!1},isNewModel:{type:Boolean,default:!1},tag:{type:String,default:"fieldset",validator:function(t){return t.length>0}}},data:function(){return{vfg:this,errors:[]}},computed:{fields:function(){var t=this,e=[];return this.schema&&this.schema.fields&&l()(this.schema.fields,function(n){t.multiple&&!0!==n.multi||e.push(n)}),e},groups:function(){var t=[];return this.schema&&this.schema.groups&&l()(this.schema.groups.slice(0),function(e){t.push(e)}),t}},watch:{model:function(t,e){var n=this;e!==t&&null!=t&&this.$nextTick(function(){!0===n.options.validateAfterLoad&&!0!==n.isNewModel?n.validate():n.clearValidationErrors()})}},mounted:function(){var t=this;this.$nextTick(function(){t.model&&(!0===t.options.validateAfterLoad&&!0!==t.isNewModel?t.validate():t.clearValidationErrors())})},methods:{fieldVisible:function(t){return Object(v.isFieldVisible)(this.model,t,this)},onFieldValidated:function(t,e,n){var r=this;this.errors=this.errors.filter(function(t){return t.field!==n.schema}),!t&&e&&e.length>0&&l()(e,function(t){r.errors.push({field:n.schema,error:t})});var i=0===this.errors.length;this.$emit("validated",i,this.errors,this)},onModelUpdated:function(t,e){this.$emit("model-updated",t,e)},onVisibilityChanged:function(t){this.$emit("visibility-changed",t)},validate:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null===e&&(e=d()(this.options,"validateAsync",!1)),this.clearValidationErrors();var n=[],r=[];l()(this.$children,function(t){s()(t.validate)&&(n.push(t.$refs.child),r.push(t.validate(!0)))});var o=function(r){var i=[];l()(r,function(t,e){u()(t)&&t.length>0&&l()(t,function(t){i.push({field:n[e].schema,error:t})})}),t.errors=i;var o=0===i.length;return t.$emit("validated",o,i,t),e?i:o};return e?i.a.all(r).then(o):o(r)},clearValidationErrors:function(){this.errors.splice(0),l()(this.$children,function(t){t.clearValidationErrors()})}}}},function(t,e,n){t.exports={default:n(117),__esModule:!0}},function(t,e,n){"use strict";var r=n(35),i=n(11),o=n(122),u=n(13),a=n(14),s=n(123),c=n(40),l=n(129),f=n(5)("iterator"),d=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,p,v,m,g){s(n,e,p);var y,_,b,x=function(t){if(!d&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",O="values"==v,j=!1,k=t.prototype,C=k[f]||k["@@iterator"]||v&&k[v],S=C||x(v),M=v?O?x("entries"):S:void 0,T="Array"==e?k.entries||C:C;if(T&&(b=l(T.call(new t)))!==Object.prototype&&b.next&&(c(b,w,!0),r||"function"==typeof b[f]||u(b,f,h)),O&&C&&"values"!==C.name&&(j=!0,S=function(){return C.call(this)}),r&&!g||!d&&!j&&k[f]||u(k,f,S),a[e]=S,a[w]=h,v)if(y={values:O?S:x("values"),keys:m?S:x("keys"),entries:M},g)for(_ in y)_ in k||o(k,_,y[_]);else i(i.P+i.F*(d||j),e,y);return y}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(24);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(33),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){var r=n(3),i=n(4),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(35)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(4).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(43),i=n(5)("iterator"),o=n(14);t.exports=n(3).getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(9),i=n(21),o=n(5)("species");t.exports=function(t,e){var n,u=r(t).constructor;return void 0===u||void 0==(n=r(u)[o])?e:i(n)}},function(t,e,n){var r,i,o,u=n(20),a=n(138),s=n(60),c=n(36),l=n(4),f=l.process,d=l.setImmediate,h=l.clearImmediate,p=l.MessageChannel,v=l.Dispatch,m=0,g={},y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},_=function(t){y.call(t.data)};d&&h||(d=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return g[++m]=function(){a("function"==typeof t?t:Function(t),e)},r(m),m},h=function(t){delete g[t]},"process"==n(24)(f)?r=function(t){f.nextTick(u(y,t,1))}:v&&v.now?r=function(t){v.now(u(y,t,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=_,r=u(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(t){l.postMessage(t+"","*")},l.addEventListener("message",_,!1)):r="onreadystatechange"in c("script")?function(t){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),y.call(t)}}:function(t){setTimeout(u(y,t,1),0)}),t.exports={set:d,clear:h}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(9),i=n(17),o=n(44);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e){function n(t,e){for(var n=-1,r=null==t?0:t.length;++n0,r=(e={},i()(e,m()(this.options,"validationErrorClass","error"),n),i()(e,m()(this.options,"validationSuccessClass","valid"),!n),i()(e,"disabled",this.fieldDisabled(t)),i()(e,"readonly",this.fieldReadonly(t)),i()(e,"featured",this.fieldFeatured(t)),i()(e,"required",this.fieldRequired(t)),e);return l()(t.styleClasses)?p()(t.styleClasses,function(t){return r[t]=!0}):s()(t.styleClasses)&&(r[t.styleClasses]=!0),d()(t.type)||(r["field-"+t.type]=!0),"checkbox"===t.type&&(r["form-check"]=!0),r},fieldErrors:function(t){return this.errors.filter(function(e){return e.field===t}).map(function(t){return t.error})},fieldDisabled:function(t){return u()(t.disabled)?t.disabled.call(this,this.model,t,this):!d()(t.disabled)&&t.disabled},fieldReadonly:function(t){return u()(t.readonly)?t.readonly.call(this,this.model,t,this):!d()(t.readonly)&&t.readonly},fieldFeatured:function(t){return u()(t.featured)?t.featured.call(this,this.model,t,this):!d()(t.featured)&&t.featured},fieldRequired:function(t){return u()(t.required)?t.required.call(this,this.model,t,this):!d()(t.required)&&t.required}}}},function(t,e){function n(t){return null!=t&&"object"==typeof t}t.exports=n},function(t,e,n){"use strict";var r=n(47),i=n.n(r),o=n(6),u=n.n(o),a=n(15),s=n.n(a),c=n(8),l=n.n(c),f=n(19),d=n(71),h=n(81),p=n.n(h),v=n(308);e.a={name:"form-group",components:i()({},p.a,{formLabel:v.a}),mixins:[d.a],props:{vfg:{type:Object,required:!0},model:Object,options:{type:Object},field:{type:Object,required:!0},errors:{type:Array,default:function(){return[]}}},methods:{fieldTypeHasLabel:function(t){if(s()(t.label))return!1;switch("input"===t.type?t.inputType:t.type){case"button":case"submit":case"reset":return!1;default:return!0}},getFieldID:function(t){var e=l()(this.options,"fieldIdPrefix","");return Object(f.slugifyFormID)(t,e)},getFieldType:function(t){return"field-"+t.type},getButtonType:function(t){return l()(t,"type","button")},getButtonClass:function(t){return t.classes?t.classes:"btn btn-outline-primary"},onFieldValidated:function(t,e,n){this.$emit("validated",t,e,n)},buttonVisibility:function(t){return t.buttons&&t.buttons.length>0},buttonClickHandler:function(t,e,n){return t.onclick.call(this,this.model,e,n,this)},fieldHint:function(t){return u()(t.hint)?t.hint.call(this,this.model,t,this):t.hint},fieldErrors:function(t){return this.errors.filter(function(e){return e.field===t}).map(function(t){return t.error})},onModelUpdated:function(t,e){this.$emit("model-updated",t,e)},validate:function(t){return this.$refs.child.validate(t)},onVisibilityChanged:function(t){this.$emit("visibility-changed",t)},clearValidationErrors:function(){if(this.$refs.child)return this.$refs.child.clearValidationErrors()},labelFirst:function(t){return"checkbox"!==t.type}}}},function(t,e,n){function r(t,e,n,P,E,F){var $,N=e&k,L=e&C,R=e&S;if(n&&($=E?n(t,P,E,F):n(t)),void 0!==$)return $;if(!w(t))return t;var V=_(t);if(V){if($=m(t),!N)return l(t,$)}else{var z=v(t),U=z==T||z==I;if(b(t))return c(t,N);if(z==A||z==M||U&&!E){if($=L||U?{}:y(t),!N)return L?d(t,s($,t)):f(t,a($,t))}else{if(!D[z])return E?t:{};$=g(t,z,N)}}F||(F=new i);var Y=F.get(t);if(Y)return Y;if(F.set(t,$),O(t))return t.forEach(function(i){$.add(r(i,e,n,i,t,F))}),$;if(x(t))return t.forEach(function(i,o){$.set(o,r(i,e,n,o,t,F))}),$;var B=R?L?p:h:L?keysIn:j,q=V?void 0:B(t);return o(q||t,function(i,o){q&&(o=i,i=t[o]),u($,o,r(i,e,n,o,t,F))}),$}var i=n(174),o=n(66),u=n(49),a=n(182),s=n(183),c=n(184),l=n(185),f=n(186),d=n(188),h=n(190),p=n(191),v=n(78),m=n(192),g=n(193),y=n(194),_=n(2),b=n(80),x=n(197),w=n(7),O=n(198),j=n(26),k=1,C=2,S=4,M="[object Arguments]",T="[object Function]",I="[object GeneratorFunction]",A="[object Object]",D={};D[M]=D["[object Array]"]=D["[object ArrayBuffer]"]=D["[object DataView]"]=D["[object Boolean]"]=D["[object Date]"]=D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Map]"]=D["[object Number]"]=D[A]=D["[object RegExp]"]=D["[object Set]"]=D["[object String]"]=D["[object Symbol]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D["[object Error]"]=D[T]=D["[object WeakMap]"]=!1,t.exports=r},function(t,e,n){function r(t,e,n){"__proto__"==e&&i?i(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var i=n(180);t.exports=r},function(t,e){function n(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t){return i.call(t)}var r=Object.prototype,i=r.toString;t.exports=n},function(t,e){function n(){return!1}t.exports=n},function(t,e){function n(){return!1}t.exports=n},function(t,e,n){var r=n(203).forEach,i={},o=n(204);r(o.keys(),function(t){var e=t.replace(/^\.\//,"").replace(/\.vue/,"");i[e]=o(t).default});var u=n(264);r(u.keys(),function(t){var e=t.replace(/^\.\//,"").replace(/\.vue/,"");i[e]=u(t).default}),t.exports=i},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default]}},function(t,e){function n(t,e,n){for(var r=n-1,i=t.length;++r=e||n<0||C&&r>=b}function h(){var t=o();if(d(t))return p(t);w=setTimeout(h,f(t))}function p(t){return w=void 0,S&&y?r(t):(y=_=void 0,x)}function v(){void 0!==w&&clearTimeout(w),j=0,y=O=_=w=void 0}function m(){return void 0===w?x:p(o())}function g(){var t=o(),n=d(t);if(y=arguments,_=this,O=t,n){if(void 0===w)return l(O);if(C)return w=setTimeout(h,e),r(O)}return void 0===w&&(w=setTimeout(h,e)),x}var y,_,b,x,w,O,j=0,k=!1,C=!1,S=!0;if("function"!=typeof t)throw new TypeError(a);return e=u(e)||0,i(n)&&(k=!!n.leading,C="maxWait"in n,b=C?s(u(n.maxWait)||0,e):b,S="trailing"in n?!!n.trailing:S),g.cancel=v,g.flush=m,g}var i=n(7),o=n(216),u=n(85),a="Expected a function",s=Math.max,c=Math.min;t.exports=r},function(t,e,n){function r(t){if("number"==typeof t)return t;if(o(t))return u;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(a,"");var n=c.test(t);return n||l.test(t)?f(t.slice(2),n?2:8):s.test(t)?u:+t}var i=n(7),o=n(28),u=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,f=parseInt;t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:k;return b()(t)||""===t?e?[i(n.fieldIsRequired)]:[]:null}function i(t){if(null!=t&&arguments.length>1)for(var e=1;e3&&void 0!==arguments[3]?arguments[3]:k;return r(t,e.required,i)},number:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;var a=[];return s()(t)?(!b()(e.min)&&te.max&&a.push(i(o.numberTooBig,e.max))):a.push(i(o.invalidNumber)),a},integer:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;var a=C.number(t,e,n,o);return m()(t)||a.push(i(o.invalidInteger)),a},double:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);return null!=u?u:!y()(t)||isNaN(t)?[i(o.invalidNumber)]:void 0},string:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;var a=[];return p()(t)?(!b()(e.min)&&t.lengthe.max&&a.push(i(o.textTooBig,t.length,e.max))):a.push(i(o.thisNotText)),a},array:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k;if(e.required){if(!d()(t))return[i(r.thisNotArray)];if(0===t.length)return[i(r.fieldIsRequired)]}if(!b()(t)){if(!b()(e.min)&&t.lengthe.max)return[i(r.selectMaxItems,e.max)]}},date:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;var a=new Date(t);if(isNaN(a.getDate()))return[i(o.invalidDate)];var s=[];if(!b()(e.min)){var c=new Date(e.min);a.valueOf()l.valueOf()&&s.push(i(o.dateIsLate,j.a.format(a),j.a.format(l)))}return s},regexp:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;if(!b()(e.pattern)){if(!new RegExp(e.pattern).test(t))return[i(o.invalidFormat)]}},email:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);return null!=u?u:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)?void 0:[i(o.invalidEmail)]},url:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);return null!=u?u:/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,4}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g.test(t)?void 0:[i(o.invalidURL)]},creditCard:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);if(null!=u)return u;var a=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,s=t.replace(/[^0-9]+/g,"");if(!a.test(s))return[i(o.invalidCard)];for(var c=0,l=void 0,f=void 0,d=void 0,h=s.length-1;h>=0;h--)l=s.substring(h,h+1),f=parseInt(l,10),d?(f*=2,c+=f>=10?f%10+1:f):c+=f,d=!d;return c%10==0&&s?void 0:[i(o.invalidCardNumber)]},alpha:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);return null!=u?u:/^[a-zA-Z]*$/.test(t)?void 0:[i(o.invalidTextContainNumber)]},alphaNumeric:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k,u=r(t,e.required,o);return null!=u?u:/^[a-zA-Z0-9]*$/.test(t)?void 0:[i(o.invalidTextContainSpec)]}};u()(C).forEach(function(t){var e=C[t];l()(e)&&(e.locale=function(t){return function(n,r,i){return e(n,r,i,w()(t,k))}})}),e.default=C},function(t,e,n){function r(t){var e=i(t),n=e%1;return e===e?n?e-n:e:0}var i=n(223);t.exports=r},function(t,e,n){function r(t){return"number"==typeof t||o(t)&&i(t)==u}var i=n(45),o=n(72),u="[object Number]";t.exports=r},function(t,e,n){"use strict";var r=n(233),i=n.n(r),o=n(15),u=n.n(o),a=n(7),s=n.n(a),c=n(1),l=n(19);e.a={mixins:[c.default],data:function(){return{comboExpanded:!1}},computed:{items:function(){var t=this.schema.values;return"function"==typeof t?t.apply(this,[this.model,this.schema]):t},selectedCount:function(){return this.value?this.value.length:0}},methods:{getInputName:function(t){return this.schema&&this.schema.inputName&&this.schema.inputName.length>0?Object(l.slugify)(this.schema.inputName+"_"+this.getItemValue(t)):Object(l.slugify)(this.getItemValue(t))},getItemValue:function(t){if(s()(t)){if(void 0!==this.schema.checklistOptions&&void 0!==this.schema.checklistOptions.value)return t[this.schema.checklistOptions.value];if(void 0!==t.value)return t.value;throw"`value` is not defined. If you want to use another key name, add a `value` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values"}return t},getItemName:function(t){if(s()(t)){if(void 0!==this.schema.checklistOptions&&void 0!==this.schema.checklistOptions.name)return t[this.schema.checklistOptions.name];if(void 0!==t.name)return t.name;throw"`name` is not defined. If you want to use another key name, add a `name` property under `checklistOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/checklist.html#checklist-field-with-object-values"}return t},isItemChecked:function(t){return this.value&&-1!==this.value.indexOf(this.getItemValue(t))},onChanged:function(t,e){if(!u()(this.value)&&Array.isArray(this.value)||(this.value=[]),t.target.checked){var n=i()(this.value);n.push(this.getItemValue(e)),this.value=n}else{var r=i()(this.value);r.splice(this.value.indexOf(this.getItemValue(e)),1),this.value=r}},onExpandCombo:function(){this.comboExpanded=!this.comboExpanded}}}},function(t,e,n){"use strict";var r=n(18),i=n.n(r),o=n(88),u=n.n(o),a=n(6),s=n.n(a),c=n(8),l=n.n(c),f=n(84),d=n.n(f),h=n(1),p=n(50),v=n.n(p),m={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm:ss","datetime-local":"YYYY-MM-DDTHH:mm:ss"};e.a={mixins:[h.default],computed:{inputType:function(){return this.schema&&"datetime"===this.schema.inputType?"datetime-local":this.schema.inputType}},methods:{formatValueToModel:function(t){var e=this;if(null!=t)switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":case"number":case"range":return function(n,r){e.debouncedFormatFunc(t,r)}}return t},formatValueToField:function(t){switch(this.schema.inputType.toLowerCase()){case"date":case"datetime":case"datetime-local":return this.formatDatetimeValueToField(t)}return t},formatDatetimeToModel:function(t,e){var n=m[this.schema.inputType.toLowerCase()],r=v.a.parse(t,n);!1!==r&&(t=this.schema.format?v.a.format(r,this.schema.format):r.valueOf()),this.updateModelValue(t,e)},formatDatetimeValueToField:function(t){if(null===t||void 0===t)return null;var e=m[this.schema.inputType.toLowerCase()],n=t;return u()(t)||(n=v.a.parse(t,e)),!1!==n?v.a.format(n,e):t},formatNumberToModel:function(t,e){u()(t)||(t=NaN),this.updateModelValue(t,e)},onInput:function(t){var e=t.target.value;switch(e&&i()(e)&&(e=e.trim()),this.schema.inputType.toLowerCase()){case"number":case"range":u()(parseFloat(t.target.value))&&(e=parseFloat(t.target.value))}this.value=e},onBlur:function(){s()(this.debouncedFormatFunc)&&this.debouncedFormatFunc.flush(),this.onDataAccept()}},mounted:function(){var t=this;switch(this.schema.inputType.toLowerCase()){case"number":case"range":this.debouncedFormatFunc=d()(function(e,n){t.formatNumberToModel(e,n)},parseInt(l()(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1});break;case"date":case"datetime":case"datetime-local":this.debouncedFormatFunc=d()(function(e,n){t.formatDatetimeToModel(e,n)},parseInt(l()(this.schema,"debounceFormatTimeout",1e3)),{trailing:!0,leading:!1})}},created:function(){"file"===this.schema.inputType.toLowerCase()&&console.warn("The 'file' type in input field is deprecated. Use 'file' field instead."),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default]}},function(t,e,n){"use strict";var r=n(8),i=n.n(r),o=n(6),u=n.n(o),a=n(7),s=n.n(a),c=n(1);e.a={mixins:[c.default],computed:{items:function(){var t=this.schema.values;return"function"==typeof t?t.apply(this,[this.model,this.schema]):t},id:function(){return this.schema.model}},methods:{getRadioId:function(t){return this.getFieldID(this.schema)+"-"+t},getItemValue:function(t){if(s()(t)){if(void 0!==this.schema.radiosOptions&&void 0!==this.schema.radiosOptions.value)return t[this.schema.radiosOptions.value];if(void 0!==t.value)return t.value;throw"`value` is not defined. If you want to use another key name, add a `value` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values"}return t},getItemName:function(t){if(s()(t)){if(void 0!==this.schema.radiosOptions&&void 0!==this.schema.radiosOptions.name)return t[this.schema.radiosOptions.name];if(void 0!==t.name)return t.name;throw"`name` is not defined. If you want to use another key name, add a `name` property under `radiosOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/radios.html#radios-field-with-object-values"}return t},getItemCssClasses:function(t){return{"form-check-label":!0,"is-checked":this.isItemChecked(t),"is-disabled":this.isItemDisabled(t)}},onSelection:function(t){this.value=this.getItemValue(t)},isItemChecked:function(t){return this.getItemValue(t)===this.value},isItemDisabled:function(t){if(this.disabled)return!0;var e=i()(t,"disabled",!1);return u()(e)?e(this.model):e}}}},function(t,e,n){"use strict";var r=n(246),i=n.n(r),o=n(15),u=n.n(o),a=n(7),s=n.n(a),c=n(1);e.a={mixins:[c.default],computed:{selectOptions:function(){return this.schema.selectOptions||{}},items:function(){var t=this.schema.values;return"function"==typeof t?this.groupValues(t.apply(this,[this.model,this.schema])):this.groupValues(t)}},methods:{formatValueToField:function(t){return u()(t)?null:t},groupValues:function(t){var e=[],n={};return t.forEach(function(t){n=null,t.group&&s()(t)?(n=i()(e,function(e){return e.group===t.group}),n?n.ops.push({id:t.id,name:t.name}):(n={group:"",ops:[]},n.group=t.group,n.ops.push({id:t.id,name:t.name}),e.push(n))):e.push(t)}),e},getGroupName:function(t){if(t&&t.group)return t.group;throw"Group name is missing! https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items"},getItemValue:function(t){if(s()(t)){if(void 0!==this.schema.selectOptions&&void 0!==this.schema.selectOptions.value)return t[this.schema.selectOptions.value];if(void 0!==t.id)return t.id;throw"`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items"}return t},getItemName:function(t){if(s()(t)){if(void 0!==this.schema.selectOptions&&void 0!==this.schema.selectOptions.name)return t[this.schema.selectOptions.name];if(void 0!==t.name)return t.name;throw"`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items"}return t}}}},function(t,e){function n(t){return t}t.exports=n},function(t,e,n){"use strict";var r=n(253),i=n.n(r),o=n(6),u=n.n(o),a=n(8),s=n.n(a),c=n(1);e.a={mixins:[c.default],methods:{onClick:function(t){var e=this;if(!0===this.schema.validateBeforeSubmit){t.preventDefault();var n=s()(this.formOptions,"validateAsync",!1),r=this.vfg.validate(),o=function(r){n&&!i()(r)||!n&&!r?u()(e.schema.onValidationError)&&e.schema.onValidationError(e.model,e.schema,r,t):u()(e.schema.onSubmit)&&e.schema.onSubmit(e.model,e.schema,t)};r&&u()(r.then)?r.then(o):o(r)}else u()(this.schema.onSubmit)&&this.schema.onSubmit(this.model,this.schema,t)}}}},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default]}},function(t,e,n){"use strict";var r=n(6),i=n.n(r),o=n(1);e.a={mixins:[o.default],methods:{onChange:function(t){i()(this.schema.onChanged)&&this.schema.onChanged.call(this,this.model,this.schema,t,this)}}}},function(t,e,n){"use strict";var r=n(18),i=n.n(r),o=n(10),u=n.n(o),a=n(1);e.a={mixins:[a.default],data:function(){return{cleave:null}},mounted:function(){this.$nextTick(function(){var t=this;window.Cleave?(this.cleave=new window.Cleave(this.$el,u()(this.schema.cleaveOptions||{},{creditCard:!1,phone:!1,phoneRegionCode:"AU",date:!1,datePattern:["d","m","Y"],numeral:!1,numeralThousandsGroupStyle:"thousand",numeralDecimalScale:2,numeralDecimalMark:".",blocks:[],delimiter:" ",prefix:null,numericOnly:!1,uppercase:!1,lowercase:!1,maxLength:0})),this.cleave.properties&&this.cleave.properties.hasOwnProperty("result")?this.$watch("cleave.properties.result",function(){t.value=t.cleave.properties.result}):this.$el.addEventListener("input",this.inputChange)):console.warn("Cleave is missing. Please download from https://github.com/nosir/cleave.js/ and load the script in the HTML head section!")})},methods:{inputChange:function(){var t=this.$el.value;t&&i()(t)&&(t=t.trim()),this.value=t}},beforeDestroy:function(){this.cleave&&(this.cleave.destroy(),this.$el.removeEventListener("input",this.inputChange)),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(47),i=n.n(r),o=n(10),u=n.n(o),a=n(1),s=n(100);e.a={mixins:[a.default],methods:i()({getDateFormat:function(){return this.schema.dateTimePickerOptions&&this.schema.dateTimePickerOptions.format?this.schema.dateTimePickerOptions.format:"YYYY-MM-DD HH:mm:ss"}},s.a),mounted:function(){this.$nextTick(function(){var t=this;if(window.$&&window.$.fn.datetimepicker){var e=this.$el.querySelector(".form-control");$(this.$el).datetimepicker(u()(this.schema.dateTimePickerOptions||{},{format:"YYYY-MM-DD HH:mm:ss"})).on("dp.change",function(){t.value=e.value})}else console.warn("Bootstrap datetimepicker library is missing. Please download from https://eonasdan.github.io/bootstrap-datetimepicker/ and load the script and CSS in the HTML head section!")})},beforeDestroy:function(){window.$&&window.$.fn.datetimepicker&&$(this.$el).data("DateTimePicker").destroy(),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(50),i=n.n(r);e.a={formatValueToField:function(t){if(null!=t){var e=this.schema.format?i.a.parse(t,this.schema.format):new Date(t);return i.a.format(e,this.getDateFormat())}return t},formatValueToModel:function(t){if(null!=t){var e=i.a.parse(t,this.getDateFormat());t=this.schema.format?i.a.format(e,this.schema.format):e.valueOf()}return t}}},function(t,e,n){"use strict";var r=n(6),i=n.n(r),o=n(1);e.a={mixins:[o.default],data:function(){return{autocomplete:"",inputs:{street_number:"long_name",route:"long_name",country:"long_name",administrative_area_level_1:"long_name",administrative_area_level_2:"long_name",locality:"long_name",postal_code:"short_name"}}},mounted:function(){var t=this;this.$nextTick(function(){window.google&&window.google.maps&&window.google.maps.places&&window.google.maps.places.Autocomplete?(t.autocomplete=new google.maps.places.Autocomplete(t.$el,{types:["geocode"]}),t.autocomplete.addListener("place_changed",t.pipeAddress)):console.warn("Google Maps API is missing. Please add https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&libraries=places script in the HTML head section!")})},methods:{pipeAddress:function(){var t=this.autocomplete.getPlace();if(t){this.value=t.formatted_address;var e={};if(void 0!==t.address_components)for(var n=0;n":this.value},set:function(t){t&&0===t.indexOf("http")&&(this.value=t)}}},watch:{model:function(){var t=this.$el.querySelector("input.file");t&&(t.value="")}},methods:{remove:function(){this.value=""},fileChanged:function(t){var e=this,n=new FileReader;n.onload=function(t){e.value=t.target.result},t.target.files&&t.target.files.length>0&&n.readAsDataURL(t.target.files[0])}}}},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default],mounted:function(){this.$nextTick(function(){window.$&&window.$.fn.mask?$(this.$el).unmask().mask(this.schema.mask,this.schema.maskOptions):console.warn("JQuery MaskedInput library is missing. Please download from https://github.com/digitalBush/jquery.maskedinput and load the script in the HTML head section!")})},beforeDestroy:function(){window.$&&window.$.fn.mask&&$(this.$el).unmask(),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(10),i=n.n(r),o=n(2),u=n.n(o),a=n(1);e.a={mixins:[a.default],data:function(){return{slider:null}},watch:{model:function(){window.noUiSlider&&this.slider&&this.slider.noUiSlider&&this.slider.noUiSlider.set(this.value)}},computed:{containPips:function(){return this.schema.noUiSliderOptions&&void 0!==this.schema.noUiSliderOptions.pips},containTooltip:function(){return this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.tooltips}},methods:{onChange:function(t){u()(t)?this.value=[parseFloat(t[0]),parseFloat(t[1])]:this.value=parseFloat(t)},formatValueToField:function(t){null!==this.slider&&void 0!==this.slider.noUiSlider&&this.slider.noUiSlider.set(t)},formatValueToModel:function(t){if(void 0!==this.slider.noUiSlider)return t instanceof Array?[Number(t[0]),Number(t[1])]:Number(t)},getStartValue:function(){return null!=this.value?this.value:void 0!==this.schema.noUiSliderOptions&&this.schema.noUiSliderOptions.double?[this.schema.min,this.schema.min]:this.schema.min}},mounted:function(){var t=this;this.$nextTick(function(){window.noUiSlider?(t.slider=t.$el,window.noUiSlider.create(t.slider,i()(t.schema.noUiSliderOptions||{},{start:t.getStartValue(),range:{min:t.schema.min,max:t.schema.max}})),t.slider.noUiSlider.on("change",t.onChange.bind(t))):console.warn("noUiSlider is missing. Please download from https://github.com/leongersen/noUiSlider and load the script and CSS in the HTML head section!")})},beforeDestroy:function(){this.slider&&this.slider.noUiSlider.off("change"),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(47),i=n.n(r),o=n(8),u=n.n(o),a=n(10),s=n.n(a),c=n(1),l=n(100);e.a={mixins:[c.default],data:function(){return{picker:null,options:null}},methods:i()({getDateFormat:function(){return u()(this.schema,"pikadayOptions.format","YYYY-MM-DD")}},l.a,{initialize:function(t){var e=this;this.picker&&this.picker.destroy&&this.picker.destroy(),this.$nextTick(function(){window.Pikaday?(e.options=s()({},t,{field:e.$el,onSelect:function(){e.value=e.picker.toString()}}),e.picker=new window.Pikaday(e.options)):console.warn("Pikaday is missing. Please download from https://github.com/dbushell/Pikaday/ and load the script and CSS in the HTML head section!")})}}),mounted:function(){this.initialize(u()(this.schema,"pikadayOptions",{}))},beforeDestroy:function(){this.picker&&this.picker.destroy(),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(287),i=n.n(r),o=n(2),u=n.n(o),a=n(10),s=n.n(a),c=n(1);e.a={mixins:[c.default],data:function(){return{slider:null}},watch:{model:function(){if(window.$&&window.$.fn.ionRangeSlider){var t=void 0,e=void 0;if(u()(this.value)){var n=i()(this.value,2);t=n[0],e=n[1]}else t=this.value;this.slider&&this.slider.update({from:t,to:e})}}},mounted:function(){this.$nextTick(function(){if(window.$&&window.$.fn.ionRangeSlider){var t=void 0,e=void 0;if(u()(this.value)){var n=i()(this.value,2);t=n[0],e=n[1]}else t=this.value;var r=this;$(this.$el).ionRangeSlider(s()(this.schema.rangeSliderOptions||{},{type:"single",grid:!0,hide_min_max:!0,from:t,to:e,onChange:function(t){"double"===r.slider.options.type?r.value=[t.from,t.to]:r.value=t.from}})),this.slider=$(this.$el).data("ionRangeSlider")}else console.warn("ion.rangeSlider library is missing. Please download from https://github.com/IonDen/ion.rangeSlider and load the script and CSS in the HTML head section!")})},beforeDestroy:function(){this.slider&&this.slider.destroy(),this.visibilityChanged()}}},function(t,e,n){t.exports={default:n(291),__esModule:!0}},function(t,e,n){"use strict";var r=n(7),i=n.n(r),o=n(1);e.a={mixins:[o.default],computed:{items:function(){var t=this.schema.values;return"function"==typeof t?t.apply(this,[this.model,this.schema]):t}},methods:{getItemValue:function(t){if(i()(t)){if(void 0!==this.schema.selectOptions&&void 0!==this.schema.selectOptions.value)return t[this.schema.selectOptions.value];if(void 0!==t.id)return t.id;throw"`id` is not defined. If you want to use another key name, add a `value` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items"}return t},getItemName:function(t){if(i()(t)){if(void 0!==this.schema.selectOptions&&void 0!==this.schema.selectOptions.name)return t[this.schema.selectOptions.name];if(void 0!==t.name)return t.name;throw"`name` is not defined. If you want to use another key name, add a `name` property under `selectOptions` in the schema. https://icebob.gitbooks.io/vueformgenerator/content/fields/select.html#select-field-with-object-items"}return t}},watch:{model:function(){$.fn.selectpicker&&$(this.$el).selectpicker("refresh")}},mounted:function(){this.$nextTick(function(){$.fn.selectpicker?$(this.$el).selectpicker("destroy").selectpicker(this.schema.selectOptions):console.warn("Bootstrap-select library is missing. Please download from https://silviomoreto.github.io/bootstrap-select/ and load the script and CSS in the HTML head section!")})},beforeDestroy:function(){$.fn.selectpicker&&$(this.$el).selectpicker("destroy"),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(10),i=n.n(r),o=n(1);e.a={mixins:[o.default],data:function(){return{picker:null}},watch:{model:function(){window.$&&window.$.fn.spectrum&&this.picker.spectrum("set",this.value)},disabled:function(t){t?this.picker.spectrum("disable"):this.picker.spectrum("enable")}},mounted:function(){this.$nextTick(function(){var t=this;window.$&&window.$.fn.spectrum?(this.picker=$(this.$el).spectrum("destroy").spectrum(i()(this.schema.colorOptions||{},{showInput:!0,showAlpha:!0,disabled:this.schema.disabled,allowEmpty:!this.schema.required,preferredFormat:"hex",change:function(e){t.value=e?e.toString():null}})),this.picker.spectrum("set",this.value)):console.warn("Spectrum color library is missing. Please download from http://bgrins.github.io/spectrum/ and load the script and CSS in the HTML head section!")})},beforeDestroy:function(){this.picker&&this.picker.spectrum("destroy"),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(107),i=n.n(r),o=n(10),u=n.n(o),a=n(1);e.a={mixins:[a.default],computed:{mapLink:function(){if(this.value){var t=void 0,e=void 0,n=u()(this.schema.staticMapOptions||{},{lat:"lat",lng:"lng",zoom:8,sizeX:640,sizeY:640});t=this.value[n.lat],e=this.value[n.lng];var r="http://maps.googleapis.com/maps/api/staticmap?center="+t+","+e+"&zoom="+n.zoom+"&size="+n.sizeX+"x"+n.sizeY,o=["scale","format","maptype","language","region","markers","path","visible","style","key","signature"],a=!0,s=!1,c=void 0;try{for(var l,f=i()(o);!(a=(l=f.next()).done);a=!0){var d=l.value;void 0!==n[d]&&(r+="&"+d+"="+n[d])}}catch(t){s=!0,c=t}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}if(t&&e)return r}return""}}}},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default],methods:{formatValueToField:function(t){return null!=t&&this.schema.valueOn?t===this.schema.valueOn:t},formatValueToModel:function(t){return null!=t&&this.schema.valueOn?t?this.schema.valueOn:this.schema.valueOff:t}}}},function(t,e,n){"use strict";var r=n(1);e.a={mixins:[r.default],computed:{selectOptions:function(){return this.schema.selectOptions||{}},options:function(){var t=this.schema.values;return"function"==typeof t?t.apply(this,[this.model,this.schema]):t},customLabel:function(){return void 0!==this.schema.selectOptions&&void 0!==this.schema.selectOptions.customLabel&&"function"==typeof this.schema.selectOptions.customLabel?this.schema.selectOptions.customLabel:void 0}},methods:{updateSelected:function(t){this.value=t},addTag:function(t,e){var n=this.selectOptions.onNewTag;"function"==typeof n&&n(t,e,this.options,this.value)},onSearchChange:function(t,e){var n=this.selectOptions.onSearch;"function"==typeof n&&n(t,e,this.options)},onSelect:function(){},onRemove:function(){},onOpen:function(){},onClose:function(){this.onDataAccept()}},created:function(){this.$root.$options.components.multiselect||console.error("'vue-multiselect' is missing. Please download from https://github.com/monterail/vue-multiselect and register the component globally!"),this.visibilityChanged()}}},function(t,e,n){"use strict";var r=n(2),i=n.n(r);e.a={name:"formLabel",props:{field:Object,fieldId:String},computed:{labelClass:function(){var t=[];return i()(this.field.labelClasses)?t=t.concat(this.field.labelClasses):t.push(this.field.labelClasses),"checkbox"===this.field.type&&t.push("form-check-label"),t}}}},function(t,e,n){var r=n(115).default,i=n(19),o=n(86).default,u=n(81).default,a=n(1).default,s=function(e,n){if(e.component("VueFormGenerator",t.exports.component),n&&n.validators)for(var r in n.validators)({}).hasOwnProperty.call(n.validators,r)&&(o[r]=n.validators[r])};t.exports={component:r,schema:i,validators:o,abstractField:a,fieldComponents:u,install:s}},function(t,e,n){"use strict";function r(t){n(116)}Object.defineProperty(e,"__esModule",{value:!0});var i=n(51),o=n(312),u=n(0),a=r,s=Object(u.a)(i.a,o.a,o.b,!1,a,null,null);e.default=s.exports},function(t,e){},function(t,e,n){n(118),n(32),n(42),n(133),n(144),n(145),t.exports=n(3).Promise},function(t,e){},function(t,e,n){var r=n(33),i=n(34);t.exports=function(t){return function(e,n){var o,u,a=String(i(e)),s=r(n),c=a.length;return s<0||s>=c?t?"":void 0:(o=a.charCodeAt(s),o<55296||o>56319||s+1===c||(u=a.charCodeAt(s+1))<56320||u>57343?t?a.charAt(s):o:t?a.slice(s,s+2):u-56320+(o-55296<<10)+65536)}}},function(t,e,n){t.exports=!n(12)&&!n(22)(function(){return 7!=Object.defineProperty(n(36)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(17);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=n(13)},function(t,e,n){"use strict";var r=n(124),i=n(54),o=n(40),u={};n(13)(u,n(5)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(u,{next:i(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var r=n(9),i=n(125),o=n(59),u=n(39)("IE_PROTO"),a=function(){},s=function(){var t,e=n(36)("iframe"),r=o.length;for(e.style.display="none",n(60).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("