tg-controls_cli 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/myLib.umd.min.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* vee-validate v3.4.15
|
|
4
4
|
* (c) 2023 Abdelrahman Awad
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/function Tt(e){return null===e||void 0===e}function Nt(e){return Array.isArray(e)&&0===e.length}function Ft(e){return"function"===typeof e}function zt(e,t){return-1!==e.indexOf(t)}function Lt(e){return Ft(Array.from)?Array.from(e):Rt(e)}function Rt(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}var Yt=function(e,t){return Array.isArray(e)?e.every((function(e){return Yt(e,t)})):Lt(t).some((function(t){return t==e}))},Bt={validate:Yt},Vt=function(e,t){return!Yt(e,t)},qt={validate:Vt},Ht=function(e,t){var n=new RegExp(".("+t.join("|")+")$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.name)})):n.test(e.name)},Ut={validate:Ht},Gt=function(e){var t=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return Array.isArray(e)?e.every((function(e){return t.test(e.name)})):t.test(e.name)},Wt={validate:Gt},Zt=function(e){return Array.isArray(e)?e.every((function(e){return/^-?[0-9]+$/.test(String(e))})):/^-?[0-9]+$/.test(String(e))},Kt={validate:Zt},Jt=function(e,t){var n=t.other;return e===n},Xt=[{name:"other"}],Qt={validate:Jt,params:Xt},en=function(e,t){var n=t.other;return e!==n},tn=[{name:"other"}],nn={validate:en,params:tn},rn=function(e,t){var n=t.length;return!Tt(e)&&("string"===typeof e&&(e=Lt(e)),"number"===typeof e&&(e=String(e)),e.length||(e=Lt(e)),e.length===n)},on=[{name:"length",cast:function(e){return Number(e)}}],an={validate:rn,params:on},sn=function(e,t){var n=t.length;return Tt(e)?n>=0:Array.isArray(e)?e.every((function(e){return sn(e,{length:n})})):String(e).length<=n},ln=[{name:"length",cast:function(e){return Number(e)}}],dn={validate:sn,params:ln},un=function(e,t){var n=t.max;return!Tt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return un(e,{max:n})})):Number(e)<=n)},cn=[{name:"max",cast:function(e){return Number(e)}}],fn={validate:un,params:cn},pn=function(e,t){var n=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.type)})):n.test(e.type)},hn={validate:pn},vn=function(e,t){var n=t.length;return!Tt(e)&&(Array.isArray(e)?e.every((function(e){return vn(e,{length:n})})):String(e).length>=n)},mn=[{name:"length",cast:function(e){return Number(e)}}],gn={validate:vn,params:mn},bn=function(e,t){var n=t.min;return!Tt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return bn(e,{min:n})})):Number(e)>=n)},_n=[{name:"min",cast:function(e){return Number(e)}}],yn={validate:bn,params:_n},$n=/^[٠١٢٣٤٥٦٧٨٩]+$/,xn=/^[0-9]+$/,wn=function(e){var t=function(e){var t=String(e);return xn.test(t)||$n.test(t)};return Array.isArray(e)?e.every(t):t(e)},kn={validate:wn},On=function(e,t){var n=t.regex;return Array.isArray(e)?e.every((function(e){return On(e,{regex:n})})):n.test(String(e))},Sn=[{name:"regex",cast:function(e){return"string"===typeof e?new RegExp(e):e}}],In={validate:On,params:Sn},Dn=function(e,t){var n=(void 0===t?{allowFalse:!0}:t).allowFalse,r={valid:!1,required:!0};return Tt(e)||Nt(e)?r:!1!==e||n?(r.valid=!!String(e).trim().length,r):r},jn=!0,Cn=[{name:"allowFalse",default:!0}],Pn={validate:Dn,params:Cn,computesRequired:jn},En=function(e){return Nt(e)||zt([!1,null,void 0],e)||!String(e).trim().length},An=function(e,t){var n,r=t.target,i=t.values;return i&&i.length?(Array.isArray(i)||"string"!==typeof i||(i=[i]),n=i.some((function(e){return e==String(r).trim()}))):n=!En(r),n?{valid:!En(e),required:n}:{valid:!0,required:n}},Mn=[{name:"target",isTarget:!0},{name:"values"}],Tn=!0,Nn={validate:An,params:Mn,computesRequired:Tn},Fn=function(e,t){var n=t.size;if(isNaN(n))return!1;var r=1024*n;if(!Array.isArray(e))return e.size<=r;for(var i=0;i<e.length;i++)if(e[i].size>r)return!1;return!0},zn=[{name:"size",cast:function(e){return Number(e)}}],Ln={validate:Fn,params:zn},Rn=function(e,t){var n=t||{},r=n.decimals,i=void 0===r?0:r,o=n.separator,a=void 0===o?"dot":o,s="comma"===a?",?":"\\.?",l=0===i?"\\d*":"(\\d{"+i+"})?",d=new RegExp("^-?\\d+"+s+l+"$");return Array.isArray(e)?e.every((function(e){return d.test(String(e))})):d.test(String(e))},Yn=[{name:"decimals",default:0},{name:"separator",default:"dot"}],Bn={validate:Rn,params:Yn};function Vn(e){return r("bb28")(`./${e}.json`).then(t=>{fe(e,t)})}function qn(e,t){let n={},r=Vn(null!==t&&void 0!==t?t:"en");return e&&("string"===typeof e||"undefined"===typeof e.length?n=e:"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(t=>{"errormessage"!=t.toLowerCase()&&(n[t]=e[t]),"errormessage"!=t.toLowerCase()&&"undefined"!=typeof e.errorMessage&&"function"!==typeof e[t]&&(r.messages[t]=e.errorMessage),"function"!==typeof e[t]&&"object"!==typeof e[t]||F(t,e[t])})}))),n}Object.keys(i).forEach(e=>{F(e,i[e])}),F("password",{params:["target"],validate(e,{target:t}){return e===t},message:"Password confirmation does not match"}),F("url",{validate(e){return!!e&&/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(e)},message:"The {_field_} field must be a valid URL"}),F("colorCode",{validate(e){return!!e&&/^#[0-9A-F]{6}$/.test(e)},message:"The {_field_} field must be a valid color"}),F("ZipCode",{validate(e){return!!e&&/(^\d{6}$)|(^\d{5}-\d{4}$)/.test(e)},message:"The {_field_} field is not valid"});var Hn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,type:"text",placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},keypress:e.onlyForCurrency,input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Un=[],Gn={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{value:""}},methods:{onlyForCurrency(e){let t=e.keyCode?e.keyCode:e.which;!(t<48||t>57)||46===t&&-1==this.fieldInfo.value.indexOf(".")||e.preventDefault(),null!=this.fieldInfo.value&&this.fieldInfo.value.indexOf(".")>-1&&this.fieldInfo.value.split(".")[1].length>1&&e.preventDefault()},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Wn=Gn;function Zn(e,t,n,r,i,o,a,s){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),r&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var Kn,Jn,Xn=Zn(Wn,Hn,Un,!1,null,null,null),Qn=Xn.exports,er=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"d-flex w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.fieldInfo,"value",t.target.multiple?n:n[0])},function(t){return e.onChange(t)}]}},[t("option",{attrs:{value:""}},[e._v("Select "+e._s(e.fieldInfo.label))]),e._l(e.renderOptions(e.fieldInfo),(function(n,r){return t("option",{key:r,domProps:{value:n.value}},[e._v(e._s(n.name))])}))],2),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))]):e._e()]}}])})},tr=[],nr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},rr=nr,ir=Zn(rr,er,tr,!1,null,null,null),or=ir.exports,ar=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,id:e.fieldInfo.name,type:"text",placeholder:e.fieldInfo.placeholder,disabled:e.fieldInfo.disabled},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},sr=[],lr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},dr=lr,ur=Zn(dr,ar,sr,!1,null,null,null),cr=ur.exports,fr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("DatePicker",{class:{"input-group w-100":!0,"is-invalid":n[0]},staticStyle:{"flex-wrap":"nowrap"},attrs:{is24hr:e.is24hr,mode:e.mode,disabled:e.fieldInfo.disabled,masks:e.masks,popover:e.popover,"min-date":e.getMinmumDate(e.fieldInfo),"max-date":e.getMaxDate(e.fieldInfo),"minute-increment":5},scopedSlots:e._u([{key:"default",fn:function({inputValue:r,inputEvents:i,togglePopover:o}){return[t("input",e._g({ref:"inputDatePicker",class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{autocomplete:"off",disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,placeholder:e.fieldInfo.label},domProps:{value:r},on:{blur:function(t){return e.onBlur(t,e.field)}}},i)),t("div",{staticClass:"input-group-append"},[t("span",e._g({staticClass:"input-group-text"},i),[t("i",{staticClass:"fa fa-calendar"})])])]}}],null,!0),model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),t("span",{directives:[{name:"show",rawName:"v-show",value:n[0],expression:"errors[0]"}],ref:"errrorMessage",staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))])]}}])})},pr=[],hr=r("404b"),vr=r.n(hr),mr={components:{Field:Re,DatePicker:vr.a},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{popover:{visibility:"click"},masks:{input:"DD-MM-YYYY"},date:new Date,mode:"date",is24hr:!1}},methods:{getMinmumDate(e){if(e.config&&this.fieldInfo.config.minDate)return e.config.minDate},getMaxDate(e){if(e.config&&this.fieldInfo.config.maxDate)return e.config.maxDate},onBlur(t){try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo.config&&this.fieldInfo.config.is24hr&&(this.is24hr=this.fieldInfo.config.is24hr),this.fieldInfo.config&&this.fieldInfo.config.mode&&(this.mode=this.fieldInfo.config.mode),this.fieldInfo.config&&this.fieldInfo.config.format&&("date"==this.mode?this.masks.input=this.fieldInfo.config.format:"dateTime"==this.mode?this.masks.inputDateTime=this.fieldInfo.config.format:"time"==this.mode&&(this.masks.inputTime=this.fieldInfo.config.format))}},gr=mr,br=(r("9f68"),Zn(gr,fr,pr,!1,null,null,null)),_r=br.exports,yr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-check custom-control-inline"},[t("input",{staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name+"_"+i,id:e.fieldInfo.name+"_"+i,type:"checkbox"},domProps:{checked:e.isChecked(r),value:r.value},on:{change:function(t){return e.onChange(t,e.field)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])})),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},$r=[],xr=(r("14d9"),{components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},created:function(){},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange:function(e,t){"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split()),e.target.checked?(this.fieldInfo.value="string"==typeof this.fieldInfo.value?[]:this.fieldInfo.value,this.fieldInfo.value.push(e.target.value)):this.fieldInfo.value.splice(this.fieldInfo.value.indexOf(e.target.value),1);try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},isChecked:function(t){try{return"array"==typeof this.fieldInfo.value||"object"==typeof this.fieldInfo.value?this.fieldInfo.value.includes(t.value):this.fieldInfo.value==t.value}catch(e){console.log("Checkbox value should be in string or array")}}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo&&this.fieldInfo.value&&"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split())}}),wr=xr,kr=Zn(wr,yr,$r,!1,null,null,null),Or=kr.exports,Sr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label,slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-radio custom-control-inline"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,id:e.fieldInfo.name+"_"+i,type:"radio"},domProps:{checked:r.value==e.fieldInfo.value,checked:e._q(e.fieldInfo.value,null)},on:{change:function(t){return e.$set(e.fieldInfo,"value",null)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])}))}}])})},Ir=[],Dr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},AssignToggleValues:function(e,t,n){this.$emit("AssignToggleValues",e,t,n)},showDependentItem:function(e,t){this.$emit("showDependentItem",e,t)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},jr=Dr,Cr=Zn(jr,Sr,Ir,!1,null,null,null),Pr=Cr.exports,Er={},Ar=Zn(Er,Kn,Jn,!1,null,null,null),Mr=Ar.exports,Tr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Nr=[],Fr=r("8e5f"),zr=r.n(Fr),Lr={components:{Multiselect:zr.a,Field:Re},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Rr=Lr,Yr=(r("8498"),Zn(Rr,Tr,Nr,!1,null,null,null)),Br=Yr.exports,Vr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("div",{class:{"is-invalid":n[0]}},[t("Toggle",{attrs:{disabled:e.fieldInfo.disabled},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}})],1),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},qr=[];function Hr(e,t,n,r,i,o,a,s,l,d){"boolean"!=typeof a&&(l=s,s=a,a=!1);const u="function"==typeof n?n.options:n;let c;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):t&&(c=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),c)if(u.functional){const e=u.render;u.render=function(t,n){return c.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,c):[c]}return n}const Ur={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},modelValue:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const n=function(e,t,n){const{value:r,modelValue:i,falseValue:o,trueValue:a,disabled:s}=Object(d["toRefs"])(e),l=i&&void 0!==i.value?i:r,u=Object(d["computed"])(()=>l.value===a.value),c=e=>{t.emit("input",e),t.emit("update:modelValue",e),t.emit("change",e)},f=()=>{c(a.value)},p=()=>{c(o.value)};return-1!==[null,void 0,!1,0,"0","off"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&p(),-1!==[!0,1,"1","on"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&f(),{externalValue:l,checked:u,update:c,check:f,uncheck:p,handleInput:e=>{c(e.target.checked?a.value:o.value)},handleClick:()=>{s.value||(u.value?p():f())}}}(e,t),r=function(e,t,n){const{trueValue:r,falseValue:i,onLabel:o,offLabel:a}=Object(d["toRefs"])(e),s=n.checked,l=n.update;return{label:Object(d["computed"])(()=>{let e=s.value?o.value:a.value;return e||(e=" "),e}),toggle:()=>{l(s.value?i.value:r.value)},on:()=>{l(r.value)},off:()=>{l(i.value)}}}(e,0,{checked:n.checked,update:n.update}),i=function(e,t,n){const r=Object(d["toRefs"])(e),i=r.disabled,o=n.checked,a=Object(d["computed"])(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...r.classes.value}));return{classList:Object(d["computed"])(()=>({container:a.value.container,toggle:[a.value.toggle,i.value?o.value?a.value.toggleOnDisabled:a.value.toggleOffDisabled:o.value?a.value.toggleOn:a.value.toggleOff],handle:[a.value.handle,i.value?o.value?a.value.handleOnDisabled:a.value.handleOffDisabled:o.value?a.value.handleOn:a.value.handleOff],label:a.value.label}))}}(e,0,{checked:n.checked}),o=function(e,t,n){const{disabled:r}=Object(d["toRefs"])(e),i=n.check,o=n.uncheck,a=n.checked;return{handleSpace:()=>{r.value||(a.value?o():i())}}}(e,0,{check:n.check,uncheck:n.uncheck,checked:n.checked});return{...n,...i,...r,...o}}};var Gr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._b({class:e.classList.container,attrs:{tabindex:e.disabled?void 0:0,"aria-checked":e.checked,"aria-describedby":e.describedby,"aria-labelledby":e.labelledby,role:"switch"},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.preventDefault(),e.handleSpace.apply(null,arguments))}}},"div",e.aria,!1),[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{type:"checkbox",id:e.id,name:e.name,disabled:e.disabled},domProps:{value:e.trueValue,checked:e.checked}}),e._v(" "),n("div",{class:e.classList.toggle,on:{click:e.handleClick}},[n("span",{class:e.classList.handle}),e._v(" "),e._t("label",(function(){return[n("span",{class:e.classList.label,domProps:{innerHTML:e._s(e.label)}})]}),{checked:e.checked,classList:e.classList}),e._v(" "),e.required?n("input",{style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},attrs:{type:"checkbox","aria-hidden":"true",tabindex:"-1",required:""},domProps:{checked:e.checked}}):e._e()],2)])};Gr._withStripped=!0;const Wr=Hr({render:Gr,staticRenderFns:[]},void 0,Ur,void 0,!1,void 0,!1,void 0,void 0,void 0);var Zr={components:{Toggle:Wr,Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,defineRule,configure,this.lang)}},Kr=Zr,Jr=(r("8542"),Zn(Kr,Vr,qr,!1,null,null,null)),Xr=Jr.exports,Qr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("vue-tel-input",{staticClass:"w-100",attrs:{mode:"international",validCharactersOnly:!0},on:{input:e.onInput},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),n[0]?t("span",{staticClass:"invalid-feedback d-block",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},ei=[],ti=r("e75b"),ni=r.n(ti),ri=(r("bf68"),{install:(e,t)=>{e.use(ni.a,{})},components:{VueTelInput:ni.a,Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{phoneError:!1}},methods:{onInput(e,t,n){t&&0==(null===t||void 0===t?void 0:t.valid)?this.phoneError=!0:null!==t&&void 0!==t&&t.formatted&&null!==t&&void 0!==t&&t.valid&&(this.fieldInfo.value=t.formatted,this.phoneError=!1)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}}),ii=ri,oi=Zn(ii,Qr,ei,!1,null,null,null),ai=oi.exports,si=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,rows:e.getRows(e.fieldInfo),cols:e.getColumns(e.fieldInfo),placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},li=[],di={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},methods:{getColumns(e){if(e.config&&this.fieldInfo.config.cols)return e.config.cols},getRows(e){if(e.config&&this.fieldInfo.config.rows)return e.config.rows},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},ui=di,ci=Zn(ui,si,li,!1,null,null,null),fi=ci.exports,pi=function(){var e=this,t=e._self._c;return t("div",{ref:"colorpicker",staticClass:"input-group color-picker"},[t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{staticClass:"form-control w-100",attrs:{disabled:"disabled",type:"text",name:e.fieldInfo.name,pattern:"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},domProps:{value:e.fieldInfo.value},on:{input:e.updateFromInput,change:e.updateFromInput}})]}}])}),t("span",{staticClass:"input-group-addon color-picker-container",staticStyle:{padding:"6px 12px","font-size":"14px","font-weight":"400","line-height":"1",color:"#555","text-align":"center","background-color":"#eee",border:"1px solid #ccc","border-radius":"4px"},on:{click:function(t){return e.showPicker()}}},[t("span",{staticClass:"current-color",staticStyle:{width:"20px",height:"20px",display:"block"},style:"background-color:"+e.colorValue,on:{click:function(t){return e.togglePicker()}}}),e.displayPicker?t("ColorPicker",{staticStyle:{position:"absolute"},attrs:{theme:"light",disabled:e.fieldInfo.disabled},on:{changeColor:e.updateFromPicker},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}):e._e()],1)],1)},hi=[],vi=r("b9d7"),mi=r.n(vi),gi={props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},components:{Field:Re,ColorPicker:mi.a.component},data:function(){return{color:"#000000",suckerCanvas:null,suckerArea:[],isSucking:!0,colorValue:"",displayPicker:!1}},created(){this.fieldInfo&&this.fieldInfo.value?this.color=this.fieldInfo.value:this.fieldInfo.value=this.color},mounted:function(){this.setColor(this.color||"#59c7f9"),this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{setColor:function(e){this.updateColors(e),this.colorValue=e},updateColors:function(e){if("#"==e.slice(0,1))this.colors={hex:e};else if("rgba"==e.slice(0,4)){var t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(","),n="#"+((1<<24)+(parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).slice(1);this.colors={hex:n,a:t[3]}}this.isSucking=!0},showPicker:function(){document.addEventListener("click",this.documentClick),this.displayPicker=!0},hidePicker:function(){document.removeEventListener("click",this.documentClick),this.displayPicker=!1},togglePicker:function(){this.displayPicker?this.hidePicker():this.showPicker()},updateFromInput:function(){var e=new RegExp("^#[0-9A-F]{6}$"),t=this.colorValue;if(!e.test(t))return!1;this.updateColors(this.colorValue)},updateFromPicker(e){this.colors=e,1==e.rgba.a?(this.colorValue=e.hex,this.fieldInfo.value=this.colorValue):(this.colorValue="rgba("+e.rgba.r+", "+e.rgba.g+", "+e.rgba.b+", "+e.rgba.a+")",this.fieldInfo.value=this.colorValue)},documentClick:function(e){var t=this.$refs.colorpicker,n=e.target;t===n||t.contains(n)||this.hidePicker()}},watch:{colorValue:function(e){e&&(this.updateColors(e),this.updateFromInput(),this.$emit("input",e))}}},bi=gi,_i=Zn(bi,pi,hi,!1,null,null,null),yi=_i.exports,$i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"col-12 p-0",attrs:{id:"fileAttachment"}},[t("div",{staticClass:"col-12 mb-2 mt-2"},[t("label",[e._v("Allowed File Type:")]),e._l(e.fieldInfo.config.accept,(function(n){return t("div",{staticClass:"mx-2 d-inline-block doc-ico-legend"},[t("em",{staticClass:"fa text-primary",class:n.iconClass,attrs:{id:"helpText"}}),e._v(" "+e._s(n.fileType)+" ")])}))],2),t("div",{staticClass:"file-upload"},[t("div",{staticClass:"file-upload__area",on:{click:e.openFilePopup}},[t("div",[0==e.previewFiles.length?t("span",[e._v("Drop files here to upload")]):e._e(),t("input",{staticClass:"d-none",attrs:{type:"file",id:"customFile",disabled:e.fieldInfo.disabled,multiple:e.canUploadMultipleFile()},on:{change:function(t){return e.onChange(t)}}}),e.errors.length>0?t("div",e._l(e.errors,(function(n,r){return t("div",{key:r,staticClass:"file-upload__error"},[t("span",[e._v(e._s(n))])])})),0):e._e()]),e._l(e.previewFiles,(function(n,r){return t("div",{key:r,staticClass:"upload-preview"},[n.isImage?t("img",{staticClass:"file-image",attrs:{src:n.url,alt:""}}):e._e(),n.isImage?e._e():t("div",{staticClass:"file-extention"},[e._v(" "+e._s(n.fileExtention)+" ")]),t("span",{staticClass:"file-name"},[e._v(" "+e._s(n.name)+e._s(n.isImage?"."+n.fileExtention:"")+" ")]),t("span",{staticClass:"crossimg"},[t("a",{staticClass:"fa fa-times text-white",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.RemoveFile(t,r)}}})])])}))],2)])])},xi=[],wi={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{maxSize:0,accept:"",errors:[],file:{name:"",size:0,type:"",fileExtention:"",url:"",isImage:!1,isUploaded:!1},previewFiles:[]}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo.placeholder&&(this.fileName=this.fieldInfo.placeholder),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("maxSize")&&(this.maxSize=this.fieldInfo.config.maxSize),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("accept")&&(this.accept=Array.prototype.map.call(this.fieldInfo.config.accept,(function(e){return e.fileType})).join(","),console.log(this.accept))},methods:{openFilePopup(){document.querySelectorAll('[type="file"]')[0].click()},RemoveFile(e,t){e.stopPropagation();const n=new DataTransfer,r=document.querySelectorAll('[type="file"]')[0],{files:i}=r;this.previewFiles=[];for(let s=0;s<i.length;s++){const e=i[s];if(t!==s){n.items.add(e);var o=e.name.split(".").pop(),a=["jpg","jpeg","png","gif"].includes(o);let t=new FileReader;t.addEventListener("load",()=>{this.file={name:e.name.split(".").shift(),size:Math.round(e.size/1024/1024*100)/100,type:e.type,fileExtention:o,isImage:a,url:t.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),t.readAsDataURL(e)}}r.files=n.files},onChange(e){if(this.errors=[],e.target.files&&e.target.files[0]){for(let o=0;o<e.target.files.length;o++){const a=e.target.files[o];if(this.isFileValid(a)){var t=Math.round(a.size/1024/1024*100)/100,n=a.name.split(".").pop(),r=a.name.split(".").shift(),i=["jpg","jpeg","png","gif"].includes(n);console.log(t,n,r,i);let e=new FileReader;e.addEventListener("load",()=>{this.file={name:r,size:t,type:a.type,fileExtention:n,isImage:i,url:e.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),e.readAsDataURL(a)}else console.log("Invalid file")}0==this.errors.length&&(this.fieldInfo.value=e.target.files,this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo))}},isFileSizeValid(e){e<=this.maxSize?console.log("File size is valid"):this.errors.push(`File size should be less than ${this.maxSize} MB`)},isFileTypeValid(e){this.accept.split(",").includes(e)?console.log("File type is valid"):this.errors.push("File type should be "+this.accept)},isFileValid(e){return this.isFileSizeValid(Math.round(e.size/1024/1024*100)/100),this.isFileTypeValid(e.name.split(".").pop()),0===this.errors.length},canUploadMultipleFile(){return!(!this.fieldInfo.config||!this.fieldInfo.config.hasOwnProperty("multiple"))&&this.fieldInfo.config.multiple}}},ki=wi,Oi=(r("4859"),Zn(ki,$i,xi,!1,null,"0a861c4c",null)),Si=Oi.exports,Ii={name:"DynamicForm",components:{ValidationObserver:Je,NumericField:Qn,SelectField:or,TextField:cr,DateField:_r,CheckBoxField:Or,RadioField:Pr,CKEditorField:Mr,MultiSelectField:Br,ToggleField:Xr,PhoneField:ai,TextAreaField:fi,ColorField:yi,FileField:Si},data:function(){return{clickedButton:null}},props:{lang:{type:String,default:"en"},buttons:{type:Array,default:[]},schema:{type:Array,default:[],required:!0}},methods:{renderButtons:function(e){if(e){var t=[].constructor;return e.constructor===t?e:[]}},GetGroupName:function(e,t){return e||t},isRequired:function(e){let t=!1;if(e){if("string"===typeof e)return e.includes("required");"undefined"===typeof e.length?Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)}):"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)})}))}return t},onSubmit:function(){var e={};this.schema.forEach(t=>{t.Data.forEach(t=>{e[t.name]=t.value})}),console.log(e),this.$emit("OnSubmit",e,this.clickedButton),console.log(1001)},onButtonClick:function(e){let t="";t=e.name?e.name:e.text,this.clickedButton=t,e.hasOwnProperty("onClick")&&e.onClick(e)}},created:function(){}},Di=Ii,ji=Zn(Di,s,l,!1,null,null,null),Ci=ji.exports,Pi=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Ei=[],Ai={components:{Multiselect:zr.a,Field:Re},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Mi=Ai,Ti=Zn(Mi,Pi,Ei,!1,null,null,null),Ni=Ti.exports,Fi={install(e,t={}){e.component("DynamicForm",Ci),e.component("NumericField",Qn),e.component("SelectField",or),e.component("TextField",cr),e.component("DateField",_r),e.component("CheckBoxField",Or),e.component("RadioField",Pr),e.component("PhoneField",ai),e.component("CustomSelectField",Ni),e.component("MultiSelectField",Br),e.component("TextAreaField",fi),e.component("CKEditorField",Mr)}};n["default"]=Fi},fc6a:function(e,t,n){var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fdbf:function(e,t,n){var r=n("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcd:function(e){e.exports=JSON.parse('{"code":"ka","messages":{"alpha":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებს","alpha_num":"{_field_} უნდა შეიცავდეს მხოლოდ ციფრებს","alpha_dash":"{_field_} უნდა შესაძლებელია შეიცავდეს ციფრებს, ასოებს და პუნქტუაციის ნიშნებს","alpha_spaces":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებსა და ცარიელ სივრცეებს","between":"{_field_} უნდა იყოს {min} და {max}ს შორის","confirmed":"{_field_} არ ემთხვევა {target}(ი)ს","digits":"{_field_} უნდა შეიცავდეს ციფრებს და უნდა იყოს ზუსტად {length}-ნიშნა","dimensions":"{_field_} უნდა იყოს {width}x{height} ზომის (pixel)","email":"{_field_}-ს უნდა ჰქონდეს ელ-ფოსტის სწორი ფორმატი","excluded":"{_field_} უნდა იყოს სწორი მნიშვნელობა","ext":"{_field_} უნდა იყოს ფაილი","image":"{_field_} უნდა იყოს სურათი","max_value":"{_field_} უნდა შეიცავდეს {max} სიმბოლოს ან ნაკლებს","max":"{_field_} არ უნდა იყოს {length} სიმბოლოზე მეტი","mimes":"{_field_}ს უნდა ჰქონდეს სწორი ფაილის ფორმატი","min_value":"{_field_} უნდა შეიცავდეს {min} ან მეტ სიმბოლოს","min":"{_field_} უნდა შეიცავდეს მინიმუმ {length} სიმბოლოს","numeric":"{_field_} უნდა შეიცავდეს ციფრებს","oneOf":"{_field_} უნდა იყოს სწორი მნიშვნელობა","regex":"{_field_}-(ი)ს ფორმატი არასწორია","required":"{_field_} აუცილებელია","required_if":"{_field_} აუცილებელია","size":"{_field_} უნდა იყოს {size}KB-ზე ნაკლები","double":"{_field_} ველი უნდა იყოს სწორი ათობითი"}}')}})}));
|
|
6
|
+
*/function Tt(e){return null===e||void 0===e}function Nt(e){return Array.isArray(e)&&0===e.length}function Ft(e){return"function"===typeof e}function zt(e,t){return-1!==e.indexOf(t)}function Lt(e){return Ft(Array.from)?Array.from(e):Rt(e)}function Rt(e){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}var Yt=function(e,t){return Array.isArray(e)?e.every((function(e){return Yt(e,t)})):Lt(t).some((function(t){return t==e}))},Bt={validate:Yt},Vt=function(e,t){return!Yt(e,t)},qt={validate:Vt},Ht=function(e,t){var n=new RegExp(".("+t.join("|")+")$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.name)})):n.test(e.name)},Ut={validate:Ht},Gt=function(e){var t=/\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;return Array.isArray(e)?e.every((function(e){return t.test(e.name)})):t.test(e.name)},Wt={validate:Gt},Zt=function(e){return Array.isArray(e)?e.every((function(e){return/^-?[0-9]+$/.test(String(e))})):/^-?[0-9]+$/.test(String(e))},Kt={validate:Zt},Jt=function(e,t){var n=t.other;return e===n},Xt=[{name:"other"}],Qt={validate:Jt,params:Xt},en=function(e,t){var n=t.other;return e!==n},tn=[{name:"other"}],nn={validate:en,params:tn},rn=function(e,t){var n=t.length;return!Tt(e)&&("string"===typeof e&&(e=Lt(e)),"number"===typeof e&&(e=String(e)),e.length||(e=Lt(e)),e.length===n)},on=[{name:"length",cast:function(e){return Number(e)}}],an={validate:rn,params:on},sn=function(e,t){var n=t.length;return Tt(e)?n>=0:Array.isArray(e)?e.every((function(e){return sn(e,{length:n})})):String(e).length<=n},ln=[{name:"length",cast:function(e){return Number(e)}}],dn={validate:sn,params:ln},un=function(e,t){var n=t.max;return!Tt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return un(e,{max:n})})):Number(e)<=n)},cn=[{name:"max",cast:function(e){return Number(e)}}],fn={validate:un,params:cn},pn=function(e,t){var n=new RegExp(t.join("|").replace("*",".+")+"$","i");return Array.isArray(e)?e.every((function(e){return n.test(e.type)})):n.test(e.type)},hn={validate:pn},vn=function(e,t){var n=t.length;return!Tt(e)&&(Array.isArray(e)?e.every((function(e){return vn(e,{length:n})})):String(e).length>=n)},mn=[{name:"length",cast:function(e){return Number(e)}}],gn={validate:vn,params:mn},bn=function(e,t){var n=t.min;return!Tt(e)&&""!==e&&(Array.isArray(e)?e.length>0&&e.every((function(e){return bn(e,{min:n})})):Number(e)>=n)},_n=[{name:"min",cast:function(e){return Number(e)}}],yn={validate:bn,params:_n},$n=/^[٠١٢٣٤٥٦٧٨٩]+$/,xn=/^[0-9]+$/,wn=function(e){var t=function(e){var t=String(e);return xn.test(t)||$n.test(t)};return Array.isArray(e)?e.every(t):t(e)},kn={validate:wn},On=function(e,t){var n=t.regex;return Array.isArray(e)?e.every((function(e){return On(e,{regex:n})})):n.test(String(e))},Sn=[{name:"regex",cast:function(e){return"string"===typeof e?new RegExp(e):e}}],In={validate:On,params:Sn},Dn=function(e,t){var n=(void 0===t?{allowFalse:!0}:t).allowFalse,r={valid:!1,required:!0};return Tt(e)||Nt(e)?r:!1!==e||n?(r.valid=!!String(e).trim().length,r):r},jn=!0,Cn=[{name:"allowFalse",default:!0}],Pn={validate:Dn,params:Cn,computesRequired:jn},En=function(e){return Nt(e)||zt([!1,null,void 0],e)||!String(e).trim().length},An=function(e,t){var n,r=t.target,i=t.values;return i&&i.length?(Array.isArray(i)||"string"!==typeof i||(i=[i]),n=i.some((function(e){return e==String(r).trim()}))):n=!En(r),n?{valid:!En(e),required:n}:{valid:!0,required:n}},Mn=[{name:"target",isTarget:!0},{name:"values"}],Tn=!0,Nn={validate:An,params:Mn,computesRequired:Tn},Fn=function(e,t){var n=t.size;if(isNaN(n))return!1;var r=1024*n;if(!Array.isArray(e))return e.size<=r;for(var i=0;i<e.length;i++)if(e[i].size>r)return!1;return!0},zn=[{name:"size",cast:function(e){return Number(e)}}],Ln={validate:Fn,params:zn},Rn=function(e,t){var n=t||{},r=n.decimals,i=void 0===r?0:r,o=n.separator,a=void 0===o?"dot":o,s="comma"===a?",?":"\\.?",l=0===i?"\\d*":"(\\d{"+i+"})?",d=new RegExp("^-?\\d+"+s+l+"$");return Array.isArray(e)?e.every((function(e){return d.test(String(e))})):d.test(String(e))},Yn=[{name:"decimals",default:0},{name:"separator",default:"dot"}],Bn={validate:Rn,params:Yn};function Vn(e){return r("bb28")(`./${e}.json`).then(t=>{fe(e,t)})}function qn(e,t){let n={},r=Vn(null!==t&&void 0!==t?t:"en");return e&&("string"===typeof e||"undefined"===typeof e.length?n=e:"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(t=>{"errormessage"!=t.toLowerCase()&&(n[t]=e[t]),"errormessage"!=t.toLowerCase()&&"undefined"!=typeof e.errorMessage&&"function"!==typeof e[t]&&(r.messages[t]=e.errorMessage),"function"!==typeof e[t]&&"object"!==typeof e[t]||F(t,e[t])})}))),n}Object.keys(i).forEach(e=>{F(e,i[e])}),F("password",{params:["target"],validate(e,{target:t}){return e===t},message:"Password confirmation does not match"}),F("url",{validate(e){return!!e&&/^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/.test(e)},message:"The {_field_} field must be a valid URL"}),F("colorCode",{validate(e){return!!e&&/^#[0-9A-F]{6}$/.test(e)},message:"The {_field_} field must be a valid color"}),F("ZipCode",{validate(e){return!!e&&/(^\d{6}$)|(^\d{5}-\d{4}$)/.test(e)},message:"The {_field_} field is not valid"});var Hn=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,type:"text",placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},keypress:e.onlyForCurrency,input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},Un=[],Gn={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{value:""}},methods:{onlyForCurrency(e){let t=e.keyCode?e.keyCode:e.which;!(t<48||t>57)||46===t&&-1==this.fieldInfo.value.indexOf(".")||e.preventDefault(),null!=this.fieldInfo.value&&this.fieldInfo.value.indexOf(".")>-1&&this.fieldInfo.value.split(".")[1].length>1&&e.preventDefault()},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Wn=Gn;function Zn(e,t,n,r,i,o,a,s){var l,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=n,d._compiled=!0),r&&(d.functional=!0),o&&(d._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},d._ssrRegister=l):i&&(l=s?function(){i.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(d.functional){d._injectStyles=l;var u=d.render;d.render=function(e,t){return l.call(t),u(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,l):[l]}return{exports:e,options:d}}var Kn,Jn,Xn=Zn(Wn,Hn,Un,!1,null,null,null),Qn=Xn.exports,er=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"d-flex w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("select",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled},on:{change:[function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.fieldInfo,"value",t.target.multiple?n:n[0])},function(t){return e.onChange(t)}]}},[t("option",{attrs:{value:""}},[e._v("Select "+e._s(e.fieldInfo.label))]),e._l(e.renderOptions(e.fieldInfo),(function(n,r){return t("option",{key:r,domProps:{value:n.value}},[e._v(e._s(n.name))])}))],2),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))]):e._e()]}}])})},tr=[],nr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},rr=nr,ir=Zn(rr,er,tr,!1,null,null,null),or=ir.exports,ar=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{name:e.fieldInfo.name,id:e.fieldInfo.name,type:"text",placeholder:e.fieldInfo.placeholder,disabled:e.fieldInfo.disabled},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},sr=[],lr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}}},dr=lr,ur=Zn(dr,ar,sr,!1,null,null,null),cr=ur.exports,fr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("DatePicker",{class:{"input-group w-100":!0,"is-invalid":n[0]},staticStyle:{"flex-wrap":"nowrap"},attrs:{is24hr:e.is24hr,mode:e.mode,disabled:e.fieldInfo.disabled,masks:e.masks,popover:e.popover,"min-date":e.getMinmumDate(e.fieldInfo),"max-date":e.getMaxDate(e.fieldInfo),"minute-increment":5},scopedSlots:e._u([{key:"default",fn:function({inputValue:r,inputEvents:i,togglePopover:o}){return[t("input",e._g({ref:"inputDatePicker",class:{"form-control w-100":!0,"is-invalid":n[0]},attrs:{autocomplete:"off",disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,placeholder:e.fieldInfo.label},domProps:{value:r},on:{blur:function(t){return e.onBlur(t,e.field)}}},i)),t("div",{staticClass:"input-group-append"},[t("span",e._g({staticClass:"input-group-text"},i),[t("i",{staticClass:"fa fa-calendar"})])])]}}],null,!0),model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),t("span",{directives:[{name:"show",rawName:"v-show",value:n[0],expression:"errors[0]"}],ref:"errrorMessage",staticClass:"invalid-feedback d-block"},[e._v(e._s(n[0]))])]}}])})},pr=[],hr=r("404b"),vr=r.n(hr),mr={components:{Field:Re,DatePicker:vr.a},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{popover:{visibility:"click"},masks:{input:"DD-MM-YYYY"},date:new Date,mode:"date",is24hr:!1}},methods:{getMinmumDate(e){if(e.config&&this.fieldInfo.config.minDate)return e.config.minDate},getMaxDate(e){if(e.config&&this.fieldInfo.config.maxDate)return e.config.maxDate},onBlur(t){try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo.config&&this.fieldInfo.config.is24hr&&(this.is24hr=this.fieldInfo.config.is24hr),this.fieldInfo.config&&this.fieldInfo.config.mode&&(this.mode=this.fieldInfo.config.mode),this.fieldInfo.config&&this.fieldInfo.config.format&&("date"==this.mode?this.masks.input=this.fieldInfo.config.format:"dateTime"==this.mode?this.masks.inputDateTime=this.fieldInfo.config.format:"time"==this.mode&&(this.masks.inputTime=this.fieldInfo.config.format))}},gr=mr,br=(r("9f68"),Zn(gr,fr,pr,!1,null,null,null)),_r=br.exports,yr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-check custom-control-inline"},[t("input",{staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name+"_"+i,id:e.fieldInfo.name+"_"+i,type:"checkbox"},domProps:{checked:e.isChecked(r),value:r.value},on:{change:function(t){return e.onChange(t,e.field)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])})),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},$r=[],xr=(r("14d9"),{components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},created:function(){},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},onChange:function(e,t){"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split()),e.target.checked?(this.fieldInfo.value="string"==typeof this.fieldInfo.value?[]:this.fieldInfo.value,this.fieldInfo.value.push(e.target.value)):this.fieldInfo.value.splice(this.fieldInfo.value.indexOf(e.target.value),1);try{t.onBlur[0](),t.onBlur[1]()}catch(n){}this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},isChecked:function(t){try{return"array"==typeof this.fieldInfo.value||"object"==typeof this.fieldInfo.value?this.fieldInfo.value.includes(t.value):this.fieldInfo.value==t.value}catch(e){console.log("Checkbox value should be in string or array")}}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo&&this.fieldInfo.value&&"array"!=typeof this.fieldInfo.value&&"object"!=typeof this.fieldInfo.value&&(this.fieldInfo.value=this.fieldInfo.value.toString().split())}}),wr=xr,kr=Zn(wr,yr,$r,!1,null,null,null),Or=kr.exports,Sr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label,slim:""},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return e._l(e.renderOptions(e.fieldInfo),(function(r,i){return t("label",{key:i,class:{"form-check form-check-inline":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled}},[t("div",{staticClass:"custom-control custom-radio custom-control-inline"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],staticClass:"custom-control-input",attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,id:e.fieldInfo.name+"_"+i,type:"radio"},domProps:{checked:r.value==e.fieldInfo.value,checked:e._q(e.fieldInfo.value,null)},on:{change:function(t){return e.$set(e.fieldInfo,"value",null)}}}),t("label",{staticClass:"custom-control-label",attrs:{for:e.fieldInfo.name+"_"+i}},[e._v(e._s(r.name))])])])}))}}])})},Ir=[],Dr={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{checkOptions:[]}},methods:{renderOptions:function(e){if(e.config&&this.fieldInfo.config.options){var t=[].constructor;return this.fieldInfo.config.options.constructor===t?e.config.options:null}},AssignToggleValues:function(e,t,n){this.$emit("AssignToggleValues",e,t,n)},showDependentItem:function(e,t){this.$emit("showDependentItem",e,t)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},jr=Dr,Cr=Zn(jr,Sr,Ir,!1,null,null,null),Pr=Cr.exports,Er={},Ar=Zn(Er,Kn,Jn,!1,null,null,null),Mr=Ar.exports,Tr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Nr=[],Fr=r("8e5f"),zr=r.n(Fr),Lr={components:{Multiselect:zr.a,Field:Re},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Rr=Lr,Yr=(r("8498"),Zn(Rr,Tr,Nr,!1,null,null,null)),Br=Yr.exports,Vr=function(){var e=this,t=e._self._c;return t("Field",{attrs:{disabled:e.fieldInfo.disabled,name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("div",{class:{"is-invalid":n[0]}},[t("Toggle",{attrs:{disabled:e.fieldInfo.disabled,"on-label":"Yes","off-label":"No"},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}})],1),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},qr=[];function Hr(e,t,n,r,i,o,a,s,l,d){"boolean"!=typeof a&&(l=s,s=a,a=!1);const u="function"==typeof n?n.options:n;let c;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,i&&(u.functional=!0)),r&&(u._scopeId=r),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):t&&(c=a?function(e){t.call(this,d(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),c)if(u.functional){const e=u.render;u.render=function(t,n){return c.call(n),e(t,n)}}else{const e=u.beforeCreate;u.beforeCreate=e?[].concat(e,c):[c]}return n}const Ur={name:"Toggle",emits:["input","update:modelValue","change"],props:{value:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},modelValue:{validator:function(e){return e=>-1!==["number","string","boolean"].indexOf(typeof e)||null==e},required:!1},id:{type:[String,Number],required:!1,default:"toggle"},name:{type:[String,Number],required:!1,default:"toggle"},disabled:{type:Boolean,required:!1,default:!1},required:{type:Boolean,required:!1,default:!1},falseValue:{type:[String,Number,Boolean],required:!1,default:!1},trueValue:{type:[String,Number,Boolean],required:!1,default:!0},onLabel:{type:[String,Object],required:!1,default:""},offLabel:{type:[String,Object],required:!1,default:""},classes:{type:Object,required:!1,default:()=>({})},labelledby:{type:String,required:!1},describedby:{type:String,required:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(e,t){const n=function(e,t,n){const{value:r,modelValue:i,falseValue:o,trueValue:a,disabled:s}=Object(d["toRefs"])(e),l=i&&void 0!==i.value?i:r,u=Object(d["computed"])(()=>l.value===a.value),c=e=>{t.emit("input",e),t.emit("update:modelValue",e),t.emit("change",e)},f=()=>{c(a.value)},p=()=>{c(o.value)};return-1!==[null,void 0,!1,0,"0","off"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&p(),-1!==[!0,1,"1","on"].indexOf(l.value)&&-1===[o.value,a.value].indexOf(l.value)&&f(),{externalValue:l,checked:u,update:c,check:f,uncheck:p,handleInput:e=>{c(e.target.checked?a.value:o.value)},handleClick:()=>{s.value||(u.value?p():f())}}}(e,t),r=function(e,t,n){const{trueValue:r,falseValue:i,onLabel:o,offLabel:a}=Object(d["toRefs"])(e),s=n.checked,l=n.update;return{label:Object(d["computed"])(()=>{let e=s.value?o.value:a.value;return e||(e=" "),e}),toggle:()=>{l(s.value?i.value:r.value)},on:()=>{l(r.value)},off:()=>{l(i.value)}}}(e,0,{checked:n.checked,update:n.update}),i=function(e,t,n){const r=Object(d["toRefs"])(e),i=r.disabled,o=n.checked,a=Object(d["computed"])(()=>({container:"toggle-container",toggle:"toggle",toggleOn:"toggle-on",toggleOff:"toggle-off",toggleOnDisabled:"toggle-on-disabled",toggleOffDisabled:"toggle-off-disabled",handle:"toggle-handle",handleOn:"toggle-handle-on",handleOff:"toggle-handle-off",handleOnDisabled:"toggle-handle-on-disabled",handleOffDisabled:"toggle-handle-off-disabled",label:"toggle-label",...r.classes.value}));return{classList:Object(d["computed"])(()=>({container:a.value.container,toggle:[a.value.toggle,i.value?o.value?a.value.toggleOnDisabled:a.value.toggleOffDisabled:o.value?a.value.toggleOn:a.value.toggleOff],handle:[a.value.handle,i.value?o.value?a.value.handleOnDisabled:a.value.handleOffDisabled:o.value?a.value.handleOn:a.value.handleOff],label:a.value.label}))}}(e,0,{checked:n.checked}),o=function(e,t,n){const{disabled:r}=Object(d["toRefs"])(e),i=n.check,o=n.uncheck,a=n.checked;return{handleSpace:()=>{r.value||(a.value?o():i())}}}(e,0,{check:n.check,uncheck:n.uncheck,checked:n.checked});return{...n,...i,...r,...o}}};var Gr=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",e._b({class:e.classList.container,attrs:{tabindex:e.disabled?void 0:0,"aria-checked":e.checked,"aria-describedby":e.describedby,"aria-labelledby":e.labelledby,role:"switch"},on:{keypress:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])?null:(t.preventDefault(),e.handleSpace.apply(null,arguments))}}},"div",e.aria,!1),[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],attrs:{type:"checkbox",id:e.id,name:e.name,disabled:e.disabled},domProps:{value:e.trueValue,checked:e.checked}}),e._v(" "),n("div",{class:e.classList.toggle,on:{click:e.handleClick}},[n("span",{class:e.classList.handle}),e._v(" "),e._t("label",(function(){return[n("span",{class:e.classList.label,domProps:{innerHTML:e._s(e.label)}})]}),{checked:e.checked,classList:e.classList}),e._v(" "),e.required?n("input",{style:{appearance:"none",height:"1px",margin:"0",padding:"0",fontSize:"0",background:"transparent",position:"absolute",width:"100%",bottom:"0",outline:"none"},attrs:{type:"checkbox","aria-hidden":"true",tabindex:"-1",required:""},domProps:{checked:e.checked}}):e._e()],2)])};Gr._withStripped=!0;const Wr=Hr({render:Gr,staticRenderFns:[]},void 0,Ur,void 0,!1,void 0,!1,void 0,void 0,void 0);var Zr={components:{Toggle:Wr,Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,defineRule,configure,this.lang)}},Kr=Zr,Jr=(r("8542"),Zn(Kr,Vr,qr,!1,null,null,null)),Xr=Jr.exports,Qr=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,disabled:e.fieldInfo.disabled,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("vue-tel-input",{staticClass:"w-100",attrs:{mode:"international",validCharactersOnly:!0},on:{input:e.onInput},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),n[0]?t("span",{staticClass:"invalid-feedback d-block",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},ei=[],ti=r("e75b"),ni=r.n(ti),ri=(r("bf68"),{install:(e,t)=>{e.use(ni.a,{})},components:{VueTelInput:ni.a,Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{phoneError:!1}},methods:{onInput(e,t,n){t&&0==(null===t||void 0===t?void 0:t.valid)?this.phoneError=!0:null!==t&&void 0!==t&&t.formatted&&null!==t&&void 0!==t&&t.valid&&(this.fieldInfo.value=t.formatted,this.phoneError=!1)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}}),ii=ri,oi=Zn(ii,Qr,ei,!1,null,null,null),ai=oi.exports,si=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.fieldInfo.value,expression:"fieldInfo.value"}],class:{"form-control":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,rows:e.getRows(e.fieldInfo),cols:e.getColumns(e.fieldInfo),placeholder:e.fieldInfo.placeholder},domProps:{value:e.fieldInfo.value},on:{change:function(t){return e.onChange(t)},blur:function(t){return e.onBlur(t)},input:function(t){t.target.composing||e.$set(e.fieldInfo,"value",t.target.value)}}}),n[0]?t("span",{staticClass:"invalid-feedback",attrs:{name:e.fieldInfo.name}},[e._v(e._s(n[0]))]):e._e()]}}])})},li=[],di={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},methods:{getColumns(e){if(e.config&&this.fieldInfo.config.cols)return e.config.cols},getRows(e){if(e.config&&this.fieldInfo.config.rows)return e.config.rows},onChange:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo)},onBlur:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onBlur&&this.fieldInfo.config.onBlur(e,this.fieldInfo)}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},ui=di,ci=Zn(ui,si,li,!1,null,null,null),fi=ci.exports,pi=function(){var e=this,t=e._self._c;return t("div",{ref:"colorpicker",staticClass:"input-group color-picker"},[t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("input",{staticClass:"form-control w-100",attrs:{disabled:"disabled",type:"text",name:e.fieldInfo.name,pattern:"^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"},domProps:{value:e.fieldInfo.value},on:{input:e.updateFromInput,change:e.updateFromInput}})]}}])}),t("span",{staticClass:"input-group-addon color-picker-container",staticStyle:{padding:"6px 12px","font-size":"14px","font-weight":"400","line-height":"1",color:"#555","text-align":"center","background-color":"#eee",border:"1px solid #ccc","border-radius":"4px"},on:{click:function(t){return e.showPicker()}}},[t("span",{staticClass:"current-color",staticStyle:{width:"20px",height:"20px",display:"block"},style:"background-color:"+e.colorValue,on:{click:function(t){return e.togglePicker()}}}),e.displayPicker?t("ColorPicker",{staticStyle:{position:"absolute"},attrs:{theme:"light",disabled:e.fieldInfo.disabled},on:{changeColor:e.updateFromPicker},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}):e._e()],1)],1)},hi=[],vi=r("b9d7"),mi=r.n(vi),gi={props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},components:{Field:Re,ColorPicker:mi.a.component},data:function(){return{color:"#000000",suckerCanvas:null,suckerArea:[],isSucking:!0,colorValue:"",displayPicker:!1}},created(){this.fieldInfo&&this.fieldInfo.value?this.color=this.fieldInfo.value:this.fieldInfo.value=this.color},mounted:function(){this.setColor(this.color||"#59c7f9"),this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)},methods:{setColor:function(e){this.updateColors(e),this.colorValue=e},updateColors:function(e){if("#"==e.slice(0,1))this.colors={hex:e};else if("rgba"==e.slice(0,4)){var t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(","),n="#"+((1<<24)+(parseInt(t[0])<<16)+(parseInt(t[1])<<8)+parseInt(t[2])).toString(16).slice(1);this.colors={hex:n,a:t[3]}}this.isSucking=!0},showPicker:function(){document.addEventListener("click",this.documentClick),this.displayPicker=!0},hidePicker:function(){document.removeEventListener("click",this.documentClick),this.displayPicker=!1},togglePicker:function(){this.displayPicker?this.hidePicker():this.showPicker()},updateFromInput:function(){var e=new RegExp("^#[0-9A-F]{6}$"),t=this.colorValue;if(!e.test(t))return!1;this.updateColors(this.colorValue)},updateFromPicker(e){this.colors=e,1==e.rgba.a?(this.colorValue=e.hex,this.fieldInfo.value=this.colorValue):(this.colorValue="rgba("+e.rgba.r+", "+e.rgba.g+", "+e.rgba.b+", "+e.rgba.a+")",this.fieldInfo.value=this.colorValue)},documentClick:function(e){var t=this.$refs.colorpicker,n=e.target;t===n||t.contains(n)||this.hidePicker()}},watch:{colorValue:function(e){e&&(this.updateColors(e),this.updateFromInput(),this.$emit("input",e))}}},bi=gi,_i=Zn(bi,pi,hi,!1,null,null,null),yi=_i.exports,$i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"col-12 p-0",attrs:{id:"fileAttachment"}},[t("div",{staticClass:"col-12 mb-2 mt-2"},[t("label",[e._v("Allowed File Type:")]),e._l(e.fieldInfo.config.accept,(function(n){return t("div",{staticClass:"mx-2 d-inline-block doc-ico-legend"},[t("em",{staticClass:"fa text-primary",class:n.iconClass,attrs:{id:"helpText"}}),e._v(" "+e._s(n.fileType)+" ")])}))],2),t("div",{staticClass:"file-upload"},[t("div",{staticClass:"file-upload__area",on:{click:e.openFilePopup}},[t("div",[0==e.previewFiles.length?t("span",[e._v("Drop files here to upload")]):e._e(),t("input",{staticClass:"d-none",attrs:{type:"file",id:"customFile",disabled:e.fieldInfo.disabled,multiple:e.canUploadMultipleFile()},on:{change:function(t){return e.onChange(t)}}}),e.errors.length>0?t("div",e._l(e.errors,(function(n,r){return t("div",{key:r,staticClass:"file-upload__error"},[t("span",[e._v(e._s(n))])])})),0):e._e()]),e._l(e.previewFiles,(function(n,r){return t("div",{key:r,staticClass:"upload-preview"},[n.isImage?t("img",{staticClass:"file-image",attrs:{src:n.url,alt:""}}):e._e(),n.isImage?e._e():t("div",{staticClass:"file-extention"},[e._v(" "+e._s(n.fileExtention)+" ")]),t("span",{staticClass:"file-name"},[e._v(" "+e._s(n.name)+e._s(n.isImage?"."+n.fileExtention:"")+" ")]),t("span",{staticClass:"crossimg"},[t("a",{staticClass:"fa fa-times text-white",attrs:{href:"javascript:void(0)"},on:{click:function(t){return e.RemoveFile(t,r)}}})])])}))],2)])])},xi=[],wi={components:{Field:Re},props:{lang:{type:String,default:"en"},fieldInfo:{type:Object,required:!0}},data:function(){return{maxSize:0,accept:"",errors:[],file:{name:"",size:0,type:"",fileExtention:"",url:"",isImage:!1,isUploaded:!1},previewFiles:[]}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang),this.fieldInfo.placeholder&&(this.fileName=this.fieldInfo.placeholder),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("maxSize")&&(this.maxSize=this.fieldInfo.config.maxSize),this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.hasOwnProperty("accept")&&(this.accept=Array.prototype.map.call(this.fieldInfo.config.accept,(function(e){return e.fileType})).join(","),console.log(this.accept))},methods:{openFilePopup(){document.querySelectorAll('[type="file"]')[0].click()},RemoveFile(e,t){e.stopPropagation();const n=new DataTransfer,r=document.querySelectorAll('[type="file"]')[0],{files:i}=r;this.previewFiles=[];for(let s=0;s<i.length;s++){const e=i[s];if(t!==s){n.items.add(e);var o=e.name.split(".").pop(),a=["jpg","jpeg","png","gif"].includes(o);let t=new FileReader;t.addEventListener("load",()=>{this.file={name:e.name.split(".").shift(),size:Math.round(e.size/1024/1024*100)/100,type:e.type,fileExtention:o,isImage:a,url:t.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),t.readAsDataURL(e)}}r.files=n.files},onChange(e){if(this.errors=[],e.target.files&&e.target.files[0]){for(let o=0;o<e.target.files.length;o++){const a=e.target.files[o];if(this.isFileValid(a)){var t=Math.round(a.size/1024/1024*100)/100,n=a.name.split(".").pop(),r=a.name.split(".").shift(),i=["jpg","jpeg","png","gif"].includes(n);console.log(t,n,r,i);let e=new FileReader;e.addEventListener("load",()=>{this.file={name:r,size:t,type:a.type,fileExtention:n,isImage:i,url:e.result,isUploaded:!0},this.previewFiles.push(this.file)},!1),e.readAsDataURL(a)}else console.log("Invalid file")}0==this.errors.length&&(this.fieldInfo.value=e.target.files,this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(e,this.fieldInfo))}},isFileSizeValid(e){e<=this.maxSize?console.log("File size is valid"):this.errors.push(`File size should be less than ${this.maxSize} MB`)},isFileTypeValid(e){this.accept.split(",").includes(e)?console.log("File type is valid"):this.errors.push("File type should be "+this.accept)},isFileValid(e){return this.isFileSizeValid(Math.round(e.size/1024/1024*100)/100),this.isFileTypeValid(e.name.split(".").pop()),0===this.errors.length},canUploadMultipleFile(){return!(!this.fieldInfo.config||!this.fieldInfo.config.hasOwnProperty("multiple"))&&this.fieldInfo.config.multiple}}},ki=wi,Oi=(r("4859"),Zn(ki,$i,xi,!1,null,"0a861c4c",null)),Si=Oi.exports,Ii={name:"DynamicForm",components:{ValidationObserver:Je,NumericField:Qn,SelectField:or,TextField:cr,DateField:_r,CheckBoxField:Or,RadioField:Pr,CKEditorField:Mr,MultiSelectField:Br,ToggleField:Xr,PhoneField:ai,TextAreaField:fi,ColorField:yi,FileField:Si},data:function(){return{clickedButton:null}},props:{lang:{type:String,default:"en"},buttons:{type:Array,default:[]},schema:{type:Array,default:[],required:!0}},methods:{renderButtons:function(e){if(e){var t=[].constructor;return e.constructor===t?e:[]}},GetGroupName:function(e,t){return e||t},isRequired:function(e){let t=!1;if(e){if("string"===typeof e)return e.includes("required");"undefined"===typeof e.length?Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)}):"undefined"!==typeof e.length&&e.forEach((function(e){Object.keys(e).forEach(n=>{"required"==n.toLowerCase()&&1==e[n]&&0==t&&(t=!0)})}))}return t},onSubmit:function(){var e={};this.schema.forEach(t=>{t.Data.forEach(t=>{e[t.name]=t.value})}),console.log(e),this.$emit("OnSubmit",e,this.clickedButton),console.log(1001)},onButtonClick:function(e){let t="";t=e.name?e.name:e.text,this.clickedButton=t,e.hasOwnProperty("onClick")&&e.onClick(e)}},created:function(){}},Di=Ii,ji=Zn(Di,s,l,!1,null,null,null),Ci=ji.exports,Pi=function(){var e=this,t=e._self._c;return t("Field",{staticClass:"w-100",attrs:{name:e.fieldInfo.name,rules:e.fieldInfo.validationRules,label:e.fieldInfo.label},scopedSlots:e._u([{key:"default",fn:function({errors:n}){return[t("Multiselect",{ref:"multiselect",class:{"form-control p-0 w-100":!0,"is-invalid":n[0]},attrs:{disabled:e.fieldInfo.disabled,options:e.options,"close-on-select":!1,searchable:!0,multiple:"tag"==e.fieldInfo.modemode,taggable:"tag"==e.fieldInfo.mode},on:{remove:function(t){return e.onRemove(t,e.field,e.meta)},"search-change":e.onSearch,select:e.onChange},model:{value:e.fieldInfo.value,callback:function(t){e.$set(e.fieldInfo,"value",t)},expression:"fieldInfo.value"}}),e.showAddIcon()?t("div",{staticClass:"ml-2 mt-1"},[t("a",{class:e.addButtonClass()},[t("i",{class:e.addIconClass(),attrs:{alt:"+"},on:{click:function(t){return e.onAddButtonClick(t)}}})])]):e._e(),n[0]?t("span",{staticClass:"invalid-feedback"},[e._v(e._s(n[0]))]):e._e()]}}])})},Ei=[],Ai={components:{Multiselect:zr.a,Field:Re},props:{lang:{type:String,default:"en"},mode:{type:String,default:"single"},fieldInfo:{type:Object,required:!0}},watch:{fieldInfo:{handler:function(e,t){let n=this;if(console.log("Multi drop down",e,t),e.config&&e.config.options)try{n.options=[],e.config.options.forEach((function(e){let t={value:e.value,label:e.name};n.options.push(t)}))}catch(r){}},deep:!0}},created:function(){let e=this;if("undefined"!=typeof e.fieldInfo.value&&""!=e.fieldInfo.value||(e.fieldInfo.value=[]),"undefined"!=typeof e.fieldInfo.mode&&""!=e.fieldInfo.mode||(e.fieldInfo.mode="single"),e.fieldInfo.config&&e.fieldInfo.config.options)try{e.fieldInfo.config.options.forEach((function(t){let n={value:t.value,label:t.name};e.options.push(n)}))}catch(t){console.log(t)}},data:function(){return{isTouched:!1,value:[],selectedHtml:"",options:[]}},computed:{isInvalid(){return this.isTouched&&0===this.value.length}},methods:{onSearch:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onSearchChange&&this.fieldInfo.config.onSearchChange(t,this.fieldInfo)},onChange:function(e,t){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onChange&&this.fieldInfo.config.onChange(t,this.fieldInfo)},showAddIcon:function(){if(this.fieldInfo.config&&this.fieldInfo.config.showAddIcon)return this.fieldInfo.config.showAddIcon},onAddButtonClick:function(e){this.fieldInfo&&this.fieldInfo.config&&this.fieldInfo.config.onAddButtonClick&&this.fieldInfo.config.onAddButtonClick(e,this.fieldInfo)},addButtonClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIconBackground?"round-icon-small theme-primary "+this.fieldInfo.config.addIconBackground:"round-icon-small btn-dark theme-primary"},addIconClass:function(){return this.fieldInfo.config&&this.fieldInfo.config.addIcon?"fa text-white pt-7 font-18 "+this.fieldInfo.config.addIcon:"fa fa-plus text-white pt-7 font-18"}},mounted:function(){this.fieldInfo.validationRules=qn(this.fieldInfo.validationRules,this.lang)}},Mi=Ai,Ti=Zn(Mi,Pi,Ei,!1,null,null,null),Ni=Ti.exports,Fi={install(e,t={}){e.component("DynamicForm",Ci),e.component("NumericField",Qn),e.component("SelectField",or),e.component("TextField",cr),e.component("DateField",_r),e.component("CheckBoxField",Or),e.component("RadioField",Pr),e.component("PhoneField",ai),e.component("CustomSelectField",Ni),e.component("MultiSelectField",Br),e.component("TextAreaField",fi),e.component("CKEditorField",Mr)}};n["default"]=Fi},fc6a:function(e,t,n){var r=n("44ad"),i=n("1d80");e.exports=function(e){return r(i(e))}},fdbf:function(e,t,n){var r=n("04f8");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fdcd:function(e){e.exports=JSON.parse('{"code":"ka","messages":{"alpha":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებს","alpha_num":"{_field_} უნდა შეიცავდეს მხოლოდ ციფრებს","alpha_dash":"{_field_} უნდა შესაძლებელია შეიცავდეს ციფრებს, ასოებს და პუნქტუაციის ნიშნებს","alpha_spaces":"{_field_} უნდა შეიცავდეს მხოლოდ ასოებსა და ცარიელ სივრცეებს","between":"{_field_} უნდა იყოს {min} და {max}ს შორის","confirmed":"{_field_} არ ემთხვევა {target}(ი)ს","digits":"{_field_} უნდა შეიცავდეს ციფრებს და უნდა იყოს ზუსტად {length}-ნიშნა","dimensions":"{_field_} უნდა იყოს {width}x{height} ზომის (pixel)","email":"{_field_}-ს უნდა ჰქონდეს ელ-ფოსტის სწორი ფორმატი","excluded":"{_field_} უნდა იყოს სწორი მნიშვნელობა","ext":"{_field_} უნდა იყოს ფაილი","image":"{_field_} უნდა იყოს სურათი","max_value":"{_field_} უნდა შეიცავდეს {max} სიმბოლოს ან ნაკლებს","max":"{_field_} არ უნდა იყოს {length} სიმბოლოზე მეტი","mimes":"{_field_}ს უნდა ჰქონდეს სწორი ფაილის ფორმატი","min_value":"{_field_} უნდა შეიცავდეს {min} ან მეტ სიმბოლოს","min":"{_field_} უნდა შეიცავდეს მინიმუმ {length} სიმბოლოს","numeric":"{_field_} უნდა შეიცავდეს ციფრებს","oneOf":"{_field_} უნდა იყოს სწორი მნიშვნელობა","regex":"{_field_}-(ი)ს ფორმატი არასწორია","required":"{_field_} აუცილებელია","required_if":"{_field_} აუცილებელია","size":"{_field_} უნდა იყოს {size}KB-ზე ნაკლები","double":"{_field_} ველი უნდა იყოს სწორი ათობითი"}}')}})}));
|
|
7
7
|
//# sourceMappingURL=myLib.umd.min.js.map
|