source: trip-planner-front/node_modules/@fortawesome/angular-fontawesome/bundles/angular-fontawesome.umd.js

Last change on this file was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 39.7 KB
Line 
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@fortawesome/fontawesome-svg-core')) :
3 typeof define === 'function' && define.amd ? define('@fortawesome/angular-fontawesome', ['exports', '@angular/core', '@angular/platform-browser', '@fortawesome/fontawesome-svg-core'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.fortawesome = global.fortawesome || {}, global.fortawesome['angular-fontawesome'] = {}), global.ng.core, global.ng.platformBrowser, global.fontawesomeSvgCore));
5}(this, (function (exports, i0, platformBrowser, fontawesomeSvgCore) { 'use strict';
6
7 /*! *****************************************************************************
8 Copyright (c) Microsoft Corporation.
9
10 Permission to use, copy, modify, and/or distribute this software for any
11 purpose with or without fee is hereby granted.
12
13 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 PERFORMANCE OF THIS SOFTWARE.
20 ***************************************************************************** */
21 /* global Reflect, Promise */
22 var extendStatics = function (d, b) {
23 extendStatics = Object.setPrototypeOf ||
24 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25 function (d, b) { for (var p in b)
26 if (Object.prototype.hasOwnProperty.call(b, p))
27 d[p] = b[p]; };
28 return extendStatics(d, b);
29 };
30 function __extends(d, b) {
31 if (typeof b !== "function" && b !== null)
32 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33 extendStatics(d, b);
34 function __() { this.constructor = d; }
35 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36 }
37 var __assign = function () {
38 __assign = Object.assign || function __assign(t) {
39 for (var s, i = 1, n = arguments.length; i < n; i++) {
40 s = arguments[i];
41 for (var p in s)
42 if (Object.prototype.hasOwnProperty.call(s, p))
43 t[p] = s[p];
44 }
45 return t;
46 };
47 return __assign.apply(this, arguments);
48 };
49 function __rest(s, e) {
50 var t = {};
51 for (var p in s)
52 if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53 t[p] = s[p];
54 if (s != null && typeof Object.getOwnPropertySymbols === "function")
55 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57 t[p[i]] = s[p[i]];
58 }
59 return t;
60 }
61 function __decorate(decorators, target, key, desc) {
62 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63 if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64 r = Reflect.decorate(decorators, target, key, desc);
65 else
66 for (var i = decorators.length - 1; i >= 0; i--)
67 if (d = decorators[i])
68 r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69 return c > 3 && r && Object.defineProperty(target, key, r), r;
70 }
71 function __param(paramIndex, decorator) {
72 return function (target, key) { decorator(target, key, paramIndex); };
73 }
74 function __metadata(metadataKey, metadataValue) {
75 if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76 return Reflect.metadata(metadataKey, metadataValue);
77 }
78 function __awaiter(thisArg, _arguments, P, generator) {
79 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80 return new (P || (P = Promise))(function (resolve, reject) {
81 function fulfilled(value) { try {
82 step(generator.next(value));
83 }
84 catch (e) {
85 reject(e);
86 } }
87 function rejected(value) { try {
88 step(generator["throw"](value));
89 }
90 catch (e) {
91 reject(e);
92 } }
93 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94 step((generator = generator.apply(thisArg, _arguments || [])).next());
95 });
96 }
97 function __generator(thisArg, body) {
98 var _ = { label: 0, sent: function () { if (t[0] & 1)
99 throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101 function verb(n) { return function (v) { return step([n, v]); }; }
102 function step(op) {
103 if (f)
104 throw new TypeError("Generator is already executing.");
105 while (_)
106 try {
107 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108 return t;
109 if (y = 0, t)
110 op = [op[0] & 2, t.value];
111 switch (op[0]) {
112 case 0:
113 case 1:
114 t = op;
115 break;
116 case 4:
117 _.label++;
118 return { value: op[1], done: false };
119 case 5:
120 _.label++;
121 y = op[1];
122 op = [0];
123 continue;
124 case 7:
125 op = _.ops.pop();
126 _.trys.pop();
127 continue;
128 default:
129 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130 _ = 0;
131 continue;
132 }
133 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134 _.label = op[1];
135 break;
136 }
137 if (op[0] === 6 && _.label < t[1]) {
138 _.label = t[1];
139 t = op;
140 break;
141 }
142 if (t && _.label < t[2]) {
143 _.label = t[2];
144 _.ops.push(op);
145 break;
146 }
147 if (t[2])
148 _.ops.pop();
149 _.trys.pop();
150 continue;
151 }
152 op = body.call(thisArg, _);
153 }
154 catch (e) {
155 op = [6, e];
156 y = 0;
157 }
158 finally {
159 f = t = 0;
160 }
161 if (op[0] & 5)
162 throw op[1];
163 return { value: op[0] ? op[1] : void 0, done: true };
164 }
165 }
166 var __createBinding = Object.create ? (function (o, m, k, k2) {
167 if (k2 === undefined)
168 k2 = k;
169 Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170 }) : (function (o, m, k, k2) {
171 if (k2 === undefined)
172 k2 = k;
173 o[k2] = m[k];
174 });
175 function __exportStar(m, o) {
176 for (var p in m)
177 if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178 __createBinding(o, m, p);
179 }
180 function __values(o) {
181 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182 if (m)
183 return m.call(o);
184 if (o && typeof o.length === "number")
185 return {
186 next: function () {
187 if (o && i >= o.length)
188 o = void 0;
189 return { value: o && o[i++], done: !o };
190 }
191 };
192 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193 }
194 function __read(o, n) {
195 var m = typeof Symbol === "function" && o[Symbol.iterator];
196 if (!m)
197 return o;
198 var i = m.call(o), r, ar = [], e;
199 try {
200 while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201 ar.push(r.value);
202 }
203 catch (error) {
204 e = { error: error };
205 }
206 finally {
207 try {
208 if (r && !r.done && (m = i["return"]))
209 m.call(i);
210 }
211 finally {
212 if (e)
213 throw e.error;
214 }
215 }
216 return ar;
217 }
218 /** @deprecated */
219 function __spread() {
220 for (var ar = [], i = 0; i < arguments.length; i++)
221 ar = ar.concat(__read(arguments[i]));
222 return ar;
223 }
224 /** @deprecated */
225 function __spreadArrays() {
226 for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227 s += arguments[i].length;
228 for (var r = Array(s), k = 0, i = 0; i < il; i++)
229 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230 r[k] = a[j];
231 return r;
232 }
233 function __spreadArray(to, from) {
234 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235 to[j] = from[i];
236 return to;
237 }
238 function __await(v) {
239 return this instanceof __await ? (this.v = v, this) : new __await(v);
240 }
241 function __asyncGenerator(thisArg, _arguments, generator) {
242 if (!Symbol.asyncIterator)
243 throw new TypeError("Symbol.asyncIterator is not defined.");
244 var g = generator.apply(thisArg, _arguments || []), i, q = [];
245 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
246 function verb(n) { if (g[n])
247 i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
248 function resume(n, v) { try {
249 step(g[n](v));
250 }
251 catch (e) {
252 settle(q[0][3], e);
253 } }
254 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
255 function fulfill(value) { resume("next", value); }
256 function reject(value) { resume("throw", value); }
257 function settle(f, v) { if (f(v), q.shift(), q.length)
258 resume(q[0][0], q[0][1]); }
259 }
260 function __asyncDelegator(o) {
261 var i, p;
262 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
263 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
264 }
265 function __asyncValues(o) {
266 if (!Symbol.asyncIterator)
267 throw new TypeError("Symbol.asyncIterator is not defined.");
268 var m = o[Symbol.asyncIterator], i;
269 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
270 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
271 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
272 }
273 function __makeTemplateObject(cooked, raw) {
274 if (Object.defineProperty) {
275 Object.defineProperty(cooked, "raw", { value: raw });
276 }
277 else {
278 cooked.raw = raw;
279 }
280 return cooked;
281 }
282 ;
283 var __setModuleDefault = Object.create ? (function (o, v) {
284 Object.defineProperty(o, "default", { enumerable: true, value: v });
285 }) : function (o, v) {
286 o["default"] = v;
287 };
288 function __importStar(mod) {
289 if (mod && mod.__esModule)
290 return mod;
291 var result = {};
292 if (mod != null)
293 for (var k in mod)
294 if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
295 __createBinding(result, mod, k);
296 __setModuleDefault(result, mod);
297 return result;
298 }
299 function __importDefault(mod) {
300 return (mod && mod.__esModule) ? mod : { default: mod };
301 }
302 function __classPrivateFieldGet(receiver, privateMap) {
303 if (!privateMap.has(receiver)) {
304 throw new TypeError("attempted to get private field on non-instance");
305 }
306 return privateMap.get(receiver);
307 }
308 function __classPrivateFieldSet(receiver, privateMap, value) {
309 if (!privateMap.has(receiver)) {
310 throw new TypeError("attempted to set private field on non-instance");
311 }
312 privateMap.set(receiver, value);
313 return value;
314 }
315
316 var FaConfig = /** @class */ (function () {
317 function FaConfig() {
318 /**
319 * Default prefix to use, when one is not provided with the icon name.
320 *
321 * @default 'fas'
322 */
323 this.defaultPrefix = 'fas';
324 /**
325 * Provides a fallback icon to use whilst main icon is being loaded asynchronously.
326 * When value is null, then fa-icon component will throw an error if icon input is missing.
327 * When value is not null, then the provided icon will be used as a fallback icon if icon input is missing.
328 *
329 * @default null
330 */
331 this.fallbackIcon = null;
332 /**
333 * Whether components should lookup icon definitions in the global icon
334 * library (the one available from
335 * `import { library } from '@fortawesome/fontawesome-svg-core')`.
336 *
337 * See https://github.com/FortAwesome/angular-fontawesome/blob/master/docs/usage/icon-library.md
338 * for detailed description of library modes.
339 *
340 * - 'unset' - Components should lookup icon definitions in the global library
341 * and emit warning if they find a definition there. This option is a default
342 * to assist existing applications with a migration. Applications are expected
343 * to switch to using {@link FaIconLibrary}.
344 * - true - Components should lookup icon definitions in the global library.
345 * Note that global icon library is deprecated and support for it will be
346 * removed. This option can be used to temporarily suppress warnings.
347 * - false - Components should not lookup icon definitions in the global
348 * library. Library will throw an error if missing icon is found in the global
349 * library.
350 *
351 * @deprecated This option is deprecated since 0.5.0. In 0.6.0 default will
352 * be changed to false. In 0.8.0 the option will be removed together with the
353 * support for the global icon library.
354 *
355 * @default false
356 */
357 this.globalLibrary = false;
358 }
359 return FaConfig;
360 }());
361 FaConfig.ɵprov = i0.ɵɵdefineInjectable({ factory: function FaConfig_Factory() { return new FaConfig(); }, token: FaConfig, providedIn: "root" });
362 FaConfig.decorators = [
363 { type: i0.Injectable, args: [{ providedIn: 'root' },] }
364 ];
365
366 var FaIconLibrary = /** @class */ (function () {
367 function FaIconLibrary() {
368 this.definitions = {};
369 }
370 FaIconLibrary.prototype.addIcons = function () {
371 var e_1, _a;
372 var icons = [];
373 for (var _i = 0; _i < arguments.length; _i++) {
374 icons[_i] = arguments[_i];
375 }
376 try {
377 for (var icons_1 = __values(icons), icons_1_1 = icons_1.next(); !icons_1_1.done; icons_1_1 = icons_1.next()) {
378 var icon = icons_1_1.value;
379 if (!(icon.prefix in this.definitions)) {
380 this.definitions[icon.prefix] = {};
381 }
382 this.definitions[icon.prefix][icon.iconName] = icon;
383 }
384 }
385 catch (e_1_1) { e_1 = { error: e_1_1 }; }
386 finally {
387 try {
388 if (icons_1_1 && !icons_1_1.done && (_a = icons_1.return)) _a.call(icons_1);
389 }
390 finally { if (e_1) throw e_1.error; }
391 }
392 };
393 FaIconLibrary.prototype.addIconPacks = function () {
394 var e_2, _a;
395 var packs = [];
396 for (var _i = 0; _i < arguments.length; _i++) {
397 packs[_i] = arguments[_i];
398 }
399 var _loop_1 = function (pack) {
400 var icons = Object.keys(pack).map(function (key) { return pack[key]; });
401 this_1.addIcons.apply(this_1, __spread(icons));
402 };
403 var this_1 = this;
404 try {
405 for (var packs_1 = __values(packs), packs_1_1 = packs_1.next(); !packs_1_1.done; packs_1_1 = packs_1.next()) {
406 var pack = packs_1_1.value;
407 _loop_1(pack);
408 }
409 }
410 catch (e_2_1) { e_2 = { error: e_2_1 }; }
411 finally {
412 try {
413 if (packs_1_1 && !packs_1_1.done && (_a = packs_1.return)) _a.call(packs_1);
414 }
415 finally { if (e_2) throw e_2.error; }
416 }
417 };
418 FaIconLibrary.prototype.getIconDefinition = function (prefix, name) {
419 if (prefix in this.definitions && name in this.definitions[prefix]) {
420 return this.definitions[prefix][name];
421 }
422 return null;
423 };
424 return FaIconLibrary;
425 }());
426 FaIconLibrary.ɵprov = i0.ɵɵdefineInjectable({ factory: function FaIconLibrary_Factory() { return new FaIconLibrary(); }, token: FaIconLibrary, providedIn: "root" });
427 FaIconLibrary.decorators = [
428 { type: i0.Injectable, args: [{ providedIn: 'root' },] }
429 ];
430
431 var faWarnIfIconDefinitionMissing = function (iconSpec) {
432 throw new Error("Could not find icon with iconName=" + iconSpec.iconName + " and prefix=" + iconSpec.prefix + " in the icon library.");
433 };
434
435 var faWarnIfIconSpecMissing = function () {
436 throw new Error('Property `icon` is required for `fa-icon`/`fa-duotone-icon` components.');
437 };
438
439 /**
440 * Fontawesome class list.
441 * Returns classes array by props.
442 */
443 var faClassList = function (props) {
444 var _a;
445 var classes = (_a = {
446 'fa-spin': props.spin,
447 'fa-pulse': props.pulse,
448 'fa-fw': props.fixedWidth,
449 'fa-border': props.border,
450 'fa-inverse': props.inverse,
451 'fa-layers-counter': props.counter,
452 'fa-flip-horizontal': props.flip === 'horizontal' || props.flip === 'both',
453 'fa-flip-vertical': props.flip === 'vertical' || props.flip === 'both'
454 },
455 _a["fa-" + props.size] = props.size !== null,
456 _a["fa-rotate-" + props.rotate] = props.rotate !== null,
457 _a["fa-pull-" + props.pull] = props.pull !== null,
458 _a["fa-stack-" + props.stackItemSize] = props.stackItemSize != null,
459 _a);
460 return Object.keys(classes)
461 .map(function (key) { return (classes[key] ? key : null); })
462 .filter(function (key) { return key; });
463 };
464
465 /**
466 * Returns if is IconLookup or not.
467 */
468 var isIconLookup = function (i) {
469 return i.prefix !== undefined && i.iconName !== undefined;
470 };
471
472 /**
473 * Normalizing icon spec.
474 */
475 var faNormalizeIconSpec = function (iconSpec, defaultPrefix) {
476 if (isIconLookup(iconSpec)) {
477 return iconSpec;
478 }
479 if (Array.isArray(iconSpec) && iconSpec.length === 2) {
480 return { prefix: iconSpec[0], iconName: iconSpec[1] };
481 }
482 if (typeof iconSpec === 'string') {
483 return { prefix: defaultPrefix, iconName: iconSpec };
484 }
485 };
486
487 var FaStackItemSizeDirective = /** @class */ (function () {
488 function FaStackItemSizeDirective() {
489 /**
490 * Specify whether icon inside {@link FaStackComponent} should be rendered in
491 * regular size (1x) or as a larger icon (2x).
492 */
493 this.stackItemSize = '1x';
494 }
495 FaStackItemSizeDirective.prototype.ngOnChanges = function (changes) {
496 if ('size' in changes) {
497 throw new Error('fa-icon is not allowed to customize size when used inside fa-stack. ' +
498 'Set size on the enclosing fa-stack instead: <fa-stack size="4x">...</fa-stack>.');
499 }
500 };
501 return FaStackItemSizeDirective;
502 }());
503 FaStackItemSizeDirective.decorators = [
504 { type: i0.Directive, args: [{
505 // tslint:disable-next-line:directive-selector
506 selector: 'fa-icon[stackItemSize],fa-duotone-icon[stackItemSize]',
507 },] }
508 ];
509 FaStackItemSizeDirective.propDecorators = {
510 stackItemSize: [{ type: i0.Input }],
511 size: [{ type: i0.Input }]
512 };
513
514 var FaStackComponent = /** @class */ (function () {
515 function FaStackComponent(renderer, elementRef) {
516 this.renderer = renderer;
517 this.elementRef = elementRef;
518 }
519 FaStackComponent.prototype.ngOnInit = function () {
520 this.renderer.addClass(this.elementRef.nativeElement, 'fa-stack');
521 };
522 FaStackComponent.prototype.ngOnChanges = function (changes) {
523 if ('size' in changes) {
524 if (changes.size.currentValue != null) {
525 this.renderer.addClass(this.elementRef.nativeElement, "fa-" + changes.size.currentValue);
526 }
527 if (changes.size.previousValue != null) {
528 this.renderer.removeClass(this.elementRef.nativeElement, "fa-" + changes.size.previousValue);
529 }
530 }
531 };
532 return FaStackComponent;
533 }());
534 FaStackComponent.decorators = [
535 { type: i0.Component, args: [{
536 selector: 'fa-stack',
537 template: "<ng-content></ng-content>"
538 },] }
539 ];
540 FaStackComponent.ctorParameters = function () { return [
541 { type: i0.Renderer2 },
542 { type: i0.ElementRef }
543 ]; };
544 FaStackComponent.propDecorators = {
545 size: [{ type: i0.Input }]
546 };
547
548 var FaIconComponent = /** @class */ (function () {
549 function FaIconComponent(sanitizer, config, iconLibrary, stackItem, stack) {
550 this.sanitizer = sanitizer;
551 this.config = config;
552 this.iconLibrary = iconLibrary;
553 this.stackItem = stackItem;
554 this.classes = [];
555 if (stack != null && stackItem == null) {
556 console.error('FontAwesome: fa-icon and fa-duotone-icon elements must specify stackItemSize attribute when wrapped into ' +
557 'fa-stack. Example: <fa-icon stackItemSize="2x"></fa-icon>.');
558 }
559 }
560 FaIconComponent.prototype.ngOnChanges = function (changes) {
561 if (this.icon == null && this.config.fallbackIcon == null) {
562 return faWarnIfIconSpecMissing();
563 }
564 var iconToBeRendered = null;
565 if (this.icon == null) {
566 iconToBeRendered = this.config.fallbackIcon;
567 }
568 else {
569 iconToBeRendered = this.icon;
570 }
571 if (changes) {
572 var iconDefinition = this.findIconDefinition(iconToBeRendered);
573 if (iconDefinition != null) {
574 var params = this.buildParams();
575 this.renderIcon(iconDefinition, params);
576 }
577 }
578 };
579 /**
580 * Programmatically trigger rendering of the icon.
581 *
582 * This method is useful, when creating {@link FaIconComponent} dynamically or
583 * changing its inputs programmatically as in these cases icon won't be
584 * re-rendered automatically.
585 */
586 FaIconComponent.prototype.render = function () {
587 this.ngOnChanges({});
588 };
589 FaIconComponent.prototype.findIconDefinition = function (i) {
590 var lookup = faNormalizeIconSpec(i, this.config.defaultPrefix);
591 if ('icon' in lookup) {
592 return lookup;
593 }
594 var definition = this.iconLibrary.getIconDefinition(lookup.prefix, lookup.iconName);
595 if (definition != null) {
596 return definition;
597 }
598 var globalDefinition = fontawesomeSvgCore.findIconDefinition(lookup);
599 if (globalDefinition != null) {
600 var message = 'Global icon library is deprecated. ' +
601 'Consult https://github.com/FortAwesome/angular-fontawesome/blob/master/UPGRADING.md ' +
602 'for the migration instructions.';
603 if (this.config.globalLibrary === 'unset') {
604 console.error('FontAwesome: ' + message);
605 }
606 else if (!this.config.globalLibrary) {
607 throw new Error(message);
608 }
609 return globalDefinition;
610 }
611 faWarnIfIconDefinitionMissing(lookup);
612 return null;
613 };
614 FaIconComponent.prototype.buildParams = function () {
615 var classOpts = {
616 flip: this.flip,
617 spin: this.spin,
618 pulse: this.pulse,
619 border: this.border,
620 inverse: this.inverse,
621 size: this.size || null,
622 pull: this.pull || null,
623 rotate: this.rotate || null,
624 fixedWidth: typeof this.fixedWidth === 'boolean' ? this.fixedWidth : this.config.fixedWidth,
625 stackItemSize: this.stackItem != null ? this.stackItem.stackItemSize : null,
626 };
627 var parsedTransform = typeof this.transform === 'string' ? fontawesomeSvgCore.parse.transform(this.transform) : this.transform;
628 return {
629 title: this.title,
630 transform: parsedTransform,
631 classes: __spread(faClassList(classOpts), this.classes),
632 mask: this.mask != null ? this.findIconDefinition(this.mask) : null,
633 styles: this.styles != null ? this.styles : {},
634 symbol: this.symbol,
635 attributes: {
636 role: this.a11yRole,
637 },
638 };
639 };
640 FaIconComponent.prototype.renderIcon = function (definition, params) {
641 var renderedIcon = fontawesomeSvgCore.icon(definition, params);
642 this.renderedIconHTML = this.sanitizer.bypassSecurityTrustHtml(renderedIcon.html.join('\n'));
643 };
644 return FaIconComponent;
645 }());
646 FaIconComponent.decorators = [
647 { type: i0.Component, args: [{
648 selector: 'fa-icon',
649 template: "",
650 host: {
651 class: 'ng-fa-icon',
652 '[attr.title]': 'title',
653 }
654 },] }
655 ];
656 FaIconComponent.ctorParameters = function () { return [
657 { type: platformBrowser.DomSanitizer },
658 { type: FaConfig },
659 { type: FaIconLibrary },
660 { type: FaStackItemSizeDirective, decorators: [{ type: i0.Optional }] },
661 { type: FaStackComponent, decorators: [{ type: i0.Optional }] }
662 ]; };
663 FaIconComponent.propDecorators = {
664 icon: [{ type: i0.Input }],
665 title: [{ type: i0.Input }],
666 spin: [{ type: i0.Input }],
667 pulse: [{ type: i0.Input }],
668 mask: [{ type: i0.Input }],
669 styles: [{ type: i0.Input }],
670 flip: [{ type: i0.Input }],
671 size: [{ type: i0.Input }],
672 pull: [{ type: i0.Input }],
673 border: [{ type: i0.Input }],
674 inverse: [{ type: i0.Input }],
675 symbol: [{ type: i0.Input }],
676 rotate: [{ type: i0.Input }],
677 fixedWidth: [{ type: i0.Input }],
678 classes: [{ type: i0.Input }],
679 transform: [{ type: i0.Input }],
680 a11yRole: [{ type: i0.Input }],
681 renderedIconHTML: [{ type: i0.HostBinding, args: ['innerHTML',] }]
682 };
683
684 var FaDuotoneIconComponent = /** @class */ (function (_super) {
685 __extends(FaDuotoneIconComponent, _super);
686 function FaDuotoneIconComponent() {
687 return _super !== null && _super.apply(this, arguments) || this;
688 }
689 FaDuotoneIconComponent.prototype.findIconDefinition = function (i) {
690 var definition = _super.prototype.findIconDefinition.call(this, i);
691 if (definition != null && !Array.isArray(definition.icon[4])) {
692 throw new Error('The specified icon does not appear to be a Duotone icon. ' +
693 'Check that you specified the correct style: ' +
694 ("<fa-duotone-icon [icon]=\"['fad', '" + definition.iconName + "']\"></fa-duotone-icon> ") +
695 ("or use: <fa-icon icon=\"" + definition.iconName + "\"></fa-icon> instead."));
696 }
697 return definition;
698 };
699 FaDuotoneIconComponent.prototype.buildParams = function () {
700 var params = _super.prototype.buildParams.call(this);
701 if (this.swapOpacity === true || this.swapOpacity === 'true') {
702 params.classes.push('fa-swap-opacity');
703 }
704 if (this.primaryOpacity != null) {
705 params.styles['--fa-primary-opacity'] = this.primaryOpacity.toString();
706 }
707 if (this.secondaryOpacity != null) {
708 params.styles['--fa-secondary-opacity'] = this.secondaryOpacity.toString();
709 }
710 if (this.primaryColor != null) {
711 params.styles['--fa-primary-color'] = this.primaryColor;
712 }
713 if (this.secondaryColor != null) {
714 params.styles['--fa-secondary-color'] = this.secondaryColor;
715 }
716 return params;
717 };
718 return FaDuotoneIconComponent;
719 }(FaIconComponent));
720 FaDuotoneIconComponent.decorators = [
721 { type: i0.Component, args: [{
722 selector: 'fa-duotone-icon',
723 template: ""
724 },] }
725 ];
726 FaDuotoneIconComponent.propDecorators = {
727 swapOpacity: [{ type: i0.Input }],
728 primaryOpacity: [{ type: i0.Input }],
729 secondaryOpacity: [{ type: i0.Input }],
730 primaryColor: [{ type: i0.Input }],
731 secondaryColor: [{ type: i0.Input }]
732 };
733
734 /**
735 * Warns if parent component not existing.
736 */
737 var faWarnIfParentNotExist = function (parent, parentName, childName) {
738 if (!parent) {
739 throw new Error(childName + " should be used as child of " + parentName + " only.");
740 }
741 };
742
743 /**
744 * Fontawesome layers.
745 */
746 var FaLayersComponent = /** @class */ (function () {
747 function FaLayersComponent(renderer, elementRef, config) {
748 this.renderer = renderer;
749 this.elementRef = elementRef;
750 this.config = config;
751 }
752 FaLayersComponent.prototype.ngOnInit = function () {
753 this.renderer.addClass(this.elementRef.nativeElement, 'fa-layers');
754 this.fixedWidth = typeof this.fixedWidth === 'boolean' ? this.fixedWidth : this.config.fixedWidth;
755 };
756 FaLayersComponent.prototype.ngOnChanges = function (changes) {
757 if ('size' in changes) {
758 if (changes.size.currentValue != null) {
759 this.renderer.addClass(this.elementRef.nativeElement, "fa-" + changes.size.currentValue);
760 }
761 if (changes.size.previousValue != null) {
762 this.renderer.removeClass(this.elementRef.nativeElement, "fa-" + changes.size.previousValue);
763 }
764 }
765 };
766 return FaLayersComponent;
767 }());
768 FaLayersComponent.decorators = [
769 { type: i0.Component, args: [{
770 selector: 'fa-layers',
771 template: "<ng-content></ng-content>"
772 },] }
773 ];
774 FaLayersComponent.ctorParameters = function () { return [
775 { type: i0.Renderer2 },
776 { type: i0.ElementRef },
777 { type: FaConfig }
778 ]; };
779 FaLayersComponent.propDecorators = {
780 size: [{ type: i0.Input }],
781 fixedWidth: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.fa-fw',] }]
782 };
783
784 var FaLayersCounterComponent = /** @class */ (function () {
785 function FaLayersCounterComponent(parent, sanitizer) {
786 this.parent = parent;
787 this.sanitizer = sanitizer;
788 this.classes = [];
789 faWarnIfParentNotExist(this.parent, 'FaLayersComponent', this.constructor.name);
790 }
791 FaLayersCounterComponent.prototype.ngOnChanges = function (changes) {
792 if (changes) {
793 var params = this.buildParams();
794 this.updateContent(params);
795 }
796 };
797 FaLayersCounterComponent.prototype.buildParams = function () {
798 return {
799 title: this.title,
800 classes: this.classes,
801 styles: this.styles,
802 };
803 };
804 FaLayersCounterComponent.prototype.updateContent = function (params) {
805 this.renderedHTML = this.sanitizer.bypassSecurityTrustHtml(fontawesomeSvgCore.counter(this.content || '', params).html.join(''));
806 };
807 return FaLayersCounterComponent;
808 }());
809 FaLayersCounterComponent.decorators = [
810 { type: i0.Component, args: [{
811 selector: 'fa-layers-counter',
812 template: '',
813 host: {
814 class: 'ng-fa-layers-counter',
815 }
816 },] }
817 ];
818 FaLayersCounterComponent.ctorParameters = function () { return [
819 { type: FaLayersComponent, decorators: [{ type: i0.Optional }] },
820 { type: platformBrowser.DomSanitizer }
821 ]; };
822 FaLayersCounterComponent.propDecorators = {
823 content: [{ type: i0.Input }],
824 title: [{ type: i0.Input }],
825 styles: [{ type: i0.Input }],
826 classes: [{ type: i0.Input }],
827 renderedHTML: [{ type: i0.HostBinding, args: ['innerHTML',] }]
828 };
829
830 var FaLayersTextComponent = /** @class */ (function () {
831 function FaLayersTextComponent(parent, sanitizer) {
832 this.parent = parent;
833 this.sanitizer = sanitizer;
834 this.classes = [];
835 faWarnIfParentNotExist(this.parent, 'FaLayersComponent', this.constructor.name);
836 }
837 FaLayersTextComponent.prototype.ngOnChanges = function (changes) {
838 if (changes) {
839 var params = this.buildParams();
840 this.updateContent(params);
841 }
842 };
843 /**
844 * Updating params by component props.
845 */
846 FaLayersTextComponent.prototype.buildParams = function () {
847 var classOpts = {
848 flip: this.flip,
849 spin: this.spin,
850 pulse: this.pulse,
851 border: this.border,
852 inverse: this.inverse,
853 size: this.size || null,
854 pull: this.pull || null,
855 rotate: this.rotate || null,
856 fixedWidth: this.fixedWidth,
857 };
858 var parsedTransform = typeof this.transform === 'string' ? fontawesomeSvgCore.parse.transform(this.transform) : this.transform;
859 return {
860 transform: parsedTransform,
861 classes: __spread(faClassList(classOpts), this.classes),
862 title: this.title,
863 styles: this.styles,
864 };
865 };
866 FaLayersTextComponent.prototype.updateContent = function (params) {
867 this.renderedHTML = this.sanitizer.bypassSecurityTrustHtml(fontawesomeSvgCore.text(this.content || '', params).html.join('\n'));
868 };
869 return FaLayersTextComponent;
870 }());
871 FaLayersTextComponent.decorators = [
872 { type: i0.Component, args: [{
873 selector: 'fa-layers-text',
874 template: '',
875 host: {
876 class: 'ng-fa-layers-text',
877 }
878 },] }
879 ];
880 FaLayersTextComponent.ctorParameters = function () { return [
881 { type: FaLayersComponent, decorators: [{ type: i0.Optional }] },
882 { type: platformBrowser.DomSanitizer }
883 ]; };
884 FaLayersTextComponent.propDecorators = {
885 content: [{ type: i0.Input }],
886 title: [{ type: i0.Input }],
887 styles: [{ type: i0.Input }],
888 classes: [{ type: i0.Input }],
889 spin: [{ type: i0.Input }],
890 pulse: [{ type: i0.Input }],
891 flip: [{ type: i0.Input }],
892 size: [{ type: i0.Input }],
893 pull: [{ type: i0.Input }],
894 border: [{ type: i0.Input }],
895 inverse: [{ type: i0.Input }],
896 rotate: [{ type: i0.Input }],
897 fixedWidth: [{ type: i0.Input }],
898 transform: [{ type: i0.Input }],
899 renderedHTML: [{ type: i0.HostBinding, args: ['innerHTML',] }]
900 };
901
902 var FontAwesomeModule = /** @class */ (function () {
903 function FontAwesomeModule() {
904 }
905 return FontAwesomeModule;
906 }());
907 FontAwesomeModule.decorators = [
908 { type: i0.NgModule, args: [{
909 declarations: [
910 FaIconComponent,
911 FaDuotoneIconComponent,
912 FaLayersComponent,
913 FaLayersTextComponent,
914 FaLayersCounterComponent,
915 FaStackComponent,
916 FaStackItemSizeDirective,
917 ],
918 exports: [
919 FaIconComponent,
920 FaDuotoneIconComponent,
921 FaLayersComponent,
922 FaLayersTextComponent,
923 FaLayersCounterComponent,
924 FaStackComponent,
925 FaStackItemSizeDirective,
926 ],
927 },] }
928 ];
929
930 /**
931 * Generated bundle index. Do not edit.
932 */
933
934 exports.FaConfig = FaConfig;
935 exports.FaDuotoneIconComponent = FaDuotoneIconComponent;
936 exports.FaIconComponent = FaIconComponent;
937 exports.FaIconLibrary = FaIconLibrary;
938 exports.FaLayersComponent = FaLayersComponent;
939 exports.FaLayersCounterComponent = FaLayersCounterComponent;
940 exports.FaLayersTextComponent = FaLayersTextComponent;
941 exports.FaStackComponent = FaStackComponent;
942 exports.FaStackItemSizeDirective = FaStackItemSizeDirective;
943 exports.FontAwesomeModule = FontAwesomeModule;
944
945 Object.defineProperty(exports, '__esModule', { value: true });
946
947})));
948//# sourceMappingURL=angular-fontawesome.umd.js.map
Note: See TracBrowser for help on using the repository browser.