@fortawesome/vue-fontawesome 2.0.9 → 2.0.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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/index.es.js +59 -9
- package/index.js +59 -9
- package/package.json +6 -7
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
9
9
|
- [Vue 3.x compatible version of this component](https://github.com/FortAwesome/vue-fontawesome/tree/3.x)
|
|
10
10
|
- [CHANGELOG for version 3.x](https://github.com/FortAwesome/vue-fontawesome/blob/3.x/CHANGELOG.md)
|
|
11
11
|
|
|
12
|
+
---
|
|
13
|
+
## [2.0.10](https://github.com/FortAwesome/vue-fontawesome/releases/tag/2.0.10) - 2023-01-24
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- 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)
|
|
17
|
+
- Updated CI workflow testing to include Vue 2.7.x
|
|
18
|
+
- Updated contributor's GitHub user name in README.md and package.json files
|
|
19
|
+
|
|
12
20
|
---
|
|
13
21
|
|
|
14
22
|
## [2.0.9](https://github.com/FortAwesome/vue-fontawesome/releases/tag/2.0.9) - 2022-11-07
|
package/README.md
CHANGED
|
@@ -55,7 +55,7 @@ being awesome contributors to this project. **We'd like to take a moment to reco
|
|
|
55
55
|
|
|
56
56
|
| | Name | GitHub |
|
|
57
57
|
| :--------------------------------------------------------: | -------------- | ---------------------------------------------------- |
|
|
58
|
-
| <img src="https://github.com/
|
|
58
|
+
| <img src="https://github.com/GregPeden.png?size=72" /> | Greg Peden | [@GregPeden](https://github.com/GregPeden) |
|
|
59
59
|
| <img src="https://github.com/meteorlxy.png?size=72" /> | Liu Xinyu | [@meteorlxy](https://github.com/meteorlxy) |
|
|
60
60
|
| <img src="https://github.com/schulz3000.png?size=72" /> | Xaver Schulz | [@schulz3000](https://github.com/schulz3000) |
|
|
61
61
|
| <img src="https://github.com/ihmels.png?size=72" /> | Yannick Ihmels | [@ihmels](https://github.com/ihmels) |
|
package/index.es.js
CHANGED
|
@@ -2,14 +2,17 @@ import { parse, icon, config, text } from '@fortawesome/fontawesome-svg-core';
|
|
|
2
2
|
|
|
3
3
|
function ownKeys(object, enumerableOnly) {
|
|
4
4
|
var keys = Object.keys(object);
|
|
5
|
+
|
|
5
6
|
if (Object.getOwnPropertySymbols) {
|
|
6
7
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
7
8
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
8
9
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
9
10
|
})), keys.push.apply(keys, symbols);
|
|
10
11
|
}
|
|
12
|
+
|
|
11
13
|
return keys;
|
|
12
14
|
}
|
|
15
|
+
|
|
13
16
|
function _objectSpread2(target) {
|
|
14
17
|
for (var i = 1; i < arguments.length; i++) {
|
|
15
18
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -19,8 +22,10 @@ function _objectSpread2(target) {
|
|
|
19
22
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
20
23
|
});
|
|
21
24
|
}
|
|
25
|
+
|
|
22
26
|
return target;
|
|
23
27
|
}
|
|
28
|
+
|
|
24
29
|
function _typeof(obj) {
|
|
25
30
|
"@babel/helpers - typeof";
|
|
26
31
|
|
|
@@ -30,6 +35,7 @@ function _typeof(obj) {
|
|
|
30
35
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
31
36
|
}, _typeof(obj);
|
|
32
37
|
}
|
|
38
|
+
|
|
33
39
|
function _defineProperty(obj, key, value) {
|
|
34
40
|
if (key in obj) {
|
|
35
41
|
Object.defineProperty(obj, key, {
|
|
@@ -41,26 +47,35 @@ function _defineProperty(obj, key, value) {
|
|
|
41
47
|
} else {
|
|
42
48
|
obj[key] = value;
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
return obj;
|
|
45
52
|
}
|
|
53
|
+
|
|
46
54
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
47
55
|
if (source == null) return {};
|
|
48
56
|
var target = {};
|
|
49
57
|
var sourceKeys = Object.keys(source);
|
|
50
58
|
var key, i;
|
|
59
|
+
|
|
51
60
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
52
61
|
key = sourceKeys[i];
|
|
53
62
|
if (excluded.indexOf(key) >= 0) continue;
|
|
54
63
|
target[key] = source[key];
|
|
55
64
|
}
|
|
65
|
+
|
|
56
66
|
return target;
|
|
57
67
|
}
|
|
68
|
+
|
|
58
69
|
function _objectWithoutProperties(source, excluded) {
|
|
59
70
|
if (source == null) return {};
|
|
71
|
+
|
|
60
72
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
73
|
+
|
|
61
74
|
var key, i;
|
|
75
|
+
|
|
62
76
|
if (Object.getOwnPropertySymbols) {
|
|
63
77
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
78
|
+
|
|
64
79
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
65
80
|
key = sourceSymbolKeys[i];
|
|
66
81
|
if (excluded.indexOf(key) >= 0) continue;
|
|
@@ -68,17 +83,22 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
68
83
|
target[key] = source[key];
|
|
69
84
|
}
|
|
70
85
|
}
|
|
86
|
+
|
|
71
87
|
return target;
|
|
72
88
|
}
|
|
89
|
+
|
|
73
90
|
function _toConsumableArray(arr) {
|
|
74
91
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
75
92
|
}
|
|
93
|
+
|
|
76
94
|
function _arrayWithoutHoles(arr) {
|
|
77
95
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
78
96
|
}
|
|
97
|
+
|
|
79
98
|
function _iterableToArray(iter) {
|
|
80
99
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
81
100
|
}
|
|
101
|
+
|
|
82
102
|
function _unsupportedIterableToArray(o, minLen) {
|
|
83
103
|
if (!o) return;
|
|
84
104
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -87,11 +107,15 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
87
107
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
88
108
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
89
109
|
}
|
|
110
|
+
|
|
90
111
|
function _arrayLikeToArray(arr, len) {
|
|
91
112
|
if (len == null || len > arr.length) len = arr.length;
|
|
113
|
+
|
|
92
114
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
115
|
+
|
|
93
116
|
return arr2;
|
|
94
117
|
}
|
|
118
|
+
|
|
95
119
|
function _nonIterableSpread() {
|
|
96
120
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
97
121
|
}
|
|
@@ -235,6 +259,7 @@ var humps$1 = {exports: {}};
|
|
|
235
259
|
var humps = humps$1.exports;
|
|
236
260
|
|
|
237
261
|
var _excluded = ["class", "style", "attrs"];
|
|
262
|
+
|
|
238
263
|
function styleToObject(style) {
|
|
239
264
|
return style.split(';').map(function (s) {
|
|
240
265
|
return s.trim();
|
|
@@ -248,54 +273,65 @@ function styleToObject(style) {
|
|
|
248
273
|
return acc;
|
|
249
274
|
}, {});
|
|
250
275
|
}
|
|
276
|
+
|
|
251
277
|
function classToObject(cls) {
|
|
252
278
|
return cls.split(/\s+/).reduce(function (acc, c) {
|
|
253
279
|
acc[c] = true;
|
|
254
280
|
return acc;
|
|
255
281
|
}, {});
|
|
256
282
|
}
|
|
283
|
+
|
|
257
284
|
function combineClassObjects() {
|
|
258
285
|
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
259
286
|
objs[_key] = arguments[_key];
|
|
260
287
|
}
|
|
288
|
+
|
|
261
289
|
return objs.reduce(function (acc, obj) {
|
|
262
290
|
if (Array.isArray(obj)) {
|
|
263
291
|
acc = acc.concat(obj);
|
|
264
292
|
} else {
|
|
265
293
|
acc.push(obj);
|
|
266
294
|
}
|
|
295
|
+
|
|
267
296
|
return acc;
|
|
268
297
|
}, []);
|
|
269
298
|
}
|
|
299
|
+
|
|
270
300
|
function convert(h, element) {
|
|
271
301
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
272
302
|
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
273
303
|
var children = (element.children || []).map(convert.bind(null, h));
|
|
274
304
|
var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
|
|
275
305
|
var val = element.attributes[key];
|
|
306
|
+
|
|
276
307
|
switch (key) {
|
|
277
308
|
case 'class':
|
|
278
309
|
acc['class'] = classToObject(val);
|
|
279
310
|
break;
|
|
311
|
+
|
|
280
312
|
case 'style':
|
|
281
313
|
acc['style'] = styleToObject(val);
|
|
282
314
|
break;
|
|
315
|
+
|
|
283
316
|
default:
|
|
284
317
|
acc.attrs[key] = val;
|
|
285
318
|
}
|
|
319
|
+
|
|
286
320
|
return acc;
|
|
287
321
|
}, {
|
|
288
322
|
'class': {},
|
|
289
323
|
style: {},
|
|
290
324
|
attrs: {}
|
|
291
325
|
});
|
|
326
|
+
|
|
292
327
|
var _data$class = data.class,
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
328
|
+
dClass = _data$class === void 0 ? {} : _data$class,
|
|
329
|
+
_data$style = data.style,
|
|
330
|
+
dStyle = _data$style === void 0 ? {} : _data$style,
|
|
331
|
+
_data$attrs = data.attrs,
|
|
332
|
+
dAttrs = _data$attrs === void 0 ? {} : _data$attrs,
|
|
333
|
+
remainingData = _objectWithoutProperties(data, _excluded);
|
|
334
|
+
|
|
299
335
|
if (typeof element === 'string') {
|
|
300
336
|
return element;
|
|
301
337
|
} else {
|
|
@@ -310,12 +346,15 @@ function convert(h, element) {
|
|
|
310
346
|
}
|
|
311
347
|
|
|
312
348
|
var PRODUCTION = false;
|
|
349
|
+
|
|
313
350
|
try {
|
|
314
351
|
PRODUCTION = process.env.NODE_ENV === 'production';
|
|
315
352
|
} catch (e) {}
|
|
353
|
+
|
|
316
354
|
function log () {
|
|
317
355
|
if (!PRODUCTION && console && typeof console.error === 'function') {
|
|
318
356
|
var _console;
|
|
357
|
+
|
|
319
358
|
(_console = console).error.apply(_console, arguments);
|
|
320
359
|
}
|
|
321
360
|
}
|
|
@@ -325,6 +364,7 @@ function objectWithKey(key, value) {
|
|
|
325
364
|
}
|
|
326
365
|
function classList(props) {
|
|
327
366
|
var _classes;
|
|
367
|
+
|
|
328
368
|
var classes = (_classes = {
|
|
329
369
|
'fa-spin': props.spin,
|
|
330
370
|
'fa-spin-pulse': props.spinPulse,
|
|
@@ -358,21 +398,26 @@ function normalizeIconArgs(icon) {
|
|
|
358
398
|
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
359
399
|
return icon;
|
|
360
400
|
}
|
|
401
|
+
|
|
361
402
|
if (parse.icon) {
|
|
362
403
|
return parse.icon(icon);
|
|
363
404
|
}
|
|
405
|
+
|
|
364
406
|
if (icon === null) {
|
|
365
407
|
return null;
|
|
366
408
|
}
|
|
409
|
+
|
|
367
410
|
if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {
|
|
368
411
|
return icon;
|
|
369
412
|
}
|
|
413
|
+
|
|
370
414
|
if (Array.isArray(icon) && icon.length === 2) {
|
|
371
415
|
return {
|
|
372
416
|
prefix: icon[0],
|
|
373
417
|
iconName: icon[1]
|
|
374
418
|
};
|
|
375
419
|
}
|
|
420
|
+
|
|
376
421
|
if (typeof icon === 'string') {
|
|
377
422
|
return {
|
|
378
423
|
prefix: 'fas',
|
|
@@ -380,6 +425,7 @@ function normalizeIconArgs(icon) {
|
|
|
380
425
|
};
|
|
381
426
|
}
|
|
382
427
|
}
|
|
428
|
+
|
|
383
429
|
var FontAwesomeIcon = {
|
|
384
430
|
name: 'FontAwesomeIcon',
|
|
385
431
|
functional: true,
|
|
@@ -496,9 +542,9 @@ var FontAwesomeIcon = {
|
|
|
496
542
|
render: function render(createElement, context) {
|
|
497
543
|
var props = context.props;
|
|
498
544
|
var iconArgs = props.icon,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
545
|
+
maskArgs = props.mask,
|
|
546
|
+
symbol = props.symbol,
|
|
547
|
+
title = props.title;
|
|
502
548
|
var icon$1 = normalizeIconArgs(iconArgs);
|
|
503
549
|
var classes = objectWithKey('classes', classList(props));
|
|
504
550
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
@@ -507,9 +553,11 @@ var FontAwesomeIcon = {
|
|
|
507
553
|
symbol: symbol,
|
|
508
554
|
title: title
|
|
509
555
|
}));
|
|
556
|
+
|
|
510
557
|
if (!renderedIcon) {
|
|
511
558
|
return log('Could not find one or more icon(s)', icon$1, mask);
|
|
512
559
|
}
|
|
560
|
+
|
|
513
561
|
var abstract = renderedIcon.abstract;
|
|
514
562
|
var convertCurry = convert.bind(null, createElement);
|
|
515
563
|
return convertCurry(abstract[0], {}, context.data);
|
|
@@ -566,9 +614,11 @@ var FontAwesomeLayersText = {
|
|
|
566
614
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
567
615
|
var renderedText = text(props.value.toString(), _objectSpread2(_objectSpread2({}, transform), classes));
|
|
568
616
|
var abstract = renderedText.abstract;
|
|
617
|
+
|
|
569
618
|
if (props.counter) {
|
|
570
619
|
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
571
620
|
}
|
|
621
|
+
|
|
572
622
|
var convertCurry = convert.bind(null, createElement);
|
|
573
623
|
return convertCurry(abstract[0], {}, context.data);
|
|
574
624
|
}
|
package/index.js
CHANGED
|
@@ -6,14 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) {
|
|
8
8
|
var keys = Object.keys(object);
|
|
9
|
+
|
|
9
10
|
if (Object.getOwnPropertySymbols) {
|
|
10
11
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
11
12
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
12
13
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
13
14
|
})), keys.push.apply(keys, symbols);
|
|
14
15
|
}
|
|
16
|
+
|
|
15
17
|
return keys;
|
|
16
18
|
}
|
|
19
|
+
|
|
17
20
|
function _objectSpread2(target) {
|
|
18
21
|
for (var i = 1; i < arguments.length; i++) {
|
|
19
22
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -23,8 +26,10 @@
|
|
|
23
26
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
24
27
|
});
|
|
25
28
|
}
|
|
29
|
+
|
|
26
30
|
return target;
|
|
27
31
|
}
|
|
32
|
+
|
|
28
33
|
function _typeof(obj) {
|
|
29
34
|
"@babel/helpers - typeof";
|
|
30
35
|
|
|
@@ -34,6 +39,7 @@
|
|
|
34
39
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
35
40
|
}, _typeof(obj);
|
|
36
41
|
}
|
|
42
|
+
|
|
37
43
|
function _defineProperty(obj, key, value) {
|
|
38
44
|
if (key in obj) {
|
|
39
45
|
Object.defineProperty(obj, key, {
|
|
@@ -45,26 +51,35 @@
|
|
|
45
51
|
} else {
|
|
46
52
|
obj[key] = value;
|
|
47
53
|
}
|
|
54
|
+
|
|
48
55
|
return obj;
|
|
49
56
|
}
|
|
57
|
+
|
|
50
58
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
51
59
|
if (source == null) return {};
|
|
52
60
|
var target = {};
|
|
53
61
|
var sourceKeys = Object.keys(source);
|
|
54
62
|
var key, i;
|
|
63
|
+
|
|
55
64
|
for (i = 0; i < sourceKeys.length; i++) {
|
|
56
65
|
key = sourceKeys[i];
|
|
57
66
|
if (excluded.indexOf(key) >= 0) continue;
|
|
58
67
|
target[key] = source[key];
|
|
59
68
|
}
|
|
69
|
+
|
|
60
70
|
return target;
|
|
61
71
|
}
|
|
72
|
+
|
|
62
73
|
function _objectWithoutProperties(source, excluded) {
|
|
63
74
|
if (source == null) return {};
|
|
75
|
+
|
|
64
76
|
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
77
|
+
|
|
65
78
|
var key, i;
|
|
79
|
+
|
|
66
80
|
if (Object.getOwnPropertySymbols) {
|
|
67
81
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
82
|
+
|
|
68
83
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
69
84
|
key = sourceSymbolKeys[i];
|
|
70
85
|
if (excluded.indexOf(key) >= 0) continue;
|
|
@@ -72,17 +87,22 @@
|
|
|
72
87
|
target[key] = source[key];
|
|
73
88
|
}
|
|
74
89
|
}
|
|
90
|
+
|
|
75
91
|
return target;
|
|
76
92
|
}
|
|
93
|
+
|
|
77
94
|
function _toConsumableArray(arr) {
|
|
78
95
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
79
96
|
}
|
|
97
|
+
|
|
80
98
|
function _arrayWithoutHoles(arr) {
|
|
81
99
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
82
100
|
}
|
|
101
|
+
|
|
83
102
|
function _iterableToArray(iter) {
|
|
84
103
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
85
104
|
}
|
|
105
|
+
|
|
86
106
|
function _unsupportedIterableToArray(o, minLen) {
|
|
87
107
|
if (!o) return;
|
|
88
108
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
@@ -91,11 +111,15 @@
|
|
|
91
111
|
if (n === "Map" || n === "Set") return Array.from(o);
|
|
92
112
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
93
113
|
}
|
|
114
|
+
|
|
94
115
|
function _arrayLikeToArray(arr, len) {
|
|
95
116
|
if (len == null || len > arr.length) len = arr.length;
|
|
117
|
+
|
|
96
118
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
119
|
+
|
|
97
120
|
return arr2;
|
|
98
121
|
}
|
|
122
|
+
|
|
99
123
|
function _nonIterableSpread() {
|
|
100
124
|
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
125
|
}
|
|
@@ -239,6 +263,7 @@
|
|
|
239
263
|
var humps = humps$1.exports;
|
|
240
264
|
|
|
241
265
|
var _excluded = ["class", "style", "attrs"];
|
|
266
|
+
|
|
242
267
|
function styleToObject(style) {
|
|
243
268
|
return style.split(';').map(function (s) {
|
|
244
269
|
return s.trim();
|
|
@@ -252,54 +277,65 @@
|
|
|
252
277
|
return acc;
|
|
253
278
|
}, {});
|
|
254
279
|
}
|
|
280
|
+
|
|
255
281
|
function classToObject(cls) {
|
|
256
282
|
return cls.split(/\s+/).reduce(function (acc, c) {
|
|
257
283
|
acc[c] = true;
|
|
258
284
|
return acc;
|
|
259
285
|
}, {});
|
|
260
286
|
}
|
|
287
|
+
|
|
261
288
|
function combineClassObjects() {
|
|
262
289
|
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
263
290
|
objs[_key] = arguments[_key];
|
|
264
291
|
}
|
|
292
|
+
|
|
265
293
|
return objs.reduce(function (acc, obj) {
|
|
266
294
|
if (Array.isArray(obj)) {
|
|
267
295
|
acc = acc.concat(obj);
|
|
268
296
|
} else {
|
|
269
297
|
acc.push(obj);
|
|
270
298
|
}
|
|
299
|
+
|
|
271
300
|
return acc;
|
|
272
301
|
}, []);
|
|
273
302
|
}
|
|
303
|
+
|
|
274
304
|
function convert(h, element) {
|
|
275
305
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
276
306
|
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
277
307
|
var children = (element.children || []).map(convert.bind(null, h));
|
|
278
308
|
var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
|
|
279
309
|
var val = element.attributes[key];
|
|
310
|
+
|
|
280
311
|
switch (key) {
|
|
281
312
|
case 'class':
|
|
282
313
|
acc['class'] = classToObject(val);
|
|
283
314
|
break;
|
|
315
|
+
|
|
284
316
|
case 'style':
|
|
285
317
|
acc['style'] = styleToObject(val);
|
|
286
318
|
break;
|
|
319
|
+
|
|
287
320
|
default:
|
|
288
321
|
acc.attrs[key] = val;
|
|
289
322
|
}
|
|
323
|
+
|
|
290
324
|
return acc;
|
|
291
325
|
}, {
|
|
292
326
|
'class': {},
|
|
293
327
|
style: {},
|
|
294
328
|
attrs: {}
|
|
295
329
|
});
|
|
330
|
+
|
|
296
331
|
var _data$class = data.class,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
332
|
+
dClass = _data$class === void 0 ? {} : _data$class,
|
|
333
|
+
_data$style = data.style,
|
|
334
|
+
dStyle = _data$style === void 0 ? {} : _data$style,
|
|
335
|
+
_data$attrs = data.attrs,
|
|
336
|
+
dAttrs = _data$attrs === void 0 ? {} : _data$attrs,
|
|
337
|
+
remainingData = _objectWithoutProperties(data, _excluded);
|
|
338
|
+
|
|
303
339
|
if (typeof element === 'string') {
|
|
304
340
|
return element;
|
|
305
341
|
} else {
|
|
@@ -314,12 +350,15 @@
|
|
|
314
350
|
}
|
|
315
351
|
|
|
316
352
|
var PRODUCTION = false;
|
|
353
|
+
|
|
317
354
|
try {
|
|
318
355
|
PRODUCTION = process.env.NODE_ENV === 'production';
|
|
319
356
|
} catch (e) {}
|
|
357
|
+
|
|
320
358
|
function log () {
|
|
321
359
|
if (!PRODUCTION && console && typeof console.error === 'function') {
|
|
322
360
|
var _console;
|
|
361
|
+
|
|
323
362
|
(_console = console).error.apply(_console, arguments);
|
|
324
363
|
}
|
|
325
364
|
}
|
|
@@ -329,6 +368,7 @@
|
|
|
329
368
|
}
|
|
330
369
|
function classList(props) {
|
|
331
370
|
var _classes;
|
|
371
|
+
|
|
332
372
|
var classes = (_classes = {
|
|
333
373
|
'fa-spin': props.spin,
|
|
334
374
|
'fa-spin-pulse': props.spinPulse,
|
|
@@ -362,21 +402,26 @@
|
|
|
362
402
|
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
363
403
|
return icon;
|
|
364
404
|
}
|
|
405
|
+
|
|
365
406
|
if (fontawesomeSvgCore.parse.icon) {
|
|
366
407
|
return fontawesomeSvgCore.parse.icon(icon);
|
|
367
408
|
}
|
|
409
|
+
|
|
368
410
|
if (icon === null) {
|
|
369
411
|
return null;
|
|
370
412
|
}
|
|
413
|
+
|
|
371
414
|
if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {
|
|
372
415
|
return icon;
|
|
373
416
|
}
|
|
417
|
+
|
|
374
418
|
if (Array.isArray(icon) && icon.length === 2) {
|
|
375
419
|
return {
|
|
376
420
|
prefix: icon[0],
|
|
377
421
|
iconName: icon[1]
|
|
378
422
|
};
|
|
379
423
|
}
|
|
424
|
+
|
|
380
425
|
if (typeof icon === 'string') {
|
|
381
426
|
return {
|
|
382
427
|
prefix: 'fas',
|
|
@@ -384,6 +429,7 @@
|
|
|
384
429
|
};
|
|
385
430
|
}
|
|
386
431
|
}
|
|
432
|
+
|
|
387
433
|
var FontAwesomeIcon = {
|
|
388
434
|
name: 'FontAwesomeIcon',
|
|
389
435
|
functional: true,
|
|
@@ -500,9 +546,9 @@
|
|
|
500
546
|
render: function render(createElement, context) {
|
|
501
547
|
var props = context.props;
|
|
502
548
|
var iconArgs = props.icon,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
549
|
+
maskArgs = props.mask,
|
|
550
|
+
symbol = props.symbol,
|
|
551
|
+
title = props.title;
|
|
506
552
|
var icon = normalizeIconArgs(iconArgs);
|
|
507
553
|
var classes = objectWithKey('classes', classList(props));
|
|
508
554
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
@@ -511,9 +557,11 @@
|
|
|
511
557
|
symbol: symbol,
|
|
512
558
|
title: title
|
|
513
559
|
}));
|
|
560
|
+
|
|
514
561
|
if (!renderedIcon) {
|
|
515
562
|
return log('Could not find one or more icon(s)', icon, mask);
|
|
516
563
|
}
|
|
564
|
+
|
|
517
565
|
var abstract = renderedIcon.abstract;
|
|
518
566
|
var convertCurry = convert.bind(null, createElement);
|
|
519
567
|
return convertCurry(abstract[0], {}, context.data);
|
|
@@ -570,9 +618,11 @@
|
|
|
570
618
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? fontawesomeSvgCore.parse.transform(props.transform) : props.transform);
|
|
571
619
|
var renderedText = fontawesomeSvgCore.text(props.value.toString(), _objectSpread2(_objectSpread2({}, transform), classes));
|
|
572
620
|
var abstract = renderedText.abstract;
|
|
621
|
+
|
|
573
622
|
if (props.counter) {
|
|
574
623
|
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
575
624
|
}
|
|
625
|
+
|
|
576
626
|
var convertCurry = convert.bind(null, createElement);
|
|
577
627
|
return convertCurry(abstract[0], {}, context.data);
|
|
578
628
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fortawesome/vue-fontawesome",
|
|
3
3
|
"description": "Official Vue 2 component for Font Awesome",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.10",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"README.md",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"contributors": [
|
|
29
29
|
"Travis Chase <travis@fontawesome.com>",
|
|
30
30
|
"Rob Madole <rob@fontawesome.com>",
|
|
31
|
-
"
|
|
31
|
+
"Greg Peden <github.com/GregPeden>",
|
|
32
32
|
"Liu Xinyu <github.com/meteorlxy>",
|
|
33
33
|
"Xaver Schulz <github.com/schulz3000>",
|
|
34
34
|
"Yannick Ihmels <github.com/ihmels>",
|
|
@@ -41,9 +41,7 @@
|
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "rollup -c rollup.config.js",
|
|
43
43
|
"dist": "cross-env NODE_ENV=production npm run build",
|
|
44
|
-
"test": "
|
|
45
|
-
"test.5": "npm --no-save install @fortawesome/fontawesome-svg-core@1.2.x @fortawesome/free-solid-svg-icons@5.x && jest --silent",
|
|
46
|
-
"test.6": "npm --no-save install @fortawesome/fontawesome-svg-core@6.x @fortawesome/free-solid-svg-icons@6.x && jest --silent",
|
|
44
|
+
"test": "jest --silent",
|
|
47
45
|
"prepack": "npm run dist"
|
|
48
46
|
},
|
|
49
47
|
"lint-staged": {
|
|
@@ -64,7 +62,7 @@
|
|
|
64
62
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
65
63
|
"@babel/plugin-syntax-import-meta": "^7.10.4",
|
|
66
64
|
"@babel/preset-env": "^7.18.2",
|
|
67
|
-
"@fortawesome/fontawesome-svg-core": "
|
|
65
|
+
"@fortawesome/fontawesome-svg-core": "^6",
|
|
68
66
|
"@fortawesome/free-solid-svg-icons": "^6",
|
|
69
67
|
"babel-core": "^7.0.0-bridge.0",
|
|
70
68
|
"babel-jest": "^28.1.1",
|
|
@@ -86,5 +84,6 @@
|
|
|
86
84
|
"hooks": {
|
|
87
85
|
"pre-commit": "lint-staged"
|
|
88
86
|
}
|
|
89
|
-
}
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {}
|
|
90
89
|
}
|