Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-svgicon

Package Overview
Dependencies
Maintainers
9
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-svgicon - npm Package Compare versions

Comparing version 3.2.5 to 3.2.6

28

dist/components/svgicon.common.js

@@ -90,9 +90,5 @@ module.exports =

/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ "1eb2":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.

@@ -102,3 +98,3 @@

var i
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js$/))) {
__webpack_require__.p = i[1] // eslint-disable-line

@@ -108,6 +104,15 @@ }

// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"19469534-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=template&id=03042cba&
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
var setPublicPath = __webpack_require__("1eb2");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"02e834b4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=template&id=03042cba&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{class:_vm.clazz,style:(_vm.style),attrs:{"version":"1.1","viewBox":_vm.box},domProps:{"innerHTML":_vm._s(_vm.path)},on:{"click":_vm.onClick}})}

@@ -119,3 +124,3 @@ var staticRenderFns = []

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=script&lang=js&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=script&lang=js&
//

@@ -477,2 +482,3 @@ //

component.options.__file = "SvgIcon.vue"
/* harmony default export */ var SvgIcon = (component.exports);

@@ -479,0 +485,0 @@ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

@@ -99,9 +99,5 @@ (function webpackUniversalModuleDefinition(root, factory) {

/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/***/ "1eb2":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
// This file is imported into lib/wc client bundles.

@@ -111,3 +107,3 @@

var i
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
if ((i = window.document.currentScript) && (i = i.src.match(/(.+\/)[^/]+\.js$/))) {
__webpack_require__.p = i[1] // eslint-disable-line

@@ -117,6 +113,15 @@ }

// Indicate to webpack that this file can be concatenated
/* harmony default export */ var setPublicPath = (null);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"19469534-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=template&id=03042cba&
/***/ }),
/***/ "fb15":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
var setPublicPath = __webpack_require__("1eb2");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"02e834b4-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=template&id=03042cba&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{class:_vm.clazz,style:(_vm.style),attrs:{"version":"1.1","viewBox":_vm.box},domProps:{"innerHTML":_vm._s(_vm.path)},on:{"click":_vm.onClick}})}

@@ -128,3 +133,3 @@ var staticRenderFns = []

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=script&lang=js&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SvgIcon.vue?vue&type=script&lang=js&
//

@@ -486,2 +491,3 @@ //

component.options.__file = "SvgIcon.vue"
/* harmony default export */ var SvgIcon = (component.exports);

@@ -488,0 +494,0 @@ // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js

@@ -1,2 +0,2 @@

