@fortawesome/vue-fontawesome 3.0.2 → 3.0.4
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/CHANGELOG.md +25 -0
- package/README.md +5 -3
- package/index.d.ts +11 -2
- package/index.es.js +26 -1
- package/index.js +26 -1
- package/package.json +11 -10
- package/src/components/FontAwesomeIcon.js +33 -22
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
|
|
7
|
+
## [3.0.4](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.0.4) - 2023-11-06
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Tests for Sharp Family
|
|
14
|
+
- Ability to include a title prop (github issue #[181](https://github.com/FortAwesome/vue-fontawesome/issues/181))
|
|
15
|
+
- Prettier config file
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [3.0.3](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.0.3) - 2023-01-24
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- NPM download `@fortawesome/vue-fontawesome-latest` is now set to Vue 3; to download the Vue 2 package you will have to use `@fortawesome/vue-fontawesome-latest-2`, which is described in our [Vue setup docs](https://fontawesome.com/docs/web/use-with/vue/#_3-add-the-vue-component)
|
|
24
|
+
- CI workflow updated for testing
|
|
25
|
+
- README.md and package.json updated for new contributor
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- Missing TypeScript animations added (github issue #[428](https://github.com/FortAwesome/vue-fontawesome/issues/428))
|
|
30
|
+
- Missing TypeScript sizes added (github issue #[415](https://github.com/FortAwesome/vue-fontawesome/issues/415))
|
|
31
|
+
|
|
7
32
|
---
|
|
8
33
|
|
|
9
34
|
## [3.0.2](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.0.2) - 2022-11-07
|
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
Official documentation is hosted at fontawesome.com
|
|
26
26
|
|
|
27
27
|
Helpful Vue links:
|
|
28
|
+
|
|
28
29
|
- [Add Icons with Vue](https://fontawesome.com/docs/web/use-with/vue/add-icons)
|
|
29
30
|
- [Adding Icon Styling with Vue](https://fontawesome.com/docs/web/use-with/vue/style)
|
|
30
31
|
|
|
@@ -34,12 +35,12 @@ To find the Vue setup, go to our [Web docs](https://fontawesome.com/docs/web) an
|
|
|
34
35
|
|
|
35
36
|
Review the following docs before diving in:
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
39
|
+
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
|
|
39
40
|
|
|
40
41
|
And then:
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
- Check the existing [issues](https://github.com/FortAwesome/vue-fontawesome/issues) and see if you can help!
|
|
43
44
|
|
|
44
45
|
## Contributors
|
|
45
46
|
|
|
@@ -60,6 +61,7 @@ being awesome contributors to this project. **We'd like to take a moment to reco
|
|
|
60
61
|
| <img src="https://github.com/viniciuslrangel.png?size=72" /> | Vinicius Rangel | [@viniciuslrangel](https://github.com/viniciuslrangel) |
|
|
61
62
|
| <img src="https://github.com/otijhuis.png?size=72" /> | Okke Tijhuis | [@otijhuis](https://github.com/otijhuis) |
|
|
62
63
|
| <img src="https://github.com/parkeyparker.png?size=72" /> | Aaron Parker | [@parkeyparker](https://github.com/parkeyparker) |
|
|
64
|
+
| <img src="https://github.com/brandon-mork.png?size=72" /> | Brandon Mork | [@brandon-mork](https://github.com/brandon-mork) |
|
|
63
65
|
|
|
64
66
|
If we've missed someone (which is quite likely) submit a Pull Request to us and we'll get it resolved.
|
|
65
67
|
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
|
|
2
2
|
import { DefineComponent } from 'vue'
|
|
3
3
|
|
|
4
4
|
interface FontAwesomeIconProps {
|
|
@@ -7,17 +7,26 @@ interface FontAwesomeIconProps {
|
|
|
7
7
|
flip?: 'horizontal' | 'vertical' | 'both'
|
|
8
8
|
icon: object | Array<string> | string | IconDefinition
|
|
9
9
|
mask?: object | Array<string> | string
|
|
10
|
+
maskId?: object | Array<string> | string
|
|
10
11
|
listItem?: boolean
|
|
11
12
|
pull?: 'right' | 'left'
|
|
12
13
|
pulse?: boolean
|
|
13
14
|
rotation?: 90 | 180 | 270 | '90' | '180' | '270'
|
|
14
15
|
swapOpacity?: boolean
|
|
15
|
-
size?: '
|
|
16
|
+
size?: '2xs' | 'xs' | 'sm' | 'lg' | 'xl' | '2xl' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x'
|
|
16
17
|
spin?: boolean
|
|
17
18
|
transform?: object | string
|
|
18
19
|
symbol?: boolean | string
|
|
19
20
|
title?: string
|
|
21
|
+
titleId?: string
|
|
20
22
|
inverse?: boolean
|
|
23
|
+
bounce?: boolean
|
|
24
|
+
shake?: boolean
|
|
25
|
+
beat?: boolean
|
|
26
|
+
fade?: boolean
|
|
27
|
+
beatFade?: boolean
|
|
28
|
+
spinPulse?: boolean
|
|
29
|
+
spinReverse?: boolean
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
interface FontAwesomeLayersProps {
|
package/index.es.js
CHANGED
|
@@ -32,6 +32,7 @@ function _typeof(obj) {
|
|
|
32
32
|
}, _typeof(obj);
|
|
33
33
|
}
|
|
34
34
|
function _defineProperty(obj, key, value) {
|
|
35
|
+
key = _toPropertyKey(key);
|
|
35
36
|
if (key in obj) {
|
|
36
37
|
Object.defineProperty(obj, key, {
|
|
37
38
|
value: value,
|
|
@@ -96,6 +97,20 @@ function _arrayLikeToArray(arr, len) {
|
|
|
96
97
|
function _nonIterableSpread() {
|
|
97
98
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
98
99
|
}
|
|
100
|
+
function _toPrimitive(input, hint) {
|
|
101
|
+
if (typeof input !== "object" || input === null) return input;
|
|
102
|
+
var prim = input[Symbol.toPrimitive];
|
|
103
|
+
if (prim !== undefined) {
|
|
104
|
+
var res = prim.call(input, hint || "default");
|
|
105
|
+
if (typeof res !== "object") return res;
|
|
106
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
107
|
+
}
|
|
108
|
+
return (hint === "string" ? String : Number)(input);
|
|
109
|
+
}
|
|
110
|
+
function _toPropertyKey(arg) {
|
|
111
|
+
var key = _toPrimitive(arg, "string");
|
|
112
|
+
return typeof key === "symbol" ? key : String(key);
|
|
113
|
+
}
|
|
99
114
|
|
|
100
115
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
101
116
|
|
|
@@ -405,6 +420,10 @@ var FontAwesomeIcon = defineComponent({
|
|
|
405
420
|
type: [Object, Array, String],
|
|
406
421
|
default: null
|
|
407
422
|
},
|
|
423
|
+
maskId: {
|
|
424
|
+
type: String,
|
|
425
|
+
default: null
|
|
426
|
+
},
|
|
408
427
|
listItem: {
|
|
409
428
|
type: Boolean,
|
|
410
429
|
default: false
|
|
@@ -454,6 +473,10 @@ var FontAwesomeIcon = defineComponent({
|
|
|
454
473
|
type: String,
|
|
455
474
|
default: null
|
|
456
475
|
},
|
|
476
|
+
titleId: {
|
|
477
|
+
type: String,
|
|
478
|
+
default: null
|
|
479
|
+
},
|
|
457
480
|
inverse: {
|
|
458
481
|
type: Boolean,
|
|
459
482
|
default: false
|
|
@@ -508,7 +531,9 @@ var FontAwesomeIcon = defineComponent({
|
|
|
508
531
|
var renderedIcon = computed(function () {
|
|
509
532
|
return icon(icon$1.value, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes.value), transform.value), mask.value), {}, {
|
|
510
533
|
symbol: props.symbol,
|
|
511
|
-
title: props.title
|
|
534
|
+
title: props.title,
|
|
535
|
+
titleId: props.titleId,
|
|
536
|
+
maskId: props.maskId
|
|
512
537
|
}));
|
|
513
538
|
});
|
|
514
539
|
watch(renderedIcon, function (value) {
|
package/index.js
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
}, _typeof(obj);
|
|
36
36
|
}
|
|
37
37
|
function _defineProperty(obj, key, value) {
|
|
38
|
+
key = _toPropertyKey(key);
|
|
38
39
|
if (key in obj) {
|
|
39
40
|
Object.defineProperty(obj, key, {
|
|
40
41
|
value: value,
|
|
@@ -99,6 +100,20 @@
|
|
|
99
100
|
function _nonIterableSpread() {
|
|
100
101
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
101
102
|
}
|
|
103
|
+
function _toPrimitive(input, hint) {
|
|
104
|
+
if (typeof input !== "object" || input === null) return input;
|
|
105
|
+
var prim = input[Symbol.toPrimitive];
|
|
106
|
+
if (prim !== undefined) {
|
|
107
|
+
var res = prim.call(input, hint || "default");
|
|
108
|
+
if (typeof res !== "object") return res;
|
|
109
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
110
|
+
}
|
|
111
|
+
return (hint === "string" ? String : Number)(input);
|
|
112
|
+
}
|
|
113
|
+
function _toPropertyKey(arg) {
|
|
114
|
+
var key = _toPrimitive(arg, "string");
|
|
115
|
+
return typeof key === "symbol" ? key : String(key);
|
|
116
|
+
}
|
|
102
117
|
|
|
103
118
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
104
119
|
|
|
@@ -408,6 +423,10 @@
|
|
|
408
423
|
type: [Object, Array, String],
|
|
409
424
|
default: null
|
|
410
425
|
},
|
|
426
|
+
maskId: {
|
|
427
|
+
type: String,
|
|
428
|
+
default: null
|
|
429
|
+
},
|
|
411
430
|
listItem: {
|
|
412
431
|
type: Boolean,
|
|
413
432
|
default: false
|
|
@@ -457,6 +476,10 @@
|
|
|
457
476
|
type: String,
|
|
458
477
|
default: null
|
|
459
478
|
},
|
|
479
|
+
titleId: {
|
|
480
|
+
type: String,
|
|
481
|
+
default: null
|
|
482
|
+
},
|
|
460
483
|
inverse: {
|
|
461
484
|
type: Boolean,
|
|
462
485
|
default: false
|
|
@@ -511,7 +534,9 @@
|
|
|
511
534
|
var renderedIcon = vue.computed(function () {
|
|
512
535
|
return fontawesomeSvgCore.icon(icon.value, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes.value), transform.value), mask.value), {}, {
|
|
513
536
|
symbol: props.symbol,
|
|
514
|
-
title: props.title
|
|
537
|
+
title: props.title,
|
|
538
|
+
titleId: props.titleId,
|
|
539
|
+
maskId: props.maskId
|
|
515
540
|
}));
|
|
516
541
|
});
|
|
517
542
|
vue.watch(renderedIcon, function (value) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortawesome/vue-fontawesome",
|
|
3
3
|
"description": "Official Vue component for Font Awesome 6",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"README.md",
|
|
@@ -37,15 +37,14 @@
|
|
|
37
37
|
"Tyranteon <github.com/tyranteon>",
|
|
38
38
|
"Vinicius Rangel <github.com/viniciuslrangel>",
|
|
39
39
|
"Okke Tijhuis <github.com/otijhuis>",
|
|
40
|
-
"Aaron Parker <github.com/parkeyparker>"
|
|
40
|
+
"Aaron Parker <github.com/parkeyparker>",
|
|
41
|
+
"Brandon Mork <github.com/brandon-mork>"
|
|
41
42
|
],
|
|
42
43
|
"license": "MIT",
|
|
43
44
|
"scripts": {
|
|
44
45
|
"build": "rollup -c rollup.config.js",
|
|
45
46
|
"dist": "cross-env NODE_ENV=production npm run build",
|
|
46
|
-
"test": "
|
|
47
|
-
"test.5": "npm --no-save install @fortawesome/fontawesome-svg-core@1.2.x @fortawesome/free-solid-svg-icons@5.x && jest --silent",
|
|
48
|
-
"test.6": "npm --no-save install @fortawesome/fontawesome-svg-core@6.x @fortawesome/free-solid-svg-icons@6.x && jest --silent",
|
|
47
|
+
"test": "jest --silent",
|
|
49
48
|
"prepack": "npm run dist"
|
|
50
49
|
},
|
|
51
50
|
"lint-staged": {
|
|
@@ -68,24 +67,26 @@
|
|
|
68
67
|
"@babel/preset-env": "^7.18.2",
|
|
69
68
|
"@fortawesome/fontawesome-svg-core": "~6",
|
|
70
69
|
"@fortawesome/free-solid-svg-icons": "^6",
|
|
70
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
71
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
73
|
+
"@vue/test-utils": "^2.0.0-beta.2",
|
|
71
74
|
"babel-core": "^7.0.0-bridge.0",
|
|
72
75
|
"babel-jest": "^28.1.1",
|
|
73
76
|
"concurrently": "^7.2.1",
|
|
74
77
|
"cross-env": "^7.0.3",
|
|
75
78
|
"humps": "^2.0.1",
|
|
76
79
|
"husky": "^8.0.1",
|
|
80
|
+
"install": "^0.13.0",
|
|
77
81
|
"jest": "^28.1.1",
|
|
78
82
|
"jest-environment-jsdom": "^28.1.1",
|
|
79
83
|
"lint-staged": "^13.0.0",
|
|
80
84
|
"markdown-toc": "^1.2.0",
|
|
85
|
+
"npm": "^10.2.2",
|
|
86
|
+
"prettier": "^3.0.3",
|
|
81
87
|
"rollup": "^2.75.6",
|
|
82
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
83
|
-
"@rollup/plugin-commonjs": "^22.0.0",
|
|
84
|
-
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
85
|
-
"@vue/test-utils": "^2.0.0-beta.2",
|
|
86
88
|
"vue": "^3"
|
|
87
89
|
},
|
|
88
|
-
"dependencies": {},
|
|
89
90
|
"husky": {
|
|
90
91
|
"hooks": {
|
|
91
92
|
"pre-commit": "lint-staged"
|
|
@@ -4,7 +4,7 @@ import convert from '../converter'
|
|
|
4
4
|
import log from '../logger'
|
|
5
5
|
import { objectWithKey, classList } from '../utils'
|
|
6
6
|
|
|
7
|
-
function normalizeIconArgs
|
|
7
|
+
function normalizeIconArgs(icon) {
|
|
8
8
|
if (icon && typeof icon === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
9
9
|
return icon
|
|
10
10
|
}
|
|
@@ -55,6 +55,10 @@ export default defineComponent({
|
|
|
55
55
|
type: [Object, Array, String],
|
|
56
56
|
default: null
|
|
57
57
|
},
|
|
58
|
+
maskId: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
58
62
|
listItem: {
|
|
59
63
|
type: Boolean,
|
|
60
64
|
default: false
|
|
@@ -98,6 +102,10 @@ export default defineComponent({
|
|
|
98
102
|
type: String,
|
|
99
103
|
default: null
|
|
100
104
|
},
|
|
105
|
+
titleId: {
|
|
106
|
+
type: String,
|
|
107
|
+
default: null
|
|
108
|
+
},
|
|
101
109
|
inverse: {
|
|
102
110
|
type: Boolean,
|
|
103
111
|
default: false
|
|
@@ -133,35 +141,38 @@ export default defineComponent({
|
|
|
133
141
|
spinReverse: {
|
|
134
142
|
type: Boolean,
|
|
135
143
|
default: false
|
|
136
|
-
}
|
|
144
|
+
}
|
|
137
145
|
},
|
|
138
146
|
|
|
139
|
-
setup
|
|
147
|
+
setup(props, { attrs }) {
|
|
140
148
|
const icon = computed(() => normalizeIconArgs(props.icon))
|
|
141
149
|
const classes = computed(() => objectWithKey('classes', classList(props)))
|
|
142
|
-
const transform = computed(() => objectWithKey(
|
|
143
|
-
'transform',
|
|
144
|
-
(typeof props.transform === 'string')
|
|
145
|
-
? faParse.transform(props.transform)
|
|
146
|
-
: props.transform
|
|
147
|
-
))
|
|
150
|
+
const transform = computed(() => objectWithKey('transform', typeof props.transform === 'string' ? faParse.transform(props.transform) : props.transform))
|
|
148
151
|
const mask = computed(() => objectWithKey('mask', normalizeIconArgs(props.mask)))
|
|
149
152
|
|
|
150
|
-
const renderedIcon = computed(() =>
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
const renderedIcon = computed(() =>
|
|
154
|
+
faIcon(icon.value, {
|
|
155
|
+
...classes.value,
|
|
156
|
+
...transform.value,
|
|
157
|
+
...mask.value,
|
|
158
|
+
symbol: props.symbol,
|
|
159
|
+
title: props.title,
|
|
160
|
+
titleId: props.titleId,
|
|
161
|
+
maskId: props.maskId
|
|
162
|
+
})
|
|
163
|
+
)
|
|
157
164
|
|
|
158
|
-
watch(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
watch(
|
|
166
|
+
renderedIcon,
|
|
167
|
+
(value) => {
|
|
168
|
+
if (!value) {
|
|
169
|
+
return log('Could not find one or more icon(s)', icon.value, mask.value)
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{ immediate: true }
|
|
173
|
+
)
|
|
163
174
|
|
|
164
|
-
const vnode = computed(() => renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null)
|
|
175
|
+
const vnode = computed(() => (renderedIcon.value ? convert(renderedIcon.value.abstract[0], {}, attrs) : null))
|
|
165
176
|
return () => vnode.value
|
|
166
177
|
}
|
|
167
178
|
})
|