vue-feather
Version:
Feather icons component for Vue 3.
2 lines • 2.72 kB
JavaScript
/*! vue-feather v2.0.0 | (c) 2018-present Chen Fengyuan | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("feather-icons")):"function"==typeof define&&define.amd?define(["vue","feather-icons"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VueFeather=t(e.Vue,e.feather)}(this,(function(e,t){"use strict";function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var n=i(t),r=e.defineComponent({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(!n)throw new Error("The Feather icons is required.");if(!n.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:t,animationSpeed:i,isRemSize:r,size:a,type:o}=this,s=n.icons[o];return e.h(this.tag,{...this.$attrs,"data-name":o,"data-tags":s.tags,"data-type":o,class:{"vue-feather":!0,[`vue-feather--${o}`]:o,[`vue-feather--${t}`]:t,[`vue-feather--${i}`]:i},style:r?{height:a,width:a}:void 0},[e.h("svg",{...s.attrs,fill:this.fill,height:r?void 0:a,stroke:this.stroke,"stroke-linecap":this.strokeLinecap,"stroke-linejoin":this.strokeLinejoin,"stroke-width":this.strokeWidth,width:r?void 0:a,class:[s.attrs.class,"vue-feather__content"],innerHTML:s.contents})])}});return function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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}"),r}));