(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["VueSvgIcon"]=e():t["VueSvgIcon"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({fb15:function(t,e,n){"use strict";var i;(n.r(e),"undefined"!==typeof window)&&((i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^\/]+\.js(\?.*)?$/))&&(n.p=i[1]));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{class:t.clazz,style:t.style,attrs:{version:"1.1",viewBox:t.box},domProps:{innerHTML:t._s(t.path)},on:{click:t.onClick}})},r=[],a={},c=[],l="",s="svg",u=!1,f=!1,d={data:function(){return{loaded:!1}},props:{icon:String,name:String,width:{type:String,default:""},height:{type:String,default:""},scale:String,dir:String,fill:{type:Boolean,default:function(){return!u}},color:String,original:{type:Boolean,default:function(){return f}},title:String},computed:{clazz:function(){var t="".concat(s,"-icon");return this.fill&&(t+=" ".concat(s,"-fill")),this.dir&&(t+=" ".concat(s,"-").concat(this.dir)),t},iconName:function(){return this.name||this.icon},iconData:function(){var t=a[this.iconName];return t||this.loaded?t:null},colors:function(){return this.color?this.color.split(" "):[]},path:function(){var t="";return this.iconData?(t=this.iconData.data,t=this.setTitle(t),this.original&&(t=this.addOriginalColor(t)),this.colors.length>0&&(t=this.addColor(t))):c.push({name:this.iconName,component:this}),this.getValidPathData(t)},box:function(){var t=this.width||16,e=this.width||16;return this.iconData?this.iconData.viewBox?this.iconData.viewBox:"0 0 ".concat(this.iconData.width," ").concat(this.iconData.height):"0 0 ".concat(parseFloat(t)," ").concat(parseFloat(e))},style:function(){var t,e,n=/^\d+$/,i=Number(this.scale);!isNaN(i)&&this.iconData?(t=Number(this.iconData.width)*i+"px",e=Number(this.iconData.height)*i+"px"):(t=n.test(this.width)?this.width+"px":this.width||l,e=n.test(this.height)?this.height+"px":this.height||l);var o={};return t&&(o.width=t),e&&(o.height=e),o}},created:function(){a[this.iconName]&&(this.loaded=!0)},methods:{addColor:function(t){var e=this,n=/<(path|rect|circle|polygon|line|polyline|ellipse)\s/gi,i=0;return t.replace(n,function(t){var n=e.colors[i++]||e.colors[e.colors.length-1],o=e.fill;if(n&&"_"===n)return t;n&&0===n.indexOf("r-")&&(o=!o,n=n.split("r-")[1]);var r=o?"fill":"stroke",a=o?"stroke":"fill";return t+"".concat(r,'="').concat(n,'" ').concat(a,'="none" ')})},addOriginalColor:function(t){var e=/_fill="|_stroke="/gi;return t.replace(e,function(t){return t&&t.slice(1)})},getValidPathData:function(t){if(this.original&&this.colors.length>0){var e=/<(path|rect|circle|polygon|line|polyline|ellipse)(\sfill|\sstroke)([="\w\s\.\-\+#\$\&>]+)(fill|stroke)/gi;t=t.replace(e,function(t,e,n,i,o){return"<".concat(e).concat(n).concat(i,"_").concat(o)})}return t},setTitle:function(t){if(this.title){var e=this.title.replace(/\</gi,"&lt;").replace(/>/gi,"&gt;").replace(/&/g,"&amp;");return"<title>".concat(e,"</title>")+t}return t},onClick:function(t){this.$emit("click",t)}},install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tagName||"svgicon";e.classPrefix&&(s=e.classPrefix),u=!!e.isStroke,f=!!e.isOriginalDefault,e.defaultWidth&&(l=e.defaultWidth),e.defaultHeight&&e.defaultHeight,t.component(n,this)},register:function(t){var e=function(e){a[e]||(a[e]=t[e]),c=c.filter(function(t,n){return t.name===e&&t.component.$set(t.component,"loaded",!0),t.name!==e})};for(var n in t)e(n)},icons:a},h=d;function p(t,e,n,i,o,r,a,c){var l,s="function"===typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),i&&(s.functional=!0),r&&(s._scopeId="data-v-"+r),a?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},s._ssrRegister=l):o&&(l=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(s.functional){s._injectStyles=l;var u=s.render;s.render=function(t,e){return l.call(e),u(t,e)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:s}}var g=p(h,o,r,!1,null,null,null),v=g.exports;e["default"]=v}})["default"]});
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["VueSvgIcon"]=e():t["VueSvgIcon"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"1eb2":function(t,e,n){var i;"undefined"!==typeof window&&((i=window.document.currentScript)&&(i=i.src.match(/(.+\/)[^/]+\.js$/))&&(n.p=i[1]))},fb15:function(t,e,n){"use strict";n.r(e);n("1eb2");var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{class:t.clazz,style:t.style,attrs:{version:"1.1",viewBox:t.box},domProps:{innerHTML:t._s(t.path)},on:{click:t.onClick}})},o=[],r={},a=[],c="",l="svg",s=!1,u=!1,f={data:function(){return{loaded:!1}},props:{icon:String,name:String,width:{type:String,default:""},height:{type:String,default:""},scale:String,dir:String,fill:{type:Boolean,default:function(){return!s}},color:String,original:{type:Boolean,default:function(){return u}},title:String},computed:{clazz:function(){var t="".concat(l,"-icon");return this.fill&&(t+=" ".concat(l,"-fill")),this.dir&&(t+=" ".concat(l,"-").concat(this.dir)),t},iconName:function(){return this.name||this.icon},iconData:function(){var t=r[this.iconName];return t||this.loaded?t:null},colors:function(){return this.color?this.color.split(" "):[]},path:function(){var t="";return this.iconData?(t=this.iconData.data,t=this.setTitle(t),this.original&&(t=this.addOriginalColor(t)),this.colors.length>0&&(t=this.addColor(t))):a.push({name:this.iconName,component:this}),this.getValidPathData(t)},box:function(){var t=this.width||16,e=this.width||16;return this.iconData?this.iconData.viewBox?this.iconData.viewBox:"0 0 ".concat(this.iconData.width," ").concat(this.iconData.height):"0 0 ".concat(parseFloat(t)," ").concat(parseFloat(e))},style:function(){var t,e,n=/^\d+$/,i=Number(this.scale);!isNaN(i)&&this.iconData?(t=Number(this.iconData.width)*i+"px",e=Number(this.iconData.height)*i+"px"):(t=n.test(this.width)?this.width+"px":this.width||c,e=n.test(this.height)?this.height+"px":this.height||c);var o={};return t&&(o.width=t),e&&(o.height=e),o}},created:function(){r[this.iconName]&&(this.loaded=!0)},methods:{addColor:function(t){var e=this,n=/<(path|rect|circle|polygon|line|polyline|ellipse)\s/gi,i=0;return t.replace(n,function(t){var n=e.colors[i++]||e.colors[e.colors.length-1],o=e.fill;if(n&&"_"===n)return t;n&&0===n.indexOf("r-")&&(o=!o,n=n.split("r-")[1]);var r=o?"fill":"stroke",a=o?"stroke":"fill";return t+"".concat(r,'="').concat(n,'" ').concat(a,'="none" ')})},addOriginalColor:function(t){var e=/_fill="|_stroke="/gi;return t.replace(e,function(t){return t&&t.slice(1)})},getValidPathData:function(t){if(this.original&&this.colors.length>0){var e=/<(path|rect|circle|polygon|line|polyline|ellipse)(\sfill|\sstroke)([="\w\s\.\-\+#\$\&>]+)(fill|stroke)/gi;t=t.replace(e,function(t,e,n,i,o){return"<".concat(e).concat(n).concat(i,"_").concat(o)})}return t},setTitle:function(t){if(this.title){var e=this.title.replace(/\</gi,"&lt;").replace(/>/gi,"&gt;").replace(/&/g,"&amp;");return"<title>".concat(e,"</title>")+t}return t},onClick:function(t){this.$emit("click",t)}},install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tagName||"svgicon";e.classPrefix&&(l=e.classPrefix),s=!!e.isStroke,u=!!e.isOriginalDefault,e.defaultWidth&&(c=e.defaultWidth),e.defaultHeight&&e.defaultHeight,t.component(n,this)},register:function(t){var e=function(e){r[e]||(r[e]=t[e]),a=a.filter(function(t,n){return t.name===e&&t.component.$set(t.component,"loaded",!0),t.name!==e})};for(var n in t)e(n)},icons:r},d=f;function h(t,e,n,i,o,r,a,c){var l,s="function"===typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),i&&(s.functional=!0),r&&(s._scopeId="data-v-"+r),a?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},s._ssrRegister=l):o&&(l=c?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(s.functional){s._injectStyles=l;var u=s.render;s.render=function(t,e){return l.call(e),u(t,e)}}else{var f=s.beforeCreate;s.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:s}}var p=h(d,i,o,!1,null,null,null);p.options.__file="SvgIcon.vue";var g=p.exports;e["default"]=g}})["default"]});
//# sourceMappingURL=svgicon.umd.min.js.map

@@ -5,2 +5,3 @@ export interface Options {

ext?: string;
export?: boolean;
es6?: boolean;

@@ -7,0 +8,0 @@ tpl?: string;

@@ -9,2 +9,3 @@ "use strict";

var Svgo = require("svgo");
var camelcase_1 = require("camelcase");
/**

@@ -106,2 +107,3 @@ * build svg icon

if (subDir === void 0) { subDir = ''; }
var shouldExport = opts.export;
var isES6 = opts.es6;

@@ -125,5 +127,15 @@ var content = '';

dirMap[dir] = [];
content += isES6
? "import './" + dir + "'\n"
: "require('./" + dir + "')\n";
if (shouldExport) {
var dirName = camelcase_1.default(dir, {
pascalCase: true
});
content += isES6
? "export * as " + dirName + " from './" + dir + "'\n"
: "module.exports." + dirName + " = require('./" + dir + "')\n";
}
else {
content += isES6
? "import './" + dir + "'\n"
: "require('./" + dir + "')\n";
}
}

@@ -133,5 +145,15 @@ dirMap[dir].push(file);

else {
content += isES6
? "import './" + filePath + name + "'\n"
: "require('./" + filePath + name + "')\n";
if (shouldExport) {
var fileName = camelcase_1.default(name, {
pascalCase: true
});
content += isES6
? "export " + fileName + " from './" + filePath + name + "'\n"
: "module.exports." + fileName + " = require('./" + filePath + name + "')\n";
}
else {
content += isES6
? "import './" + filePath + name + "'\n"
: "require('./" + filePath + name + "')\n";
}
}

@@ -138,0 +160,0 @@ });

@@ -17,2 +17,3 @@ #!/usr/bin/env node

.describe('tpl', 'The template file which to generate icon files')
.describe('export', 'Should the templates export icons individually')
.describe('es6', 'Use ES6 module')

@@ -41,2 +42,3 @@ .describe('svgo', 'Svgo config file')

tpl: args.tpl,
export: args.export,
ext: args.ext,

@@ -43,0 +45,0 @@ es6: args.es6,

{
"name": "vue-svgicon",
"version": "3.2.5",
"version": "3.2.6",
"description": "A tool to create svg icon components. (vue 2.x)",

@@ -46,2 +46,3 @@ "main": "./dist/components/svgicon.common.js",

"dependencies": {
"camelcase": "^5.2.0",
"colors": "^1.3.0",

@@ -72,3 +73,2 @@ "fs-plus": "^3.0.2",

"@vue/test-utils": "^1.0.0-beta.16",
"vue": "^2.5.16",
"chai": "^4.1.2",

@@ -85,2 +85,3 @@ "highlight.js": "^9.12.0",

"typescript": "^3.0.1",
"vue": "^2.5.16",
"vue-class-component": "^6.0.0",

@@ -87,0 +88,0 @@ "vue-property-decorator": "^6.0.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc