"use strict";(self["webpackChunkcarabi_x2"]=self["webpackChunkcarabi_x2"]||[]).push([[6217],{2550:function(e,t,n){n.r(t),n.d(t,{default:function(){return d}});var a=function(){var e=this,t=e._self._c;return t("aside",{staticClass:"pos-widget",class:{"has-subvalue":!!e.subvalue,animated:!e.editable},style:e.linearGradient},[e.loading?t("div",{staticClass:"loading"},[t("i",{staticClass:"fas fa-sync fa-spin"})]):e._e(),e.value?[t("div",{staticClass:"count"},[t("span",{domProps:{textContent:e._s(e.value)}}),t("span",{staticClass:"unit",domProps:{innerHTML:e._s(e.valueUnit)}})]),e.subvalue?t("div",{staticClass:"subvalue",domProps:{textContent:e._s(e.subvalue)}}):e._e()]:e.icon?t("div",{staticClass:"icon"},[t("img",{attrs:{src:e.icon,"uk-svg":""}})]):e._e(),e.renaming?e._e():t("div",{staticClass:"title",domProps:{textContent:e._s(e.title)}}),e.cover?t("a",{staticClass:"uk-position-cover link",on:{click:function(t){return t.preventDefault(),e.$emit("action")}}}):e._e(),e.editable&&!e.renaming?t("div",{staticClass:"rename"},[t("button",{staticClass:"uk-button uk-button-small uk-button-primary",on:{click:e.renameStart}},[t("i",{staticClass:"fas fa-pen"})])]):e._e(),e.editable&&!e.renaming?t("div",{staticClass:"delete"},[t("button",{staticClass:"uk-button uk-button-small uk-button-danger",on:{click:function(t){return e.$emit("delete")}}},[t("i",{staticClass:"fas fa-trash"})])]):e._e(),e.renaming?t("div",{staticClass:"title"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.newTitle,expression:"newTitle"}],ref:"rename",staticClass:"uk-input",staticStyle:{"text-align":"center"},domProps:{value:e.newTitle},on:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.renameEnd()},blur:function(t){return e.renameEnd()},input:function(t){t.target.composing||(e.newTitle=t.target.value)}}})]):e._e()],2)},r=[],l={name:"DashboardButton",components:{},props:{title:{type:String,required:!0},subvalue:{type:String,default:""},value:{type:String,default:""},valueUnit:{type:String,default:""},icon:{type:String,default:""},loading:{type:Boolean,default:0},chart:{type:Array,default:null},color:{type:String,default:null},cover:{type:Boolean,default:!1},editable:{type:Boolean,default:!1}},data(){return{renaming:!1,lineChartOptions:null,newTitle:null}},computed:{rgbColor(){let e=i.find((e=>e.name===this.color));return e?e.color:i[0].color},linearGradient(){return{backgroundColor:this.rgbColor,background:"linear-gradient(to bottom right, "+o(this.rgbColor,25)+", "+o(this.rgbColor,-25)+")"}}},beforeMount(){},mounted(){this.newTitle=this.title},methods:{async renameStart(){this.renaming=!0,await this.$nextTick(),this.$refs.rename.focus(),this.$refs.rename.select()},async renameEnd(){this.renaming=!1,this.$emit("rename",this.newTitle)}}};function o(e,t){"#"===e[0]&&(e=e.slice(1));var n=parseInt(e,16),a=Math.round(2.55*t),r=(n>>16)+a,l=(n>>8&255)+a,o=(255&n)+a;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(l<255?l<1?0:l:255)+(o<255?o<1?0:o:255)).toString(16).slice(1)}const i=[{name:"Red",color:"#f44336"},{name:"Pink",color:"#e91e63"},{name:"Purple",color:"#9c27b0"},{name:"DeepPurple",color:"#673ab7"},{name:"Indigo",color:"#3f51b5"},{name:"Blue",color:"#2196f3"},{name:"LightBlue",color:"#03a9f4"},{name:"Cyan",color:"#00bcd4"},{name:"Teal",color:"#009688"},{name:"Green",color:"#4caf50"},{name:"LightGreen",color:"#8bc34a"},{name:"Lime",color:"#cddc39"},{name:"Yellow",color:"#ffeb3b"},{name:"Amber",color:"#ffc107"},{name:"Orange",color:"#ff9800"},{name:"DeepOrange",color:"#ff5722"},{name:"Brown",color:"#795548"},{name:"Grey",color:"#9e9e9e"},{name:"BlueGrey",color:"#607d8b"}];var s=l,u=n(1656),c=(0,u.A)(s,a,r,!1,null,null,null),d=c.exports}}]);
//# sourceMappingURL=DashboardButton.8e997857.js.map