@fortawesome/vue-fontawesome 0.1.6 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +24 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/workflows/ci.yml +29 -0
- package/.tool-versions +2 -0
- package/CHANGELOG.md +29 -0
- package/DEVELOPMENT.md +2 -0
- package/README.md +143 -12
- package/examples/vue-cli-webpack/package-lock.json +750 -924
- package/examples/vue-cli-webpack/package.json +3 -3
- package/examples/vue-cli-webpack/src/App.vue +9 -0
- package/index.d.ts +8 -10
- package/index.es.js +30 -2
- package/index.js +30 -2
- package/package.json +5 -2
- package/src/components/FontAwesomeIcon.js +8 -0
- package/src/components/FontAwesomeLayersText.js +23 -3
- package/src/components/__tests__/FontAwesomeIcon.test.js +12 -0
- package/src/components/__tests__/FontAwesomeLayersText.test.js +19 -3
- package/src/utils.js +3 -1
- package/.github/ISSUE_TEMPLATE/bug-report.md +0 -13
- package/.github/ISSUE_TEMPLATE/feature-request.md +0 -25
- package/.travis.yml +0 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**Reproducible test case**
|
|
14
|
+
Include a URL (codepen.io, jsfiddle.net, Git repository, codesandbox.io, stackblitz.com, etc.) that demonstrates the problem.
|
|
15
|
+
|
|
16
|
+
**Expected behavior**
|
|
17
|
+
A clear and concise description of what you expected to happen.
|
|
18
|
+
|
|
19
|
+
**Desktop (please complete the following information):**
|
|
20
|
+
- Browser [e.g. chrome, safari]
|
|
21
|
+
- Version
|
|
22
|
+
|
|
23
|
+
**Additional context**
|
|
24
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on: [push]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
node-version: [8.x, 10.x, 12.x]
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v1
|
|
16
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
17
|
+
uses: actions/setup-node@v1
|
|
18
|
+
with:
|
|
19
|
+
node-version: ${{ matrix.node-version }}
|
|
20
|
+
- name: install, build, and test
|
|
21
|
+
run: |
|
|
22
|
+
npm install
|
|
23
|
+
npm run build
|
|
24
|
+
npm run test
|
|
25
|
+
env:
|
|
26
|
+
CI: true
|
|
27
|
+
- name: dist
|
|
28
|
+
run: |
|
|
29
|
+
npm run dist
|
package/.tool-versions
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [0.1.10](https://github.com/FortAwesome/vue-fontawesome/releases/tag/0.1.10) - 2020-06-15
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
* Add TSX support to Typescript definition
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## [0.1.9](https://github.com/FortAwesome/vue-fontawesome/releases/tag/0.1.9) - 2019-12-13
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
* Counters support for the FontAwesomeLayersText component #174
|
|
19
|
+
* FontAwesomeIcon now supports the "inverse" property #174
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## [0.1.8](https://github.com/FortAwesome/vue-fontawesome/releases/tag/0.1.8) - 2019-11-03
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
* Removed declare namespace in the TypeScript definition file #177
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## [0.1.7](https://github.com/FortAwesome/vue-fontawesome/releases/tag/0.1.7) - 2019-08-31
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
* Duotone icon support
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
8
37
|
## [0.1.6](https://github.com/FortAwesome/vue-fontawesome/releases/tag/0.1.6) - 2019-03-18
|
|
9
38
|
|
|
10
39
|
### Changed
|
package/DEVELOPMENT.md
CHANGED
|
@@ -17,6 +17,8 @@ test | Execute unit tests
|
|
|
17
17
|
1. Update `README.md` and `package.json`; adding any contributors
|
|
18
18
|
1. Update the `CHANGELOG.md`
|
|
19
19
|
1. `npm publish`
|
|
20
|
+
1. `npm pack`
|
|
21
|
+
1. `CLOUDSMITH_API_KEY=API_TOKEN cloudsmith upload npm fortawesome/fontawesome-pro ./fortawesome-vue-fontawesome-VERSION.tgz`
|
|
20
22
|
1. `git add index.js index.es.js`
|
|
21
23
|
1. `git commit -a -m 'Release VERSION'`
|
|
22
24
|
1. `git push`
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# vue-fontawesome
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@fortawesome/vue-fontawesome)
|
|
8
|
-
[](https://github.com/FortAwesome/vue-fontawesome/actions)
|
|
9
9
|
|
|
10
10
|
> Font Awesome 5 Vue component using SVG with JS
|
|
11
11
|
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
- [Add more styles or Pro icons](#add-more-styles-or-pro-icons)
|
|
22
22
|
- [Usage](#usage)
|
|
23
23
|
* [Recommended](#recommended)
|
|
24
|
+
+ [Using Solid icons](#using-solid-icons)
|
|
25
|
+
+ [Using Brand icons](#using-brand-icons)
|
|
26
|
+
+ [Using Regular icons](#using-regular-icons)
|
|
27
|
+
+ [Using Light icons](#using-light-icons)
|
|
28
|
+
+ [Using Duotone icons](#using-duotone-icons)
|
|
24
29
|
+ [Quick warning about self-closing tags](#quick-warning-about-self-closing-tags)
|
|
25
30
|
+ [Processing i tags into svg using Font Awesome](#processing-i-tags-into-svg-using-font-awesome)
|
|
26
31
|
* [The icon property](#the-icon-property)
|
|
@@ -39,6 +44,7 @@
|
|
|
39
44
|
* [Advanced](#advanced)
|
|
40
45
|
- [Integrating with other tools and frameworks](#integrating-with-other-tools-and-frameworks)
|
|
41
46
|
* [Nuxt.js](#nuxtjs)
|
|
47
|
+
* [PurgeCSS](#purgecss)
|
|
42
48
|
* [Web Components with vue-web-component-wrapper](#web-components-with-vue-web-component-wrapper)
|
|
43
49
|
- [FAQ](#faq)
|
|
44
50
|
* [Why so explicit (the :icon="['far', 'coffee']" syntax)?](#why-so-explicit-the-iconfar-coffee-syntax)
|
|
@@ -106,15 +112,16 @@ $ npm i --save @fortawesome/free-brands-svg-icons
|
|
|
106
112
|
$ npm i --save @fortawesome/free-regular-svg-icons
|
|
107
113
|
```
|
|
108
114
|
|
|
109
|
-
If you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages.
|
|
115
|
+
If you are a [Font Awesome Pro](https://fontawesome.com/pro) subscriber you can install Pro packages after these [additional configuration](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers) are made.
|
|
110
116
|
|
|
111
117
|
```
|
|
112
118
|
$ npm i --save @fortawesome/pro-solid-svg-icons
|
|
113
119
|
$ npm i --save @fortawesome/pro-regular-svg-icons
|
|
114
120
|
$ npm i --save @fortawesome/pro-light-svg-icons
|
|
121
|
+
$ npm i --save @fortawesome/pro-duotone-svg-icons
|
|
115
122
|
```
|
|
116
123
|
|
|
117
|
-
|
|
124
|
+
**Duotone icons are currently in pre-release and are coming soon to this component.**
|
|
118
125
|
|
|
119
126
|
Or with Yarn:
|
|
120
127
|
|
|
@@ -169,6 +176,86 @@ export default {
|
|
|
169
176
|
</script>
|
|
170
177
|
```
|
|
171
178
|
|
|
179
|
+
#### Using Solid icons
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
183
|
+
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
|
|
184
|
+
|
|
185
|
+
library.add(faUserSecret)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
```html
|
|
189
|
+
<!-- The solid style is implicit -->
|
|
190
|
+
<font-awesome-icon icon="user-secret" />
|
|
191
|
+
|
|
192
|
+
<!-- It's better to be explicit -->
|
|
193
|
+
<!-- Don't forget to bind the property with ":" (we forget all the time!) -->
|
|
194
|
+
<font-awesome-icon :icon="['fas', 'user-secret']" />
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### Using Brand icons
|
|
198
|
+
|
|
199
|
+
```javascript
|
|
200
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
201
|
+
import { faFontAwesome } from '@fortawesome/free-brands-svg-icons'
|
|
202
|
+
|
|
203
|
+
library.add(faFontAwesome)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
```html
|
|
207
|
+
<!-- Don't forget to bind the property with ":" (we forget all the time!) -->
|
|
208
|
+
<font-awesome-icon :icon="['fab', 'font-awesome']" />
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
#### Using Regular icons
|
|
212
|
+
|
|
213
|
+
Using the Pro packages requires [additional configuration](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers).
|
|
214
|
+
|
|
215
|
+
```javascript
|
|
216
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
217
|
+
# Note we are using the Pro style here
|
|
218
|
+
import { faUserSecret } from '@fortawesome/pro-regular-svg-icons'
|
|
219
|
+
|
|
220
|
+
library.add(faUserSecret)
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```html
|
|
224
|
+
<font-awesome-icon :icon="['far', 'user-secret']" />
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
#### Using Light icons
|
|
228
|
+
|
|
229
|
+
```javascript
|
|
230
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
231
|
+
# Note we are using the Pro style here
|
|
232
|
+
import { faUserSecret } from '@fortawesome/pro-light-svg-icons'
|
|
233
|
+
|
|
234
|
+
library.add(faUserSecret)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
```html
|
|
238
|
+
<font-awesome-icon :icon="['fal', 'user-secret']" />
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### Using Duotone icons
|
|
242
|
+
|
|
243
|
+
```javascript
|
|
244
|
+
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
245
|
+
# Note we are using the Pro style here
|
|
246
|
+
import { faUserSecret } from '@fortawesome/pro-duotone-svg-icons'
|
|
247
|
+
|
|
248
|
+
library.add(faUserSecret)
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
```html
|
|
252
|
+
<font-awesome-icon :icon="['fad', 'user-secret']" />
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
You can also [import the same icon from different
|
|
256
|
+
styles](#import-the-same-icon-from-different-styles) with some help from ES
|
|
257
|
+
`import`.
|
|
258
|
+
|
|
172
259
|
#### Quick warning about self-closing tags
|
|
173
260
|
|
|
174
261
|
If you are using inline templates or HTML as templates you need to be careful to avoid self-closing tags.
|
|
@@ -251,7 +338,7 @@ library.add(faSpinner)
|
|
|
251
338
|
```javascript
|
|
252
339
|
<template>
|
|
253
340
|
<div id="app">
|
|
254
|
-
<font-awesome-icon icon="appIcon" />
|
|
341
|
+
<font-awesome-icon :icon="appIcon" />
|
|
255
342
|
</div>
|
|
256
343
|
</template>
|
|
257
344
|
|
|
@@ -324,8 +411,16 @@ import { library } from '@fortawesome/fontawesome-svg-core'
|
|
|
324
411
|
import { faCoffee as fasCoffee } from '@fortawesome/pro-solid-svg-icons'
|
|
325
412
|
import { faCoffee as farCoffee } from '@fortawesome/pro-regular-svg-icons'
|
|
326
413
|
import { faCoffee as falCoffee } from '@fortawesome/pro-light-svg-icons'
|
|
414
|
+
import { faCoffee as fadCoffee } from '@fortawesome/pro-duotone-svg-icons'
|
|
415
|
+
|
|
416
|
+
library.add(fasCoffee, farCoffee, falCoffee, fadCoffee)
|
|
417
|
+
```
|
|
327
418
|
|
|
328
|
-
|
|
419
|
+
```html
|
|
420
|
+
<font-awesome-icon :icon="['fas', 'coffee']"/>
|
|
421
|
+
<font-awesome-icon :icon="['far', 'coffee']"/>
|
|
422
|
+
<font-awesome-icon :icon="['fal', 'coffee']"/>
|
|
423
|
+
<font-awesome-icon :icon="['fad', 'coffee']"/>
|
|
329
424
|
```
|
|
330
425
|
|
|
331
426
|
#### Import entire styles
|
|
@@ -371,7 +466,7 @@ A good place to do this is in `main.js` or in the module you are calling `new
|
|
|
371
466
|
Vue()`. **Make sure you register the component** and **have added icons to your
|
|
372
467
|
library** before you bootstrap your Vue application.
|
|
373
468
|
|
|
374
|
-
```
|
|
469
|
+
```javascript
|
|
375
470
|
import Vue from 'vue'
|
|
376
471
|
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'
|
|
377
472
|
|
|
@@ -432,6 +527,18 @@ Spin and pulse [animation](https://fontawesome.com/how-to-use/on-the-web/styling
|
|
|
432
527
|
<font-awesome-icon icon="spinner" pull="right" />
|
|
433
528
|
```
|
|
434
529
|
|
|
530
|
+
[Inverse](https://fontawesome.com/how-to-use/on-the-web/styling/stacking-icons):
|
|
531
|
+
|
|
532
|
+
```html
|
|
533
|
+
<font-awesome-icon icon="spinner" inverse />
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
[Swap opacity](https://fontawesome.com/how-to-use/on-the-web/styling/duotone-icons#swapping-layers):
|
|
537
|
+
|
|
538
|
+
```html
|
|
539
|
+
<font-awesome-icon :icon="['fad', 'spinner']" swap-opacity />
|
|
540
|
+
```
|
|
541
|
+
|
|
435
542
|
### Advanced
|
|
436
543
|
|
|
437
544
|
[Power Transforms]((https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms)):
|
|
@@ -472,6 +579,15 @@ Spin and pulse [animation](https://fontawesome.com/how-to-use/on-the-web/styling
|
|
|
472
579
|
</font-awesome-layers>
|
|
473
580
|
```
|
|
474
581
|
|
|
582
|
+
[Counters](https://fontawesome.com/how-to-use/on-the-web/styling/layering):
|
|
583
|
+
|
|
584
|
+
```html
|
|
585
|
+
<font-awesome-layers full-width class="fa-4x">
|
|
586
|
+
<font-awesome-icon icon="envelope"/>
|
|
587
|
+
<font-awesome-layers-text counter value="1" position="top-right" />
|
|
588
|
+
</font-awesome-layers>
|
|
589
|
+
```
|
|
590
|
+
|
|
475
591
|
## Integrating with other tools and frameworks
|
|
476
592
|
|
|
477
593
|
### Nuxt.js
|
|
@@ -515,6 +631,18 @@ plugins: [
|
|
|
515
631
|
]
|
|
516
632
|
```
|
|
517
633
|
|
|
634
|
+
### PurgeCSS
|
|
635
|
+
|
|
636
|
+
If you use PurgeCSS, or use the nuxt.js tailwindcss module which comes with PurgeCSS prebundled, you need to add fontawesome css classes to the whitelist, as the classes only gets inserted on rendering, and PurgeCSS will treat them as unused and remove them otherwise.
|
|
637
|
+
|
|
638
|
+
In your `nuxt.config.js`, add a purgeCSS config object. You may adjust the regex to your liking:
|
|
639
|
+
|
|
640
|
+
```javascript
|
|
641
|
+
purgeCSS: {
|
|
642
|
+
whitelistPatterns: [/svg.*/, /fa.*/]
|
|
643
|
+
},
|
|
644
|
+
```
|
|
645
|
+
|
|
518
646
|
### Web Components with vue-web-component-wrapper
|
|
519
647
|
|
|
520
648
|
The Vue [project provides a wrapper](https://github.com/vuejs/vue-web-component-wrapper)
|
|
@@ -707,12 +835,15 @@ The following contributors have either hepled to start this project, have contri
|
|
|
707
835
|
code, are actively maintaining it (including documentation), or in other ways
|
|
708
836
|
being awesome contributors to this project. **We'd like to take a moment to recognize them.**
|
|
709
837
|
|
|
710
|
-
|
|
|
711
|
-
| :--------------------------------------------------------:
|
|
712
|
-
| <img src="https://github.com/SirLamer.png?size=72" />
|
|
713
|
-
| <img src="https://github.com/meteorlxy.png?size=72" />
|
|
714
|
-
| <img src="https://github.com/schulz3000.png?size=72" />
|
|
715
|
-
| <img src="https://github.com/ihmels.png?size=72" />
|
|
838
|
+
| | Name | GitHub |
|
|
839
|
+
| :--------------------------------------------------------: | -------------- | ---------------------------------------------------- |
|
|
840
|
+
| <img src="https://github.com/SirLamer.png?size=72" /> | SirLamer | [@SirLamer](https://github.com/SirLamer) |
|
|
841
|
+
| <img src="https://github.com/meteorlxy.png?size=72" /> | Liu Xinyu | [@meteorlxy](https://github.com/meteorlxy) |
|
|
842
|
+
| <img src="https://github.com/schulz3000.png?size=72" /> | Xaver Schulz | [@schulz3000](https://github.com/schulz3000) |
|
|
843
|
+
| <img src="https://github.com/ihmels.png?size=72" /> | Yannick Ihmels | [@ihmels](https://github.com/ihmels) |
|
|
844
|
+
| <img src="https://github.com/btaens.png?size=72" /> | btaens | [@btaens](https://github.com/btaens) |
|
|
845
|
+
| <img src="https://github.com/david-driscoll.png?size=72" /> | David Driscoll | [@david-driscoll](https://github.com/david-driscoll) |
|
|
846
|
+
| <img src="https://github.com/tyranteon.png?size=72" /> | Tyranteon | [@tyranteon](https://github.com/tyranteon) |
|
|
716
847
|
|
|
717
848
|
If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.
|
|
718
849
|
|