oh-vue-icons
Advanced tools
Comparing version 0.2.1 to 0.2.2
# Change Log | ||
## [0.2.1](https://github.com/Renovamen/oh-vue-icons/compare/v0.1.11...v0.2.1) (2021-03-14) | ||
### BREAKING CHANGES | ||
- support Vue 3 🎉 ([b7b3eed](https://github.com/Renovamen/oh-vue-icons/commit/b7b3eedf400248aeeb18494ff259faec8bb523ab)) | ||
- import path for Vue 2 has changed: | ||
```diff | ||
- import OhVueIcon from "oh-vue-icons/components/Icon"; | ||
+ import OhVueIcon from "oh-vue-icons/components/icon"; | ||
``` | ||
### Features | ||
- **iconpack:** upgrade: | ||
- Pixelarticons (v1.4.0): 9 more icons, 1 fixed icon ([36e9465](https://github.com/Renovamen/oh-vue-icons/commit/36e946528fc490b79876567e3631de69e3029c95)) | ||
- Simple Icons (v4.13.0): 32 more icons, 5 updated icons ([f81ad2c](https://github.com/Renovamen/oh-vue-icons/commit/f81ad2c3ec91d274a3df5897aa254c1f7d8c7343)) | ||
## [0.1.11](https://github.com/Renovamen/oh-vue-icons/compare/v0.1.10...v0.1.11) (2021-02-27) | ||
@@ -4,0 +23,0 @@ |
import "../style.css"; | ||
import { assign, warn, escapeHTML, getId } from "../utils"; | ||
import { h } from "vue"; | ||
@@ -6,12 +7,2 @@ | ||
function warn(msg, vm) { | ||
if (!vm) { | ||
/* eslint-disable no-console */ | ||
console.error(msg); | ||
/* eslint-enable no-console */ | ||
return; | ||
} | ||
vm.constructor.super.util.warn(msg, vm); | ||
} | ||
export default { | ||
@@ -159,4 +150,7 @@ name: "v-icon", | ||
); | ||
return raw; | ||
}, | ||
attribs() { | ||
if (!this.icon || !this.icon.attr) return {}; | ||
return this.icon.attr; | ||
} | ||
@@ -201,14 +195,18 @@ }, | ||
let options = { | ||
class: this.klass, | ||
style: this.style, | ||
role: this.$attrs.role || (this.label || this.title ? "img" : null), | ||
"aria-label": this.label || null, | ||
"aria-hidden": !(this.label || this.title), | ||
width: this.width, | ||
height: this.height, | ||
viewBox: this.box, | ||
fill: this.fill ? this.fill : "currentColor" | ||
}; | ||
let options = Object.assign( | ||
{ | ||
class: this.klass, | ||
style: this.style, | ||
role: this.$attrs.role || (this.label || this.title ? "img" : null), | ||
"aria-label": this.label || null, | ||
"aria-hidden": !(this.label || this.title), | ||
width: this.width, | ||
height: this.height, | ||
viewBox: this.box | ||
}, | ||
this.attribs | ||
); | ||
if (!this.attribs.fill) | ||
options.fill = this.fill ? this.fill : "currentColor"; | ||
if (this.x) options.x = this.x; | ||
@@ -285,33 +283,1 @@ if (this.y) options.y = this.y; | ||
}; | ||
function hasOwn(obj, key) { | ||
return Object.prototype.hasOwnProperty.call(obj, key); | ||
} | ||
function assign(obj, ...sources) { | ||
sources.forEach(source => { | ||
for (let key in source) { | ||
if (key === "name") continue; | ||
if (hasOwn(source, key)) { | ||
obj[key] = source[key]; | ||
} | ||
} | ||
}); | ||
return obj; | ||
} | ||
let count = 0; | ||
function getId(prefix = "") { | ||
return prefix + count++; | ||
} | ||
const ESCAPE_MAP = { | ||
"<": "<", | ||
">": ">", | ||
'"': """, | ||
"&": "&" | ||
}; | ||
function escapeHTML(html) { | ||
return html.replace(/[<>"&]/g, c => ESCAPE_MAP[c] || c); | ||
} |
import "../style.css"; | ||
import { assign, warn, escapeHTML, getId } from "../utils"; | ||
let icons = {}; | ||
function warn(msg, vm) { | ||
if (!vm) { | ||
/* eslint-disable no-console */ | ||
console.error(msg); | ||
/* eslint-enable no-console */ | ||
return; | ||
} | ||
vm.constructor.super.util.warn(msg, vm); | ||
} | ||
export default { | ||
@@ -157,4 +148,7 @@ name: "v-icon", | ||
); | ||
return raw; | ||
}, | ||
attribs() { | ||
if (!this.icon || !this.icon.attr) return {}; | ||
return this.icon.attr; | ||
} | ||
@@ -181,3 +175,2 @@ }, | ||
child.outerScale = this.normalizedScale; | ||
width = Math.max(width, child.width); | ||
@@ -197,6 +190,4 @@ height = Math.max(height, child.height); | ||
let options = { | ||
class: this.klass, | ||
style: this.style, | ||
attrs: { | ||
let attrs = Object.assign( | ||
{ | ||
role: this.$attrs.role || (this.label || this.title ? "img" : null), | ||
@@ -207,10 +198,20 @@ "aria-label": this.label || null, | ||
height: this.height, | ||
viewBox: this.box, | ||
fill: this.fill ? this.fill : "currentColor" | ||
} | ||
viewBox: this.box | ||
}, | ||
this.attribs | ||
); | ||
if (this.attribs.stroke) | ||
attrs.stroke = this.fill ? this.fill : "currentColor"; | ||
else attrs.fill = this.fill ? this.fill : "currentColor"; | ||
if (this.x) attrs.x = this.x; | ||
if (this.y) attrs.y = this.y; | ||
let options = { | ||
class: this.klass, | ||
style: this.style, | ||
attrs: attrs | ||
}; | ||
if (this.x) options.attrs.x = this.x; | ||
if (this.y) options.attrs.y = this.y; | ||
const transOri = this.icon | ||
@@ -225,3 +226,2 @@ ? `${Number((this.icon.width / 2 + this.icon.minX).toFixed(3))} ${Number( | ||
if (this.title) html = `<title>${escapeHTML(this.title)}</title>${html}`; | ||
options.domProps = { innerHTML: html }; | ||
@@ -287,33 +287,1 @@ } | ||
}; | ||
function hasOwn(obj, key) { | ||
return Object.prototype.hasOwnProperty.call(obj, key); | ||
} | ||
function assign(obj, ...sources) { | ||
sources.forEach(source => { | ||
for (let key in source) { | ||
if (key === "name") continue; | ||
if (hasOwn(source, key)) { | ||
obj[key] = source[key]; | ||
} | ||
} | ||
}); | ||
return obj; | ||
} | ||
let count = 0; | ||
function getId(prefix = "") { | ||
return prefix + count++; | ||
} | ||
const ESCAPE_MAP = { | ||
"<": "<", | ||
">": ">", | ||
'"': """, | ||
"&": "&" | ||
}; | ||
function escapeHTML(html) { | ||
return html.replace(/[<>"&]/g, c => ESCAPE_MAP[c] || c); | ||
} |
@@ -5,2 +5,3 @@ // THIS FILE IS AUTO GENERATED | ||
export * from './ci'; | ||
export * from './co'; | ||
export * from './fa'; | ||
@@ -10,5 +11,8 @@ export * from './fc'; | ||
export * from './gi'; | ||
export * from './hi'; | ||
export * from './io'; | ||
export * from './la'; | ||
export * from './oi'; | ||
export * from './pi'; | ||
export * from './pr'; | ||
export * from './px'; | ||
@@ -15,0 +19,0 @@ export * from './ri'; |
{ | ||
"name": "oh-vue-icons", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Include inline SVG icons from different popular icon packs in Vue easily.", | ||
@@ -62,2 +62,5 @@ "keywords": [ | ||
}, | ||
"dependencies": { | ||
"cheerio": "^1.0.0-rc.5" | ||
}, | ||
"devDependencies": { | ||
@@ -64,0 +67,0 @@ "@nuxt/content": "^1.13.1", |
@@ -16,3 +16,3 @@ # Oh, Vue Icons! | ||
- 支持 Vue 2 和 Vue 3 | ||
- 支持 [15 个流行的图标库](#支持的图标库) | ||
- 支持 [19 个流行的图标库](#支持的图标库) | ||
@@ -24,3 +24,3 @@ | ||
目前支持以下 15 个图标库: | ||
目前支持以下 19 个图标库: | ||
@@ -31,2 +31,3 @@ | 图标库 | 前缀 | 协议 | 图标数量 | | ||
| [Bootstrap Icons](https://icons.getbootstrap.com/) | `bi` | [MIT](https://github.com/twbs/icons/blob/main/LICENSE.md) | 1325 | | ||
| [CoreUI Icons Free](https://github.com/coreui/coreui-icons) (Colorful) | `co` | [CC BY 4.0 License](https://github.com/coreui/coreui-icons/blob/master/LICENSE) | 1583 | | ||
| [Cryptocurrency Icons](https://github.com/spothq/cryptocurrency-icons) (Colorful) | `ci` | [CC0 1.0 Universal](https://github.com/spothq/cryptocurrency-icons/blob/master/LICENSE.md) | 892 | | ||
@@ -37,9 +38,12 @@ | [Font Awesome 5 Free](https://fontawesome.com/) | `fa` | [CC BY 4.0](https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt) | 1609 | | ||
| [gameicons](https://game-icons.net/) | `gi` | [CC BY 3.0](https://github.com/game-icons/icons/blob/master/license.txt) | 3927 | | ||
| [Heroicons](https://heroicons.com/) | `hi` | [MIT](https://github.com/tailwindlabs/heroicons/blob/master/LICENSE) | 452 | | ||
| [Ionicons](https://ionicons.com/) | `io` | [MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE) | 1332 | | ||
| [Line Awesome](https://icons8.com/line-awesome) | `la` | [MIT / Good Boy](https://github.com/icons8/line-awesome/blob/master/LICENSE.md) | 1544 | | ||
| [Octicons](https://primer.style/octicons/) | `oi` | [MIT](https://github.com/primer/octicons/blob/master/LICENSE) | 209 | | ||
| [Pokemon Icons](https://theartificial.github.io/pokemon-icons/) (Colorful)| `pi` | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | 1453 | | ||
| [PrimeIcons](https://github.com/primefaces/primeicons) | `pr` | [MIT](https://github.com/primefaces/primeicons/blob/master/LICENSE) | 202 | | ||
| [Pixelarticons](https://pixelarticons.com/) | `px` | [MIT](https://github.com/halfmage/pixelarticons/blob/master/LICENSE) | 460 | | ||
| [Remix Icon](https://github.com/Remix-Design/RemixIcon) | `ri` | [Apache 2.0](https://github.com/Remix-Design/RemixIcon/blob/master/License) | 2271 | | ||
| [Simple Icons](https://simpleicons.org/) | `si` | [CC0 1.0 Universal](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md) | 1831 | | ||
| [VSCode Icons](https://github.com/vscode-icons/vscode-icons) (Colorful) | `vi` | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) | 1061 | | ||
| [Simple Icons](https://simpleicons.org/) | `si` | [CC0 1.0 Universal](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md) | 1872 | | ||
| [VSCode Icons](https://github.com/vscode-icons/vscode-icons) (Colorful) | `vi` | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) | 1068 | | ||
| [Weather Icons](https://erikflowers.github.io/weather-icons/) | `wi` | [SIL OFL 1.1](http://scripts.sil.org/OFL) | 219 | | ||
@@ -46,0 +50,0 @@ |
@@ -16,3 +16,3 @@ # Oh, Vue Icons! | ||
- Supports Vue 2 and Vue 3 | ||
- Supports 15 popular icon packs, see [here](#supported-icon-packs) | ||
- Supports 19 popular icon packs, see [here](#supported-icon-packs) | ||
@@ -24,3 +24,3 @@ | ||
Now the following 15 icon packs are supported: | ||
Now the following 19 icon packs are supported: | ||
@@ -31,2 +31,3 @@ | Icon Pack | Prefix | License | Icon Numer | | ||
| [Bootstrap Icons](https://icons.getbootstrap.com/) | `bi` | [MIT](https://github.com/twbs/icons/blob/main/LICENSE.md) | 1325 | | ||
| [CoreUI Icons Free](https://github.com/coreui/coreui-icons) (Colorful) | `co` | [CC BY 4.0 License](https://github.com/coreui/coreui-icons/blob/master/LICENSE) | 1583 | | ||
| [Cryptocurrency Icons](https://github.com/spothq/cryptocurrency-icons) (Colorful) | `ci` | [CC0 1.0 Universal](https://github.com/spothq/cryptocurrency-icons/blob/master/LICENSE.md) | 892 | | ||
@@ -37,9 +38,12 @@ | [Font Awesome 5 Free](https://fontawesome.com/) | `fa` | [CC BY 4.0](https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt) | 1609 | | ||
| [gameicons](https://game-icons.net/) | `gi` | [CC BY 3.0](https://github.com/game-icons/icons/blob/master/license.txt) | 3927 | | ||
| [Line Awesome](https://icons8.com/line-awesome) | `la` | [MIT / Good Boy](https://github.com/icons8/line-awesome/blob/master/LICENSE.md) | 1544 | | ||
| [Heroicons](https://heroicons.com/) | `hi` | [MIT](https://github.com/tailwindlabs/heroicons/blob/master/LICENSE) | 452 | | ||
| [Ionicons](https://ionicons.com/) | `io` | [MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE) | 1332 | | ||
| [Line Awesome](https://icons8.com/line-awesome) | `la` | [MIT](https://github.com/ionic-team/ionicons/blob/master/LICENSE) | 1544 | | ||
| [Octicons](https://primer.style/octicons/) | `oi` | [MIT](https://github.com/primer/octicons/blob/master/LICENSE) | 209 | | ||
| [Pokemon Icons](https://theartificial.github.io/pokemon-icons/) (Colorful)| `pi` | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | 1453 | | ||
| [PrimeIcons](https://github.com/primefaces/primeicons) | `pr` | [MIT](https://github.com/primefaces/primeicons/blob/master/LICENSE) | 202 | | ||
| [Pixelarticons](https://pixelarticons.com/) | `px` | [MIT](https://github.com/halfmage/pixelarticons/blob/master/LICENSE) | 460 | | ||
| [Remix Icon](https://github.com/Remix-Design/RemixIcon) | `ri` | [Apache 2.0](https://github.com/Remix-Design/RemixIcon/blob/master/License) | 2271 | | ||
| [Simple Icons](https://simpleicons.org/) | `si` | [CC0 1.0 Universal](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md) | 1831 | | ||
| [VSCode Icons](https://github.com/vscode-icons/vscode-icons) (Colorful) | `vi` | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) | 1061 | | ||
| [Simple Icons](https://simpleicons.org/) | `si` | [CC0 1.0 Universal](https://github.com/simple-icons/simple-icons/blob/develop/LICENSE.md) | 1872 | | ||
| [VSCode Icons](https://github.com/vscode-icons/vscode-icons) (Colorful) | `vi` | [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) | 1068 | | ||
| [Weather Icons](https://erikflowers.github.io/weather-icons/) | `wi` | [SIL OFL 1.1](http://scripts.sil.org/OFL) | 219 | | ||
@@ -46,0 +50,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38005372
50
60420
210
1
+ Addedcheerio@^1.0.0-rc.5
+ Addedboolbase@1.0.0(transitive)
+ Addedcheerio@1.0.0(transitive)
+ Addedcheerio-select@2.1.0(transitive)
+ Addedcss-select@5.1.0(transitive)
+ Addedcss-what@6.1.0(transitive)
+ Addeddom-serializer@2.0.0(transitive)
+ Addeddomelementtype@2.3.0(transitive)
+ Addeddomhandler@5.0.3(transitive)
+ Addeddomutils@3.1.0(transitive)
+ Addedencoding-sniffer@0.2.0(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedhtmlparser2@9.1.0(transitive)
+ Addediconv-lite@0.6.3(transitive)
+ Addednth-check@2.1.1(transitive)
+ Addedparse5@7.2.0(transitive)
+ Addedparse5-htmlparser2-tree-adapter@7.1.0(transitive)
+ Addedparse5-parser-stream@7.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedundici@6.20.1(transitive)
+ Addedwhatwg-encoding@3.1.1(transitive)
+ Addedwhatwg-mimetype@4.0.0(transitive)