UNPKG

@synergy-design-system/angular

Version:
116 lines (112 loc) 4.56 kB
import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import '@synergy-design-system/components/components/icon/icon.js'; // --------------------------------------------------------------------- // 🔒 AUTOGENERATED @synergy-design-system/angular wrappers for @synergy-design-system/components // Please do not edit this file directly! // It will get recreated when running pnpm build. // --------------------------------------------------------------------- /** * @summary Icons are symbols that can be used to represent various options within an application. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-icon--docs * @status stable * @since 2.0 * * @event syn-load - Emitted when the icon has loaded. When using `spriteSheet: true` this will not emit. * @event syn-error - Emitted when the icon fails to load due to an error. When using `spriteSheet: true` this will not emit. * * @csspart svg - The internal SVG element. * @csspart use - The <use> element generated when using `spriteSheet: true` */ class SynIconComponent { nativeElement; _ngZone; constructor(e, ngZone) { this.nativeElement = e.nativeElement; this._ngZone = ngZone; this.nativeElement.addEventListener('syn-load', (e) => { this.synLoadEvent.emit(e); }); this.nativeElement.addEventListener('syn-error', (e) => { this.synErrorEvent.emit(e); }); } /** * The name of the icon to draw. * Available names depend on the icon library being used. */ set name(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.name = v)); } get name() { return this.nativeElement.name; } /** * An external URL of an SVG file. * Be sure you trust the content you are including, as it will be executed as code and can result in XSS attacks. */ set src(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.src = v)); } get src() { return this.nativeElement.src; } /** * An alternate description to use for assistive devices. * If omitted, the icon will be considered presentational and ignored by assistive devices. */ set label(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.label = v)); } get label() { return this.nativeElement.label; } /** * The name of a registered custom icon library. */ set library(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.library = v)); } get library() { return this.nativeElement.library; } /** * Emitted when the icon has loaded. * When using `spriteSheet: true` this will not emit. */ synLoadEvent = new EventEmitter(); /** * Emitted when the icon fails to load due to an error. * When using `spriteSheet: true` this will not emit. */ synErrorEvent = new EventEmitter(); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynIconComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynIconComponent, isStandalone: true, selector: "syn-icon", inputs: { name: "name", src: "src", label: "label", library: "library" }, outputs: { synLoadEvent: "synLoadEvent", synErrorEvent: "synErrorEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynIconComponent, decorators: [{ type: Component, args: [{ selector: 'syn-icon', standalone: true, template: '<ng-content></ng-content>', }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { name: [{ type: Input }], src: [{ type: Input }], label: [{ type: Input }], library: [{ type: Input }], synLoadEvent: [{ type: Output }], synErrorEvent: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { SynIconComponent }; //# sourceMappingURL=synergy-design-system-angular-components-icon.mjs.map