angular-switchery
Advanced tools
Comparing version 0.3.1 to 0.3.3
@@ -5,7 +5,2 @@ import { CommonModule } from '@angular/common'; | ||
var ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR = { | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(function () { return AngularSwitcheryComponent; }), | ||
multi: true | ||
}; | ||
var AngularSwitcheryComponent = (function () { | ||
@@ -16,4 +11,4 @@ function AngularSwitcheryComponent() { | ||
this.change = new EventEmitter(); | ||
this.onTouchedCallback = function (v) { }; | ||
this.onChangeCallback = function (v) { }; | ||
this.onTouchedCallback = function (checked) { }; | ||
this.onChangeCallback = function (checked) { }; | ||
this.onClick = function () { | ||
@@ -66,9 +61,7 @@ if (this.isDisabled()) { | ||
/** | ||
* @param {?} obj | ||
* @param {?} checked | ||
* @return {?} | ||
*/ | ||
AngularSwitcheryComponent.prototype.writeValue = function (obj) { | ||
if (obj !== this.checked) { | ||
this.checked = !!obj; | ||
} | ||
AngularSwitcheryComponent.prototype.writeValue = function (checked) { | ||
this.checked = !!checked; | ||
}; | ||
@@ -96,3 +89,7 @@ /** | ||
template: "<span (keydown)=\"onKeyDown($event)\" tabindex=\"0\" [class]=\"className\" (click)=\"onClick()\" [class.disabled]=\"isDisabled()\">\n <small [ngClass]=\"{'checked': checked}\"></small></span>", | ||
providers: [ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR] | ||
providers: [{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(function () { return AngularSwitcheryComponent; }), | ||
multi: true | ||
}] | ||
},] }, | ||
@@ -99,0 +96,0 @@ ]; |
@@ -5,7 +5,2 @@ import { CommonModule } from '@angular/common'; | ||
const ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR = { | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => AngularSwitcheryComponent), | ||
multi: true | ||
}; | ||
class AngularSwitcheryComponent { | ||
@@ -16,4 +11,4 @@ constructor() { | ||
this.change = new EventEmitter(); | ||
this.onTouchedCallback = (v) => { }; | ||
this.onChangeCallback = (v) => { }; | ||
this.onTouchedCallback = (checked) => { }; | ||
this.onChangeCallback = (checked) => { }; | ||
this.onClick = function () { | ||
@@ -62,9 +57,7 @@ if (this.isDisabled()) { | ||
/** | ||
* @param {?} obj | ||
* @param {?} checked | ||
* @return {?} | ||
*/ | ||
writeValue(obj) { | ||
if (obj !== this.checked) { | ||
this.checked = !!obj; | ||
} | ||
writeValue(checked) { | ||
this.checked = !!checked; | ||
} | ||
@@ -92,3 +85,7 @@ /** | ||
<small [ngClass]="{'checked': checked}"></small></span>`, | ||
providers: [ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR] | ||
providers: [{ | ||
provide: NG_VALUE_ACCESSOR, | ||
useExisting: forwardRef(() => AngularSwitcheryComponent), | ||
multi: true | ||
}] | ||
},] }, | ||
@@ -95,0 +92,0 @@ ]; |
@@ -14,6 +14,6 @@ import { EventEmitter } from '@angular/core'; | ||
isDisabled(): boolean; | ||
writeValue(obj: any): void; | ||
registerOnChange(fn: any): void; | ||
registerOnTouched(fn: any): void; | ||
writeValue(checked: boolean): void; | ||
registerOnChange(fn: () => void): void; | ||
registerOnTouched(fn: () => void): void; | ||
onClick: () => void; | ||
} |
@@ -7,7 +7,2 @@ (function (global, factory) { | ||
var ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR = { | ||
provide: _angular_forms.NG_VALUE_ACCESSOR, | ||
useExisting: _angular_core.forwardRef(function () { return AngularSwitcheryComponent; }), | ||
multi: true | ||
}; | ||
var AngularSwitcheryComponent = (function () { | ||
@@ -18,4 +13,4 @@ function AngularSwitcheryComponent() { | ||
this.change = new _angular_core.EventEmitter(); | ||
this.onTouchedCallback = function (v) { }; | ||
this.onChangeCallback = function (v) { }; | ||
this.onTouchedCallback = function (checked) { }; | ||
this.onChangeCallback = function (checked) { }; | ||
this.onClick = function () { | ||
@@ -68,9 +63,7 @@ if (this.isDisabled()) { | ||
/** | ||
* @param {?} obj | ||
* @param {?} checked | ||
* @return {?} | ||
*/ | ||
AngularSwitcheryComponent.prototype.writeValue = function (obj) { | ||
if (obj !== this.checked) { | ||
this.checked = !!obj; | ||
} | ||
AngularSwitcheryComponent.prototype.writeValue = function (checked) { | ||
this.checked = !!checked; | ||
}; | ||
@@ -98,3 +91,7 @@ /** | ||
template: "<span (keydown)=\"onKeyDown($event)\" tabindex=\"0\" [class]=\"className\" (click)=\"onClick()\" [class.disabled]=\"isDisabled()\">\n <small [ngClass]=\"{'checked': checked}\"></small></span>", | ||
providers: [ANGULAR_SWITCHERY_CONTROL_VALUE_ACCESSOR] | ||
providers: [{ | ||
provide: _angular_forms.NG_VALUE_ACCESSOR, | ||
useExisting: _angular_core.forwardRef(function () { return AngularSwitcheryComponent; }), | ||
multi: true | ||
}] | ||
},] }, | ||
@@ -101,0 +98,0 @@ ]; |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms"],t):t(e.angularSwitchery=e.angularSwitchery||{},e.ng.common,e.ng.core,e._angular_forms)}(this,function(e,t,o,i){"use strict";var n={provide:i.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return r}),multi:!0},r=function(){function e(){this.checked=!1,this.className="switchery",this.change=new o.EventEmitter,this.onTouchedCallback=function(e){},this.onChangeCallback=function(e){},this.onClick=function(){this.isDisabled()||(this.checked=!this.checked,this.change.emit(this.checked),this.onChangeCallback(this.checked),this.onTouchedCallback(this.checked))}}return Object.defineProperty(e.prototype,"disabled",{set:function(e){this._disabled=!1!==e},enumerable:!0,configurable:!0}),e.prototype.onKeyDown=function(e){39===e.keyCode&&(this.checked=!0),37===e.keyCode&&(this.checked=!1),32===e.keyCode&&(this.checked=!this.checked)},e.prototype.isDisabled=function(){return this._disabled},e.prototype.writeValue=function(e){e!==this.checked&&(this.checked=!!e)},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e}();r.decorators=[{type:o.Component,args:[{selector:"angular-switchery",styles:[".switchery { background-color: #64bd63; border: 1px solid #dfdfdf; border-radius: 20px; cursor: pointer; display: inline-block; height: 30px; position: relative; vertical-align: middle; width: 50px; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-background-clip: content-box; background-clip: content-box; } .switchery > small { background: #fff; border-radius: 100%; box-shadow: 0 1px 3px #dfdfdf; height: 30px; position: absolute; top: 0; width: 30px; } .switchery > small.checked { right: 0px; } /* Switchery sizes. */ .switchery-small { border-radius: 20px; height: 20px; width: 33px; } .switchery-small > small { height: 20px; width: 20px; } .switchery-large { border-radius: 40px; height: 40px; width: 66px; } .switchery-large > small { height: 40px; width: 40px; } .disabled { opacity: .50; cursor: not-allowed; } "],template:'<span (keydown)="onKeyDown($event)" tabindex="0" [class]="className" (click)="onClick()" [class.disabled]="isDisabled()">\n <small [ngClass]="{\'checked\': checked}"></small></span>',providers:[n]}]}],r.ctorParameters=function(){return[]},r.propDecorators={className:[{type:o.Input}],disabled:[{type:o.Input}],change:[{type:o.Output}]};var c=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();c.decorators=[{type:o.NgModule,args:[{declarations:[r],exports:[r],imports:[t.CommonModule]}]}],c.ctorParameters=function(){return[]},e.AngularSwitcheryModule=c,e.ɵa=r,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","@angular/forms"],t):t(e.angularSwitchery=e.angularSwitchery||{},e.ng.common,e.ng.core,e._angular_forms)}(this,function(e,t,o,n){"use strict";var i=function(){function e(){this.checked=!1,this.className="switchery",this.change=new o.EventEmitter,this.onTouchedCallback=function(e){},this.onChangeCallback=function(e){},this.onClick=function(){this.isDisabled()||(this.checked=!this.checked,this.change.emit(this.checked),this.onChangeCallback(this.checked),this.onTouchedCallback(this.checked))}}return Object.defineProperty(e.prototype,"disabled",{set:function(e){this._disabled=!1!==e},enumerable:!0,configurable:!0}),e.prototype.onKeyDown=function(e){39===e.keyCode&&(this.checked=!0),37===e.keyCode&&(this.checked=!1),32===e.keyCode&&(this.checked=!this.checked)},e.prototype.isDisabled=function(){return this._disabled},e.prototype.writeValue=function(e){this.checked=!!e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e}();i.decorators=[{type:o.Component,args:[{selector:"angular-switchery",styles:[".switchery { background-color: #64bd63; border: 1px solid #dfdfdf; border-radius: 20px; cursor: pointer; display: inline-block; height: 30px; position: relative; vertical-align: middle; width: 50px; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -webkit-background-clip: content-box; background-clip: content-box; } .switchery > small { background: #fff; border-radius: 100%; box-shadow: 0 1px 3px #dfdfdf; height: 30px; position: absolute; top: 0; width: 30px; } .switchery > small.checked { right: 0px; } /* Switchery sizes. */ .switchery-small { border-radius: 20px; height: 20px; width: 33px; } .switchery-small > small { height: 20px; width: 20px; } .switchery-large { border-radius: 40px; height: 40px; width: 66px; } .switchery-large > small { height: 40px; width: 40px; } .disabled { opacity: .50; cursor: not-allowed; } "],template:'<span (keydown)="onKeyDown($event)" tabindex="0" [class]="className" (click)="onClick()" [class.disabled]="isDisabled()">\n <small [ngClass]="{\'checked\': checked}"></small></span>',providers:[{provide:n.NG_VALUE_ACCESSOR,useExisting:o.forwardRef(function(){return i}),multi:!0}]}]}],i.ctorParameters=function(){return[]},i.propDecorators={className:[{type:o.Input}],disabled:[{type:o.Input}],change:[{type:o.Output}]};var r=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[]}},e}();r.decorators=[{type:o.NgModule,args:[{declarations:[i],exports:[i],imports:[t.CommonModule]}]}],r.ctorParameters=function(){return[]},e.AngularSwitcheryModule=r,e.ɵa=i,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=angular-switchery.umd.min.js.map |
{ | ||
"name": "angular-switchery", | ||
"version": "0.3.1", | ||
"version": "0.3.3", | ||
"description": "Angular Switchery, an Angular library", | ||
@@ -79,3 +79,3 @@ "main": "./bundles/angular-switchery.umd.js", | ||
"es2015": "./angular-switchery.js", | ||
"types": "./index.d.ts", | ||
"typings": "./angular-switchery.d.ts", | ||
"dependencies": { | ||
@@ -82,0 +82,0 @@ "@angular/common": "^4.0.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
50317
456