@fortawesome/vue-fontawesome 3.0.8 → 3.1.1
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/index.d.ts +2 -0
- package/index.es.js +91 -89
- package/index.js +95 -93
- package/package.json +10 -8
- package/src/components/FontAwesomeIcon.js +25 -9
- package/src/components/FontAwesomeLayers.js +3 -6
- package/src/components/FontAwesomeLayersText.js +9 -8
- package/src/utils.js +10 -6
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.1.1](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.1.1) - 2025-07-24
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Removed version checks related to `props.fixedWidth`, `iconProps.title`, and `iconProps.title`.
|
|
12
|
+
|
|
13
|
+
- The use of `require` to retrieve the version from `@fortawesome/fontawesome-svg-core` for version checks has been
|
|
14
|
+
removed to help ensure compatibility with ESM builds.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## [3.1.0](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.1.0) - 2025-07-22
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Font Awesome Pro+ icons are now available with an active Pro+ subscription.
|
|
23
|
+
|
|
24
|
+
- Added `widthAuto` prop
|
|
25
|
+
|
|
26
|
+
- Added `rotateBy` prop
|
|
27
|
+
|
|
28
|
+
- Deprecated `fa-fw` prop
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
7
32
|
## [3.0.8](https://github.com/FortAwesome/vue-fontawesome/releases/tag/3.0.8) - 2024-05-21
|
|
8
33
|
|
|
9
34
|
### Changed
|
package/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ interface FontAwesomeIconProps {
|
|
|
12
12
|
pull?: 'right' | 'left'
|
|
13
13
|
pulse?: boolean
|
|
14
14
|
rotation?: 90 | 180 | 270 | '90' | '180' | '270'
|
|
15
|
+
rotateBy?: boolean
|
|
15
16
|
swapOpacity?: boolean
|
|
16
17
|
size?: '2xs' | 'xs' | 'sm' | 'lg' | 'xl' | '2xl' | '1x' | '2x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x'
|
|
17
18
|
spin?: boolean
|
|
@@ -27,6 +28,7 @@ interface FontAwesomeIconProps {
|
|
|
27
28
|
beatFade?: boolean
|
|
28
29
|
spinPulse?: boolean
|
|
29
30
|
spinReverse?: boolean
|
|
31
|
+
widthAuto?: boolean
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
interface FontAwesomeLayersProps {
|
package/index.es.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import { parse, icon, config, text } from '@fortawesome/fontawesome-svg-core';
|
|
2
1
|
import { h, defineComponent, computed, watch } from 'vue';
|
|
2
|
+
import { parse, icon, config, text } from '@fortawesome/fontawesome-svg-core';
|
|
3
3
|
|
|
4
|
+
function _arrayLikeToArray(r, a) {
|
|
5
|
+
(null == a || a > r.length) && (a = r.length);
|
|
6
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
function _arrayWithoutHoles(r) {
|
|
10
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
11
|
+
}
|
|
12
|
+
function _defineProperty(e, r, t) {
|
|
13
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
14
|
+
value: t,
|
|
15
|
+
enumerable: !0,
|
|
16
|
+
configurable: !0,
|
|
17
|
+
writable: !0
|
|
18
|
+
}) : e[r] = t, e;
|
|
19
|
+
}
|
|
20
|
+
function _iterableToArray(r) {
|
|
21
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
22
|
+
}
|
|
23
|
+
function _nonIterableSpread() {
|
|
24
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
25
|
+
}
|
|
4
26
|
function ownKeys(e, r) {
|
|
5
27
|
var t = Object.keys(e);
|
|
6
28
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -22,6 +44,29 @@ function _objectSpread2(e) {
|
|
|
22
44
|
}
|
|
23
45
|
return e;
|
|
24
46
|
}
|
|
47
|
+
function _objectWithoutProperties(e, t) {
|
|
48
|
+
if (null == e) return {};
|
|
49
|
+
var o,
|
|
50
|
+
r,
|
|
51
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
52
|
+
if (Object.getOwnPropertySymbols) {
|
|
53
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
54
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
55
|
+
}
|
|
56
|
+
return i;
|
|
57
|
+
}
|
|
58
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
59
|
+
if (null == r) return {};
|
|
60
|
+
var t = {};
|
|
61
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
62
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
63
|
+
t[n] = r[n];
|
|
64
|
+
}
|
|
65
|
+
return t;
|
|
66
|
+
}
|
|
67
|
+
function _toConsumableArray(r) {
|
|
68
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
69
|
+
}
|
|
25
70
|
function _toPrimitive(t, r) {
|
|
26
71
|
if ("object" != typeof t || !t) return t;
|
|
27
72
|
var e = t[Symbol.toPrimitive];
|
|
@@ -45,70 +90,36 @@ function _typeof(o) {
|
|
|
45
90
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
46
91
|
}, _typeof(o);
|
|
47
92
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
enumerable: true,
|
|
54
|
-
configurable: true,
|
|
55
|
-
writable: true
|
|
56
|
-
});
|
|
57
|
-
} else {
|
|
58
|
-
obj[key] = value;
|
|
59
|
-
}
|
|
60
|
-
return obj;
|
|
61
|
-
}
|
|
62
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
63
|
-
if (source == null) return {};
|
|
64
|
-
var target = {};
|
|
65
|
-
for (var key in source) {
|
|
66
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
67
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
68
|
-
target[key] = source[key];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return target;
|
|
72
|
-
}
|
|
73
|
-
function _objectWithoutProperties(source, excluded) {
|
|
74
|
-
if (source == null) return {};
|
|
75
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
-
var key, i;
|
|
77
|
-
if (Object.getOwnPropertySymbols) {
|
|
78
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
79
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
80
|
-
key = sourceSymbolKeys[i];
|
|
81
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
82
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
83
|
-
target[key] = source[key];
|
|
84
|
-
}
|
|
93
|
+
function _unsupportedIterableToArray(r, a) {
|
|
94
|
+
if (r) {
|
|
95
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
96
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
97
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
85
98
|
}
|
|
86
|
-
return target;
|
|
87
|
-
}
|
|
88
|
-
function _toConsumableArray(arr) {
|
|
89
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
90
99
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
function _iterableToArray(iter) {
|
|
95
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
96
|
-
}
|
|
97
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
98
|
-
if (!o) return;
|
|
99
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
100
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
101
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
102
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
103
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
104
|
-
}
|
|
105
|
-
function _arrayLikeToArray(arr, len) {
|
|
106
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
107
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
108
|
-
return arr2;
|
|
100
|
+
|
|
101
|
+
function objectWithKey(key, value) {
|
|
102
|
+
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
109
103
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
104
|
+
function classList(props) {
|
|
105
|
+
var _classes;
|
|
106
|
+
var classes = (_classes = {
|
|
107
|
+
'fa-spin': props.spin,
|
|
108
|
+
'fa-pulse': props.pulse,
|
|
109
|
+
// the fixedWidth property has been deprecated as of version 7.0.0
|
|
110
|
+
'fa-fw': props.fixedWidth,
|
|
111
|
+
'fa-border': props.border,
|
|
112
|
+
'fa-li': props.listItem,
|
|
113
|
+
'fa-inverse': props.inverse,
|
|
114
|
+
'fa-flip': props.flip === true,
|
|
115
|
+
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
116
|
+
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
117
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, "fa-".concat(props.size), props.size !== null), "fa-rotate-".concat(props.rotation), props.rotation !== null), 'fa-rotate-by', props.rotateBy), "fa-pull-".concat(props.pull), props.pull !== null), 'fa-swap-opacity', props.swapOpacity), 'fa-bounce', props.bounce), 'fa-shake', props.shake), 'fa-beat', props.beat), 'fa-fade', props.fade), 'fa-beat-fade', props.beatFade), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, 'fa-flash', props.flash), 'fa-spin-pulse', props.spinPulse), 'fa-spin-reverse', props.spinReverse), 'fa-width-auto', props.widthAuto));
|
|
118
|
+
return Object.keys(classes).map(function (key) {
|
|
119
|
+
return classes[key] ? key : null;
|
|
120
|
+
}).filter(function (key) {
|
|
121
|
+
return key;
|
|
122
|
+
});
|
|
112
123
|
}
|
|
113
124
|
|
|
114
125
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -344,29 +355,6 @@ function log () {
|
|
|
344
355
|
}
|
|
345
356
|
}
|
|
346
357
|
|
|
347
|
-
function objectWithKey(key, value) {
|
|
348
|
-
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
349
|
-
}
|
|
350
|
-
function classList(props) {
|
|
351
|
-
var _classes;
|
|
352
|
-
var classes = (_classes = {
|
|
353
|
-
'fa-spin': props.spin,
|
|
354
|
-
'fa-pulse': props.pulse,
|
|
355
|
-
'fa-fw': props.fixedWidth,
|
|
356
|
-
'fa-border': props.border,
|
|
357
|
-
'fa-li': props.listItem,
|
|
358
|
-
'fa-inverse': props.inverse,
|
|
359
|
-
'fa-flip': props.flip === true,
|
|
360
|
-
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
361
|
-
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
362
|
-
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, "fa-".concat(props.size), props.size !== null), "fa-rotate-".concat(props.rotation), props.rotation !== null), "fa-pull-".concat(props.pull), props.pull !== null), 'fa-swap-opacity', props.swapOpacity), 'fa-bounce', props.bounce), 'fa-shake', props.shake), 'fa-beat', props.beat), 'fa-fade', props.fade), 'fa-beat-fade', props.beatFade), 'fa-flash', props.flash), _defineProperty(_defineProperty(_classes, 'fa-spin-pulse', props.spinPulse), 'fa-spin-reverse', props.spinReverse));
|
|
363
|
-
return Object.keys(classes).map(function (key) {
|
|
364
|
-
return classes[key] ? key : null;
|
|
365
|
-
}).filter(function (key) {
|
|
366
|
-
return key;
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
|
|
370
358
|
function normalizeIconArgs(icon) {
|
|
371
359
|
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
372
360
|
return icon;
|
|
@@ -400,6 +388,7 @@ var FontAwesomeIcon = defineComponent({
|
|
|
400
388
|
type: Boolean,
|
|
401
389
|
default: false
|
|
402
390
|
},
|
|
391
|
+
// the fixedWidth property has been deprecated as of version 7
|
|
403
392
|
fixedWidth: {
|
|
404
393
|
type: Boolean,
|
|
405
394
|
default: false
|
|
@@ -445,6 +434,11 @@ var FontAwesomeIcon = defineComponent({
|
|
|
445
434
|
return [90, 180, 270].indexOf(Number.parseInt(value, 10)) > -1;
|
|
446
435
|
}
|
|
447
436
|
},
|
|
437
|
+
// the rotateBy property is only supported in version 7.0.0 and later
|
|
438
|
+
rotateBy: {
|
|
439
|
+
type: Boolean,
|
|
440
|
+
default: false
|
|
441
|
+
},
|
|
448
442
|
swapOpacity: {
|
|
449
443
|
type: Boolean,
|
|
450
444
|
default: false
|
|
@@ -511,6 +505,11 @@ var FontAwesomeIcon = defineComponent({
|
|
|
511
505
|
spinReverse: {
|
|
512
506
|
type: Boolean,
|
|
513
507
|
default: false
|
|
508
|
+
},
|
|
509
|
+
// the widthAuto property is only supported in version 7.0.0 and later
|
|
510
|
+
widthAuto: {
|
|
511
|
+
type: Boolean,
|
|
512
|
+
default: false
|
|
514
513
|
}
|
|
515
514
|
},
|
|
516
515
|
setup: function setup(props, _ref) {
|
|
@@ -528,12 +527,15 @@ var FontAwesomeIcon = defineComponent({
|
|
|
528
527
|
return objectWithKey('mask', normalizeIconArgs(props.mask));
|
|
529
528
|
});
|
|
530
529
|
var renderedIcon = computed(function () {
|
|
531
|
-
|
|
530
|
+
var iconProps = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes.value), transform.value), mask.value), {}, {
|
|
532
531
|
symbol: props.symbol,
|
|
533
|
-
title: props.title,
|
|
534
|
-
titleId: props.titleId,
|
|
535
532
|
maskId: props.maskId
|
|
536
|
-
})
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// the title attribute will only apply to versions prior to version 7.0.0
|
|
536
|
+
iconProps.title = props.title;
|
|
537
|
+
iconProps.titleId = props.titleId;
|
|
538
|
+
return icon(icon$1.value, iconProps);
|
|
537
539
|
});
|
|
538
540
|
watch(renderedIcon, function (value) {
|
|
539
541
|
if (!value) {
|
package/index.js
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fortawesome/fontawesome-svg-core')
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', '@fortawesome/fontawesome-svg-core'
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["vue-fontawesome"] = {}, global.
|
|
5
|
-
})(this, (function (exports,
|
|
6
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@fortawesome/fontawesome-svg-core')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@fortawesome/fontawesome-svg-core'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["vue-fontawesome"] = {}, global.vue, global.FontAwesome));
|
|
5
|
+
})(this, (function (exports, vue, fontawesomeSvgCore) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(r, a) {
|
|
8
|
+
(null == a || a > r.length) && (a = r.length);
|
|
9
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
10
|
+
return n;
|
|
11
|
+
}
|
|
12
|
+
function _arrayWithoutHoles(r) {
|
|
13
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
14
|
+
}
|
|
15
|
+
function _defineProperty(e, r, t) {
|
|
16
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
17
|
+
value: t,
|
|
18
|
+
enumerable: !0,
|
|
19
|
+
configurable: !0,
|
|
20
|
+
writable: !0
|
|
21
|
+
}) : e[r] = t, e;
|
|
22
|
+
}
|
|
23
|
+
function _iterableToArray(r) {
|
|
24
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
25
|
+
}
|
|
26
|
+
function _nonIterableSpread() {
|
|
27
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
28
|
+
}
|
|
7
29
|
function ownKeys(e, r) {
|
|
8
30
|
var t = Object.keys(e);
|
|
9
31
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -25,6 +47,29 @@
|
|
|
25
47
|
}
|
|
26
48
|
return e;
|
|
27
49
|
}
|
|
50
|
+
function _objectWithoutProperties(e, t) {
|
|
51
|
+
if (null == e) return {};
|
|
52
|
+
var o,
|
|
53
|
+
r,
|
|
54
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
55
|
+
if (Object.getOwnPropertySymbols) {
|
|
56
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
57
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
58
|
+
}
|
|
59
|
+
return i;
|
|
60
|
+
}
|
|
61
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
62
|
+
if (null == r) return {};
|
|
63
|
+
var t = {};
|
|
64
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
65
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
66
|
+
t[n] = r[n];
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
function _toConsumableArray(r) {
|
|
71
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
72
|
+
}
|
|
28
73
|
function _toPrimitive(t, r) {
|
|
29
74
|
if ("object" != typeof t || !t) return t;
|
|
30
75
|
var e = t[Symbol.toPrimitive];
|
|
@@ -48,70 +93,36 @@
|
|
|
48
93
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
49
94
|
}, _typeof(o);
|
|
50
95
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
enumerable: true,
|
|
57
|
-
configurable: true,
|
|
58
|
-
writable: true
|
|
59
|
-
});
|
|
60
|
-
} else {
|
|
61
|
-
obj[key] = value;
|
|
96
|
+
function _unsupportedIterableToArray(r, a) {
|
|
97
|
+
if (r) {
|
|
98
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
99
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
100
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
62
101
|
}
|
|
63
|
-
return obj;
|
|
64
102
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
for (var key in source) {
|
|
69
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
70
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
71
|
-
target[key] = source[key];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return target;
|
|
75
|
-
}
|
|
76
|
-
function _objectWithoutProperties(source, excluded) {
|
|
77
|
-
if (source == null) return {};
|
|
78
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
79
|
-
var key, i;
|
|
80
|
-
if (Object.getOwnPropertySymbols) {
|
|
81
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
82
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
83
|
-
key = sourceSymbolKeys[i];
|
|
84
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
85
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
86
|
-
target[key] = source[key];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return target;
|
|
90
|
-
}
|
|
91
|
-
function _toConsumableArray(arr) {
|
|
92
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
93
|
-
}
|
|
94
|
-
function _arrayWithoutHoles(arr) {
|
|
95
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
96
|
-
}
|
|
97
|
-
function _iterableToArray(iter) {
|
|
98
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
99
|
-
}
|
|
100
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
101
|
-
if (!o) return;
|
|
102
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
103
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
104
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
105
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
106
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
107
|
-
}
|
|
108
|
-
function _arrayLikeToArray(arr, len) {
|
|
109
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
110
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
111
|
-
return arr2;
|
|
103
|
+
|
|
104
|
+
function objectWithKey(key, value) {
|
|
105
|
+
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
112
106
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
107
|
+
function classList(props) {
|
|
108
|
+
var _classes;
|
|
109
|
+
var classes = (_classes = {
|
|
110
|
+
'fa-spin': props.spin,
|
|
111
|
+
'fa-pulse': props.pulse,
|
|
112
|
+
// the fixedWidth property has been deprecated as of version 7.0.0
|
|
113
|
+
'fa-fw': props.fixedWidth,
|
|
114
|
+
'fa-border': props.border,
|
|
115
|
+
'fa-li': props.listItem,
|
|
116
|
+
'fa-inverse': props.inverse,
|
|
117
|
+
'fa-flip': props.flip === true,
|
|
118
|
+
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
119
|
+
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
120
|
+
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, "fa-".concat(props.size), props.size !== null), "fa-rotate-".concat(props.rotation), props.rotation !== null), 'fa-rotate-by', props.rotateBy), "fa-pull-".concat(props.pull), props.pull !== null), 'fa-swap-opacity', props.swapOpacity), 'fa-bounce', props.bounce), 'fa-shake', props.shake), 'fa-beat', props.beat), 'fa-fade', props.fade), 'fa-beat-fade', props.beatFade), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, 'fa-flash', props.flash), 'fa-spin-pulse', props.spinPulse), 'fa-spin-reverse', props.spinReverse), 'fa-width-auto', props.widthAuto));
|
|
121
|
+
return Object.keys(classes).map(function (key) {
|
|
122
|
+
return classes[key] ? key : null;
|
|
123
|
+
}).filter(function (key) {
|
|
124
|
+
return key;
|
|
125
|
+
});
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -347,29 +358,6 @@
|
|
|
347
358
|
}
|
|
348
359
|
}
|
|
349
360
|
|
|
350
|
-
function objectWithKey(key, value) {
|
|
351
|
-
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
352
|
-
}
|
|
353
|
-
function classList(props) {
|
|
354
|
-
var _classes;
|
|
355
|
-
var classes = (_classes = {
|
|
356
|
-
'fa-spin': props.spin,
|
|
357
|
-
'fa-pulse': props.pulse,
|
|
358
|
-
'fa-fw': props.fixedWidth,
|
|
359
|
-
'fa-border': props.border,
|
|
360
|
-
'fa-li': props.listItem,
|
|
361
|
-
'fa-inverse': props.inverse,
|
|
362
|
-
'fa-flip': props.flip === true,
|
|
363
|
-
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
364
|
-
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
365
|
-
}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_classes, "fa-".concat(props.size), props.size !== null), "fa-rotate-".concat(props.rotation), props.rotation !== null), "fa-pull-".concat(props.pull), props.pull !== null), 'fa-swap-opacity', props.swapOpacity), 'fa-bounce', props.bounce), 'fa-shake', props.shake), 'fa-beat', props.beat), 'fa-fade', props.fade), 'fa-beat-fade', props.beatFade), 'fa-flash', props.flash), _defineProperty(_defineProperty(_classes, 'fa-spin-pulse', props.spinPulse), 'fa-spin-reverse', props.spinReverse));
|
|
366
|
-
return Object.keys(classes).map(function (key) {
|
|
367
|
-
return classes[key] ? key : null;
|
|
368
|
-
}).filter(function (key) {
|
|
369
|
-
return key;
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
361
|
function normalizeIconArgs(icon) {
|
|
374
362
|
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
375
363
|
return icon;
|
|
@@ -403,6 +391,7 @@
|
|
|
403
391
|
type: Boolean,
|
|
404
392
|
default: false
|
|
405
393
|
},
|
|
394
|
+
// the fixedWidth property has been deprecated as of version 7
|
|
406
395
|
fixedWidth: {
|
|
407
396
|
type: Boolean,
|
|
408
397
|
default: false
|
|
@@ -448,6 +437,11 @@
|
|
|
448
437
|
return [90, 180, 270].indexOf(Number.parseInt(value, 10)) > -1;
|
|
449
438
|
}
|
|
450
439
|
},
|
|
440
|
+
// the rotateBy property is only supported in version 7.0.0 and later
|
|
441
|
+
rotateBy: {
|
|
442
|
+
type: Boolean,
|
|
443
|
+
default: false
|
|
444
|
+
},
|
|
451
445
|
swapOpacity: {
|
|
452
446
|
type: Boolean,
|
|
453
447
|
default: false
|
|
@@ -514,6 +508,11 @@
|
|
|
514
508
|
spinReverse: {
|
|
515
509
|
type: Boolean,
|
|
516
510
|
default: false
|
|
511
|
+
},
|
|
512
|
+
// the widthAuto property is only supported in version 7.0.0 and later
|
|
513
|
+
widthAuto: {
|
|
514
|
+
type: Boolean,
|
|
515
|
+
default: false
|
|
517
516
|
}
|
|
518
517
|
},
|
|
519
518
|
setup: function setup(props, _ref) {
|
|
@@ -531,12 +530,15 @@
|
|
|
531
530
|
return objectWithKey('mask', normalizeIconArgs(props.mask));
|
|
532
531
|
});
|
|
533
532
|
var renderedIcon = vue.computed(function () {
|
|
534
|
-
|
|
533
|
+
var iconProps = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes.value), transform.value), mask.value), {}, {
|
|
535
534
|
symbol: props.symbol,
|
|
536
|
-
title: props.title,
|
|
537
|
-
titleId: props.titleId,
|
|
538
535
|
maskId: props.maskId
|
|
539
|
-
})
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
// the title attribute will only apply to versions prior to version 7.0.0
|
|
539
|
+
iconProps.title = props.title;
|
|
540
|
+
iconProps.titleId = props.titleId;
|
|
541
|
+
return fontawesomeSvgCore.icon(icon.value, iconProps);
|
|
540
542
|
});
|
|
541
543
|
vue.watch(renderedIcon, function (value) {
|
|
542
544
|
if (!value) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortawesome/vue-fontawesome",
|
|
3
|
-
"description": "Official Vue component for Font Awesome
|
|
4
|
-
"version": "3.
|
|
3
|
+
"description": "Official Vue component for Font Awesome 7",
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"README.md",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@fortawesome/fontawesome-svg-core": "~1 || ~6",
|
|
68
|
+
"@fortawesome/fontawesome-svg-core": "~1 || ~6 || ~7",
|
|
69
69
|
"vue": ">= 3.0.0 < 4"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
@@ -76,12 +76,13 @@
|
|
|
76
76
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
77
77
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
|
78
78
|
"@babel/preset-env": "^7.18.2",
|
|
79
|
-
"@fortawesome/fontawesome-svg-core": "
|
|
80
|
-
"@fortawesome/free-
|
|
79
|
+
"@fortawesome/fontawesome-svg-core": "^7.0.0",
|
|
80
|
+
"@fortawesome/free-brands-svg-icons": "^7.0.0",
|
|
81
|
+
"@fortawesome/free-solid-svg-icons": "^7.0.0",
|
|
81
82
|
"@rollup/plugin-babel": "^5.3.1",
|
|
82
83
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
83
84
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
84
|
-
"@vue/test-utils": "^2.
|
|
85
|
+
"@vue/test-utils": "^2.4.6",
|
|
85
86
|
"babel-core": "^7.0.0-bridge.0",
|
|
86
87
|
"babel-jest": "^28.1.1",
|
|
87
88
|
"concurrently": "^7.2.1",
|
|
@@ -96,11 +97,12 @@
|
|
|
96
97
|
"npm": "^10.2.2",
|
|
97
98
|
"prettier": "^3.0.3",
|
|
98
99
|
"rollup": "^2.75.6",
|
|
99
|
-
"vue": "^3"
|
|
100
|
+
"vue": "^3.0.0"
|
|
100
101
|
},
|
|
101
102
|
"husky": {
|
|
102
103
|
"hooks": {
|
|
103
104
|
"pre-commit": "lint-staged"
|
|
104
105
|
}
|
|
105
|
-
}
|
|
106
|
+
},
|
|
107
|
+
"dependencies": {}
|
|
106
108
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { classList, objectWithKey } from '../utils'
|
|
2
|
+
import { computed, defineComponent, watch } from 'vue'
|
|
3
|
+
import { icon as faIcon, parse as faParse } from '@fortawesome/fontawesome-svg-core'
|
|
4
|
+
|
|
3
5
|
import convert from '../converter'
|
|
4
6
|
import log from '../logger'
|
|
5
|
-
import { objectWithKey, classList } from '../utils'
|
|
6
7
|
|
|
7
8
|
function normalizeIconArgs(icon) {
|
|
8
9
|
if (icon && typeof icon === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
@@ -38,6 +39,7 @@ export default defineComponent({
|
|
|
38
39
|
type: Boolean,
|
|
39
40
|
default: false
|
|
40
41
|
},
|
|
42
|
+
// the fixedWidth property has been deprecated as of version 7
|
|
41
43
|
fixedWidth: {
|
|
42
44
|
type: Boolean,
|
|
43
45
|
default: false
|
|
@@ -77,6 +79,11 @@ export default defineComponent({
|
|
|
77
79
|
default: null,
|
|
78
80
|
validator: (value) => [90, 180, 270].indexOf(Number.parseInt(value, 10)) > -1
|
|
79
81
|
},
|
|
82
|
+
// the rotateBy property is only supported in version 7.0.0 and later
|
|
83
|
+
rotateBy: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
80
87
|
swapOpacity: {
|
|
81
88
|
type: Boolean,
|
|
82
89
|
default: false
|
|
@@ -141,6 +148,11 @@ export default defineComponent({
|
|
|
141
148
|
spinReverse: {
|
|
142
149
|
type: Boolean,
|
|
143
150
|
default: false
|
|
151
|
+
},
|
|
152
|
+
// the widthAuto property is only supported in version 7.0.0 and later
|
|
153
|
+
widthAuto: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
default: false
|
|
144
156
|
}
|
|
145
157
|
},
|
|
146
158
|
|
|
@@ -150,17 +162,21 @@ export default defineComponent({
|
|
|
150
162
|
const transform = computed(() => objectWithKey('transform', typeof props.transform === 'string' ? faParse.transform(props.transform) : props.transform))
|
|
151
163
|
const mask = computed(() => objectWithKey('mask', normalizeIconArgs(props.mask)))
|
|
152
164
|
|
|
153
|
-
const renderedIcon = computed(() =>
|
|
154
|
-
|
|
165
|
+
const renderedIcon = computed(() => {
|
|
166
|
+
const iconProps = {
|
|
155
167
|
...classes.value,
|
|
156
168
|
...transform.value,
|
|
157
169
|
...mask.value,
|
|
158
170
|
symbol: props.symbol,
|
|
159
|
-
title: props.title,
|
|
160
|
-
titleId: props.titleId,
|
|
161
171
|
maskId: props.maskId
|
|
162
|
-
}
|
|
163
|
-
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// the title attribute will only apply to versions prior to version 7.0.0
|
|
175
|
+
iconProps.title = props.title
|
|
176
|
+
iconProps.titleId = props.titleId
|
|
177
|
+
|
|
178
|
+
return faIcon(icon.value, iconProps)
|
|
179
|
+
})
|
|
164
180
|
|
|
165
181
|
watch(
|
|
166
182
|
renderedIcon,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { computed, defineComponent, h } from 'vue'
|
|
1
2
|
import { config } from '@fortawesome/fontawesome-svg-core'
|
|
2
|
-
import { defineComponent, h, computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
export default defineComponent({
|
|
5
5
|
name: 'FontAwesomeLayers',
|
|
@@ -11,13 +11,10 @@ export default defineComponent({
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
-
setup
|
|
14
|
+
setup(props, { slots }) {
|
|
15
15
|
const { familyPrefix } = config
|
|
16
16
|
|
|
17
|
-
const className = computed(() => [
|
|
18
|
-
`${familyPrefix}-layers`,
|
|
19
|
-
...(props.fixedWidth ? [`${familyPrefix}-fw`] : [])
|
|
20
|
-
])
|
|
17
|
+
const className = computed(() => [`${familyPrefix}-layers`, ...(props.fixedWidth ? [`${familyPrefix}-fw`] : [])])
|
|
21
18
|
|
|
22
19
|
return () => h('div', { class: className.value }, slots.default ? slots.default() : [])
|
|
23
20
|
}
|
|
@@ -23,18 +23,19 @@ export default defineComponent({
|
|
|
23
23
|
type: String,
|
|
24
24
|
default: null,
|
|
25
25
|
validator: (value) => ['bottom-left', 'bottom-right', 'top-left', 'top-right'].indexOf(value) > -1
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
},
|
|
28
28
|
|
|
29
|
-
setup
|
|
29
|
+
setup(props, { attrs }) {
|
|
30
30
|
const { familyPrefix } = config
|
|
31
31
|
|
|
32
|
-
const classes = computed(() =>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const classes = computed(() =>
|
|
33
|
+
objectWithKey('classes', [
|
|
34
|
+
...(props.counter ? [`${familyPrefix}-layers-counter`] : []),
|
|
35
|
+
...(props.position ? [`${familyPrefix}-layers-${props.position}`] : [])
|
|
36
|
+
])
|
|
37
|
+
)
|
|
38
|
+
const transform = computed(() => objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform))
|
|
38
39
|
const abstractElement = computed(() => {
|
|
39
40
|
const { abstract } = text(props.value.toString(), { ...transform.value, ...classes.value })
|
|
40
41
|
if (props.counter) {
|
package/src/utils.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
export function objectWithKey
|
|
2
|
-
return (
|
|
1
|
+
export function objectWithKey(key, value) {
|
|
2
|
+
return (Array.isArray(value) && value.length > 0) || (!Array.isArray(value) && value) ? { [key]: value } : {}
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
export function classList
|
|
5
|
+
export function classList(props) {
|
|
6
6
|
let classes = {
|
|
7
7
|
'fa-spin': props.spin,
|
|
8
8
|
'fa-pulse': props.pulse,
|
|
9
|
+
// the fixedWidth property has been deprecated as of version 7.0.0
|
|
9
10
|
'fa-fw': props.fixedWidth,
|
|
10
11
|
'fa-border': props.border,
|
|
11
12
|
'fa-li': props.listItem,
|
|
@@ -15,6 +16,7 @@ export function classList (props) {
|
|
|
15
16
|
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both',
|
|
16
17
|
[`fa-${props.size}`]: props.size !== null,
|
|
17
18
|
[`fa-rotate-${props.rotation}`]: props.rotation !== null,
|
|
19
|
+
'fa-rotate-by': props.rotateBy,
|
|
18
20
|
[`fa-pull-${props.pull}`]: props.pull !== null,
|
|
19
21
|
'fa-swap-opacity': props.swapOpacity,
|
|
20
22
|
'fa-bounce': props.bounce,
|
|
@@ -24,12 +26,14 @@ export function classList (props) {
|
|
|
24
26
|
'fa-beat-fade': props.beatFade,
|
|
25
27
|
'fa-flash': props.flash,
|
|
26
28
|
'fa-spin-pulse': props.spinPulse,
|
|
27
|
-
'fa-spin-reverse': props.spinReverse
|
|
29
|
+
'fa-spin-reverse': props.spinReverse,
|
|
30
|
+
// the widthAuto property is only supported in version 7.0.0 and later
|
|
31
|
+
'fa-width-auto': props.widthAuto
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
return Object.keys(classes)
|
|
31
|
-
.map(key => classes[key] ? key : null)
|
|
32
|
-
.filter(key => key)
|
|
35
|
+
.map((key) => (classes[key] ? key : null))
|
|
36
|
+
.filter((key) => key)
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export function addStaticClass(to, what) {
|