UNPKG

vue-feather

Version:
2 lines 2.17 kB
/*! vue-feather v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */ import{defineComponent as e,h as t}from"vue";import*as i from"feather-icons";var r=e({name:"VueFeather",props:{animation:{type:String,default:void 0},animationSpeed:{type:String,default:void 0},fill:{type:String,default:"none"},size:{type:[Number,String],default:24},stroke:{type:String,default:"currentColor"},strokeLinecap:{type:String,default:"round"},strokeLinejoin:{type:String,default:"round"},strokeWidth:{type:[Number,String],default:2},tag:{type:String,default:"i"},type:{type:String,default:"feather",validator(e){if(!i)throw new Error("The Feather icons is required.");if(!i.icons[e])throw new Error(`"${e}" is not an available icon type.`);return!0}}},computed:{isRemSize(){return"string"==typeof this.size&&this.size.endsWith("rem")}},render(){const{animation:e,animationSpeed:r,isRemSize:n,size:a,type:s}=this,o=i.icons[s];return t(this.tag,{...this.$attrs,"data-name":s,"data-tags":o.tags,"data-type":s,class:{"vue-feather":!0,[`vue-feather--${s}`]:s,[`vue-feather--${e}`]:e,[`vue-feather--${r}`]:r},style:n?{height:a,width:a}:void 0},[t("svg",{...o.attrs,fill:this.fill,height:n?void 0:a,stroke:this.stroke,"stroke-linecap":this.strokeLinecap,"stroke-linejoin":this.strokeLinejoin,"stroke-width":this.strokeWidth,width:n?void 0:a,class:[o.attrs.class,"vue-feather__content"],innerHTML:o.contents})])}});!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}("@keyframes vue-feather--spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.vue-feather{display:inline-block;overflow:hidden}.vue-feather--spin{animation:vue-feather--spin 2s linear infinite}.vue-feather--pulse{animation:vue-feather--spin 2s steps(8) infinite}.vue-feather--slow{animation-duration:3s}.vue-feather--fast{animation-duration:1s}.vue-feather__content{display:block;height:inherit;width:inherit}");export{r as default};