MyRepo-Ums/node_modules/@fortawesome/angular-fontawesome/esm2022/icon/duotone-icon.component.mjs

55 lines
8.3 KiB
JavaScript
Raw Normal View History

2024-01-19 10:09:11 +00:00
import { Component, Input } from '@angular/core';
import { FaIconComponent } from './icon.component';
import * as i0 from "@angular/core";
export class FaDuotoneIconComponent extends FaIconComponent {
findIconDefinition(i) {
const definition = super.findIconDefinition(i);
if (definition != null && !Array.isArray(definition.icon[4])) {
throw new Error('The specified icon does not appear to be a Duotone icon. ' +
'Check that you specified the correct style: ' +
`<fa-duotone-icon [icon]="['fad', '${definition.iconName}']"></fa-duotone-icon> ` +
`or use: <fa-icon icon="${definition.iconName}"></fa-icon> instead.`);
}
return definition;
}
buildParams() {
const params = super.buildParams();
if (this.swapOpacity === true || this.swapOpacity === 'true') {
params.classes.push('fa-swap-opacity');
}
if (this.primaryOpacity != null) {
params.styles['--fa-primary-opacity'] = this.primaryOpacity.toString();
}
if (this.secondaryOpacity != null) {
params.styles['--fa-secondary-opacity'] = this.secondaryOpacity.toString();
}
if (this.primaryColor != null) {
params.styles['--fa-primary-color'] = this.primaryColor;
}
if (this.secondaryColor != null) {
params.styles['--fa-secondary-color'] = this.secondaryColor;
}
return params;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: FaDuotoneIconComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.0", type: FaDuotoneIconComponent, isStandalone: true, selector: "fa-duotone-icon", inputs: { swapOpacity: "swapOpacity", primaryOpacity: "primaryOpacity", secondaryOpacity: "secondaryOpacity", primaryColor: "primaryColor", secondaryColor: "secondaryColor" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: FaDuotoneIconComponent, decorators: [{
type: Component,
args: [{
selector: 'fa-duotone-icon',
standalone: true,
template: ``,
}]
}], propDecorators: { swapOpacity: [{
type: Input
}], primaryOpacity: [{
type: Input
}], secondaryOpacity: [{
type: Input
}], primaryColor: [{
type: Input
}], secondaryColor: [{
type: Input
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHVvdG9uZS1pY29uLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9saWIvaWNvbi9kdW90b25lLWljb24uY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRWpELE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQzs7QUFPbkQsTUFBTSxPQUFPLHNCQUF1QixTQUFRLGVBQWU7SUEwQy9DLGtCQUFrQixDQUFDLENBQTRCO1FBQ3ZELE1BQU0sVUFBVSxHQUFHLEtBQUssQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUUvQyxJQUFJLFVBQVUsSUFBSSxJQUFJLElBQUksQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDLFVBQVUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsRUFBRTtZQUM1RCxNQUFNLElBQUksS0FBSyxDQUNiLDJEQUEyRDtnQkFDekQsOENBQThDO2dCQUM5QyxxQ0FBcUMsVUFBVSxDQUFDLFFBQVEseUJBQXlCO2dCQUNqRiwwQkFBMEIsVUFBVSxDQUFDLFFBQVEsdUJBQXVCLENBQ3ZFLENBQUM7U0FDSDtRQUVELE9BQU8sVUFBVSxDQUFDO0lBQ3BCLENBQUM7SUFFUyxXQUFXO1FBQ25CLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQyxXQUFXLEVBQUUsQ0F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