UNPKG

@synergy-design-system/angular

Version:
184 lines (180 loc) 6.46 kB
import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import '@synergy-design-system/components/components/icon-button/icon-button.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 buttons are simple, icon-only buttons that can be used for actions and in toolbars. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-icon-button--docs * @status stable * @since 2.0 * * @dependency syn-icon * * @event syn-blur - Emitted when the icon button loses focus. * @event syn-focus - Emitted when the icon button gains focus. * * @csspart base - The component's base wrapper. */ class SynIconButtonComponent { nativeElement; _ngZone; constructor(e, ngZone) { this.nativeElement = e.nativeElement; this._ngZone = ngZone; this.nativeElement.addEventListener('syn-blur', (e) => { this.synBlurEvent.emit(e); }); this.nativeElement.addEventListener('syn-focus', (e) => { this.synFocusEvent.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; } /** * The name of a registered custom icon library. */ set library(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.library = v)); } get library() { return this.nativeElement.library; } /** * 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; } /** * When set, the underlying button will be rendered as an `<a>` with this `href` instead of a `<button>`. */ set href(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.href = v)); } get href() { return this.nativeElement.href; } /** * Tells the browser where to open the link. * Only used when `href` is set. */ set target(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.target = v)); } get target() { return this.nativeElement.target; } /** * Tells the browser to download the linked file as this filename. * Only used when `href` is set. */ set download(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.download = v)); } get download() { return this.nativeElement.download; } /** * A description that gets read by assistive devices. * For optimal accessibility, you should always include a label that describes what the icon button does. */ set label(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.label = v)); } get label() { return this.nativeElement.label; } /** * The icon button's size. */ set size(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.size = v)); } get size() { return this.nativeElement.size; } /** * The color of the icon button. The default "currentColor" makes it possible to easily style the icon button from outside without any CSS variables. */ set color(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.color = v)); } get color() { return this.nativeElement.color; } /** * Disables the button. */ set disabled(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v)); } get disabled() { return this.nativeElement.disabled; } /** * Emitted when the icon button loses focus. */ synBlurEvent = new EventEmitter(); /** * Emitted when the icon button gains focus. */ synFocusEvent = new EventEmitter(); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynIconButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynIconButtonComponent, isStandalone: true, selector: "syn-icon-button", inputs: { name: "name", library: "library", src: "src", href: "href", target: "target", download: "download", label: "label", size: "size", color: "color", disabled: "disabled" }, outputs: { synBlurEvent: "synBlurEvent", synFocusEvent: "synFocusEvent" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynIconButtonComponent, decorators: [{ type: Component, args: [{ selector: 'syn-icon-button', standalone: true, template: '<ng-content></ng-content>', }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { name: [{ type: Input }], library: [{ type: Input }], src: [{ type: Input }], href: [{ type: Input }], target: [{ type: Input }], download: [{ type: Input }], label: [{ type: Input }], size: [{ type: Input }], color: [{ type: Input }], disabled: [{ type: Input }], synBlurEvent: [{ type: Output }], synFocusEvent: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { SynIconButtonComponent }; //# sourceMappingURL=synergy-design-system-angular-components-icon-button.mjs.map