diff --git a/dist/formulate.esm.js b/dist/formulate.esm.js index 512e0fa..d31df2d 100644 --- a/dist/formulate.esm.js +++ b/dist/formulate.esm.js @@ -1 +1 @@ -import t from"is-url";import e from"nanoid";import n from"is-plain-object";var r={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},o=function(t,e,n){this.input=t,this.fileList=t.files,this.files=[],this.options=n,this.addFileList(this.fileList),this.context=e};function i(t,e){var n={};for(var r in t)n[r]=e(r,t[r]);return n}function a(t,e){if(t===e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e),o=n.length;if(r.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},o.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},o.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},o.prototype.getFileList=function(){return this.fileList},o.prototype.getFiles=function(){return this.files},o.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var d={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&o>r)},alpha:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},alphanumeric:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},before:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&oe&&r.lengthe&&r()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?a(t,e):t===e})))},matches:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(!!n.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,n){var r=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length<=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))<=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length<=e)},mime:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(function(){if(e instanceof o)for(var t=e.getFileList(),r=0;r=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))>=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length>=e)},not:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?a(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var n=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(n)?!n.length:"string"==typeof n?!n:!("object"!=typeof n||n&&Object.keys(n).length))))},url:function(e){var n=e.value;return Promise.resolve(t(n))}},p={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?l(e)+" must be after "+n[0]+".":l(e)+" must be a later date."},alpha:function(t){return l(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return l(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?l(e)+" must be before "+n[0]+".":l(e)+" must be an earlier date."},between:function(t){var e=t.name,n=t.value,r=t.args;return isNaN(n)?l(e)+" must be between "+r[0]+" and "+r[1]+" characters long.":l(e)+" must be between "+r[0]+" and "+r[1]+"."},confirm:function(t){var e=t.name;t.args;return l(e)+" does not match."},date:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?l(e)+" is not a valid, please use the format "+n[0]:l(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,n=t.value;return"string"==typeof n&&n?"“"+l(n)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return l(t.name)+" is not an allowed value."},max:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You may only select "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?l(e)+" must be less than "+r[0]+".":l(e)+" must be less than "+r[0]+" characters long."},mime:function(t){var e=t.name,n=t.args;return l(e)+" must be of the the type: "+(n[0]||"No file formats allowed.")},min:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You must select at least "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?l(e)+" must be more than "+r[0]+".":l(e)+" must be more than "+r[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return l(t.name)+" must be a number."},required:function(t){return l(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function m(t,e,n,r){return new Promise((function(n,o){var i=(r.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var r=performance.now()-a,o=Math.min(100,Math.round(r/i*100));if(e(o),o>=100)return n({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var f={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:v.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:h.call(this,this.options),optionGroups:!!this.optionGroups&&i(this.optionGroups,(function(e,n){return h.call(t,n)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:h.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return s(this.errors).concat(s(this.error)).concat(s(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function h(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var n=[];for(var r in t)n.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return n}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||e(9)}]:t}function v(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:y.bind(this),set:b.bind(this)})}function y(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function b(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function g(t,e,n,r,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),r&&(d._scopeId=r),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var m=d.beforeCreate;d.beforeCreate=m?[].concat(m,c):[c]}return n}var w={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:e(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},f,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||a(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!a(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){a(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=u(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var n=e[0],r=e[1],o=n.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(r));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(n,r)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,n="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[n])switch(typeof this.validationMessages[n]){case"function":return this.validationMessages[n];case"string":return function(){return e.validationMessages[n]}}return function(n){return e.$formulate.validationMessage(t.name,n)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},F=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[n("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[n(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?n("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?n("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};F._withStripped=!0;var _=g({render:F,staticRenderFns:[]},void 0,w,void 0,!1,void 0,!1,void 0,void 0,void 0),P=function(t){this.form=t};P.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},P.prototype.values=function(){var t=this;return new Promise((function(e,n){var r=[],i=function t(e){var n={};for(var r in e)e[r]instanceof o||c(e[r])?n[r]=e[r]:n[r]=t(e[r]);return n}(t.form.internalFormModelProxy);for(var a in i)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof o&&r.push(t.form.internalFormModelProxy[a].upload());Promise.all(r).then((function(){return e(i)})).catch((function(t){return n(t)}))}))};var A={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var n in t)!this.registry.hasOwnProperty(n)||a(t[n],this.internalFormModelProxy[n])||a(t[n],this.registry[n].internalModelProxy[n])||(this.setFieldValue(n,t[n]),this.registry[n].context.model=t[n])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var n;Object.assign(this.internalFormModelProxy,((n={})[t]=e,n)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!n&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!n&&!r||a(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new P(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},V=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};V._withStripped=!0;var N=g({render:V,staticRenderFns:[]},void 0,A,void 0,!1,void 0,!1,void 0,void 0,void 0),$={props:{errors:{type:[Boolean,Array],required:!0}}},E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.errors.length?n("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return n("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};E._withStripped=!0;var O=g({render:E,staticRenderFns:[]},void 0,$,void 0,!1,void 0,!1,void 0,void 0,void 0);var S={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,n=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(n,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},I=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return n(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};I._withStripped=!0;var C=g({render:I,staticRenderFns:[]},void 0,S,void 0,!1,void 0,!1,void 0,void 0,void 0),j={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},D={name:"FormulateInputBox",mixins:[j]},k=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t.context.value,a=t._i(n,i);r.checked?a<0&&t.$set(t.context,"model",n.concat([i])):a>-1&&t.$set(t.context,"model",n.slice(0,a).concat(n.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),n("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};k._withStripped=!0;var B=g({render:k,staticRenderFns:[]},void 0,D,void 0,!1,void 0,!1,void 0,void 0,void 0),M={name:"FormulateInputText",mixins:[j]},T=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};T._withStripped=!0;var U=g({render:T,staticRenderFns:[]},void 0,M,void 0,!1,void 0,!1,void 0,void 0,void 0),R={name:"FormulateFiles",props:{files:{type:o,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},L=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.fileUploads.length?n("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return n("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[n("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?n("div",{staticClass:"formulate-file-image-preview"},[n("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),n("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?n("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[n("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?n("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?n("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};L._withStripped=!0;var H={name:"FormulateInputFile",components:{FormulateFiles:g({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[j],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof o&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof o&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[n("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[n("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?n("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};q._withStripped=!0;var G=g({render:q,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),Y={name:"FormulateInputButton",mixins:[j]},W=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[n("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};W._withStripped=!0;var z=g({render:W,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={name:"FormulateInputSelect",mixins:[j],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},J=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?n:n[0])}}},"select",t.attributes,!1),[t.context.placeholder?n("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,r){return n("optgroup",{key:r,attrs:{label:r}},t._l(e,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};J._withStripped=!0;var X=g({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),K={name:"FormulateInputSlider",mixins:[j]},Q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?n("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Q._withStripped=!0;var tt=g({render:Q,staticRenderFns:[]},void 0,K,void 0,!1,void 0,!1,void 0,void 0,void 0),et={name:"FormulateInputTextArea",mixins:[j]},nt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[n("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};nt._withStripped=!0;var rt=g({render:nt,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),ot=function(){this.defaults={components:{FormulateForm:N,FormulateInput:_,FormulateInputErrors:O,FormulateInputBox:B,FormulateInputText:U,FormulateInputFile:G,FormulateInputGroup:C,FormulateInputButton:z,FormulateInputSelect:X,FormulateInputSlider:tt,FormulateInputTextArea:rt},library:r,rules:d,locale:"en",uploader:m,uploadJustCompleteDuration:1e3,locales:{en:p}}};ot.prototype.install=function(t,e){for(var n in t.prototype.$formulate=this,this.options=this.extend(this.defaults,e||{}),this.options.components)t.component(n,this.options.components[n]);Object.freeze(this)},ot.prototype.extend=function(t,e){var r={};for(var o in t)e.hasOwnProperty(o)?r[o]=n(e[o])&&n(t[o])?this.extend(t[o],e[o]):e[o]:r[o]=t[o];for(var i in e)r.hasOwnProperty(i)||(r[i]=e[i]);return r},ot.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},ot.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},ot.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},ot.prototype.validationMessage=function(t,e){var n=this.options.locales[this.options.locale];return n.hasOwnProperty(t)?n[t](e):"_"===t[0]&&n.hasOwnProperty(t.substr(1))?n[t.substr(1)](e):n.hasOwnProperty("default")?n.default(e):"This field does not have a valid value"},ot.prototype.getUploader=function(){return this.options.uploader||!1},ot.prototype.createUpload=function(t,e){return new o(t,e,this.options)};var it=new ot;export default it;export{o as FileUpload}; +import t from"is-url";import e from"nanoid";import r from"is-plain-object";var n={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},o=function(t,e,r){this.input=t,this.fileList=t.files,this.files=[],this.options=r,this.addFileList(this.fileList),this.context=e};function i(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function a(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),n=Object.keys(e),o=r.length;if(n.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},o.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},o.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},o.prototype.getFileList=function(){return this.fileList},o.prototype.getFiles=function(){return this.files},o.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var d={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&o>n)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&oe&&n.lengthe&&n()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?a(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},mime:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(function(){if(e instanceof o)for(var t=e.getFileList(),n=0;n=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},not:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?a(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(r)?!r.length:"string"==typeof r?!r:!("object"!=typeof r||r&&Object.keys(r).length))))},url:function(e){var r=e.value;return Promise.resolve(t(r))}},p={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?l(e)+" must be after "+r[0]+".":l(e)+" must be a later date."},alpha:function(t){return l(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return l(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?l(e)+" must be before "+r[0]+".":l(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,n=t.args;return isNaN(r)?l(e)+" must be between "+n[0]+" and "+n[1]+" characters long.":l(e)+" must be between "+n[0]+" and "+n[1]+"."},confirm:function(t){var e=t.name;t.args;return l(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?l(e)+" is not a valid, please use the format "+r[0]:l(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+l(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return l(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You may only select "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?l(e)+" must be less than "+n[0]+".":l(e)+" must be less than "+n[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return l(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You must select at least "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?l(e)+" must be more than "+n[0]+".":l(e)+" must be more than "+n[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return l(t.name)+" must be a number."},required:function(t){return l(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function m(t,e,r,n){return new Promise((function(r,o){var i=(n.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var n=performance.now()-a,o=Math.min(100,Math.round(n/i*100));if(e(o),o>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var f={context:function(){return y.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:v.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:h.call(this,this.options),optionGroups:!!this.optionGroups&&i(this.optionGroups,(function(e,r){return h.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:h.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return s(this.errors).concat(s(this.error)).concat(s(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function h(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var r=[];for(var n in t)r.push({value:n,label:t[n],id:this.elementAttributes.id+"_"+n});return r}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||e(9)}]:t}function v(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function y(t){return Object.defineProperty(t,"model",{get:x.bind(this),set:b.bind(this)})}function x(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function b(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function g(t,e,r,n,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),n&&(d._scopeId=n),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var m=d.beforeCreate;d.beforeCreate=m?[].concat(m,c):[c]}return r}var w={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:e(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},f,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||a(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!a(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){a(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=u(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],n=e[1],o=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(n));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(r,n)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,r="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[r])switch(typeof this.validationMessages[r]){case"function":return this.validationMessages[r];case"string":return function(){return e.validationMessages[r]}}return function(r){return e.$formulate.validationMessage(t.name,r)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},F=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?r("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?r("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};F._withStripped=!0;var _=g({render:F,staticRenderFns:[]},void 0,w,void 0,!1,void 0,!1,void 0,void 0,void 0),P=function(t){this.form=t};P.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},P.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],i=function t(e){var r={};for(var n in e)e[n]instanceof o||c(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.internalFormModelProxy);for(var a in i)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof o&&n.push(t.form.internalFormModelProxy[a].upload());Promise.all(n).then((function(){return e(i)})).catch((function(t){return r(t)}))}))};var A={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.hasOwnProperty(r)||a(t[r],this.internalFormModelProxy[r])||a(t[r],this.registry[r].internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry[r].context.model=t[r])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var r;Object.assign(this.internalFormModelProxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!r&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!r&&!n||a(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new P(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},V=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};V._withStripped=!0;var N=g({render:V,staticRenderFns:[]},void 0,A,void 0,!1,void 0,!1,void 0,void 0,void 0),$={props:{errors:{type:[Boolean,Array],required:!0}}},E=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.errors.length?r("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return r("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};E._withStripped=!0;var O=g({render:E,staticRenderFns:[]},void 0,$,void 0,!1,void 0,!1,void 0,void 0,void 0);var S={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(r,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},I=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return r(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};I._withStripped=!0;var C=g({render:I,staticRenderFns:[]},void 0,S,void 0,!1,void 0,!1,void 0,void 0,void 0),j={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},D={name:"FormulateInputBox",mixins:[j]},k=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t.context.value,a=t._i(r,i);n.checked?a<0&&t.$set(t.context,"model",r.concat([i])):a>-1&&t.$set(t.context,"model",r.slice(0,a).concat(r.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};k._withStripped=!0;var B=g({render:k,staticRenderFns:[]},void 0,D,void 0,!1,void 0,!1,void 0,void 0,void 0),M={name:"FormulateInputText",mixins:[j]},T=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};T._withStripped=!0;var U=g({render:T,staticRenderFns:[]},void 0,M,void 0,!1,void 0,!1,void 0,void 0,void 0),R={name:"FormulateFiles",props:{files:{type:o,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},L=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};L._withStripped=!0;var H={name:"FormulateInputFile",components:{FormulateFiles:g({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[j],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof o&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof o&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},q=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};q._withStripped=!0;var G=g({render:q,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),Y={name:"FormulateInputButton",mixins:[j]},W=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[r("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};W._withStripped=!0;var z=g({render:W,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),Z={name:"FormulateInputSelect",mixins:[j],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},J=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?r:r[0])}}},"select",t.attributes,!1),[t.context.placeholder?r("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,n){return r("optgroup",{key:n,attrs:{label:n}},t._l(e,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};J._withStripped=!0;var X=g({render:J,staticRenderFns:[]},void 0,Z,void 0,!1,void 0,!1,void 0,void 0,void 0),K={name:"FormulateInputSlider",mixins:[j]},Q=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};Q._withStripped=!0;var tt=g({render:Q,staticRenderFns:[]},void 0,K,void 0,!1,void 0,!1,void 0,void 0,void 0),et={name:"FormulateInputTextArea",mixins:[j]},rt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};rt._withStripped=!0;var nt=g({render:rt,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),ot=function(){this.options={},this.defaults={components:{FormulateForm:N,FormulateInput:_,FormulateInputErrors:O,FormulateInputBox:B,FormulateInputText:U,FormulateInputFile:G,FormulateInputGroup:C,FormulateInputButton:z,FormulateInputSelect:X,FormulateInputSlider:tt,FormulateInputTextArea:nt},library:n,rules:d,locale:"en",uploader:m,uploadJustCompleteDuration:1e3,plugins:[],locales:{en:p}}};ot.prototype.install=function(t,e){var r=this;for(var n in t.prototype.$formulate=this,this.options=this.merge(this.defaults,e||{}),Array.isArray(this.options.plugins)&&this.options.plugins.length&&this.options.plugins.forEach((function(t){return"function"==typeof t?t(r):null})),this.options.components)t.component(n,this.options.components[n])},ot.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},ot.prototype.merge=function(t,e,n){void 0===n&&(n=!0);var o={};for(var i in t)e.hasOwnProperty(i)?r(e[i])&&r(t[i])?o[i]=this.merge(t[i],e[i],n):n&&Array.isArray(t[i])&&Array.isArray(e[i])?o[i]=t[i].concat(e[i]):o[i]=e[i]:o[i]=t[i];for(var a in e)o.hasOwnProperty(a)||(o[a]=e[a]);return o},ot.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},ot.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},ot.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},ot.prototype.validationMessage=function(t,e){var r=this.options.locales[this.options.locale];return r.hasOwnProperty(t)?r[t](e):"_"===t[0]&&r.hasOwnProperty(t.substr(1))?r[t.substr(1)](e):r.hasOwnProperty("default")?r.default(e):"This field does not have a valid value"},ot.prototype.getUploader=function(){return this.options.uploader||!1},ot.prototype.createUpload=function(t,e){return new o(t,e,this.options)};var it=new ot;export default it;export{o as FileUpload}; diff --git a/dist/formulate.min.js b/dist/formulate.min.js index c570ae9..f95abd5 100644 --- a/dist/formulate.min.js +++ b/dist/formulate.min.js @@ -1 +1 @@ -var Formulate=function(t,e,n,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n,r=r&&r.hasOwnProperty("default")?r.default:r;var o={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},i=function(t,e,n){this.input=t,this.fileList=t.files,this.files=[],this.options=n,this.addFileList(this.fileList),this.context=e};function a(t,e){var n={};for(var r in t)n[r]=e(r,t[r]);return n}function s(t,e){if(t===e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e),o=n.length;if(r.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},i.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},i.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},i.prototype.getFileList=function(){return this.fileList},i.prototype.getFiles=function(){return this.files},i.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var p={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&o>r)},alpha:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},alphanumeric:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},before:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&oe&&r.lengthe&&r()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},matches:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(!!n.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,n){var r=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length<=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))<=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length<=e)},mime:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(function(){if(e instanceof i)for(var t=e.getFileList(),r=0;r=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))>=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length>=e)},not:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var n=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(n)?!n.length:"string"==typeof n?!n:!("object"!=typeof n||n&&Object.keys(n).length))))},url:function(t){var n=t.value;return Promise.resolve(e(n))}},m={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be after "+n[0]+".":u(e)+" must be a later date."},alpha:function(t){return u(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return u(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be before "+n[0]+".":u(e)+" must be an earlier date."},between:function(t){var e=t.name,n=t.value,r=t.args;return isNaN(n)?u(e)+" must be between "+r[0]+" and "+r[1]+" characters long.":u(e)+" must be between "+r[0]+" and "+r[1]+"."},confirm:function(t){var e=t.name;t.args;return u(e)+" does not match."},date:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" is not a valid, please use the format "+n[0]:u(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,n=t.value;return"string"==typeof n&&n?"“"+u(n)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return u(t.name)+" is not an allowed value."},max:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You may only select "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be less than "+r[0]+".":u(e)+" must be less than "+r[0]+" characters long."},mime:function(t){var e=t.name,n=t.args;return u(e)+" must be of the the type: "+(n[0]||"No file formats allowed.")},min:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You must select at least "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be more than "+r[0]+".":u(e)+" must be more than "+r[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return u(t.name)+" must be a number."},required:function(t){return u(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function f(t,e,n,r){return new Promise((function(n,o){var i=(r.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var r=performance.now()-a,o=Math.min(100,Math.round(r/i*100));if(e(o),o>=100)return n({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var h={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:y.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:v.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,n){return v.call(t,n)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:v.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return l(this.errors).concat(l(this.error)).concat(l(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function v(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||n(9)}]:t}function y(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:b.bind(this),set:g.bind(this)})}function b(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function g(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function w(t,e,n,r,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),r&&(d._scopeId=r),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var m=d.beforeCreate;d.beforeCreate=m?[].concat(m,c):[c]}return n}var F={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:n(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},h,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||s(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!s(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){s(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=c(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var n=e[0],r=e[1],o=n.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(r));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(n,r)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,n="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[n])switch(typeof this.validationMessages[n]){case"function":return this.validationMessages[n];case"string":return function(){return e.validationMessages[n]}}return function(n){return e.$formulate.validationMessage(t.name,n)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},_=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[n("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[n(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?n("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?n("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};_._withStripped=!0;var P=w({render:_,staticRenderFns:[]},void 0,F,void 0,!1,void 0,!1,void 0,void 0,void 0),A=function(t){this.form=t};A.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},A.prototype.values=function(){var t=this;return new Promise((function(e,n){var r=[],o=function t(e){var n={};for(var r in e)e[r]instanceof i||d(e[r])?n[r]=e[r]:n[r]=t(e[r]);return n}(t.form.internalFormModelProxy);for(var a in o)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof i&&r.push(t.form.internalFormModelProxy[a].upload());Promise.all(r).then((function(){return e(o)})).catch((function(t){return n(t)}))}))};var V={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var n in t)!this.registry.hasOwnProperty(n)||s(t[n],this.internalFormModelProxy[n])||s(t[n],this.registry[n].internalModelProxy[n])||(this.setFieldValue(n,t[n]),this.registry[n].context.model=t[n])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var n;Object.assign(this.internalFormModelProxy,((n={})[t]=e,n)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!n&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!n&&!r||s(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new A(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},N=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};N._withStripped=!0;var $=w({render:N,staticRenderFns:[]},void 0,V,void 0,!1,void 0,!1,void 0,void 0,void 0),O={props:{errors:{type:[Boolean,Array],required:!0}}},E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.errors.length?n("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return n("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};E._withStripped=!0;var S=w({render:E,staticRenderFns:[]},void 0,O,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,n=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(n,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return n(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};C._withStripped=!0;var j=w({render:C,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),D={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},k={name:"FormulateInputBox",mixins:[D]},B=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t.context.value,a=t._i(n,i);r.checked?a<0&&t.$set(t.context,"model",n.concat([i])):a>-1&&t.$set(t.context,"model",n.slice(0,a).concat(n.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),n("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};B._withStripped=!0;var M=w({render:B,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),T={name:"FormulateInputText",mixins:[D]},U=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};U._withStripped=!0;var R=w({render:U,staticRenderFns:[]},void 0,T,void 0,!1,void 0,!1,void 0,void 0,void 0),L={name:"FormulateFiles",props:{files:{type:i,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},H=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.fileUploads.length?n("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return n("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[n("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?n("div",{staticClass:"formulate-file-image-preview"},[n("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),n("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?n("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[n("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?n("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?n("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};H._withStripped=!0;var q={name:"FormulateInputFile",components:{FormulateFiles:w({render:H,staticRenderFns:[]},void 0,L,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[D],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof i&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof i&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},G=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[n("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[n("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?n("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};G._withStripped=!0;var Y=w({render:G,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateInputButton",mixins:[D]},z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[n("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};z._withStripped=!0;var Z=w({render:z,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),J={name:"FormulateInputSelect",mixins:[D],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},X=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?n:n[0])}}},"select",t.attributes,!1),[t.context.placeholder?n("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,r){return n("optgroup",{key:r,attrs:{label:r}},t._l(e,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};X._withStripped=!0;var K=w({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSlider",mixins:[D]},tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?n("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};tt._withStripped=!0;var et=w({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputTextArea",mixins:[D]},rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[n("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};rt._withStripped=!0;var ot=w({render:rt,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),it=function(){this.defaults={components:{FormulateForm:$,FormulateInput:P,FormulateInputErrors:S,FormulateInputBox:M,FormulateInputText:R,FormulateInputFile:Y,FormulateInputGroup:j,FormulateInputButton:Z,FormulateInputSelect:K,FormulateInputSlider:et,FormulateInputTextArea:ot},library:o,rules:p,locale:"en",uploader:f,uploadJustCompleteDuration:1e3,locales:{en:m}}};it.prototype.install=function(t,e){for(var n in t.prototype.$formulate=this,this.options=this.extend(this.defaults,e||{}),this.options.components)t.component(n,this.options.components[n]);Object.freeze(this)},it.prototype.extend=function(t,e){var n={};for(var o in t)e.hasOwnProperty(o)?n[o]=r(e[o])&&r(t[o])?this.extend(t[o],e[o]):e[o]:n[o]=t[o];for(var i in e)n.hasOwnProperty(i)||(n[i]=e[i]);return n},it.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},it.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},it.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},it.prototype.validationMessage=function(t,e){var n=this.options.locales[this.options.locale];return n.hasOwnProperty(t)?n[t](e):"_"===t[0]&&n.hasOwnProperty(t.substr(1))?n[t.substr(1)](e):n.hasOwnProperty("default")?n.default(e):"This field does not have a valid value"},it.prototype.getUploader=function(){return this.options.uploader||!1},it.prototype.createUpload=function(t,e){return new i(t,e,this.options)};var at=new it;return t.FileUpload=i,t.default=at,t}({},isUrl,nanoid,isPlainObject); +var Formulate=function(t,e,r,n){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,r=r&&r.hasOwnProperty("default")?r.default:r,n=n&&n.hasOwnProperty("default")?n.default:n;var o={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},i=function(t,e,r){this.input=t,this.fileList=t.files,this.files=[],this.options=r,this.addFileList(this.fileList),this.context=e};function a(t,e){var r={};for(var n in t)r[n]=e(n,t[n]);return r}function s(t,e){if(t===e)return!0;if(!t||!e)return!1;var r=Object.keys(t),n=Object.keys(e),o=r.length;if(n.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},i.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},i.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},i.prototype.getFileList=function(){return this.fileList},i.prototype.getFiles=function(){return this.files},i.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var p={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&o>n)},alpha:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},alphanumeric:function(t,e){var r=t.value;void 0===e&&(e="default");var n={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=n.hasOwnProperty(e)?e:"default";return Promise.resolve(n[o].test(r))},before:function(t,e){var r=t.value;void 0===e&&(e=!1);var n=Date.parse(e||new Date),o=Date.parse(r);return Promise.resolve(!isNaN(o)&&oe&&n.lengthe&&n()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0!==r.find((function(t){return"object"==typeof t?s(t,e):t===e})))},matches:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(!!r.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,r){var n=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(n)?(e=isNaN(e)?e:Number(e),n.length<=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))<=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length<=e)},mime:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(function(){if(e instanceof i)for(var t=e.getFileList(),n=0;n=e):!isNaN(n)&&"length"!==r||"value"===r?(n=isNaN(n)?n:Number(n))>=e:("string"==typeof n||"length"===r)&&(n=isNaN(n)?n:n.toString()).length>=e)},not:function(t){for(var e=t.value,r=[],n=arguments.length-1;n-- >0;)r[n]=arguments[n+1];return Promise.resolve(void 0===r.find((function(t){return"object"==typeof t?s(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var r=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(r)?!r.length:"string"==typeof r?!r:!("object"!=typeof r||r&&Object.keys(r).length))))},url:function(t){var r=t.value;return Promise.resolve(e(r))}},m={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?u(e)+" must be after "+r[0]+".":u(e)+" must be a later date."},alpha:function(t){return u(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return u(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?u(e)+" must be before "+r[0]+".":u(e)+" must be an earlier date."},between:function(t){var e=t.name,r=t.value,n=t.args;return isNaN(r)?u(e)+" must be between "+n[0]+" and "+n[1]+" characters long.":u(e)+" must be between "+n[0]+" and "+n[1]+"."},confirm:function(t){var e=t.name;t.args;return u(e)+" does not match."},date:function(t){var e=t.name,r=t.args;return Array.isArray(r)&&r.length?u(e)+" is not a valid, please use the format "+r[0]:u(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,r=t.value;return"string"==typeof r&&r?"“"+u(r)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return u(t.name)+" is not an allowed value."},max:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You may only select "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?u(e)+" must be less than "+n[0]+".":u(e)+" must be less than "+n[0]+" characters long."},mime:function(t){var e=t.name,r=t.args;return u(e)+" must be of the the type: "+(r[0]||"No file formats allowed.")},min:function(t){var e=t.name,r=t.value,n=t.args;if(Array.isArray(r))return"You must select at least "+n[0]+" "+e+".";var o=!(!Array.isArray(n)||!n[1])&&n[1];return!isNaN(r)&&"length"!==o||"value"===o?u(e)+" must be more than "+n[0]+".":u(e)+" must be more than "+n[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return u(t.name)+" must be a number."},required:function(t){return u(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function f(t,e,r,n){return new Promise((function(r,o){var i=(n.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var n=performance.now()-a,o=Math.min(100,Math.round(n/i*100));if(e(o),o>=100)return r({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var h={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:y.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:v.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,r){return v.call(t,r)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:v.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return l(this.errors).concat(l(this.error)).concat(l(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function v(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var n in t)e.push({value:n,label:t[n],id:this.elementAttributes.id+"_"+n});return e}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||r(9)}]:t}function y(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:b.bind(this),set:g.bind(this)})}function b(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function g(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function w(t,e,r,n,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof r?r.options:r;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),n&&(d._scopeId=n),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var m=d.beforeCreate;d.beforeCreate=m?[].concat(m,c):[c]}return r}var F={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:r(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},h,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||s(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!s(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){s(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=c(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var r=e[0],n=e[1],o=r.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(n));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(r,n)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,r="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[r])switch(typeof this.validationMessages[r]){case"function":return this.validationMessages[r];case"string":return function(){return e.validationMessages[r]}}return function(r){return e.$formulate.validationMessage(t.name,r)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},_=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[r("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[r(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[r("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?r("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?r("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};_._withStripped=!0;var P=w({render:_,staticRenderFns:[]},void 0,F,void 0,!1,void 0,!1,void 0,void 0,void 0),A=function(t){this.form=t};A.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},A.prototype.values=function(){var t=this;return new Promise((function(e,r){var n=[],o=function t(e){var r={};for(var n in e)e[n]instanceof i||d(e[n])?r[n]=e[n]:r[n]=t(e[n]);return r}(t.form.internalFormModelProxy);for(var a in o)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof i&&n.push(t.form.internalFormModelProxy[a].upload());Promise.all(n).then((function(){return e(o)})).catch((function(t){return r(t)}))}))};var V={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var r in t)!this.registry.hasOwnProperty(r)||s(t[r],this.internalFormModelProxy[r])||s(t[r],this.registry[r].internalModelProxy[r])||(this.setFieldValue(r,t[r]),this.registry[r].context.model=t[r])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var r;Object.assign(this.internalFormModelProxy,((r={})[t]=e,r)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!r&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!r&&!n||s(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new A(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},N=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};N._withStripped=!0;var $=w({render:N,staticRenderFns:[]},void 0,V,void 0,!1,void 0,!1,void 0,void 0,void 0),E={props:{errors:{type:[Boolean,Array],required:!0}}},O=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.errors.length?r("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return r("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};O._withStripped=!0;var S=w({render:O,staticRenderFns:[]},void 0,E,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,r=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(r,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},C=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return r(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};C._withStripped=!0;var j=w({render:C,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),D={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},k={name:"FormulateInputBox",mixins:[D]},B=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t.context.value,a=t._i(r,i);n.checked?a<0&&t.$set(t.context,"model",r.concat([i])):a>-1&&t.$set(t.context,"model",r.slice(0,a).concat(r.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),r("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};B._withStripped=!0;var M=w({render:B,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),T={name:"FormulateInputText",mixins:[D]},U=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};U._withStripped=!0;var R=w({render:U,staticRenderFns:[]},void 0,T,void 0,!1,void 0,!1,void 0,void 0,void 0),L={name:"FormulateFiles",props:{files:{type:i,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},H=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.fileUploads.length?r("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return r("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[r("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?r("div",{staticClass:"formulate-file-image-preview"},[r("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),r("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?r("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[r("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?r("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?r("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};H._withStripped=!0;var q={name:"FormulateInputFile",components:{FormulateFiles:w({render:H,staticRenderFns:[]},void 0,L,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[D],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof i&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof i&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},G=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[r("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[r("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?r("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};G._withStripped=!0;var Y=w({render:G,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateInputButton",mixins:[D]},z=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[r("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};z._withStripped=!0;var Z=w({render:z,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),J={name:"FormulateInputSelect",mixins:[D],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},X=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[r("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?r:r[0])}}},"select",t.attributes,!1),[t.context.placeholder?r("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,n){return r("optgroup",{key:n,attrs:{label:n}},t._l(e,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return r("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};X._withStripped=!0;var K=w({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSlider",mixins:[D]},tt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var r=t.context.model,n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.context,"model",r.concat([null])):i>-1&&t.$set(t.context,"model",r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):r("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?r("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};tt._withStripped=!0;var et=w({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),rt={name:"FormulateInputTextArea",mixins:[D]},nt=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[r("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};nt._withStripped=!0;var ot=w({render:nt,staticRenderFns:[]},void 0,rt,void 0,!1,void 0,!1,void 0,void 0,void 0),it=function(){this.options={},this.defaults={components:{FormulateForm:$,FormulateInput:P,FormulateInputErrors:S,FormulateInputBox:M,FormulateInputText:R,FormulateInputFile:Y,FormulateInputGroup:j,FormulateInputButton:Z,FormulateInputSelect:K,FormulateInputSlider:et,FormulateInputTextArea:ot},library:o,rules:p,locale:"en",uploader:f,uploadJustCompleteDuration:1e3,plugins:[],locales:{en:m}}};it.prototype.install=function(t,e){var r=this;for(var n in t.prototype.$formulate=this,this.options=this.merge(this.defaults,e||{}),Array.isArray(this.options.plugins)&&this.options.plugins.length&&this.options.plugins.forEach((function(t){return"function"==typeof t?t(r):null})),this.options.components)t.component(n,this.options.components[n])},it.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},it.prototype.merge=function(t,e,r){void 0===r&&(r=!0);var o={};for(var i in t)e.hasOwnProperty(i)?n(e[i])&&n(t[i])?o[i]=this.merge(t[i],e[i],r):r&&Array.isArray(t[i])&&Array.isArray(e[i])?o[i]=t[i].concat(e[i]):o[i]=e[i]:o[i]=t[i];for(var a in e)o.hasOwnProperty(a)||(o[a]=e[a]);return o},it.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},it.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},it.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},it.prototype.validationMessage=function(t,e){var r=this.options.locales[this.options.locale];return r.hasOwnProperty(t)?r[t](e):"_"===t[0]&&r.hasOwnProperty(t.substr(1))?r[t.substr(1)](e):r.hasOwnProperty("default")?r.default(e):"This field does not have a valid value"},it.prototype.getUploader=function(){return this.options.uploader||!1},it.prototype.createUpload=function(t,e){return new i(t,e,this.options)};var at=new it;return t.FileUpload=i,t.default=at,t}({},isUrl,nanoid,isPlainObject); diff --git a/dist/formulate.umd.js b/dist/formulate.umd.js index d989425..7fbf065 100644 --- a/dist/formulate.umd.js +++ b/dist/formulate.umd.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("is-url"),require("nanoid"),require("is-plain-object")):"function"==typeof define&&define.amd?define(["exports","is-url","nanoid","is-plain-object"],e):e((t=t||self).Formulate={},t.isUrl,t.nanoid,t.isPlainObject)}(this,(function(t,e,n,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n,r=r&&r.hasOwnProperty("default")?r.default:r;var o={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},i=function(t,e,n){this.input=t,this.fileList=t.files,this.files=[],this.options=n,this.addFileList(this.fileList),this.context=e};function a(t,e){var n={};for(var r in t)n[r]=e(r,t[r]);return n}function s(t,e){if(t===e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e),o=n.length;if(r.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},i.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},i.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},i.prototype.getFileList=function(){return this.fileList},i.prototype.getFiles=function(){return this.files},i.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var p={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&o>r)},alpha:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},alphanumeric:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},before:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&oe&&r.lengthe&&r()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},matches:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(!!n.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,n){var r=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length<=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))<=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length<=e)},mime:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(function(){if(e instanceof i)for(var t=e.getFileList(),r=0;r=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))>=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length>=e)},not:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var n=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(n)?!n.length:"string"==typeof n?!n:!("object"!=typeof n||n&&Object.keys(n).length))))},url:function(t){var n=t.value;return Promise.resolve(e(n))}},f={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be after "+n[0]+".":u(e)+" must be a later date."},alpha:function(t){return u(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return u(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be before "+n[0]+".":u(e)+" must be an earlier date."},between:function(t){var e=t.name,n=t.value,r=t.args;return isNaN(n)?u(e)+" must be between "+r[0]+" and "+r[1]+" characters long.":u(e)+" must be between "+r[0]+" and "+r[1]+"."},confirm:function(t){var e=t.name;t.args;return u(e)+" does not match."},date:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" is not a valid, please use the format "+n[0]:u(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,n=t.value;return"string"==typeof n&&n?"“"+u(n)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return u(t.name)+" is not an allowed value."},max:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You may only select "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be less than "+r[0]+".":u(e)+" must be less than "+r[0]+" characters long."},mime:function(t){var e=t.name,n=t.args;return u(e)+" must be of the the type: "+(n[0]||"No file formats allowed.")},min:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You must select at least "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be more than "+r[0]+".":u(e)+" must be more than "+r[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return u(t.name)+" must be a number."},required:function(t){return u(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function m(t,e,n,r){return new Promise((function(n,o){var i=(r.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var r=performance.now()-a,o=Math.min(100,Math.round(r/i*100));if(e(o),o>=100)return n({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var h={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:y.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:v.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,n){return v.call(t,n)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:v.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return l(this.errors).concat(l(this.error)).concat(l(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function v(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||n(9)}]:t}function y(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:b.bind(this),set:g.bind(this)})}function b(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function g(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function w(t,e,n,r,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),r&&(d._scopeId=r),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return n}var F={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:n(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},h,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||s(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!s(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){s(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=c(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var n=e[0],r=e[1],o=n.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(r));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(n,r)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,n="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[n])switch(typeof this.validationMessages[n]){case"function":return this.validationMessages[n];case"string":return function(){return e.validationMessages[n]}}return function(n){return e.$formulate.validationMessage(t.name,n)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},_=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[n("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[n(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?n("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?n("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};_._withStripped=!0;var P=w({render:_,staticRenderFns:[]},void 0,F,void 0,!1,void 0,!1,void 0,void 0,void 0),A=function(t){this.form=t};A.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},A.prototype.values=function(){var t=this;return new Promise((function(e,n){var r=[],o=function t(e){var n={};for(var r in e)e[r]instanceof i||d(e[r])?n[r]=e[r]:n[r]=t(e[r]);return n}(t.form.internalFormModelProxy);for(var a in o)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof i&&r.push(t.form.internalFormModelProxy[a].upload());Promise.all(r).then((function(){return e(o)})).catch((function(t){return n(t)}))}))};var V={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var n in t)!this.registry.hasOwnProperty(n)||s(t[n],this.internalFormModelProxy[n])||s(t[n],this.registry[n].internalModelProxy[n])||(this.setFieldValue(n,t[n]),this.registry[n].context.model=t[n])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var n;Object.assign(this.internalFormModelProxy,((n={})[t]=e,n)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!n&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!n&&!r||s(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new A(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},N=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};N._withStripped=!0;var $=w({render:N,staticRenderFns:[]},void 0,V,void 0,!1,void 0,!1,void 0,void 0,void 0),O={props:{errors:{type:[Boolean,Array],required:!0}}},E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.errors.length?n("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return n("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};E._withStripped=!0;var S=w({render:E,staticRenderFns:[]},void 0,O,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,n=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(n,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},j=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return n(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};j._withStripped=!0;var C=w({render:j,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),D={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},k={name:"FormulateInputBox",mixins:[D]},B=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t.context.value,a=t._i(n,i);r.checked?a<0&&t.$set(t.context,"model",n.concat([i])):a>-1&&t.$set(t.context,"model",n.slice(0,a).concat(n.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),n("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};B._withStripped=!0;var M=w({render:B,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),T={name:"FormulateInputText",mixins:[D]},U=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};U._withStripped=!0;var R=w({render:U,staticRenderFns:[]},void 0,T,void 0,!1,void 0,!1,void 0,void 0,void 0),L={name:"FormulateFiles",props:{files:{type:i,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.fileUploads.length?n("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return n("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[n("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?n("div",{staticClass:"formulate-file-image-preview"},[n("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),n("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?n("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[n("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?n("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?n("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};q._withStripped=!0;var H={name:"FormulateInputFile",components:{FormulateFiles:w({render:q,staticRenderFns:[]},void 0,L,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[D],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof i&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof i&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},G=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[n("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[n("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?n("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};G._withStripped=!0;var Y=w({render:G,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateInputButton",mixins:[D]},z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[n("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};z._withStripped=!0;var Z=w({render:z,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),J={name:"FormulateInputSelect",mixins:[D],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},X=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?n:n[0])}}},"select",t.attributes,!1),[t.context.placeholder?n("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,r){return n("optgroup",{key:r,attrs:{label:r}},t._l(e,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};X._withStripped=!0;var K=w({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSlider",mixins:[D]},tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?n("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};tt._withStripped=!0;var et=w({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputTextArea",mixins:[D]},rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[n("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};rt._withStripped=!0;var ot=w({render:rt,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),it=function(){this.defaults={components:{FormulateForm:$,FormulateInput:P,FormulateInputErrors:S,FormulateInputBox:M,FormulateInputText:R,FormulateInputFile:Y,FormulateInputGroup:C,FormulateInputButton:Z,FormulateInputSelect:K,FormulateInputSlider:et,FormulateInputTextArea:ot},library:o,rules:p,locale:"en",uploader:m,uploadJustCompleteDuration:1e3,locales:{en:f}}};it.prototype.install=function(t,e){for(var n in t.prototype.$formulate=this,this.options=this.extend(this.defaults,e||{}),this.options.components)t.component(n,this.options.components[n]);Object.freeze(this)},it.prototype.extend=function(t,e){var n={};for(var o in t)e.hasOwnProperty(o)?n[o]=r(e[o])&&r(t[o])?this.extend(t[o],e[o]):e[o]:n[o]=t[o];for(var i in e)n.hasOwnProperty(i)||(n[i]=e[i]);return n},it.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},it.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},it.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},it.prototype.validationMessage=function(t,e){var n=this.options.locales[this.options.locale];return n.hasOwnProperty(t)?n[t](e):"_"===t[0]&&n.hasOwnProperty(t.substr(1))?n[t.substr(1)](e):n.hasOwnProperty("default")?n.default(e):"This field does not have a valid value"},it.prototype.getUploader=function(){return this.options.uploader||!1},it.prototype.createUpload=function(t,e){return new i(t,e,this.options)};var at=new it;t.FileUpload=i,t.default=at,Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("is-url"),require("nanoid"),require("is-plain-object")):"function"==typeof define&&define.amd?define(["exports","is-url","nanoid","is-plain-object"],e):e((t=t||self).Formulate={},t.isUrl,t.nanoid,t.isPlainObject)}(this,(function(t,e,n,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,n=n&&n.hasOwnProperty("default")?n.default:n,r=r&&r.hasOwnProperty("default")?r.default:r;var o={text:{classification:"text",component:"FormulateInputText"},email:{classification:"text",component:"FormulateInputText"},number:{classification:"text",component:"FormulateInputText"},color:{classification:"text",component:"FormulateInputText"},date:{classification:"text",component:"FormulateInputText"},hidden:{classification:"text",component:"FormulateInputText"},month:{classification:"text",component:"FormulateInputText"},password:{classification:"text",component:"FormulateInputText"},search:{classification:"text",component:"FormulateInputText"},tel:{classification:"text",component:"FormulateInputText"},time:{classification:"text",component:"FormulateInputText"},url:{classification:"text",component:"FormulateInputText"},week:{classification:"text",component:"FormulateInputText"},"datetime-local":{classification:"text",component:"FormulateInputText"},range:{classification:"slider",component:"FormulateInputSlider"},textarea:{classification:"textarea",component:"FormulateInputTextArea"},checkbox:{classification:"box",component:"FormulateInputBox"},radio:{classification:"box",component:"FormulateInputBox"},submit:{classification:"button",component:"FormulateInputButton"},button:{classification:"button",component:"FormulateInputButton"},select:{classification:"select",component:"FormulateInputSelect"},file:{classification:"file",component:"FormulateInputFile"},image:{classification:"file",component:"FormulateInputFile"}},i=function(t,e,n){this.input=t,this.fileList=t.files,this.files=[],this.options=n,this.addFileList(this.fileList),this.context=e};function a(t,e){var n={};for(var r in t)n[r]=e(r,t[r]);return n}function s(t,e){if(t===e)return!0;if(!t||!e)return!1;var n=Object.keys(t),r=Object.keys(e),o=n.length;if(r.length!==o)return!1;for(var i=0;i=100&&(e.complete||(e.justFinished=!0,setTimeout((function(){e.justFinished=!1}),t.options.uploadJustCompleteDuration)),e.complete=!0)}),(function(t){e.progress=0,e.error=t,e.complete=!0}),t.options)}))).then((function(t){return e(t)})).catch((function(t){throw new Error(t)}))}))},i.prototype.removeFile=function(t){if(this.files=this.files.filter((function(e){return e.uuid!==t})),window){var e=new DataTransfer;this.files.map((function(t){return e.items.add(t.file)})),this.fileList=e.files,this.input.files=this.fileList}},i.prototype.loadPreviews=function(){this.files.map((function(t){if(!t.previewData&&window&&window.FileReader&&/^image\//.test(t.file.type)){var e=new FileReader;e.onload=function(e){return Object.assign(t,{previewData:e.target.result})},e.readAsDataURL(t.file)}}))},i.prototype.getFileList=function(){return this.fileList},i.prototype.getFiles=function(){return this.files},i.prototype.toString=function(){return"FileUpload("+(this.files.length?this.files.length+" files":"empty")+")"};var p={accepted:function(t){var e=t.value;return Promise.resolve(["yes","on","1",1,!0,"true"].includes(e))},after:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&o>r)},alpha:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-ZÀ-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},alphanumeric:function(t,e){var n=t.value;void 0===e&&(e="default");var r={default:/^[a-zA-Z0-9À-ÖØ-öø-ÿ]+$/,latin:/^[a-zA-Z0-9]+$/},o=r.hasOwnProperty(e)?e:"default";return Promise.resolve(r[o].test(n))},before:function(t,e){var n=t.value;void 0===e&&(e=!1);var r=Date.parse(e||new Date),o=Date.parse(n);return Promise.resolve(!isNaN(o)&&oe&&r.lengthe&&r()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))},in:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0!==n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},matches:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(!!n.find((function(t){return t instanceof RegExp?t.test(e):t===e})))},max:function(t,e,n){var r=t.value;return void 0===e&&(e=10),Promise.resolve(Array.isArray(r)?(e=isNaN(e)?e:Number(e),r.length<=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))<=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length<=e)},mime:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(function(){if(e instanceof i)for(var t=e.getFileList(),r=0;r=e):!isNaN(r)&&"length"!==n||"value"===n?(r=isNaN(r)?r:Number(r))>=e:("string"==typeof r||"length"===n)&&(r=isNaN(r)?r:r.toString()).length>=e)},not:function(t){for(var e=t.value,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return Promise.resolve(void 0===n.find((function(t){return"object"==typeof t?s(t,e):t===e})))},number:function(t){var e=t.value;return Promise.resolve(!isNaN(e))},required:function(t,e){var n=t.value;return void 0===e&&(e=!0),Promise.resolve(!(e&&!["no","false"].includes(e)&&(Array.isArray(n)?!n.length:"string"==typeof n?!n:!("object"!=typeof n||n&&Object.keys(n).length))))},url:function(t){var n=t.value;return Promise.resolve(e(n))}},f={accepted:function(t){return"Please accept the "+t.name+"."},after:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be after "+n[0]+".":u(e)+" must be a later date."},alpha:function(t){return u(t.name)+" can only contain alphabetical characters."},alphanumeric:function(t){return u(t.name)+" can only contain letters and numbers."},before:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" must be before "+n[0]+".":u(e)+" must be an earlier date."},between:function(t){var e=t.name,n=t.value,r=t.args;return isNaN(n)?u(e)+" must be between "+r[0]+" and "+r[1]+" characters long.":u(e)+" must be between "+r[0]+" and "+r[1]+"."},confirm:function(t){var e=t.name;t.args;return u(e)+" does not match."},date:function(t){var e=t.name,n=t.args;return Array.isArray(n)&&n.length?u(e)+" is not a valid, please use the format "+n[0]:u(e)+" is not a valid date."},default:function(t){t.name;return"This field isn’t valid."},email:function(t){t.name;var e=t.value;return e?"“"+e+"” is not a valid email address.":"Please enter a valid email address."},in:function(t){var e=t.name,n=t.value;return"string"==typeof n&&n?"“"+u(n)+"” is not an allowed "+e+".":"This is not an allowed "+e+"."},matches:function(t){return u(t.name)+" is not an allowed value."},max:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You may only select "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be less than "+r[0]+".":u(e)+" must be less than "+r[0]+" characters long."},mime:function(t){var e=t.name,n=t.args;return u(e)+" must be of the the type: "+(n[0]||"No file formats allowed.")},min:function(t){var e=t.name,n=t.value,r=t.args;if(Array.isArray(n))return"You must select at least "+r[0]+" "+e+".";var o=!(!Array.isArray(r)||!r[1])&&r[1];return!isNaN(n)&&"length"!==o||"value"===o?u(e)+" must be more than "+r[0]+".":u(e)+" must be more than "+r[0]+" characters long."},not:function(t){var e=t.name;return"“"+t.value+"” is not an allowed "+e+"."},number:function(t){return u(t.name)+" must be a number."},required:function(t){return u(t.name)+" is required."},url:function(t){t.name;return"Please include a valid url."}};function m(t,e,n,r){return new Promise((function(n,o){var i=(r.fauxUploaderDuration||2e3)*(.5+Math.random()),a=performance.now(),s=function(){return setTimeout((function(){var r=performance.now()-a,o=Math.min(100,Math.round(r/i*100));if(e(o),o>=100)return n({url:"http://via.placeholder.com/350x150.png",name:t.name});s()}),20)};s()}))}var h={context:function(){return x.call(this,Object.assign({},{type:this.type,value:this.value,name:this.nameOrFallback,classification:this.classification,component:this.component,id:this.id||this.defaultId,hasLabel:this.label&&"button"!==this.classification,label:this.label,labelPosition:this.logicalLabelPosition,attributes:this.elementAttributes,blurHandler:y.bind(this),imageBehavior:this.imageBehavior,uploadUrl:this.uploadUrl,uploader:this.uploader||this.$formulate.getUploader(),uploadBehavior:this.uploadBehavior,preventWindowDrops:this.preventWindowDrops,hasValidationErrors:this.hasValidationErrors},this.typeContext))},nameOrFallback:function(){if(!0===this.name&&"button"!==this.classification)return this.type+"_"+this.elementAttributes.id;if(!1===this.name||"button"===this.classification&&!0===this.name)return!1;return this.name},typeContext:function(){var t=this;switch(this.classification){case"select":return{options:v.call(this,this.options),optionGroups:!!this.optionGroups&&a(this.optionGroups,(function(e,n){return v.call(t,n)})),placeholder:this.$attrs.placeholder||!1};case"slider":return{showValue:!!this.showValue};default:return this.options?{options:v.call(this,this.options)}:{}}},elementAttributes:function(){var t=Object.assign({},this.localAttributes);this.id?t.id=this.id:t.id=this.defaultId;return t},logicalLabelPosition:function(){if(this.labelPosition)return this.labelPosition;switch(this.classification){case"box":return"after";default:return"before"}},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)},mergedErrors:function(){return l(this.errors).concat(l(this.error)).concat(l(this.validationErrors)).reduce((function(t,e){return t.includes(e)?t:t.concat(e)}),[])},hasErrors:function(){return!!this.mergedErrors.length},showFieldErrors:function(){if(this.showErrors||this.formShouldShowErrors)return!0;return this.behavioralErrorVisibility},mergedValidationName:function(){if(this.validationName)return this.validationName;if("string"==typeof this.name)return this.name;if(this.label)return this.label;return this.type}};function v(t){if(!Array.isArray(t)&&t&&"object"==typeof t){var e=[];for(var r in t)e.push({value:r,label:t[r],id:this.elementAttributes.id+"_"+r});return e}return Array.isArray(t)&&!t.length?[{value:this.value,label:this.label||this.name,id:this.context.id||n(9)}]:t}function y(){"blur"===this.errorBehavior&&(this.behavioralErrorVisibility=!0)}function x(t){return Object.defineProperty(t,"model",{get:b.bind(this),set:g.bind(this)})}function b(){var t=this.isVmodeled?"formulateValue":"internalModelProxy";return"checkbox"===this.type&&!Array.isArray(this[t])&&this.options?[]:this[t]?this[t]:""}function g(t){this.internalModelProxy=t,this.$emit("input",t),this.context.name&&"function"==typeof this.formulateFormSetter&&this.formulateFormSetter(this.context.name,t)}function w(t,e,n,r,o,i,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);var c,d="function"==typeof n?n.options:n;if(t&&t.render&&(d.render=t.render,d.staticRenderFns=t.staticRenderFns,d._compiled=!0,o&&(d.functional=!0)),r&&(d._scopeId=r),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},d._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(d.functional){var p=d.render;d.render=function(t,e){return c.call(e),p(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,c):[c]}return n}var F={name:"FormulateInput",inheritAttrs:!1,inject:{formulateFormSetter:{default:void 0},formulateFormRegister:{default:void 0},getFormValues:{default:function(){return function(){return{}}}}},model:{prop:"formulateValue",event:"input"},props:{type:{type:String,default:"text"},name:{type:[String,Boolean],default:!0},formulateValue:{default:""},value:{default:!1},options:{type:[Object,Array,Boolean],default:!1},optionGroups:{type:[Object,Boolean],default:!1},id:{type:[String,Boolean,Number],default:!1},label:{type:[String,Boolean],default:!1},labelPosition:{type:[String,Boolean],default:!1},help:{type:[String,Boolean],default:!1},debug:{type:Boolean,default:!1},errors:{type:[String,Array,Boolean],default:!1},validation:{type:[String,Boolean,Array],default:!1},validationName:{type:[String,Boolean],default:!1},error:{type:[String,Boolean],default:!1},errorBehavior:{type:String,default:"blur",validator:function(t){return["blur","live"].includes(t)}},showErrors:{type:Boolean,default:!1},imageBehavior:{type:String,default:"preview"},uploadUrl:{type:[String,Boolean],default:!1},uploader:{type:[Function,Object,Boolean],default:!1},uploadBehavior:{type:String,default:"live"},preventWindowDrops:{type:Boolean,default:!0},showValue:{type:[String,Boolean],default:!1},validationMessages:{type:Object,default:function(){return{}}},validationRules:{type:Object,default:function(){return{}}}},data:function(){return{defaultId:n(9),localAttributes:{},internalModelProxy:this.formulateValue||this.value,behavioralErrorVisibility:"live"===this.errorBehavior,formShouldShowErrors:!1,validationErrors:[],pendingValidation:Promise.resolve()}},computed:Object.assign({},h,{classification:function(){var t=this.$formulate.classify(this.type);return"box"===t&&this.options?"group":t},component:function(){return"group"===this.classification?"FormulateInputGroup":this.$formulate.component(this.type)}}),watch:{$attrs:{handler:function(t){this.updateLocalAttributes(t)},deep:!0},internalModelProxy:function(t,e){this.performValidation(),this.isVmodeled||s(t,e)||(this.context.model=t)},formulateValue:function(t,e){this.isVmodeled&&!s(t,e)&&(this.context.model=t)}},created:function(){this.formulateFormRegister&&"function"==typeof this.formulateFormRegister&&this.formulateFormRegister(this.nameOrFallback,this),this.updateLocalAttributes(this.$attrs),this.performValidation()},methods:{updateLocalAttributes:function(t){s(t,this.localAttributes)||(this.localAttributes=t)},performValidation:function(){var t=this,e=c(this.validation,this.$formulate.rules(this.validationRules));return this.pendingValidation=Promise.all(e.map((function(e){var n=e[0],r=e[1],o=n.apply(void 0,[{value:t.context.model,getFormValues:t.getFormValues.bind(t),name:t.context.name}].concat(r));return(o=o instanceof Promise?o:Promise.resolve(o)).then((function(e){return!e&&t.getValidationMessage(n,r)}))}))).then((function(t){return t.filter((function(t){return t}))})).then((function(e){t.validationErrors=e})),this.pendingValidation},getValidationMessage:function(t,e){return this.getValidationFunction(t)({args:e,name:this.mergedValidationName,value:this.context.model,vm:this,formValues:this.getFormValues()})},getValidationFunction:function(t){var e=this,n="_"===t.name.substr(0,1)?t.name.substr(1):t.name;if(this.validationMessages&&"object"==typeof this.validationMessages&&void 0!==this.validationMessages[n])switch(typeof this.validationMessages[n]){case"function":return this.validationMessages[n];case"string":return function(){return e.validationMessages[n]}}return function(n){return e.$formulate.validationMessage(t.name,n)}},hasValidationErrors:function(){var t=this;return new Promise((function(e){t.$nextTick((function(){t.pendingValidation.then((function(){return e(!!t.validationErrors.length)}))}))}))}}},_=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input",attrs:{"data-classification":t.classification,"data-has-errors":t.hasErrors,"data-is-showing-errors":t.hasErrors&&t.showFieldErrors,"data-type":t.type}},[n("div",{staticClass:"formulate-input-wrapper"},[t.context.hasLabel&&"before"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--before",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context):t._e(),t._v(" "),t._t("element",[n(t.context.component,{tag:"component",attrs:{context:t.context}},[t._t("default",null,null,t.context)],2)],null,t.context),t._v(" "),t.context.hasLabel&&"after"===t.context.labelPosition?t._t("label",[n("label",{staticClass:"formulate-input-label formulate-input-label--after",attrs:{for:t.context.attributes.id},domProps:{textContent:t._s(t.context.label)}})],null,t.context.label):t._e()],2),t._v(" "),t.help?n("div",{staticClass:"formulate-input-help",domProps:{textContent:t._s(t.help)}}):t._e(),t._v(" "),t.showFieldErrors?n("FormulateInputErrors",{attrs:{errors:t.mergedErrors}}):t._e()],1)};_._withStripped=!0;var P=w({render:_,staticRenderFns:[]},void 0,F,void 0,!1,void 0,!1,void 0,void 0,void 0),A=function(t){this.form=t};A.prototype.hasValidationErrors=function(){return this.form.hasValidationErrors()},A.prototype.values=function(){var t=this;return new Promise((function(e,n){var r=[],o=function t(e){var n={};for(var r in e)e[r]instanceof i||d(e[r])?n[r]=e[r]:n[r]=t(e[r]);return n}(t.form.internalFormModelProxy);for(var a in o)"object"==typeof t.form.internalFormModelProxy[a]&&t.form.internalFormModelProxy[a]instanceof i&&r.push(t.form.internalFormModelProxy[a].upload());Promise.all(r).then((function(){return e(o)})).catch((function(t){return n(t)}))}))};var V={provide:function(){return{formulateFormSetter:this.setFieldValue,formulateFormRegister:this.register,getFormValues:this.getFormValues}},name:"FormulateForm",model:{prop:"formulateValue",event:"input"},props:{name:{type:[String,Boolean],default:!1},formulateValue:{type:Object,default:function(){return{}}}},data:function(){return{registry:{},internalFormModelProxy:{},formShouldShowErrors:!1}},computed:{hasFormulateValue:function(){return this.formulateValue&&"object"==typeof this.formulateValue},isVmodeled:function(){return!!(this.$options.propsData.hasOwnProperty("formulateValue")&&this._events&&Array.isArray(this._events.input)&&this._events.input.length)}},watch:{formulateValue:{handler:function(t,e){if(this.isVmodeled&&t&&"object"==typeof t)for(var n in t)!this.registry.hasOwnProperty(n)||s(t[n],this.internalFormModelProxy[n])||s(t[n],this.registry[n].internalModelProxy[n])||(this.setFieldValue(n,t[n]),this.registry[n].context.model=t[n])},deep:!0,immediate:!1}},created:function(){this.$options.propsData.hasOwnProperty("formulateValue")&&(this.internalFormModelProxy=Object.assign({},this.formulateValue))},methods:{setFieldValue:function(t,e){var n;Object.assign(this.internalFormModelProxy,((n={})[t]=e,n)),this.$emit("input",Object.assign({},this.internalFormModelProxy))},register:function(t,e){this.registry[t]=e;var n=Object.prototype.hasOwnProperty.call(e.$options.propsData,"formulateValue"),r=Object.prototype.hasOwnProperty.call(e.$options.propsData,"value");!n&&this.hasFormulateValue&&this.formulateValue[t]?e.context.model=this.formulateValue[t]:!n&&!r||s(e.internalModelProxy,this.formulateValue[t])||this.setFieldValue(t,e.internalModelProxy)},formSubmitted:function(){var t=this;this.showErrors();var e=new A(this);return this.$emit("submit-raw",e),e.hasValidationErrors().then((function(t){return t?void 0:e.values()})).then((function(e){if(void 0!==e)return t.$emit("submit",e),e}))},showErrors:function(){for(var t in this.registry)this.registry[t].formShouldShowErrors=!0},getFormValues:function(){return this.internalFormModelProxy},hasValidationErrors:function(){var t=[];for(var e in this.registry)"function"==typeof this.registry[e].hasValidationErrors&&t.push(this.registry[e].hasValidationErrors());return Promise.all(t).then((function(t){return!!t.find((function(t){return t}))}))}}},N=function(){var t=this,e=t.$createElement;return(t._self._c||e)("form",{on:{submit:function(e){return e.preventDefault(),t.formSubmitted(e)}}},[t._t("default")],2)};N._withStripped=!0;var $=w({render:N,staticRenderFns:[]},void 0,V,void 0,!1,void 0,!1,void 0,void 0,void 0),E={props:{errors:{type:[Boolean,Array],required:!0}}},O=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.errors.length?n("ul",{staticClass:"formulate-input-errors"},t._l(t.errors,(function(e){return n("li",{key:e,staticClass:"formulate-input-error",domProps:{innerHTML:t._s(e)}})})),0):t._e()};O._withStripped=!0;var S=w({render:O,staticRenderFns:[]},void 0,E,void 0,!1,void 0,!1,void 0,void 0,void 0);var I={name:"FormulateInputGroup",props:{context:{type:Object,required:!0}},computed:{options:function(){return this.context.options||[]},optionsWithContext:function(){var t=this,e=this.context,n=(e.options,e.labelPosition,e.attributes,e.classification,function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&-1===e.indexOf(r)&&(n[r]=t[r]);return n}(e,["options","labelPosition","attributes","classification"]));return this.options.map((function(e){return t.groupItemContext(n,e)}))}},methods:{groupItemContext:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Object.assign.apply(Object,[{}].concat(t,[{component:"FormulateInput"}]))}}},j=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-group"},t._l(t.optionsWithContext,(function(e){return n(e.component,t._b({key:e.id,tag:"component",staticClass:"formulate-input-group-item",model:{value:t.context.model,callback:function(e){t.$set(t.context,"model",e)},expression:"context.model"}},"component",e,!1))})),1)};j._withStripped=!0;var C=w({render:j,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0),D={props:{context:{type:Object,required:!0}},computed:{type:function(){return this.context.type},id:function(){return this.context.id},attributes:function(){return this.context.attributes||{}},hasValue:function(){return!!this.context.model}}},k={name:"FormulateInputBox",mixins:[D]},B=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{value:t.context.value,checked:Array.isArray(t.context.model)?t._i(t.context.model,t.context.value)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t.context.value,a=t._i(n,i);r.checked?a<0&&t.$set(t.context,"model",n.concat([i])):a>-1&&t.$set(t.context,"model",n.slice(0,a).concat(n.slice(a+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{value:t.context.value,checked:t._q(t.context.model,t.context.value)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",t.context.value)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.value,value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),n("label",{staticClass:"formulate-input-element-decorator",attrs:{for:t.id}})])};B._withStripped=!0;var M=w({render:B,staticRenderFns:[]},void 0,k,void 0,!1,void 0,!1,void 0,void 0,void 0),T={name:"FormulateInputText",mixins:[D]},U=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1))])};U._withStripped=!0;var R=w({render:U,staticRenderFns:[]},void 0,T,void 0,!1,void 0,!1,void 0,void 0,void 0),L={name:"FormulateFiles",props:{files:{type:i,required:!0},imagePreview:{type:Boolean,default:!1}},computed:{fileUploads:function(){return this.files.files||[]}},watch:{files:function(){this.imagePreview&&this.files.loadPreviews()}},mounted:function(){this.imagePreview&&this.files.loadPreviews()}},q=function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.fileUploads.length?n("ul",{staticClass:"formulate-files"},t._l(t.fileUploads,(function(e){return n("li",{key:e.uuid,attrs:{"data-has-error":!!e.error,"data-has-preview":t.imagePreview&&e.previewData}},[n("div",{staticClass:"formulate-file"},[t.imagePreview&&e.previewData?n("div",{staticClass:"formulate-file-image-preview"},[n("img",{attrs:{src:e.previewData}})]):t._e(),t._v(" "),n("div",{staticClass:"formualte-file-name",domProps:{textContent:t._s(e.name)}}),t._v(" "),!1!==e.progress?n("div",{staticClass:"formulate-file-progress",attrs:{"data-just-finished":e.justFinished,"data-is-finished":!e.justFinished&&e.complete}},[n("div",{staticClass:"formulate-file-progress-inner",style:{width:e.progress+"%"}})]):t._e(),t._v(" "),e.complete&&!e.justFinished||!1===e.progress?n("div",{staticClass:"formulate-file-remove",on:{click:e.removeFile}}):t._e()]),t._v(" "),e.error?n("div",{staticClass:"formulate-file-upload-error",domProps:{textContent:t._s(e.error)}}):t._e()])})),0):t._e()};q._withStripped=!0;var H={name:"FormulateInputFile",components:{FormulateFiles:w({render:q,staticRenderFns:[]},void 0,L,void 0,!1,void 0,!1,void 0,void 0,void 0)},mixins:[D],data:function(){return{isOver:!1}},computed:{hasFiles:function(){return!!(this.context.model instanceof i&&this.context.model.files.length)}},mounted:function(){window&&this.context.preventWindowDrops&&(window.addEventListener("dragover",this.preventDefault),window.addEventListener("drop",this.preventDefault))},destroyed:function(){window&&this.context.preventWindowDrops&&(window.removeEventListener("dragover",this.preventDefault),window.removeEventListener("drop",this.preventDefault))},methods:{preventDefault:function(t){"INPUT"!==t.target.tagName&&"file"!==t.target.getAttribute("type")&&(t=t||event).preventDefault()},handleFile:function(){this.isOver=!1;var t=this.$refs.file;t.files.length&&(this.context.model=this.$formulate.createUpload(t,this.context)),this.attemptImmediateUpload()},attemptImmediateUpload:function(){var t=this;"live"===this.context.uploadBehavior&&this.context.model instanceof i&&this.context.hasValidationErrors().then((function(e){e||t.context.model.upload()}))},handleDragOver:function(t){t.preventDefault(),this.isOver=!0},handleDragLeave:function(t){t.preventDefault(),this.isOver=!1}}},G=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type,"data-has-files":t.hasFiles}},[n("div",{staticClass:"formulate-input-upload-area",attrs:{"data-has-files":t.hasFiles}},[n("input",t._b({ref:"file",attrs:{"data-is-drag-hover":t.isOver,type:"file"},on:{blur:t.context.blurHandler,change:t.handleFile,dragover:t.handleDragOver,dragleave:t.handleDragLeave}},"input",t.attributes,!1)),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasFiles,expression:"!hasFiles"}],staticClass:"formulate-input-upload-area-mask"}),t._v(" "),t.hasFiles?n("FormulateFiles",{attrs:{files:t.context.model,"image-preview":"image"===t.context.type&&"preview"===t.context.imageBehavior}}):t._e()],1)])};G._withStripped=!0;var Y=w({render:G,staticRenderFns:[]},void 0,H,void 0,!1,void 0,!1,void 0,void 0,void 0),W={name:"FormulateInputButton",mixins:[D]},z=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("button",t._b({attrs:{type:t.type}},"button",t.attributes,!1),[t._t("default",[n("span",{class:"formulate-input-element--"+t.context.type+"--label",domProps:{textContent:t._s(t.context.value||t.context.label||t.context.name||"Submit")}})])],2)])};z._withStripped=!0;var Z=w({render:z,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),J={name:"FormulateInputSelect",mixins:[D],computed:{options:function(){return this.context.options||{}},optionGroups:function(){return this.context.optionGroups||!1},placeholderSelected:function(){return!(this.hasValue||!this.context.attributes||!this.context.attributes.placeholder)}}},X=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},[n("select",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{"data-placeholder-selected":t.placeholderSelected},on:{blur:t.context.blurHandler,change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.context,"model",e.target.multiple?n:n[0])}}},"select",t.attributes,!1),[t.context.placeholder?n("option",{attrs:{value:"",disabled:""},domProps:{selected:!t.hasValue}},[t._v("\n "+t._s(t.context.placeholder)+"\n ")]):t._e(),t._v(" "),t.optionGroups?t._l(t.optionGroups,(function(e,r){return n("optgroup",{key:r,attrs:{label:r}},t._l(e,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))})),0)})):t._l(t.options,(function(e){return n("option",t._b({key:e.id,domProps:{value:e.value,textContent:t._s(e.label)}},"option",e.attributes||{},!1))}))],2)])};X._withStripped=!0;var K=w({render:X,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={name:"FormulateInputSlider",mixins:[D]},tt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:"formulate-input-element formulate-input-element--"+t.context.type,attrs:{"data-type":t.context.type}},["checkbox"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.context.model)?t._i(t.context.model,null)>-1:t.context.model},on:{blur:t.context.blurHandler,change:function(e){var n=t.context.model,r=e.target,o=!!r.checked;if(Array.isArray(n)){var i=t._i(n,null);r.checked?i<0&&t.$set(t.context,"model",n.concat([null])):i>-1&&t.$set(t.context,"model",n.slice(0,i).concat(n.slice(i+1)))}else t.$set(t.context,"model",o)}}},"input",t.attributes,!1)):"radio"===t.type?n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:"radio"},domProps:{checked:t._q(t.context.model,null)},on:{blur:t.context.blurHandler,change:function(e){return t.$set(t.context,"model",null)}}},"input",t.attributes,!1)):n("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],attrs:{type:t.type},domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"input",t.attributes,!1)),t._v(" "),t.context.showValue?n("div",{staticClass:"formulate-input-element-range-value",domProps:{textContent:t._s(t.context.model)}}):t._e()])};tt._withStripped=!0;var et=w({render:tt,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={name:"FormulateInputTextArea",mixins:[D]},rt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"formulate-input-element formulate-input-element--textarea",attrs:{"data-type":"textarea"}},[n("textarea",t._b({directives:[{name:"model",rawName:"v-model",value:t.context.model,expression:"context.model"}],domProps:{value:t.context.model},on:{blur:t.context.blurHandler,input:function(e){e.target.composing||t.$set(t.context,"model",e.target.value)}}},"textarea",t.attributes,!1))])};rt._withStripped=!0;var ot=w({render:rt,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),it=function(){this.options={},this.defaults={components:{FormulateForm:$,FormulateInput:P,FormulateInputErrors:S,FormulateInputBox:M,FormulateInputText:R,FormulateInputFile:Y,FormulateInputGroup:C,FormulateInputButton:Z,FormulateInputSelect:K,FormulateInputSlider:et,FormulateInputTextArea:ot},library:o,rules:p,locale:"en",uploader:m,uploadJustCompleteDuration:1e3,plugins:[],locales:{en:f}}};it.prototype.install=function(t,e){var n=this;for(var r in t.prototype.$formulate=this,this.options=this.merge(this.defaults,e||{}),Array.isArray(this.options.plugins)&&this.options.plugins.length&&this.options.plugins.forEach((function(t){return"function"==typeof t?t(n):null})),this.options.components)t.component(r,this.options.components[r])},it.prototype.extend=function(t){if("object"==typeof t)return this.options=this.merge(this.options,t),this;throw new Error("VueFormulate extend() should be passed an object (was "+typeof t+")")},it.prototype.merge=function(t,e,n){void 0===n&&(n=!0);var o={};for(var i in t)e.hasOwnProperty(i)?r(e[i])&&r(t[i])?o[i]=this.merge(t[i],e[i],n):n&&Array.isArray(t[i])&&Array.isArray(e[i])?o[i]=t[i].concat(e[i]):o[i]=e[i]:o[i]=t[i];for(var a in e)o.hasOwnProperty(a)||(o[a]=e[a]);return o},it.prototype.classify=function(t){return this.options.library.hasOwnProperty(t)?this.options.library[t].classification:"unknown"},it.prototype.component=function(t){return!!this.options.library.hasOwnProperty(t)&&this.options.library[t].component},it.prototype.rules=function(t){return void 0===t&&(t={}),Object.assign({},this.options.rules,t)},it.prototype.validationMessage=function(t,e){var n=this.options.locales[this.options.locale];return n.hasOwnProperty(t)?n[t](e):"_"===t[0]&&n.hasOwnProperty(t.substr(1))?n[t.substr(1)](e):n.hasOwnProperty("default")?n.default(e):"This field does not have a valid value"},it.prototype.getUploader=function(){return this.options.uploader||!1},it.prototype.createUpload=function(t,e){return new i(t,e,this.options)};var at=new it;t.FileUpload=i,t.default=at,Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/dist/snow.min.css b/dist/snow.min.css index a1b400c..885a809 100644 --- a/dist/snow.min.css +++ b/dist/snow.min.css @@ -1,2 +1 @@ -.formulate-input{margin-bottom:1.5em}.formulate-input .formulate-input-label{display:block;line-height:1.5;font-size:.9em;font-weight:600;margin-bottom:.1em}.formulate-input .formulate-input-element{max-width:20em;margin-bottom:.1em}.formulate-input .formulate-input-help{color:#6d6d6d;font-size:.7em;font-weight:400;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-errors{list-style-type:none;padding:0;margin:0}.formulate-input .formulate-file-upload-error,.formulate-input .formulate-input-error{color:#960505;font-size:.8em;font-weight:300;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-group-item{margin-bottom:.5em}.formulate-input:last-child{margin-bottom:0}.formulate-input[data-classification=text] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0}.formulate-input[data-classification=text] input::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=text] .formulate-input-element--search{position:relative}.formulate-input[data-classification=text] .formulate-input-element--search:before{content:"";width:2em;height:100%;position:absolute;left:0;top:0;background-image:url('data:image/svg+xml;utf8,');background-size:1em 1em;background-repeat:no-repeat;background-position:50%;pointer-events:none}.formulate-input[data-classification=text] .formulate-input-element--search input{padding-left:2em}.formulate-input[data-classification=text] input[type=color]{height:1.1em;box-sizing:content-box}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch-wrapper{padding:0 0 0 1.5em;display:flex;align-items:center;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-size:.9em .9em;background-position:left .1em}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=text] input[type=color]::-moz-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=slider] .formulate-input-element--range{display:flex;align-items:center}.formulate-input[data-classification=slider] .formulate-input-element-range-value{font-size:.9em;line-height:1;margin-left:.5em;background-color:#efefef;padding:.25em .3em;border-radius:.25em;color:#6d6d6d;font-variant-numeric:tabular-nums}.formulate-input[data-classification=slider] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;font-size:1em;padding:.5em 0}.formulate-input[data-classification=slider] input:focus{outline:0}.formulate-input[data-classification=slider] input::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-moz-range-thumb{cursor:pointer;-moz-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-ms-thumb{cursor:pointer;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=textarea] textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0}.formulate-input[data-classification=textarea] textarea::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0;border:1px solid #41b883;background-color:#41b883;color:#fff;min-width:0;width:auto;font-weight:700;cursor:pointer;display:inline-flex;align-items:center}.formulate-input[data-classification=button] button::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button[disabled]{background-color:#cecece;border-color:#cecece}.formulate-input[data-classification=button] button:active{background-color:#64c89b;border-color:#64c89b}.formulate-input[data-classification=select] .formulate-input-element{position:relative}.formulate-input[data-classification=select] .formulate-input-element:before{content:"";width:0;height:0;border-color:#cecece transparent transparent;border-style:solid;border-width:.3em .3em 0;top:50%;margin-top:-.1em;right:1em;position:absolute}.formulate-input[data-classification=select] select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0;padding:.75em 2em .75em .75em}.formulate-input[data-classification=select] select::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=select] select[data-placeholder-selected]{color:#a8a8a8}.formulate-input[data-classification=box] .formulate-input-wrapper{display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element{overflow:hidden;display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element input{position:absolute;left:-999px}.formulate-input[data-classification=box] .formulate-input-element-decorator{display:block;width:1em;height:1em;border-radius:.25em;border:1px solid #cecece;position:relative}.formulate-input[data-classification=box] .formulate-input-element-decorator:before{content:"";display:block;background-size:contain;background-position:100%;width:calc(100% - .125em);height:calc(100% - .125em);box-sizing:border-box;position:absolute;top:.0625em;left:.0625em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator{border-radius:1em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator:before{border-radius:1em;width:calc(100% - .5em);height:calc(100% - .5em);top:.25em;left:.25em}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator:before{background-color:#41b883;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator:before{background-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input:focus~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-label--after{margin-left:.5em}.formulate-input[data-classification=box] .formulate-input-label--before{margin-right:.5em}.formulate-input[data-classification=group]>.formulate-input-wrapper>.formulate-input-label{margin-bottom:.5em}.formulate-input[data-classification=file] .formulate-input-upload-area{width:100%;position:relative;padding:2em 0}.formulate-input[data-classification=file] .formulate-input-upload-area input{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;position:absolute;left:0;right:0;bottom:0;top:0;width:100%;height:100%;z-index:5}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files]{padding:0}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files] input{display:none}.formulate-input[data-classification=file] .formulate-input-upload-area-mask{border-radius:.4em;pointer-events:none;position:absolute;display:flex;justify-content:center;align-items:center;left:0;right:0;top:0;bottom:0;border:2px dashed #a8a8a8;z-index:2}.formulate-input[data-classification=file] .formulate-input-upload-area-mask:before{content:"";background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;width:2em;height:2em;position:absolute;pointer-events:none}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask{border-color:#41b883}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask:before{background-color:#41b883}.formulate-input[data-classification=file] .formulate-files{list-style-type:none;margin:0;padding:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress{background-color:#cecece;height:.3em;border-radius:1.25em;width:5em;overflow:hidden;position:absolute;right:.75em;transition:height .25s,width .25s;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;display:block;opacity:0;transform:scale(.08);background-color:#fff;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:77%;mask-size:77%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;z-index:3}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]{width:1.25em;height:1.25em}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]:before{transition:transform .25s .2s,opacity .25s .2s;transform:scale(1);opacity:1}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]{transition:height .25s,width .25s,left .25s,top,.25s,border-radius .25s;width:.3em;height:100%;right:0;border-radius:0 .23em .23em 0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]:before{transition:opacity .1s;opacity:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress .formulate-file-progress-inner{background-color:#41b883;width:1%;position:absolute;left:0;bottom:0;top:0;z-index:2}.formulate-input[data-classification=file] .formulate-files .formualte-file-name{padding-left:1.5em;padding-right:2em}.formulate-input[data-classification=file] .formulate-files .formualte-file-name:before{position:absolute;left:.7em;top:50%;margin-top:-.7em;background-color:#a8a8a8;content:"";-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.25em;height:1.25em;display:inline-block;margin-right:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file-remove{width:1.25em;height:1.25em;border-radius:1em;border:1px solid #a8a8a8;background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:.6em;mask-size:.6em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;cursor:pointer;position:absolute;right:.75em;z-index:1;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-remove:hover{transform:scale(1.5)}}.formulate-input[data-classification=file] .formulate-files li{display:block}.formulate-input[data-classification=file] .formulate-files li[data-has-error] .formulate-file-progress{background-color:#dc2c2c}.formulate-input[data-classification=file] .formulate-files li[data-has-preview] .formualte-file-name:before{display:none}.formulate-input[data-classification=file] .formulate-files li+li{margin-top:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;font-weight:400;line-height:1.1em;margin:0;display:block;width:100%;display:flex;justify-content:flex-start;align-items:center;position:relative}.formulate-input[data-classification=file] .formulate-files .formulate-file::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=file] .formulate-files .formulate-file ::-webkit-progress-bar{-webkit-appearance:none;appearance:none;height:.5em;border-radius:.5em;overflow:hidden}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview{width:3em;height:3em;position:relative;z-index:2;left:-1px;box-shadow:0 0 0 1px #efefef;transition:transform .25s,box-shadow .25s,background-color .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview:hover{transition-delay:.2s;transform:scale(3);background-color:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.1)}}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview img{display:block;position:absolute;width:100%;height:100%;left:0;right:0;bottom:0;top:0;-o-object-fit:contain;object-fit:contain;transition:all .25s}.formulate-input[data-classification=file] [data-type=image] .formulate-input-upload-area .formulate-input-upload-area-mask:before{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')} -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUNFLG1CQUFzQixDQUN0Qix3Q0FDRSxhQUFjLENBQ2QsZUFBZ0IsQ0FDaEIsY0FBZSxDQUNmLGVBQWdCLENBQ2hCLGtCQUFxQixDQUN2QiwwQ0FDRSxjQUFlLENBQ2Ysa0JBQXFCLENBQ3ZCLHVDQUNFLGFBQWMsQ0FDZCxjQUFlLENBQ2YsZUFBZ0IsQ0FDaEIsZUFBZ0IsQ0FDaEIsbUJBQXNCLENBQ3hCLHlDQUNFLG9CQUFxQixDQUNyQixTQUFVLENBQ1YsUUFBVyxDQUNiLHNGQUVFLGFBQWMsQ0FDZCxjQUFlLENBQ2YsZUFBZ0IsQ0FDaEIsZUFBZ0IsQ0FDaEIsbUJBQXNCLENBQ3hCLDZDQUNFLGtCQUFxQixDQUN2Qiw0QkFDRSxlQUFrQixDQUNwQixpREFDRSx1QkFBZ0IsQ0FBaEIsb0JBQWdCLENBQWhCLGVBQWdCLENBQ2hCLGtCQUFtQixDQUNuQix3QkFBeUIsQ0FDekIscUJBQXNCLENBQ3RCLDRCQUE2QixDQUM3QixjQUFlLEN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jpiZWZvcmUge1xuICAgIG1hc2staW1hZ2U6IHVybCgnZGF0YTppbWFnZS9zdmcreG1sO3V0ZjgsPHN2ZyB4bWxucz1cImh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnXCIgdmlld0JveD1cIjAgMCA5MCA3MS4wNVwiPjxwYXRoIGQ9XCJNODIuODksMEg3LjFBNy4xMiw3LjEyLDAsMCwwLDAsNy4xMVY2NGE3LjExLDcuMTEsMCwwLDAsNy4xLDcuMUg4Mi45QTcuMTEsNy4xMSwwLDAsMCw5MCw2NFY3LjExQTcuMTIsNy4xMiwwLDAsMCw4Mi44OSwwWk02OS4yOCwzOS4zNWE1LjQ0LDUuNDQsMCwwLDAtOCwwTDUwLjU4LDUwLjc0LDMyLjM4LDMwLjg4YTUuMzEsNS4zMSwwLDAsMC03LjkyLDBMNC43NCw1Mi40VjcuMTFBMi4zNywyLjM3LDAsMCwxLDcuMTEsNC43NEg4Mi45YTIuMzcsMi4zNywwLDAsMSwyLjM2LDIuMzdWNTYuM1pcIi8+PGNpcmNsZSBjeD1cIjY3Ljc0XCIgY3k9XCIyMi4yNlwiIHI9XCI4LjUzXCIvPjwvc3ZnPicpOyB9XG4iXX0= */ \ No newline at end of file +.formulate-input{margin-bottom:1.5em}.formulate-input .formulate-input-label{display:block;line-height:1.5;font-size:.9em;font-weight:600;margin-bottom:.1em}.formulate-input .formulate-input-element{max-width:20em;margin-bottom:.1em}.formulate-input .formulate-input-help{color:#6d6d6d;font-size:.7em;font-weight:400;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-errors{list-style-type:none;padding:0;margin:0}.formulate-input .formulate-file-upload-error,.formulate-input .formulate-input-error{color:#960505;font-size:.8em;font-weight:300;line-height:1.5;margin-bottom:.25em}.formulate-input .formulate-input-group-item{margin-bottom:.5em}.formulate-input:last-child{margin-bottom:0}.formulate-input[data-classification=text] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0}.formulate-input[data-classification=text] input::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input::placeholder{color:#a8a8a8}.formulate-input[data-classification=text] input:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=text] .formulate-input-element--search{position:relative}.formulate-input[data-classification=text] .formulate-input-element--search:before{content:"";width:2em;height:100%;position:absolute;left:0;top:0;background-image:url('data:image/svg+xml;utf8,');background-size:1em 1em;background-repeat:no-repeat;background-position:50%;pointer-events:none}.formulate-input[data-classification=text] .formulate-input-element--search input{padding-left:2em}.formulate-input[data-classification=text] input[type=color]{height:1.1em;box-sizing:content-box}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch-wrapper{padding:0 0 0 1.5em;display:flex;align-items:center;background-image:url('data:image/svg+xml;utf8,');background-repeat:no-repeat;background-size:.9em .9em;background-position:left .1em}.formulate-input[data-classification=text] input[type=color]::-webkit-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=text] input[type=color]::-moz-color-swatch{display:block;height:1em;border-radius:.2em;border:0;flex:auto}.formulate-input[data-classification=slider] .formulate-input-element--range{display:flex;align-items:center}.formulate-input[data-classification=slider] .formulate-input-element-range-value{font-size:.9em;line-height:1;margin-left:.5em;background-color:#efefef;padding:.25em .3em;border-radius:.25em;color:#6d6d6d;font-variant-numeric:tabular-nums}.formulate-input[data-classification=slider] input{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;font-size:1em;padding:.5em 0}.formulate-input[data-classification=slider] input:focus{outline:0}.formulate-input[data-classification=slider] input::-webkit-slider-thumb{cursor:pointer;-webkit-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-moz-range-thumb{cursor:pointer;-moz-appearance:none;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-ms-thumb{cursor:pointer;appearance:none;width:1em;height:1em;border-radius:1em;background-color:#41b883;margin-top:calc(-.5em + 2px)}.formulate-input[data-classification=slider] input::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none;width:100%;height:4px;background-color:#efefef;border-radius:3px;margin:0;padding:0}.formulate-input[data-classification=textarea] textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0}.formulate-input[data-classification=textarea] textarea::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea::placeholder{color:#a8a8a8}.formulate-input[data-classification=textarea] textarea:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0;border:1px solid #41b883;background-color:#41b883;color:#fff;min-width:0;width:auto;font-weight:700;cursor:pointer;display:inline-flex;align-items:center}.formulate-input[data-classification=button] button::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button::placeholder{color:#a8a8a8}.formulate-input[data-classification=button] button:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=button] button[disabled]{background-color:#cecece;border-color:#cecece}.formulate-input[data-classification=button] button:active{background-color:#64c89b;border-color:#64c89b}.formulate-input[data-classification=select] .formulate-input-element{position:relative}.formulate-input[data-classification=select] .formulate-input-element:before{content:"";width:0;height:0;border-color:#cecece transparent transparent;border-style:solid;border-width:.3em .3em 0;top:50%;margin-top:-.1em;right:1em;position:absolute}.formulate-input[data-classification=select] select{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;display:block;width:100%;font-weight:400;line-height:1.1em;margin:0;padding:.75em 2em .75em .75em}.formulate-input[data-classification=select] select::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select::placeholder{color:#a8a8a8}.formulate-input[data-classification=select] select:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=select] select[data-placeholder-selected]{color:#a8a8a8}.formulate-input[data-classification=box] .formulate-input-wrapper{display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element{overflow:hidden;display:flex;align-items:center}.formulate-input[data-classification=box] .formulate-input-element input{position:absolute;left:-999px}.formulate-input[data-classification=box] .formulate-input-element-decorator{display:block;width:1em;height:1em;border-radius:.25em;border:1px solid #cecece;position:relative}.formulate-input[data-classification=box] .formulate-input-element-decorator:before{content:"";display:block;background-size:contain;background-position:100%;width:calc(100% - .125em);height:calc(100% - .125em);box-sizing:border-box;position:absolute;top:.0625em;left:.0625em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator{border-radius:1em}.formulate-input[data-classification=box] .formulate-input-element[data-type=radio] .formulate-input-element-decorator:before{border-radius:1em;width:calc(100% - .5em);height:calc(100% - .5em);top:.25em;left:.25em}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=checkbox]:checked~.formulate-input-element-decorator:before{background-color:#41b883;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input[type=radio]:checked~.formulate-input-element-decorator:before{background-color:#41b883}.formulate-input[data-classification=box] .formulate-input-element input:focus~.formulate-input-element-decorator{border-color:#41b883}.formulate-input[data-classification=box] .formulate-input-label--after{margin-left:.5em}.formulate-input[data-classification=box] .formulate-input-label--before{margin-right:.5em}.formulate-input[data-classification=group]>.formulate-input-wrapper>.formulate-input-label{margin-bottom:.5em}.formulate-input[data-classification=file] .formulate-input-upload-area{width:100%;position:relative;padding:2em 0}.formulate-input[data-classification=file] .formulate-input-upload-area input{cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;opacity:0;position:absolute;left:0;right:0;bottom:0;top:0;width:100%;height:100%;z-index:5}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files]{padding:0}.formulate-input[data-classification=file] .formulate-input-upload-area[data-has-files] input{display:none}.formulate-input[data-classification=file] .formulate-input-upload-area-mask{border-radius:.4em;pointer-events:none;position:absolute;display:flex;justify-content:center;align-items:center;left:0;right:0;top:0;bottom:0;border:2px dashed #a8a8a8;z-index:2}.formulate-input[data-classification=file] .formulate-input-upload-area-mask:before{content:"";background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;width:2em;height:2em;position:absolute;pointer-events:none}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask{border-color:#41b883}.formulate-input[data-classification=file] .formulate-input-upload-area input:focus~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input:hover~.formulate-input-upload-area-mask:before,.formulate-input[data-classification=file] .formulate-input-upload-area input[data-is-drag-hover]~.formulate-input-upload-area-mask:before{background-color:#41b883}.formulate-input[data-classification=file] .formulate-files{list-style-type:none;margin:0;padding:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress{background-color:#cecece;height:.3em;border-radius:1.25em;width:5em;overflow:hidden;position:absolute;right:.75em;transition:height .25s,width .25s;z-index:2}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;display:block;opacity:0;transform:scale(.08);background-color:#fff;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:77%;mask-size:77%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;z-index:3}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]{width:1.25em;height:1.25em}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-just-finished]:before{transition:transform .25s .2s,opacity .25s .2s;transform:scale(1);opacity:1}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]{transition:height .25s,width .25s,left .25s,top,.25s,border-radius .25s;width:.3em;height:100%;right:0;border-radius:0 .23em .23em 0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress[data-is-finished]:before{transition:opacity .1s;opacity:0}.formulate-input[data-classification=file] .formulate-files .formulate-file-progress .formulate-file-progress-inner{background-color:#41b883;width:1%;position:absolute;left:0;bottom:0;top:0;z-index:2}.formulate-input[data-classification=file] .formulate-files .formualte-file-name{padding-left:1.5em;padding-right:2em}.formulate-input[data-classification=file] .formulate-files .formualte-file-name:before{position:absolute;left:.7em;top:50%;margin-top:-.7em;background-color:#a8a8a8;content:"";-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;width:1.25em;height:1.25em;display:inline-block;margin-right:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file-remove{width:1.25em;height:1.25em;border-radius:1em;border:1px solid #a8a8a8;background-color:#a8a8a8;-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');-webkit-mask-size:.6em;mask-size:.6em;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center;mask-position:center;cursor:pointer;position:absolute;right:.75em;z-index:1;transition:transform .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-remove:hover{transform:scale(1.5)}}.formulate-input[data-classification=file] .formulate-files li{display:block}.formulate-input[data-classification=file] .formulate-files li[data-has-error] .formulate-file-progress{background-color:#dc2c2c}.formulate-input[data-classification=file] .formulate-files li[data-has-preview] .formualte-file-name:before{display:none}.formulate-input[data-classification=file] .formulate-files li+li{margin-top:.5em}.formulate-input[data-classification=file] .formulate-files .formulate-file{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:.3em;border:1px solid #cecece;box-sizing:border-box;background-color:transparent;font-size:.9em;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:.75em;font-weight:400;line-height:1.1em;margin:0;display:block;width:100%;display:flex;justify-content:flex-start;align-items:center;position:relative}.formulate-input[data-classification=file] .formulate-files .formulate-file::-webkit-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::-moz-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file:-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::-ms-input-placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file::placeholder{color:#a8a8a8}.formulate-input[data-classification=file] .formulate-files .formulate-file:focus{outline:0;border:1px solid #41b883}.formulate-input[data-classification=file] .formulate-files .formulate-file ::-webkit-progress-bar{-webkit-appearance:none;appearance:none;height:.5em;border-radius:.5em;overflow:hidden}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview{width:3em;height:3em;position:relative;z-index:2;left:-1px;box-shadow:0 0 0 1px #efefef;transition:transform .25s,box-shadow .25s,background-color .25s}@media (pointer:fine){.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview:hover{transition-delay:.2s;transform:scale(3);background-color:#fff;box-shadow:0 0 2px 0 rgba(0,0,0,.1)}}.formulate-input[data-classification=file] .formulate-files .formulate-file-image-preview img{display:block;position:absolute;width:100%;height:100%;left:0;right:0;bottom:0;top:0;-o-object-fit:contain;object-fit:contain;transition:all .25s}.formulate-input[data-classification=file] [data-type=image] .formulate-input-upload-area .formulate-input-upload-area-mask:before{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,')} \ No newline at end of file diff --git a/package.json b/package.json index a77de28..4f98ff8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ }, "scripts": { "build": "npm run build:umd & npm run build:es & npm run build:unpkg & npm run build:css", - "build:css": "node-sass themes/snow/snow.scss dist/snow.css && postcss --use autoprefixer -b '> 2%' < dist/snow.css | postcss --use cssnano > dist/snow.min.css", + "build:css": "node-sass themes/snow/snow.scss dist/snow.css && postcss --use autoprefixer -b '> 2%' < dist/snow.css | postcss --no-map --use cssnano > dist/snow.min.css", "build:umd": "rollup --config build/rollup.config.js --format umd --file dist/formulate.umd.js", "build:es": "rollup --config build/rollup.config.js --format es --file dist/formulate.esm.js", "build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/formulate.min.js", diff --git a/src/Formulate.js b/src/Formulate.js index 0aaf3ae..dd02345 100644 --- a/src/Formulate.js +++ b/src/Formulate.js @@ -24,6 +24,7 @@ class Formulate { * Instantiate our base options. */ constructor () { + this.options = {} this.defaults = { components: { FormulateForm, @@ -43,6 +44,7 @@ class Formulate { locale: 'en', uploader: fauxUploader, uploadJustCompleteDuration: 1000, + plugins: [], locales: { en } @@ -54,32 +56,54 @@ class Formulate { */ install (Vue, options) { Vue.prototype.$formulate = this - this.options = this.extend(this.defaults, options || {}) + this.options = this.merge(this.defaults, options || {}) + if (Array.isArray(this.options.plugins) && this.options.plugins.length) { + this.options.plugins + .forEach(plugin => (typeof plugin === 'function') ? plugin(this) : null) + } for (var componentName in this.options.components) { Vue.component(componentName, this.options.components[componentName]) } - Object.freeze(this) } /** - * Create a new object by copying properties of base and extendWith. - * @param {Object} base + * Given a set of options, apply them to the pre-existing options. * @param {Object} extendWith */ - extend (base, extendWith) { + extend (extendWith) { + if (typeof extendWith === 'object') { + this.options = this.merge(this.options, extendWith) + return this + } + throw new Error(`VueFormulate extend() should be passed an object (was ${typeof extendWith})`) + } + + /** + * Create a new object by copying properties of base and mergeWith. + * Note: arrays don't overwrite - they push + * + * @param {Object} base + * @param {Object} mergeWith + * @param {boolean} concatArrays + */ + merge (base, mergeWith, concatArrays = true) { var merged = {} for (var key in base) { - if (extendWith.hasOwnProperty(key)) { - merged[key] = isPlainObject(extendWith[key]) && isPlainObject(base[key]) - ? this.extend(base[key], extendWith[key]) - : extendWith[key] + if (mergeWith.hasOwnProperty(key)) { + if (isPlainObject(mergeWith[key]) && isPlainObject(base[key])) { + merged[key] = this.merge(base[key], mergeWith[key], concatArrays) + } else if (concatArrays && Array.isArray(base[key]) && Array.isArray(mergeWith[key])) { + merged[key] = base[key].concat(mergeWith[key]) + } else { + merged[key] = mergeWith[key] + } } else { merged[key] = base[key] } } - for (var prop in extendWith) { + for (var prop in mergeWith) { if (!merged.hasOwnProperty(prop)) { - merged[prop] = extendWith[prop] + merged[prop] = mergeWith[prop] } } return merged diff --git a/test/Formulate.test.js b/test/Formulate.test.js index ac6c0e4..d2926fa 100644 --- a/test/Formulate.test.js +++ b/test/Formulate.test.js @@ -1,6 +1,6 @@ import Formulate from '../src/Formulate.js' -test('can extend simple object', () => { +test('can merge simple object', () => { let a = { optionA: true, optionB: '1234' @@ -8,14 +8,27 @@ test('can extend simple object', () => { let b = { optionA: false } - expect(Formulate.extend(a, b)).toEqual({ + expect(Formulate.merge(a, b)).toEqual({ optionA: false, optionB: '1234' }) }) +test('can add to simple array', () => { + let a = { + optionA: true, + optionB: ['first', 'second'] + } + let b = { + optionB: ['third'] + } + expect(Formulate.merge(a, b, true)).toEqual({ + optionA: true, + optionB: ['first', 'second', 'third'] + }) +}) -test('can extend recursively', () => { +test('can merge recursively', () => { let a = { optionA: true, optionC: { @@ -33,7 +46,7 @@ test('can extend recursively', () => { second: '789', } } - expect(Formulate.extend(a, b)).toEqual({ + expect(Formulate.merge(a, b)).toEqual({ optionA: true, optionC: { first: '1234', @@ -69,3 +82,20 @@ test('installs on vue instance', () => { expect(Vue.prototype.$formulate).toBe(Formulate) expect(registry).toEqual(components) }) + +test('can extend instance in a plugin', () => { + function Vue () {} + Vue.component = function (name, instance) {} + const plugin = function (i) { + i.extend({ + rules: { + testRule: () => false + } + }) + } + Formulate.install(Vue, { + plugins: [ plugin ] + }) + + expect(typeof Vue.prototype.$formulate.options.rules.testRule).toBe('function') +}) diff --git a/themes/boilerplate/boilerplate.scss b/themes/boilerplate/boilerplate.scss new file mode 100644 index 0000000..0306780 --- /dev/null +++ b/themes/boilerplate/boilerplate.scss @@ -0,0 +1,109 @@ +// Formulate inputs +// ----------------------------------------------------------------------------- + +.formulate-input { + // global wrapper styles + + .formulate-input-label { + // global label styles + } + + .formulate-input-element { + // Global field-level wrapper styles + } + + .formulate-input-help { + // Global help text styles + } + + .formulate-input-errors { + // Global error message list wrapper + } + + .formulate-input-error, + .formulate-file-upload-error { + // Error message styles + } + + .formulate-input-group-item { + // Group of items (like list of checkboxes) wrapper + } + +// Text inputs +// ----------------------------------------------------------------------------- + + &[data-classification='text'] { + input { + // Style all text-like input elements + } + } + +// Slider inputs +// ----------------------------------------------------------------------------- + +&[data-classification='slider'] { + input { + // Style range inputs + } +} + +// Textarea inputs +// ----------------------------------------------------------------------------- + + &[data-classification='textarea'] { + textarea { + // Style textareas + } + } + + // Button inputs +// ----------------------------------------------------------------------------- + +&[data-classification='button'] { + button { + // Style button inputs + } +} + +// Select lists +// ----------------------------------------------------------------------------- + + &[data-classification='select'] { + select { + // Style select lists + } + } + + +// Box inputs +// ----------------------------------------------------------------------------- + + &[data-classification='box'] { + .formulate-input-element { + // Box input (checkbox and radio) wrapper (might want flex here) + input { + // Style box element itself + } + } + } + + + // File inputs +// ----------------------------------------------------------------------------- + + &[data-classification="file"] { + .formulate-input-upload-area { + input { + // The actual upload element + } + } + } + + +// Image uploads +// ----------------------------------------------------------------------------- + + [data-type="image"] { + // image uploads + } +}