UNPKG

4.36 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("@angular/forms")):"function"==typeof define&&define.amd?define("primeng/radiobutton",["exports","@angular/core","@angular/common","@angular/forms"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.radiobutton={}),e.ng.core,e.ng.common,e.ng.forms)}(this,(function(e,t,o,n){"use strict";var i=this&&this.__decorate||function(e,t,o,n){var i,r=arguments.length,u=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)u=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(u=(r<3?i(u):r>3?i(t,o,u):i(t,o))||u);return r>3&&u&&Object.defineProperty(t,o,u),u},r={provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return u})),multi:!0},u=function(){function e(e){this.cd=e,this.onClick=new t.EventEmitter,this.onFocus=new t.EventEmitter,this.onBlur=new t.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){}}return e.prototype.handleClick=function(e,t,o){e.preventDefault(),this.disabled||(this.select(e),o&&t.focus())},e.prototype.select=function(e){this.disabled||(this.inputViewChild.nativeElement.checked=!0,this.checked=!0,this.onModelChange(this.value),this.onClick.emit(e))},e.prototype.writeValue=function(e){this.checked=e==this.value,this.inputViewChild&&this.inputViewChild.nativeElement&&(this.inputViewChild.nativeElement.checked=this.checked),this.cd.markForCheck()},e.prototype.registerOnChange=function(e){this.onModelChange=e},e.prototype.registerOnTouched=function(e){this.onModelTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onInputFocus=function(e){this.focused=!0,this.onFocus.emit(e)},e.prototype.onInputBlur=function(e){this.focused=!1,this.onModelTouched(),this.onBlur.emit(e)},e.prototype.onChange=function(e){this.select(e)},e.prototype.focus=function(){this.inputViewChild.nativeElement.focus()},e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},i([t.Input()],e.prototype,"value",void 0),i([t.Input()],e.prototype,"name",void 0),i([t.Input()],e.prototype,"disabled",void 0),i([t.Input()],e.prototype,"label",void 0),i([t.Input()],e.prototype,"tabindex",void 0),i([t.Input()],e.prototype,"inputId",void 0),i([t.Input()],e.prototype,"ariaLabelledBy",void 0),i([t.Input()],e.prototype,"style",void 0),i([t.Input()],e.prototype,"styleClass",void 0),i([t.Input()],e.prototype,"labelStyleClass",void 0),i([t.Output()],e.prototype,"onClick",void 0),i([t.Output()],e.prototype,"onFocus",void 0),i([t.Output()],e.prototype,"onBlur",void 0),i([t.ViewChild("rb")],e.prototype,"inputViewChild",void 0),e=i([t.Component({selector:"p-radioButton",template:'\n <div [ngStyle]="style" [ngClass]="\'ui-radiobutton ui-widget\'" [class]="styleClass">\n <div class="ui-helper-hidden-accessible">\n <input #rb type="radio" [attr.id]="inputId" [attr.name]="name" [attr.value]="value" [attr.tabindex]="tabindex" [attr.aria-labelledby]="ariaLabelledBy"\n [checked]="checked" (change)="onChange($event)" (focus)="onInputFocus($event)" (blur)="onInputBlur($event)" [disabled]="disabled">\n </div>\n <div (click)="handleClick($event, rb, true)" role="radio" [attr.aria-checked]="checked"\n [ngClass]="{\'ui-radiobutton-box ui-widget ui-state-default\':true,\n \'ui-state-active\':rb.checked,\'ui-state-disabled\':disabled,\'ui-state-focus\':focused}">\n <span class="ui-radiobutton-icon ui-clickable" [ngClass]="{\'pi pi-circle-on\':rb.checked}"></span>\n </div>\n </div>\n <label (click)="select($event)" [class]="labelStyleClass"\n [ngClass]="{\'ui-radiobutton-label\':true, \'ui-label-active\':rb.checked, \'ui-label-disabled\':disabled, \'ui-label-focus\':focused}"\n *ngIf="label" [attr.for]="inputId">{{label}}</label>\n ',providers:[r],changeDetection:t.ChangeDetectionStrategy.Default})],e)}(),l=function(){function e(){}return e=i([t.NgModule({imports:[o.CommonModule],exports:[u],declarations:[u]})],e)}();e.RADIO_VALUE_ACCESSOR=r,e.RadioButton=u,e.RadioButtonModule=l,Object.defineProperty(e,"__esModule",{value:!0})}));
2//# sourceMappingURL=primeng-radiobutton.umd.min.js.map
\No newline at end of file