@ngx-tiny/switch-input
Version:
  {"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("@ngx-tiny/switch-input",["exports","@angular/core","@angular/forms","@angular/common"],n):n(((t=t||self)["ngx-tiny"]=t["ngx-tiny"]||{},t["ngx-tiny"]["switch-input"]={}),t.ng.core,t.ng.forms,t.ng.common)}(this,(function(t,n,e,i){"use strict";var o=0,a=function(){function t(){this.instanceId="ngx-switch-input-"+o++,this._value=!1,this.valueChange=new n.EventEmitter,this.onChange=function(t){},this.onTouched=function(){}}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t,this.onChange(t),this.onTouched(),this.valueChange.emit(t)},enumerable:!1,configurable:!0}),t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.writeValue=function(t){t!==this.value&&(this.value=t)},t.prototype.switch=function(){this.value=!this.value},t}();a.decorators=[{type:n.Component,args:[{selector:"ngx-switch-input",template:'<label [for]="instanceId" class="ngx-switch-input">\r\n <span *ngIf="label" class="ngx-switch-input-label">{{label}}</span>\r\n <div class="ngx-switch-input-wrap" [ngClass]="{ \'ngx-switch-input-checked\': value }">\r\n <input type="checkbox" [id]="instanceId" class="ngx-switch-input-input" [checked]="value" (change)="switch()" [attr.aria-label]="label">\r\n <span class="ngx-switch-input-background"></span>\r\n <span class="ngx-switch-input-handle"></span>\r\n </div>\r\n</label>',changeDetection:n.ChangeDetectionStrategy.Default,providers:[{provide:e.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return a})),multi:!0}],encapsulation:n.ViewEncapsulation.None,styles:["ngx-switch-input{display:inline-block}.ngx-switch-input{padding:5px 0}.ngx-switch-input-wrap{cursor:pointer;display:inline-block;overflow:visible;padding:1px 0;position:relative;vertical-align:top}.ngx-switch-input-label{cursor:pointer;display:inline-block;font-size:15px;padding-right:5px;padding-top:5px}.ngx-switch-input-handle{background:#fff;border-radius:100%;height:16px;left:3px;position:absolute;top:6px;transition:left .15s ease-out;width:16px}.ngx-switch-input-input{left:0;opacity:0;position:absolute;top:0}.ngx-switch-input-background{background:#ccc;border-radius:15px;display:block;font-size:16px;font-weight:400;height:26px;position:relative;text-transform:uppercase;transition:.15s ease-out;transition-property:opacity background;width:45px}.ngx-switch-input-background:after,.ngx-switch-input-background:before{line-height:1;margin-top:-7px;position:absolute;top:50%;transition:inherit}.ngx-switch-input-checked .ngx-switch-input-background{background:#3d3d3d}.ngx-switch-input-checked .ngx-switch-input-background:before{opacity:0}.ngx-switch-input-checked .ngx-switch-input-background:after{opacity:1}.ngx-switch-input-checked .ngx-switch-input-handle{left:25px}"]}]}],a.propDecorators={label:[{type:n.Input}],_value:[{type:n.Input,args:["value"]}],valueChange:[{type:n.Output}]};var s=function(){};s.decorators=[{type:n.NgModule,args:[{imports:[i.CommonModule],declarations:[a],exports:[a]}]}],t.NgxSwitchInputComponent=a,t.NgxSwitchInputModule=s,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ngx-tiny-switch-input.umd.min.js.map