@fortawesome/vue-fontawesome 2.0.6 → 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 +8 -0
- package/README.md +6 -6
- package/index.es.js +288 -229
- package/index.js +636 -577
- package/package.json +40 -23
- package/src/components/FontAwesomeIcon.js +15 -3
- package/src/utils.js +5 -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 -337
- 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);
|
|
73
|
+
|
|
74
|
+
var key, i;
|
|
75
|
+
|
|
76
|
+
if (Object.getOwnPropertySymbols) {
|
|
77
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
180
78
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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,9 +360,8 @@ 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
|
|
|
@@ -315,56 +377,58 @@ function classList(props) {
|
|
|
315
377
|
'fa-border': props.border,
|
|
316
378
|
'fa-li': props.listItem,
|
|
317
379
|
'fa-inverse': props.inverse,
|
|
380
|
+
'fa-flip': props.flip === true,
|
|
318
381
|
'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
|
|
319
382
|
'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
|
|
320
|
-
},
|
|
321
|
-
|
|
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);
|
|
322
384
|
return Object.keys(classes).map(function (key) {
|
|
323
385
|
return classes[key] ? key : null;
|
|
324
386
|
}).filter(function (key) {
|
|
325
387
|
return key;
|
|
326
388
|
});
|
|
327
389
|
}
|
|
328
|
-
|
|
329
390
|
function addStaticClass(to, what) {
|
|
330
391
|
var val = (to || '').length === 0 ? [] : [to];
|
|
331
|
-
|
|
332
392
|
return val.concat(what).join(' ');
|
|
333
393
|
}
|
|
334
394
|
|
|
335
|
-
function normalizeIconArgs(icon
|
|
395
|
+
function normalizeIconArgs(icon) {
|
|
336
396
|
// this has everything that it needs to be rendered which means it was probably imported
|
|
337
397
|
// directly from an icon svg package
|
|
338
|
-
if (icon
|
|
339
|
-
return icon
|
|
398
|
+
if (icon && _typeof(icon) === 'object' && icon.prefix && icon.iconName && icon.icon) {
|
|
399
|
+
return icon;
|
|
340
400
|
}
|
|
341
401
|
|
|
342
402
|
if (parse.icon) {
|
|
343
|
-
return parse.icon(icon
|
|
403
|
+
return parse.icon(icon);
|
|
344
404
|
}
|
|
345
405
|
|
|
346
|
-
if (icon
|
|
406
|
+
if (icon === null) {
|
|
347
407
|
return null;
|
|
348
408
|
}
|
|
349
409
|
|
|
350
|
-
if (
|
|
351
|
-
return icon
|
|
410
|
+
if (_typeof(icon) === 'object' && icon.prefix && icon.iconName) {
|
|
411
|
+
return icon;
|
|
352
412
|
}
|
|
353
413
|
|
|
354
|
-
if (Array.isArray(icon
|
|
355
|
-
return {
|
|
414
|
+
if (Array.isArray(icon) && icon.length === 2) {
|
|
415
|
+
return {
|
|
416
|
+
prefix: icon[0],
|
|
417
|
+
iconName: icon[1]
|
|
418
|
+
};
|
|
356
419
|
}
|
|
357
420
|
|
|
358
|
-
if (typeof icon
|
|
359
|
-
return {
|
|
421
|
+
if (typeof icon === 'string') {
|
|
422
|
+
return {
|
|
423
|
+
prefix: 'fas',
|
|
424
|
+
iconName: icon
|
|
425
|
+
};
|
|
360
426
|
}
|
|
361
427
|
}
|
|
362
428
|
|
|
363
429
|
var FontAwesomeIcon = {
|
|
364
430
|
name: 'FontAwesomeIcon',
|
|
365
|
-
|
|
366
431
|
functional: true,
|
|
367
|
-
|
|
368
432
|
props: {
|
|
369
433
|
beat: {
|
|
370
434
|
type: Boolean,
|
|
@@ -387,10 +451,10 @@ var FontAwesomeIcon = {
|
|
|
387
451
|
default: false
|
|
388
452
|
},
|
|
389
453
|
flip: {
|
|
390
|
-
type: String,
|
|
391
|
-
default:
|
|
454
|
+
type: [Boolean, String],
|
|
455
|
+
default: false,
|
|
392
456
|
validator: function validator(value) {
|
|
393
|
-
return ['horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
457
|
+
return [true, false, 'horizontal', 'vertical', 'both'].indexOf(value) > -1;
|
|
394
458
|
}
|
|
395
459
|
},
|
|
396
460
|
icon: {
|
|
@@ -461,54 +525,59 @@ var FontAwesomeIcon = {
|
|
|
461
525
|
inverse: {
|
|
462
526
|
type: Boolean,
|
|
463
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
|
|
464
540
|
}
|
|
465
541
|
},
|
|
466
|
-
|
|
467
542
|
render: function render(createElement, context) {
|
|
468
543
|
var props = context.props;
|
|
469
544
|
var iconArgs = props.icon,
|
|
470
545
|
maskArgs = props.mask,
|
|
471
546
|
symbol = props.symbol,
|
|
472
547
|
title = props.title;
|
|
473
|
-
|
|
474
|
-
var icon$$1 = normalizeIconArgs(iconArgs);
|
|
548
|
+
var icon$1 = normalizeIconArgs(iconArgs);
|
|
475
549
|
var classes = objectWithKey('classes', classList(props));
|
|
476
550
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
477
551
|
var mask = objectWithKey('mask', normalizeIconArgs(maskArgs));
|
|
478
|
-
var renderedIcon = icon(icon
|
|
552
|
+
var renderedIcon = icon(icon$1, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, classes), transform), mask), {}, {
|
|
553
|
+
symbol: symbol,
|
|
554
|
+
title: title
|
|
555
|
+
}));
|
|
479
556
|
|
|
480
557
|
if (!renderedIcon) {
|
|
481
|
-
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);
|
|
482
559
|
}
|
|
483
560
|
|
|
484
561
|
var abstract = renderedIcon.abstract;
|
|
485
|
-
|
|
486
562
|
var convertCurry = convert.bind(null, createElement);
|
|
487
|
-
|
|
488
563
|
return convertCurry(abstract[0], {}, context.data);
|
|
489
564
|
}
|
|
490
565
|
};
|
|
491
566
|
|
|
492
567
|
var FontAwesomeLayers = {
|
|
493
568
|
name: 'FontAwesomeLayers',
|
|
494
|
-
|
|
495
569
|
functional: true,
|
|
496
|
-
|
|
497
570
|
props: {
|
|
498
571
|
fixedWidth: {
|
|
499
572
|
type: Boolean,
|
|
500
573
|
default: false
|
|
501
574
|
}
|
|
502
575
|
},
|
|
503
|
-
|
|
504
576
|
render: function render(createElement, context) {
|
|
505
577
|
var familyPrefix = config.familyPrefix;
|
|
506
578
|
var staticClass = context.data.staticClass;
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
var classes = [familyPrefix + '-layers'].concat(toConsumableArray(context.props.fixedWidth ? [familyPrefix + '-fw'] : []));
|
|
510
|
-
|
|
511
|
-
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), {}, {
|
|
512
581
|
staticClass: addStaticClass(staticClass, classes)
|
|
513
582
|
}), context.children);
|
|
514
583
|
}
|
|
@@ -516,9 +585,7 @@ var FontAwesomeLayers = {
|
|
|
516
585
|
|
|
517
586
|
var FontAwesomeLayersText = {
|
|
518
587
|
name: 'FontAwesomeLayersText',
|
|
519
|
-
|
|
520
588
|
functional: true,
|
|
521
|
-
|
|
522
589
|
props: {
|
|
523
590
|
value: {
|
|
524
591
|
type: [String, Number],
|
|
@@ -540,27 +607,19 @@ var FontAwesomeLayersText = {
|
|
|
540
607
|
}
|
|
541
608
|
}
|
|
542
609
|
},
|
|
543
|
-
|
|
544
610
|
render: function render(createElement, context) {
|
|
545
611
|
var familyPrefix = config.familyPrefix;
|
|
546
612
|
var props = context.props;
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
var classes = objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));
|
|
550
|
-
|
|
613
|
+
var classes = objectWithKey('classes', [].concat(_toConsumableArray(props.counter ? ["".concat(familyPrefix, "-layers-counter")] : []), _toConsumableArray(props.position ? ["".concat(familyPrefix, "-layers-").concat(props.position)] : [])));
|
|
551
614
|
var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);
|
|
552
|
-
|
|
553
|
-
var renderedText = text(props.value.toString(), _extends({}, transform, classes));
|
|
554
|
-
|
|
615
|
+
var renderedText = text(props.value.toString(), _objectSpread2(_objectSpread2({}, transform), classes));
|
|
555
616
|
var abstract = renderedText.abstract;
|
|
556
617
|
|
|
557
|
-
|
|
558
618
|
if (props.counter) {
|
|
559
619
|
abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
|
|
560
620
|
}
|
|
561
621
|
|
|
562
622
|
var convertCurry = convert.bind(null, createElement);
|
|
563
|
-
|
|
564
623
|
return convertCurry(abstract[0], {}, context.data);
|
|
565
624
|
}
|
|
566
625
|
};
|