UNPKG

4.08 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/tristatecheckbox",["exports","@angular/core","@angular/common","@angular/forms"],t):t(((e=e||self).primeng=e.primeng||{},e.primeng.tristatecheckbox={}),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,l=arguments.length,a=l<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var u=e.length-1;u>=0;u--)(i=e[u])&&(a=(l<3?i(a):l>3?i(t,o,a):i(t,o))||a);return l>3&&a&&Object.defineProperty(t,o,a),a},l={provide:n.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return a})),multi:!0},a=function(){function e(e){this.cd=e,this.onChange=new t.EventEmitter,this.onModelChange=function(){},this.onModelTouched=function(){}}return e.prototype.onClick=function(e,t){this.disabled||this.readonly||(this.toggle(e),this.focus=!0,t.focus())},e.prototype.onKeydown=function(e){32==e.keyCode&&e.preventDefault()},e.prototype.onKeyup=function(e){32!=e.keyCode||this.readonly||(this.toggle(e),e.preventDefault())},e.prototype.toggle=function(e){null==this.value||null==this.value?this.value=!0:1==this.value?this.value=!1:0==this.value&&(this.value=null),this.onModelChange(this.value),this.onChange.emit({originalEvent:e,value:this.value})},e.prototype.onFocus=function(){this.focus=!0},e.prototype.onBlur=function(){this.focus=!1,this.onModelTouched()},e.prototype.registerOnChange=function(e){this.onModelChange=e},e.prototype.registerOnTouched=function(e){this.onModelTouched=e},e.prototype.writeValue=function(e){this.value=e,this.cd.markForCheck()},e.prototype.setDisabledState=function(e){this.disabled=e},e.ctorParameters=function(){return[{type:t.ChangeDetectorRef}]},i([t.Input()],e.prototype,"disabled",void 0),i([t.Input()],e.prototype,"name",void 0),i([t.Input()],e.prototype,"ariaLabelledBy",void 0),i([t.Input()],e.prototype,"tabindex",void 0),i([t.Input()],e.prototype,"inputId",void 0),i([t.Input()],e.prototype,"style",void 0),i([t.Input()],e.prototype,"styleClass",void 0),i([t.Input()],e.prototype,"label",void 0),i([t.Input()],e.prototype,"readonly",void 0),i([t.Output()],e.prototype,"onChange",void 0),e=i([t.Component({selector:"p-triStateCheckbox",template:'\n <div [ngStyle]="style" [ngClass]="{\'ui-chkbox ui-tristatechkbox ui-widget\': true,\'ui-chkbox-readonly\': readonly}" [class]="styleClass">\n <div class="ui-helper-hidden-accessible">\n <input #input type="text" [attr.id]="inputId" [name]="name" [attr.tabindex]="tabindex" [readonly]="readonly" [disabled]="disabled" (keyup)="onKeyup($event)" (keydown)="onKeydown($event)" (focus)="onFocus()" (blur)="onBlur()" [attr.aria-labelledby]="ariaLabelledBy">\n </div>\n <div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default" (click)="onClick($event,input)" role="checkbox" [attr.aria-checked]="value === true"\n [ngClass]="{\'ui-state-active\':value!=null,\'ui-state-disabled\':disabled,\'ui-state-focus\':focus}">\n <span class="ui-chkbox-icon pi ui-clickable" [ngClass]="{\'pi-check\':value==true,\'pi-times\':value==false}"></span>\n </div>\n </div>\n <label class="ui-chkbox-label" (click)="onClick($event,input)"\n [ngClass]="{\'ui-label-active\':value!=null, \'ui-label-disabled\':disabled, \'ui-label-focus\':focus}"\n *ngIf="label" [attr.for]="inputId">{{label}}</label>\n ',providers:[l],changeDetection:t.ChangeDetectionStrategy.Default})],e)}(),u=function(){function e(){}return e=i([t.NgModule({imports:[o.CommonModule],exports:[a],declarations:[a]})],e)}();e.TRISTATECHECKBOX_VALUE_ACCESSOR=l,e.TriStateCheckbox=a,e.TriStateCheckboxModule=u,Object.defineProperty(e,"__esModule",{value:!0})}));
2//# sourceMappingURL=primeng-tristatecheckbox.umd.min.js.map
\No newline at end of file