@synergy-design-system/angular
Version:
Angular wrappers for the Synergy Design System
108 lines (104 loc) • 4.18 kB
JavaScript
import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component } from '@angular/core';
import '@synergy-design-system/components/components/radio/radio.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 allow the user to select a single option from a group.
* @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-radio--docs
* @status stable
* @since 2.0
*
* @dependency syn-icon
*
* @slot - The radio's label.
*
* @event syn-blur - Emitted when the control loses focus.
* @event syn-focus - Emitted when the control gains focus.
*
* @csspart base - The component's base wrapper.
* @csspart control - The circular container that wraps the radio's checked state.
* @csspart control--checked - The radio control when the radio is checked.
* @csspart checked-icon - The checked icon, an `<syn-icon>` element.
* @csspart label - The container that wraps the radio's label.
*/
class SynRadioComponent {
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;
}
/**
* The radio'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;
}
/**
* Disables the radio.
*/
set disabled(v) {
this._ngZone.runOutsideAngular(() => (this.nativeElement.disabled = v === '' || v));
}
get disabled() {
return this.nativeElement.disabled;
}
/**
* Emitted when the control loses focus.
*/
synBlurEvent = new EventEmitter();
/**
* Emitted when the control gains focus.
*/
synFocusEvent = new EventEmitter();
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.1", ngImport: i0, type: SynRadioComponent, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.1", type: SynRadioComponent, isStandalone: true, selector: "syn-radio", inputs: { value: "value", size: "size", 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: SynRadioComponent, decorators: [{
type: Component,
args: [{
selector: 'syn-radio',
standalone: true,
template: '<ng-content></ng-content>',
}]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { value: [{
type: Input
}], size: [{
type: Input
}], disabled: [{
type: Input
}], synBlurEvent: [{
type: Output
}], synFocusEvent: [{
type: Output
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { SynRadioComponent };
//# sourceMappingURL=synergy-design-system-angular-components-radio.mjs.map