"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[2775],{5212:function(e,t,l){l.r(t),l.d(t,{default:function(){return o}});var a=function(){var e=this,t=e._self._c;return t("input",{ref:"value",staticClass:"uk-input field-input",attrs:{readonly:e.readonly,type:e.inputType},on:{keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.save.apply(null,arguments)},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.$emit("close")}]}})},i=[],n=l(588),s=l.n(n),r={name:"fieldSimple",components:{},data(){return{loading:!0}},props:{field:Object,value:{type:String,default:""}},computed:{inputType(){return"6"===this.field.DOCPROP_OBJECT?"password":"text"},readonly(){return!!this.field.DOCPROP_READONY}},created(){},async mounted(){this.value&&(this.$refs.value.value=this.value);let e=this.field.DOC_FORMAT||2;"2"===this.field.DOCPROP_OBJECT&&(this.mask=new(s())(this.$refs.value,{numeral:!0,numeralThousandsGroupStyle:"thousand",delimiter:" ",numeralDecimalScale:e,numeralDecimalMark:[",","."]})),"11"===this.field.DOCPROP_OBJECT&&(this.mask=new(s())(this.$refs.value,{numeral:!0,delimiter:"",numeralDecimalScale:e,numeralDecimalMark:[",","."]})),this.$refs.value.focus(),this.$refs.value.select()},methods:{async save(){if(this.readonly)setTimeout((()=>{this.$emit("close")}),0);else try{let e=this.$refs.value.value;-1!==["2","11"].indexOf(this.field.DOCPROP_OBJECT)&&(e=e.replace(/ /g,"").replace(/,/,".")),this.$emit("change",{value:e,display:e})}catch(e){console.error(e)}}}},u=r,c=l(1656),d=(0,c.A)(u,a,i,!1,null,null,null),o=d.exports}}]);
//# sourceMappingURL=FieldSimple.3de17cb8.js.map