UNPKG

4.76 kBTypeScriptView Raw
1import { OnChanges, SimpleChanges } from '@angular/core';
2import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
3import { FaSymbol, FlipProp, IconDefinition, IconProp, PullProp, RotateProp, SizeProp, Styles, Transform } from '@fortawesome/fontawesome-svg-core';
4import { FaConfig } from '../config';
5import { FaIconLibrary } from '../icon-library';
6import { AnimationProp } from '../shared/models/props.model';
7import { FaStackItemSizeDirective } from '../stack/stack-item-size.directive';
8import { FaStackComponent } from '../stack/stack.component';
9import * as i0 from "@angular/core";
10export declare class FaIconComponent implements OnChanges {
11 private sanitizer;
12 private config;
13 private iconLibrary;
14 private stackItem;
15 icon: IconProp;
16 /**
17 * Specify a title for the icon.
18 *
19 * This text will be displayed in a tooltip on hover and presented to the
20 * screen readers.
21 */
22 title?: string;
23 /**
24 * Icon animation.
25 *
26 * Most of the animations are only available when using Font Awesome 6. With
27 * Font Awesome 5, only 'spin' and 'spin-pulse' are supported.
28 */
29 animation?: AnimationProp;
30 /**
31 * @deprecated Use animation="spin" instead. To be removed in 0.14.0.
32 */
33 set spin(value: boolean);
34 /**
35 * @deprecated Use animation="spin-pulse" instead. To be removed in 0.14.0.
36 */
37 set pulse(value: boolean);
38 mask?: IconProp;
39 /**
40 * Set `style` attribute on the SVG element rendered by the component.
41 *
42 * @deprecated This input breaks view encapsulation and is not recommended.
43 * For simple cases (like colors), use `style` on the component itself, for
44 * more complex usages, explicitly opt-in to break the view encapsulation.
45 * This input is deprecated since 0.12.0 and will be removed in 0.13.0.
46 */
47 styles?: Styles;
48 flip?: FlipProp;
49 size?: SizeProp;
50 pull?: PullProp;
51 border?: boolean;
52 inverse?: boolean;
53 symbol?: FaSymbol;
54 rotate?: RotateProp;
55 fixedWidth?: boolean;
56 /**
57 * Set `class` attribute on the SVG element rendered by the component.
58 *
59 * @deprecated This input breaks view encapsulation and is not recommended.
60 * For simple cases (like colors), use `class` on the component itself, for
61 * more complex usages, explicitly opt-in to break the view encapsulation.
62 * This input is deprecated since 0.12.0 and will be removed in 0.13.0.
63 */
64 classes?: string[];
65 transform?: string | Transform;
66 /**
67 * Specify the `role` attribute for the rendered <svg> element.
68 *
69 * @default 'img'
70 */
71 a11yRole: string;
72 renderedIconHTML: SafeHtml;
73 constructor(sanitizer: DomSanitizer, config: FaConfig, iconLibrary: FaIconLibrary, stackItem: FaStackItemSizeDirective, stack: FaStackComponent);
74 ngOnChanges(changes: SimpleChanges): void;
75 /**
76 * Programmatically trigger rendering of the icon.
77 *
78 * This method is useful, when creating {@link FaIconComponent} dynamically or
79 * changing its inputs programmatically as in these cases icon won't be
80 * re-rendered automatically.
81 */
82 render(): void;
83 protected findIconDefinition(i: IconProp | IconDefinition): IconDefinition | null;
84 protected buildParams(): {
85 title: string;
86 transform: Transform;
87 classes: string[];
88 mask: IconDefinition;
89 styles: Styles;
90 symbol: FaSymbol;
91 attributes: {
92 role: string;
93 };
94 };
95 private renderIcon;
96 static ɵfac: i0.ɵɵFactoryDeclaration<FaIconComponent, [null, null, null, { optional: true; }, { optional: true; }]>;
97 static ɵcmp: i0.ɵɵComponentDeclaration<FaIconComponent, "fa-icon", never, { "icon": { "alias": "icon"; "required": false; }; "title": { "alias": "title"; "required": false; }; "animation": { "alias": "animation"; "required": false; }; "spin": { "alias": "spin"; "required": false; }; "pulse": { "alias": "pulse"; "required": false; }; "mask": { "alias": "mask"; "required": false; }; "styles": { "alias": "styles"; "required": false; }; "flip": { "alias": "flip"; "required": false; }; "size": { "alias": "size"; "required": false; }; "pull": { "alias": "pull"; "required": false; }; "border": { "alias": "border"; "required": false; }; "inverse": { "alias": "inverse"; "required": false; }; "symbol": { "alias": "symbol"; "required": false; }; "rotate": { "alias": "rotate"; "required": false; }; "fixedWidth": { "alias": "fixedWidth"; "required": false; }; "classes": { "alias": "classes"; "required": false; }; "transform": { "alias": "transform"; "required": false; }; "a11yRole": { "alias": "a11yRole"; "required": false; }; }, {}, never, never, false, never>;
98}