(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms')) : typeof define === 'function' && define.amd ? define('primeng/radiobutton', ['exports', '@angular/core', '@angular/common', '@angular/forms'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.primeng = global.primeng || {}, global.primeng.radiobutton = {}), global.ng.core, global.ng.common, global.ng.forms)); }(this, (function (exports, core, common, forms) { 'use strict'; var RADIO_VALUE_ACCESSOR = { provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef(function () { return RadioButton; }), multi: true }; var RadioButton = /** @class */ (function () { function RadioButton(cd) { this.cd = cd; this.onClick = new core.EventEmitter(); this.onFocus = new core.EventEmitter(); this.onBlur = new core.EventEmitter(); this.onModelChange = function () { }; this.onModelTouched = function () { }; } RadioButton.prototype.handleClick = function (event, radioButton, focus) { event.preventDefault(); if (this.disabled) { return; } this.select(event); if (focus) { radioButton.focus(); } }; RadioButton.prototype.select = function (event) { if (!this.disabled) { this.inputViewChild.nativeElement.checked = true; this.checked = true; this.onModelChange(this.value); this.onClick.emit(event); } }; RadioButton.prototype.writeValue = function (value) { this.checked = (value == this.value); if (this.inputViewChild && this.inputViewChild.nativeElement) { this.inputViewChild.nativeElement.checked = this.checked; } this.cd.markForCheck(); }; RadioButton.prototype.registerOnChange = function (fn) { this.onModelChange = fn; }; RadioButton.prototype.registerOnTouched = function (fn) { this.onModelTouched = fn; }; RadioButton.prototype.setDisabledState = function (val) { this.disabled = val; this.cd.markForCheck(); }; RadioButton.prototype.onInputFocus = function (event) { this.focused = true; this.onFocus.emit(event); }; RadioButton.prototype.onInputBlur = function (event) { this.focused = false; this.onModelTouched(); this.onBlur.emit(event); }; RadioButton.prototype.onChange = function (event) { this.select(event); }; RadioButton.prototype.focus = function () { this.inputViewChild.nativeElement.focus(); }; return RadioButton; }()); RadioButton.decorators = [ { type: core.Component, args: [{ selector: 'p-radioButton', template: "\n