@fortawesome/vue-fontawesome 2.0.4 → 2.0.7
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 +23 -0
- package/README.md +6 -6
- package/index.es.js +314 -230
- package/index.js +636 -552
- package/package.json +40 -23
- package/src/components/FontAwesomeIcon.js +36 -4
- package/src/utils.js +10 -1
- package/.babelrc +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -24
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/workflows/ci.yml +0 -31
- package/.npmrc.proregistry +0 -2
- package/.tool-versions +0 -2
- package/CODE_OF_CONDUCT.md +0 -74
- package/CONTRIBUTING.md +0 -57
- package/DEVELOPMENT.md +0 -44
- package/bin/dev +0 -3
- package/bin/setup +0 -8
- package/examples/vue-cli-webpack/.babelrc +0 -12
- package/examples/vue-cli-webpack/.editorconfig +0 -9
- package/examples/vue-cli-webpack/.eslintignore +0 -4
- package/examples/vue-cli-webpack/.eslintrc.js +0 -29
- package/examples/vue-cli-webpack/.postcssrc.js +0 -10
- package/examples/vue-cli-webpack/README.md +0 -21
- package/examples/vue-cli-webpack/build/build.js +0 -41
- package/examples/vue-cli-webpack/build/check-versions.js +0 -54
- package/examples/vue-cli-webpack/build/logo.png +0 -0
- package/examples/vue-cli-webpack/build/utils.js +0 -101
- package/examples/vue-cli-webpack/build/vue-loader.conf.js +0 -22
- package/examples/vue-cli-webpack/build/webpack.base.conf.js +0 -91
- package/examples/vue-cli-webpack/build/webpack.dev.conf.js +0 -95
- package/examples/vue-cli-webpack/build/webpack.prod.conf.js +0 -145
- package/examples/vue-cli-webpack/config/dev.env.js +0 -7
- package/examples/vue-cli-webpack/config/index.js +0 -76
- package/examples/vue-cli-webpack/config/prod.env.js +0 -4
- package/examples/vue-cli-webpack/index.html +0 -13
- package/examples/vue-cli-webpack/package-lock.json +0 -11632
- package/examples/vue-cli-webpack/package.json +0 -77
- package/examples/vue-cli-webpack/src/App.vue +0 -66
- package/examples/vue-cli-webpack/src/assets/logo.png +0 -0
- package/examples/vue-cli-webpack/src/components/HelloWorld.vue +0 -113
- package/examples/vue-cli-webpack/src/main.js +0 -28
- package/examples/vue-cli-webpack/static/.gitkeep +0 -0
- package/rollup.config.js +0 -54
- package/src/components/__fixtures__/helpers.js +0 -40
- package/src/components/__fixtures__/icons.js +0 -35
- package/src/components/__tests__/FontAwesomeIcon.test.js +0 -330
- package/src/components/__tests__/FontAwesomeLayers.test.js +0 -55
- package/src/components/__tests__/FontAwesomeLayersText.test.js +0 -52
package/index.es.js
CHANGED
|
@@ -1,152 +1,42 @@
|
|
|
1
1
|
import { parse, icon, config, text } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
function ownKeys(object, enumerableOnly) {
|
|
4
|
+
var keys = Object.keys(object);
|
|
5
|
+
|
|
6
|
+
if (Object.getOwnPropertySymbols) {
|
|
7
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
9
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
10
|
+
})), keys.push.apply(keys, symbols);
|
|
11
|
+
}
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
13
|
+
return keys;
|
|
7
14
|
}
|
|
8
15
|
|
|
9
|
-
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var output,
|
|
18
|
-
i = 0,
|
|
19
|
-
l = 0;
|
|
20
|
-
|
|
21
|
-
if(_isArray(obj)) {
|
|
22
|
-
output = [];
|
|
23
|
-
for(l=obj.length; i<l; i++) {
|
|
24
|
-
output.push(_processKeys(convert, obj[i], options));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
output = {};
|
|
29
|
-
for(var key in obj) {
|
|
30
|
-
if(Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
31
|
-
output[convert(key, options)] = _processKeys(convert, obj[key], options);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return output;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// String conversion methods
|
|
39
|
-
|
|
40
|
-
var separateWords = function(string, options) {
|
|
41
|
-
options = options || {};
|
|
42
|
-
var separator = options.separator || '_';
|
|
43
|
-
var split = options.split || /(?=[A-Z])/;
|
|
44
|
-
|
|
45
|
-
return string.split(split).join(separator);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var camelize = function(string) {
|
|
49
|
-
if (_isNumerical(string)) {
|
|
50
|
-
return string;
|
|
51
|
-
}
|
|
52
|
-
string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
|
|
53
|
-
return chr ? chr.toUpperCase() : '';
|
|
16
|
+
function _objectSpread2(target) {
|
|
17
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
18
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
19
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
20
|
+
_defineProperty(target, key, source[key]);
|
|
21
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
22
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
54
23
|
});
|
|
55
|
-
// Ensure 1st char is always lowercase
|
|
56
|
-
return string.substr(0, 1).toLowerCase() + string.substr(1);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var pascalize = function(string) {
|
|
60
|
-
var camelized = camelize(string);
|
|
61
|
-
// Ensure 1st char is always uppercase
|
|
62
|
-
return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var decamelize = function(string, options) {
|
|
66
|
-
return separateWords(string, options).toLowerCase();
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Utilities
|
|
70
|
-
// Taken from Underscore.js
|
|
71
|
-
|
|
72
|
-
var toString = Object.prototype.toString;
|
|
73
|
-
|
|
74
|
-
var _isFunction = function(obj) {
|
|
75
|
-
return typeof(obj) === 'function';
|
|
76
|
-
};
|
|
77
|
-
var _isObject = function(obj) {
|
|
78
|
-
return obj === Object(obj);
|
|
79
|
-
};
|
|
80
|
-
var _isArray = function(obj) {
|
|
81
|
-
return toString.call(obj) == '[object Array]';
|
|
82
|
-
};
|
|
83
|
-
var _isDate = function(obj) {
|
|
84
|
-
return toString.call(obj) == '[object Date]';
|
|
85
|
-
};
|
|
86
|
-
var _isRegExp = function(obj) {
|
|
87
|
-
return toString.call(obj) == '[object RegExp]';
|
|
88
|
-
};
|
|
89
|
-
var _isBoolean = function(obj) {
|
|
90
|
-
return toString.call(obj) == '[object Boolean]';
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
// Performant way to determine if obj coerces to a number
|
|
94
|
-
var _isNumerical = function(obj) {
|
|
95
|
-
obj = obj - 0;
|
|
96
|
-
return obj === obj;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// Sets up function which handles processing keys
|
|
100
|
-
// allowing the convert function to be modified by a callback
|
|
101
|
-
var _processor = function(convert, options) {
|
|
102
|
-
var callback = options && 'process' in options ? options.process : options;
|
|
103
|
-
|
|
104
|
-
if(typeof(callback) !== 'function') {
|
|
105
|
-
return convert;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return function(string, options) {
|
|
109
|
-
return callback(string, convert, options);
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var humps = {
|
|
114
|
-
camelize: camelize,
|
|
115
|
-
decamelize: decamelize,
|
|
116
|
-
pascalize: pascalize,
|
|
117
|
-
depascalize: decamelize,
|
|
118
|
-
camelizeKeys: function(object, options) {
|
|
119
|
-
return _processKeys(_processor(camelize, options), object);
|
|
120
|
-
},
|
|
121
|
-
decamelizeKeys: function(object, options) {
|
|
122
|
-
return _processKeys(_processor(decamelize, options), object, options);
|
|
123
|
-
},
|
|
124
|
-
pascalizeKeys: function(object, options) {
|
|
125
|
-
return _processKeys(_processor(pascalize, options), object);
|
|
126
|
-
},
|
|
127
|
-
depascalizeKeys: function () {
|
|
128
|
-
return this.decamelizeKeys.apply(this, arguments);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
if (typeof undefined === 'function' && undefined.amd) {
|
|
133
|
-
undefined(humps);
|
|
134
|
-
} else if ('object' !== 'undefined' && module.exports) {
|
|
135
|
-
module.exports = humps;
|
|
136
|
-
} else {
|
|
137
|
-
global.humps = humps;
|
|
138
24
|
}
|
|
139
25
|
|
|
140
|
-
|
|
141
|
-
}
|
|
26
|
+
return target;
|
|
27
|
+
}
|
|
142
28
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
} : function (obj) {
|
|
146
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
147
|
-
};
|
|
29
|
+
function _typeof(obj) {
|
|
30
|
+
"@babel/helpers - typeof";
|
|
148
31
|
|
|
149
|
-
|
|
32
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
33
|
+
return typeof obj;
|
|
34
|
+
} : function (obj) {
|
|
35
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
36
|
+
}, _typeof(obj);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _defineProperty(obj, key, value) {
|
|
150
40
|
if (key in obj) {
|
|
151
41
|
Object.defineProperty(obj, key, {
|
|
152
42
|
value: value,
|
|
@@ -159,43 +49,216 @@ var defineProperty = function (obj, key, value) {
|
|
|
159
49
|
}
|
|
160
50
|
|
|
161
51
|
return obj;
|
|
162
|
-
}
|
|
52
|
+
}
|
|
163
53
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
54
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = {};
|
|
57
|
+
var sourceKeys = Object.keys(source);
|
|
58
|
+
var key, i;
|
|
167
59
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
60
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
61
|
+
key = sourceKeys[i];
|
|
62
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
63
|
+
target[key] = source[key];
|
|
173
64
|
}
|
|
174
65
|
|
|
175
66
|
return target;
|
|
176
|
-
}
|
|
67
|
+
}
|
|
177
68
|
|
|
178
|
-
|
|
179
|
-
|
|
69
|
+
function _objectWithoutProperties(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
|
|
72
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
180
73
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
74
|
+
var key, i;
|
|
75
|
+
|
|
76
|
+
if (Object.getOwnPropertySymbols) {
|
|
77
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
78
|
+
|
|
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
|
+
}
|
|
185
85
|
}
|
|
186
86
|
|
|
187
87
|
return target;
|
|
188
|
-
}
|
|
88
|
+
}
|
|
189
89
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
90
|
+
function _toConsumableArray(arr) {
|
|
91
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
92
|
+
}
|
|
193
93
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
94
|
+
function _arrayWithoutHoles(arr) {
|
|
95
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function _iterableToArray(iter) {
|
|
99
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
103
|
+
if (!o) return;
|
|
104
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
105
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
106
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
107
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
108
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function _arrayLikeToArray(arr, len) {
|
|
112
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
113
|
+
|
|
114
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
115
|
+
|
|
116
|
+
return arr2;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function _nonIterableSpread() {
|
|
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.");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
124
|
+
|
|
125
|
+
var humps$1 = {exports: {}};
|
|
126
|
+
|
|
127
|
+
(function (module) {
|
|
128
|
+
(function(global) {
|
|
129
|
+
|
|
130
|
+
var _processKeys = function(convert, obj, options) {
|
|
131
|
+
if(!_isObject(obj) || _isDate(obj) || _isRegExp(obj) || _isBoolean(obj) || _isFunction(obj)) {
|
|
132
|
+
return obj;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
var output,
|
|
136
|
+
i = 0,
|
|
137
|
+
l = 0;
|
|
138
|
+
|
|
139
|
+
if(_isArray(obj)) {
|
|
140
|
+
output = [];
|
|
141
|
+
for(l=obj.length; i<l; i++) {
|
|
142
|
+
output.push(_processKeys(convert, obj[i], options));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
output = {};
|
|
147
|
+
for(var key in obj) {
|
|
148
|
+
if(Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
149
|
+
output[convert(key, options)] = _processKeys(convert, obj[key], options);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return output;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// String conversion methods
|
|
157
|
+
|
|
158
|
+
var separateWords = function(string, options) {
|
|
159
|
+
options = options || {};
|
|
160
|
+
var separator = options.separator || '_';
|
|
161
|
+
var split = options.split || /(?=[A-Z])/;
|
|
162
|
+
|
|
163
|
+
return string.split(split).join(separator);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
var camelize = function(string) {
|
|
167
|
+
if (_isNumerical(string)) {
|
|
168
|
+
return string;
|
|
169
|
+
}
|
|
170
|
+
string = string.replace(/[\-_\s]+(.)?/g, function(match, chr) {
|
|
171
|
+
return chr ? chr.toUpperCase() : '';
|
|
172
|
+
});
|
|
173
|
+
// Ensure 1st char is always lowercase
|
|
174
|
+
return string.substr(0, 1).toLowerCase() + string.substr(1);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
var pascalize = function(string) {
|
|
178
|
+
var camelized = camelize(string);
|
|
179
|
+
// Ensure 1st char is always uppercase
|
|
180
|
+
return camelized.substr(0, 1).toUpperCase() + camelized.substr(1);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
var decamelize = function(string, options) {
|
|
184
|
+
return separateWords(string, options).toLowerCase();
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// Utilities
|
|
188
|
+
// Taken from Underscore.js
|
|
189
|
+
|
|
190
|
+
var toString = Object.prototype.toString;
|
|
191
|
+
|
|
192
|
+
var _isFunction = function(obj) {
|
|
193
|
+
return typeof(obj) === 'function';
|
|
194
|
+
};
|
|
195
|
+
var _isObject = function(obj) {
|
|
196
|
+
return obj === Object(obj);
|
|
197
|
+
};
|
|
198
|
+
var _isArray = function(obj) {
|
|
199
|
+
return toString.call(obj) == '[object Array]';
|
|
200
|
+
};
|
|
201
|
+
var _isDate = function(obj) {
|
|
202
|
+
return toString.call(obj) == '[object Date]';
|
|
203
|
+
};
|
|
204
|
+
var _isRegExp = function(obj) {
|
|
205
|
+
return toString.call(obj) == '[object RegExp]';
|
|
206
|
+
};
|
|
207
|
+
var _isBoolean = function(obj) {
|
|
208
|
+
return toString.call(obj) == '[object Boolean]';
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
// Performant way to determine if obj coerces to a number
|
|
212
|
+
var _isNumerical = function(obj) {
|
|
213
|
+
obj = obj - 0;
|
|
214
|
+
return obj === obj;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
// Sets up function which handles processing keys
|
|
218
|
+
// allowing the convert function to be modified by a callback
|
|
219
|
+
var _processor = function(convert, options) {
|
|
220
|
+
var callback = options && 'process' in options ? options.process : options;
|
|
221
|
+
|
|
222
|
+
if(typeof(callback) !== 'function') {
|
|
223
|
+
return convert;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return function(string, options) {
|
|
227
|
+
return callback(string, convert, options);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var humps = {
|
|
232
|
+
camelize: camelize,
|
|
233
|
+
decamelize: decamelize,
|
|
234
|
+
pascalize: pascalize,
|
|
235
|
+
depascalize: decamelize,
|
|
236
|
+
camelizeKeys: function(object, options) {
|
|
237
|
+
return _processKeys(_processor(camelize, options), object);
|
|
238
|
+
},
|
|
239
|
+
decamelizeKeys: function(object, options) {
|
|
240
|
+
return _processKeys(_processor(decamelize, options), object, options);
|
|
241
|
+
},
|
|
242
|
+
pascalizeKeys: function(object, options) {
|
|
243
|
+
return _processKeys(_processor(pascalize, options), object);
|
|
244
|
+
},
|
|
245
|
+
depascalizeKeys: function () {
|
|
246
|
+
return this.decamelizeKeys.apply(this, arguments);
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
if (module.exports) {
|
|
251
|
+
module.exports = humps;
|
|
252
|
+
} else {
|
|
253
|
+
global.humps = humps;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
})(commonjsGlobal);
|
|
257
|
+
} (humps$1));
|
|
258
|
+
|
|
259
|
+
var humps = humps$1.exports;
|
|
260
|
+
|
|
261
|
+
var _excluded = ["class", "style", "attrs"];
|
|
199
262
|
|
|
200
263
|
function styleToObject(style) {
|
|
201
264
|
return style.split(';').map(function (s) {
|
|
@@ -206,9 +269,7 @@ function styleToObject(style) {
|
|
|
206
269
|
var i = pair.indexOf(':');
|
|
207
270
|
var prop = humps.camelize(pair.slice(0, i));
|
|
208
271
|
var value = pair.slice(i + 1).trim();
|
|
209
|
-
|
|
210
272
|
acc[prop] = value;
|
|
211
|
-
|
|
212
273
|
return acc;
|
|
213
274
|
}, {});
|
|
214
275
|
}
|
|
@@ -216,13 +277,12 @@ function styleToObject(style) {
|
|
|
216
277
|
function classToObject(cls) {
|
|
217
278
|
return cls.split(/\s+/).reduce(function (acc, c) {
|
|
218
279
|
acc[c] = true;
|
|
219
|
-
|
|
220
280
|
return acc;
|
|
221
281
|
}, {});
|
|
222
282
|
}
|
|
223
283
|
|
|
224
284
|
function combineClassObjects() {
|
|
225
|
-
for (var _len = arguments.length, objs = Array(_len), _key = 0; _key < _len; _key++) {
|
|
285
|
+
for (var _len = arguments.length, objs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
226
286
|
objs[_key] = arguments[_key];
|
|
227
287
|
}
|
|
228
288
|
|
|
@@ -240,9 +300,7 @@ function combineClassObjects() {
|
|
|
240
300
|
function convert(h, element) {
|
|
241
301
|
var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
242
302
|
var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
243
|
-
|
|
244
303
|
var children = (element.children || []).map(convert.bind(null, h));
|
|
245
|
-
|
|
246
304
|
var mixins = Object.keys(element.attributes || {}).reduce(function (acc, key) {
|
|
247
305
|
var val = element.attributes[key];
|
|
248
306
|
|
|
@@ -250,33 +308,38 @@ function convert(h, element) {
|
|
|
250
308
|
case 'class':
|
|
251
309
|
acc['class'] = classToObject(val);
|
|
252
310
|
break;
|
|
311
|
+
|
|
253
312
|
case 'style':
|
|
254
313
|
acc['style'] = styleToObject(val);
|
|
255
314
|
break;
|
|
315
|
+
|
|
256
316
|
default:
|
|
257
317
|
acc.attrs[key] = val;
|
|
258
318
|
}
|
|
259
319
|
|
|
260
320
|
return acc;
|
|
261
|
-
}, {
|
|
321
|
+
}, {
|
|
322
|
+
'class': {},
|
|
323
|
+
style: {},
|
|
324
|
+
attrs: {}
|
|
325
|
+
});
|
|
262
326
|
|
|
263
327
|
var _data$class = data.class,
|
|
264
|
-
dClass = _data$class ===
|
|
328
|
+
dClass = _data$class === void 0 ? {} : _data$class,
|
|
265
329
|
_data$style = data.style,
|
|
266
|
-
dStyle = _data$style ===
|
|
330
|
+
dStyle = _data$style === void 0 ? {} : _data$style,
|
|
267
331
|
_data$attrs = data.attrs,
|
|
268
|
-
dAttrs = _data$attrs ===
|
|
269
|
-
remainingData =
|
|
270
|
-
|
|
332
|
+
dAttrs = _data$attrs === void 0 ? {} : _data$attrs,
|
|
333
|
+
remainingData = _objectWithoutProperties(data, _excluded);
|
|
271
334
|
|
|
272
335
|
if (typeof element === 'string') {
|
|
273
336
|
return element;
|
|
274
337
|
} else {
|
|
275
|
-
return h(element.tag,
|
|
338
|
+
return h(element.tag, _objectSpread2(_objectSpread2({
|
|
276
339
|
class: combineClassObjects(mixins.class, dClass),
|
|
277
|
-
style:
|
|
278
|
-
attrs:
|
|
279
|
-
}, remainingData, {
|
|
340
|
+
style: _objectSpread2(_objectSpread2({}, mixins.style), dStyle),
|
|
341
|
+
attrs: _objectSpread2(_objectSpread2({}, mixins.attrs), dAttrs)
|
|
342
|
+
}, remainingData), {}, {
|
|
280
343
|
props: props
|
|
281
344
|
}), children);
|
|
282
345
|
}
|
|
@@ -297,83 +360,101 @@ function log () {
|
|
|
297
360
|
}
|
|
298
361
|
|
|
299
362
|
function objectWithKey(key, value) {
|
|
300
|
-
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ?
|
|
363
|
+
return Array.isArray(value) && value.length > 0 || !Array.isArray(value) && value ? _defineProperty({}, key, value) : {};
|
|
301
364
|
}
|
|
302
|
-
|
|
303
365
|
function classList(props) {
|
|
304
366
|
var _classes;
|
|
305
367
|
|
|
306
368
|
var classes = (_classes = {
|
|
307
369
|
'fa-spin': props.spin,
|
|
370
|
+
'fa-spin-pulse': props.spinPulse,
|
|
371
|
+
'fa-spin-reverse': props.spinReverse,
|
|
308
372
|
'fa-pulse': props.pulse,
|
|
373
|
+
'fa-beat': props.beat,
|
|
374
|
+
'fa-fade': props.fade,
|
|
375
|
+
'fa-flash': props.flash,
|
|
309
376
|
'fa-fw': props.fixedWidth,
|
|
310
377
|
'fa-border': props.border,
|
|
311
378
|
'fa-li': props.listItem,
|
|
312
379
|
'fa-inverse': props.inverse,
|
|
380
|
+
'fa-flip': props.flip === true,
|
|
313
381
|
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
314
382
|
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
315
|
-
},
|
|
316
|
-
|
|
383
|
+
}, _defineProperty(_classes, "fa-".concat(props.size), props.size !== null), _defineProperty(_classes, "fa-rotate-".concat(props.rotation), props.rotation !== null), _defineProperty(_classes, "fa-pull-".concat(props.pull), props.pull !== null), _defineProperty(_classes, 'fa-swap-opacity', props.swapOpacity), _defineProperty(_classes, 'fa-bounce', props.bounce), _defineProperty(_classes, 'fa-shake', props.shake), _defineProperty(_classes, 'fa-beat-fade', props.beatFade), _classes);
|
|
317
384
|
return Object.keys(classes).map(function (key) {
|
|
318
385
|
return classes[key] ? key : null;
|
|
319
386
|
}).filter(function (key) {
|
|
320
387
|
return key;
|
|
321
388
|
});
|
|
322
389
|
}
|
|
323
|
-
|
|
324
390
|
function addStaticClass(to, what) {
|
|
325
391
|
var val = (to || '').length === 0 ? [] : [to];
|
|
326
|
-
|
|
327
392
|
return val.concat(what).join(' ');
|
|
328
393
|
}
|
|
329
394
|
|
|
330
|
-
function normalizeIconArgs(icon
|
|
395
|
+
function normalizeIconArgs(icon) {
|
|
331
396
|
// this has everything that it needs to be rendered which means it was probably imported
|
|
332
397
|
// directly from an icon svg package
|
|
333
|
-
if (icon
|
|
334
|
-
return icon
|
|
398
|
+
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
399
|
+
return icon;
|
|
335
400
|
}
|
|
336
401
|
|
|
337
402
|
if (parse.icon) {
|
|
338
|
-
return parse.icon(icon
|
|
403
|
+
return parse.icon(icon);
|
|
339
404
|
}
|
|
340
405
|
|
|
341
|
-
if (icon
|
|
406
|
+
if (icon === null) {
|
|
342
407
|
return null;
|
|
343
408
|
}
|
|
344
409
|
|
|
345
|
-
if (
|
|
346
|
-
return icon
|
|
410
|
+
if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {
|
|
411
|
+
return icon;
|
|
347
412
|
}
|
|
348
413
|
|
|
349
|
-
if (Array.isArray(icon
|
|
350
|
-
return {
|
|
414
|
+
if (Array.isArray(icon) && icon.length === 2) {
|
|
415
|
+
return {
|
|
416
|
+
prefix: icon[0],
|
|
417
|
+
iconName: icon[1]
|
|
418
|
+
};
|
|
351
419
|
}
|
|
352
420
|
|
|
353
|
-
if (typeof icon
|
|
354
|
-
return {
|
|
421
|
+
if (typeof icon === 'string') {
|
|
422
|
+
return {
|
|
423
|
+
prefix: 'fas',
|
|
424
|
+
iconName: icon
|
|
425
|
+
};
|
|
355
426
|
}
|
|
356
427
|
}
|
|
357
428
|
|
|
358
429
|
var FontAwesomeIcon = {
|
|
359
430
|
name: 'FontAwesomeIcon',
|
|
360
|
-
|
|
361
431
|
functional: true,
|
|
362
|
-
|
|
363
432
|
props: {
|
|
433
|
+
beat: {
|
|
434
|
+
type: Boolean,
|
|
435
|
+
default: false
|
|
436
|
+
},
|
|
364
437
|
border: {
|
|
365
438
|
type: Boolean,
|
|
366
439
|
default: false
|
|
367
440
|
},
|
|
441
|
+
fade: {
|
|
442
|
+
type: Boolean,
|
|
443
|
+
default: false
|
|
444
|
+
},
|
|
368
445
|
fixedWidth: {
|
|
369
446
|
type: Boolean,
|
|
370
447
|
default: false
|
|
371
448
|
},
|
|
449
|
+
flash: {
|
|
450
|
+
type: Boolean,
|
|
451
|
+
default: false
|
|
452
|
+
},
|
|
372
453
|
flip: {
|
|
373
|
-
type: String,
|
|
374
|
-
default:
|
|
454
|
+
type: [Boolean, String],
|
|
455
|
+
default: false,
|
|
375
456
|
validator: function validator(value) {
|
|
376
|
-
return ['horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
457
|
+
return [true, false, 'horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
377
458
|
}
|
|
378
459
|
},
|
|
379
460
|
icon: {
|
|
@@ -414,13 +495,21 @@ var FontAwesomeIcon = {
|
|
|
414
495
|
type: String,
|
|
415
496
|
default: null,
|
|
416
497
|
validator: function validator(value) {
|
|
417
|
-
return ['
|
|
498
|
+
return ['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', '1x', '2x', '3x', '4x', '5x', '6x', '7x', '8x', '9x', '10x'].indexOf(value) > -1;
|
|
418
499
|
}
|
|
419
500
|
},
|
|
420
501
|
spin: {
|
|
421
502
|
type: Boolean,
|
|
422
503
|
default: false
|
|
423
504
|
},
|
|
505
|
+
spinPulse: {
|
|
506
|
+
type: Boolean,
|
|
507
|
+
default: false
|
|
508
|
+
},
|
|
509
|
+
spinReverse: {
|
|
510
|
+
type: Boolean,
|
|
511
|
+
default: false
|
|
512
|
+
},
|
|
424
513
|
transform: {
|
|
425
514
|
type: [String, Object],
|
|
426
515
|
default: null
|
|
@@ -436,54 +525,59 @@ var FontAwesomeIcon = {
|
|
|
436
525
|
inverse: {
|
|
437
526
|
type: Boolean,
|
|
438
527
|
default: false
|
|
528
|
+
},
|
|
529
|
+
bounce: {
|
|
530
|
+
type: Boolean,
|
|
531
|
+
default: false
|
|
532
|
+
},
|
|
533
|
+
shake: {
|
|
534
|
+
type: Boolean,
|
|
535
|
+
default: false
|
|
536
|
+
},
|
|
537
|
+
beatFade: {
|
|
538
|
+
type: Boolean,
|
|
539
|
+
default: false
|
|
439
540
|
}
|
|
440
541
|
},
|
|
441
|
-
|
|
442
542
|
render: function render(createElement, context) {
|
|
443
543
|
var props = context.props;
|
|
444
544
|
var iconArgs = props.icon,
|
|
445
545
|
maskArgs = props.mask,
|
|
446
546
|
symbol = props.symbol,
|
|
447
547
|
title = props.title;
|
|
448
|
-
|
|
449
|
-
var icon$$1 = normalizeIconArgs(iconArgs);
|
|
548
|
+
var icon$1 = normalizeIconArgs(iconArgs);
|
|
450
549
|
var classes = objectWithKey('classes', classList(props));
|
|
451
550
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
452
551
|
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
|
|
453
|
-
var renderedIcon = icon(icon
|
|
552
|
+
var renderedIcon = icon(icon$1, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
|
|
553
|
+
symbol: symbol,
|
|
554
|
+
title: title
|
|
555
|
+
}));
|
|
454
556
|
|
|
455
557
|
if (!renderedIcon) {
|
|
456
|
-
return log('Could not find one or more icon(s)', icon
|
|
558
|
+
return log('Could not find one or more icon(s)', icon$1, mask);
|
|
457
559
|
}
|
|
458
560
|
|
|
459
561
|
var abstract = renderedIcon.abstract;
|
|
460
|
-
|
|
461
562
|
var convertCurry = convert.bind(null, createElement);
|
|
462
|
-
|
|
463
563
|
return convertCurry(abstract[0], {}, context.data);
|
|
464
564
|
}
|
|
465
565
|
};
|
|
466
566
|
|
|
467
567
|
var FontAwesomeLayers = {
|
|
468
568
|
name: 'FontAwesomeLayers',
|
|
469
|
-
|
|
470
569
|
functional: true,
|
|
471
|
-
|
|
472
570
|
props: {
|
|
473
571
|
fixedWidth: {
|
|
474
572
|
type: Boolean,
|
|
475
573
|
default: false
|
|
476
574
|
}
|
|
477
575
|
},
|
|
478
|
-
|
|
479
576
|
render: function render(createElement, context) {
|
|
480
577
|
var familyPrefix = config.familyPrefix;
|
|
481
578
|
var staticClass = context.data.staticClass;
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
var classes = [familyPrefix + '-layers'].concat(toConsumableArray(context.props.fixedWidth ? [familyPrefix + '-fw'] : []));
|
|
485
|
-
|
|
486
|
-
return createElement('div', _extends({}, context.data, {
|
|
579
|
+
var classes = ["".concat(familyPrefix, "-layers")].concat(_toConsumableArray(context.props.fixedWidth ? ["".concat(familyPrefix, "-fw")] : []));
|
|
580
|
+
return createElement('div', _objectSpread2(_objectSpread2({}, context.data), {}, {
|
|
487
581
|
staticClass: addStaticClass(staticClass, classes)
|
|
488
582
|
}), context.children);
|
|
489
583
|
}
|
|
@@ -491,9 +585,7 @@ var FontAwesomeLayers = {
|
|
|
491
585
|
|
|
492
586
|
var FontAwesomeLayersText = {
|
|
493
587
|
name: 'FontAwesomeLayersText',
|
|
494
|
-
|
|
495
588
|
functional: true,
|
|
496
|
-
|
|
497
589
|
props: {
|
|
498
590
|
value: {
|
|
499
591
|
type: [String, Number],
|
|
@@ -515,27 +607,19 @@ var FontAwesomeLayersText = {
|
|
|
515
607
|
}
|
|
516
608
|
}
|
|
517
609
|
},
|
|
518
|
-
|
|
519
610
|
render: function render(createElement, context) {
|
|
520
611
|
var familyPrefix = config.familyPrefix;
|
|
521
612
|
var props = context.props;
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
var classes = objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));
|
|
525
|
-
|
|
613
|
+
var classes = objectWithKey('classes', [].concat(_toConsumableArray(props.counter ? ["".concat(familyPrefix, "-layers-counter")] : []), _toConsumableArray(props.position ? ["".concat(familyPrefix, "-layers-").concat(props.position)] : [])));
|
|
526
614
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
527
|
-
|
|
528
|
-
var renderedText = text(props.value.toString(), _extends({}, transform, classes));
|
|
529
|
-
|
|
615
|
+
var renderedText = text(props.value.toString(), _objectSpread2(_objectSpread2({}, transform), classes));
|
|
530
616
|
var abstract = renderedText.abstract;
|
|
531
617
|
|
|
532
|
-
|
|
533
618
|
if (props.counter) {
|
|
534
619
|
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
535
620
|
}
|
|
536
621
|
|
|
537
622
|
var convertCurry = convert.bind(null, createElement);
|
|
538
|
-
|
|
539
623
|
return convertCurry(abstract[0], {}, context.data);
|
|
540
624
|
}
|
|
541
625
|
};
|