ngx-bootstrap-fix-datepicker
Version:
Native Angular Bootstrap Components
2 lines • 5.29 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define("ngx-bootstrap/buttons",["exports","@angular/core","@angular/forms"],e):e(((t=t||self)["ngx-bootstrap"]=t["ngx-bootstrap"]||{},t["ngx-bootstrap"].buttons={}),t.ng.core,t.ng.forms)}(this,(function(t,e,o){"use strict";var n={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return i})),multi:!0},i=function(){function t(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}return t.prototype.onClick=function(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))},t.prototype.ngOnInit=function(){this.toggle(this.trueValue===this.value)},Object.defineProperty(t.prototype,"trueValue",{get:function(){return void 0===this.btnCheckboxTrue||this.btnCheckboxTrue},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"falseValue",{get:function(){return void 0!==this.btnCheckboxFalse&&this.btnCheckboxFalse},enumerable:!0,configurable:!0}),t.prototype.toggle=function(t){this.state=t,this.value=this.state?this.trueValue:this.falseValue},t.prototype.writeValue=function(t){this.state=this.trueValue===t,this.value=t?this.trueValue:this.falseValue},t.prototype.setDisabledState=function(t){this.isDisabled=t},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.decorators=[{type:e.Directive,args:[{selector:"[btnCheckbox]",providers:[n]}]}],t.propDecorators={btnCheckboxTrue:[{type:e.Input}],btnCheckboxFalse:[{type:e.Input}],state:[{type:e.HostBinding,args:["class.active"]},{type:e.HostBinding,args:["attr.aria-pressed"]}],onClick:[{type:e.HostListener,args:["click"]}]},t}();var r={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return s})),multi:!0},s=function(){function t(t,e,o,n){this.el=t,this.cdr=e,this.group=o,this.renderer=n,this.onChange=Function.prototype,this.onTouched=Function.prototype}return Object.defineProperty(t.prototype,"value",{get:function(){return this.group?this.group.value:this._value},set:function(t){this.group?this.group.value=t:this._value=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this.setDisabledState(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.btnRadio===this.value},enumerable:!0,configurable:!0}),t.prototype.onClick=function(){this.el.nativeElement.attributes.disabled||!this.uncheckable&&this.btnRadio===this.value||(this.value=this.uncheckable&&this.btnRadio===this.value?void 0:this.btnRadio,this._onChange(this.value))},t.prototype.ngOnInit=function(){this.uncheckable=void 0!==this.uncheckable},t.prototype.onBlur=function(){this.onTouched()},t.prototype._onChange=function(t){if(this.group)return this.group.onTouched(),void this.group.onChange(t);this.onTouched(),this.onChange(t)},t.prototype.writeValue=function(t){this.value=t,this.cdr.markForCheck()},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){t?this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled"):this.renderer.removeAttribute(this.el.nativeElement,"disabled")},t.decorators=[{type:e.Directive,args:[{selector:"[btnRadio]",providers:[r]}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef},{type:a,decorators:[{type:e.Optional}]},{type:e.Renderer2}]},t.propDecorators={btnRadio:[{type:e.Input}],uncheckable:[{type:e.Input}],value:[{type:e.Input}],disabled:[{type:e.Input}],isActive:[{type:e.HostBinding,args:["class.active"]},{type:e.HostBinding,args:["attr.aria-pressed"]}],onClick:[{type:e.HostListener,args:["click"]}]},t}();var u={provide:o.NG_VALUE_ACCESSOR,useExisting:e.forwardRef((function(){return a})),multi:!0},a=function(){function t(t){this.cdr=t,this.onChange=Function.prototype,this.onTouched=Function.prototype}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this._value=t,this.cdr.markForCheck()},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.radioButtons&&this.radioButtons.forEach((function(e){e.setDisabledState(t)}))},t.decorators=[{type:e.Directive,args:[{selector:"[btnRadioGroup]",providers:[u]}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},t.propDecorators={radioButtons:[{type:e.ContentChildren,args:[e.forwardRef((function(){return s}))]}]},t}();var c=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t.decorators=[{type:e.NgModule,args:[{declarations:[i,s,a],exports:[i,s,a]}]}],t}();t.ButtonCheckboxDirective=i,t.ButtonRadioDirective=s,t.ButtonRadioGroupDirective=a,t.ButtonsModule=c,t.ɵa=n,t.ɵb=u,t.ɵc=r,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-bootstrap-buttons.umd.min.js.map