UNPKG

@synergy-design-system/angular

Version:
120 lines (116 loc) 4.77 kB
import * as i0 from '@angular/core'; import { EventEmitter, Output, Input, Component } from '@angular/core'; import '@synergy-design-system/components/components/radio-button/radio-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 Radios buttons allow the user to select a single option from a group using a button-like control. * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio-button--docs * @status stable * @since 2.0 * * @slot - The radio button's label. * @slot prefix - A presentational prefix icon or similar element. * @slot suffix - A presentational suffix icon or similar element. * * @event syn-blur - Emitted when the button loses focus. * @event syn-focus - Emitted when the button gains focus. * * @csspart base - The component's base wrapper. * @csspart button - The internal `<button>` element. * @csspart button--checked - The internal button element when the radio button is checked. * @csspart prefix - The container that wraps the prefix. * @csspart label - The container that wraps the radio button's label. * @csspart suffix - The container that wraps the suffix. */ class SynRadioButtonComponent { 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 radio's value. * When selected, the radio group will receive this value. */ set value(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.value = v)); } get value() { return this.nativeElement.value; } /** * Disables the radio button. */ set disabled(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v)); } get disabled() { return this.nativeElement.disabled; } /** * The radio button's size. * When used inside a radio group, the size will be determined by the radio group's size so this attribute can typically be omitted. */ set size(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.size = v)); } get size() { return this.nativeElement.size; } /** * Draws a pill-style radio button with rounded edges. */ set pill(v) { this._ngZone.runOutsideAngular(() => (this.nativeElement.pill = v === '' || v)); } get pill() { return this.nativeElement.pill; } /** * Emitted when the button loses focus. */ synBlurEvent = new EventEmitter(); /** * Emitted when the button gains focus. */ synFocusEvent = new EventEmitter(); static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynRadioButtonComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynRadioButtonComponent, isStandalone: true, selector: "syn-radio-button", inputs: { value: "value", disabled: "disabled", size: "size", pill: "pill" }, 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: SynRadioButtonComponent, decorators: [{ type: Component, args: [{ selector: 'syn-radio-button', standalone: true, template: '<ng-content></ng-content>', }] }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { value: [{ type: Input }], disabled: [{ type: Input }], size: [{ type: Input }], pill: [{ type: Input }], synBlurEvent: [{ type: Output }], synFocusEvent: [{ type: Output }] } }); /** * Generated bundle index. Do not edit. */ export { SynRadioButtonComponent }; //# sourceMappingURL=synergy-design-system-angular-components-radio-button.mjs.map