ng2-nouislider
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "ng2-nouislider", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Angular2 noUiSlider component", | ||
@@ -51,3 +51,3 @@ "main": "src/nouislider.js", | ||
"node-sass": "^3.7.0", | ||
"nouislider": "^8.4.0", | ||
"nouislider": "^9.0.0", | ||
"raw-loader": "^0.5.1", | ||
@@ -54,0 +54,0 @@ "reflect-metadata": "^0.1.3", |
@@ -19,6 +19,18 @@ # ng2-nouislider | ||
Styles | ||
### Styles | ||
@import "~nouislider/distribute/nouislider.min.css"; | ||
### SystemJS config | ||
Add to map: | ||
'nouislider': 'node_modules/nouislider', | ||
'ng2-nouislider': 'node_modules/ng2-nouislider', | ||
Add to packages: | ||
'nouislider': { main: 'distribute/nouislider.js', defaultExtension: 'js' }, | ||
'ng2-nouislider': { main: 'src/nouislider.js', defaultExtension: 'js' }, | ||
## Usage | ||
@@ -25,0 +37,0 @@ |
@@ -15,3 +15,2 @@ import { ElementRef, OnInit } from '@angular/core'; | ||
private ngModel; | ||
private ngModelChange; | ||
private change; | ||
@@ -18,0 +17,0 @@ private update; |
@@ -30,3 +30,2 @@ "use strict"; | ||
this.config = {}; | ||
this.ngModelChange = new core_1.EventEmitter(true); | ||
this.change = new core_1.EventEmitter(true); | ||
@@ -40,3 +39,2 @@ this.update = new core_1.EventEmitter(true); | ||
this.onTouched = Function.prototype; | ||
this.change = this.ngModelChange; | ||
} | ||
@@ -55,4 +53,11 @@ NouisliderComponent.prototype.ngOnInit = function () { | ||
this.slider.on('set', function (value) { | ||
_this.writeValue(toValue(value)); | ||
_this.set.emit(_this.value); | ||
var v = toValue(value); | ||
if (_this.value == v || String(_this.value) == String(v)) { | ||
return; | ||
} | ||
if (_this.value !== undefined) { | ||
_this.set.emit(v); | ||
_this.onChange(v); | ||
} | ||
_this.value = v; | ||
}); | ||
@@ -62,2 +67,5 @@ this.slider.on('update', function () { | ||
}); | ||
this.slider.on('change', function () { | ||
_this.change.emit(_this.value); | ||
}); | ||
this.slider.on('slide', function () { | ||
@@ -74,10 +82,2 @@ _this.slide.emit(_this.value); | ||
NouisliderComponent.prototype.writeValue = function (value) { | ||
if (this.value == value || String(this.value) == String(value)) { | ||
return; | ||
} | ||
// avoid triggering change event on slider initialization | ||
if (this.value !== undefined) { | ||
this.ngModelChange.emit(value); | ||
} | ||
this.value = value; | ||
if (this.slider) { | ||
@@ -128,6 +128,2 @@ this.slider.set(value); | ||
__metadata('design:type', core_1.EventEmitter) | ||
], NouisliderComponent.prototype, "ngModelChange", void 0); | ||
__decorate([ | ||
core_1.Output(), | ||
__metadata('design:type', core_1.EventEmitter) | ||
], NouisliderComponent.prototype, "change", void 0); | ||
@@ -189,2 +185,2 @@ __decorate([ | ||
exports.NouisliderModule = NouisliderModule; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm91aXNsaWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm5vdWlzbGlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLElBQVksVUFBVSxXQUFNLFlBQVksQ0FBQyxDQUFBO0FBQ3pDLHFCQVNPLGVBQWUsQ0FBQyxDQUFBO0FBQ3ZCLHNCQUdPLGdCQUFnQixDQUFDLENBQUE7QUFFeEIsaUJBQXdCLEtBQWU7SUFDckMsRUFBRSxDQUFDLENBQUMsS0FBSyxDQUFDLE1BQU0sSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ3RCLE1BQU0sQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDOUIsQ0FBQztJQUFDLElBQUksQ0FBQyxFQUFFLENBQUMsQ0FBQyxLQUFLLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDNUIsTUFBTSxDQUFDLEtBQ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B9XG59XG5cblxuQE5nTW9kdWxlKHtcbiAgaW1wb3J0czogW10sXG4gIGV4cG9ydHM6IFtOb3Vpc2xpZGVyQ29tcG9uZW50XSxcbiAgZGVjbGFyYXRpb25zOiBbTm91aXNsaWRlckNvbXBvbmVudF0sXG59KVxuZXhwb3J0IGNsYXNzIE5vdWlzbGlkZXJNb2R1bGUgeyB9XG4iXX0= |
@@ -58,3 +58,2 @@ import * as noUiSlider from 'nouislider'; | ||
@Input() private ngModel: number | number[]; | ||
@Output() private ngModelChange: EventEmitter<any> = new EventEmitter(true); | ||
@Output() private change: EventEmitter<any> = new EventEmitter(true); | ||
@@ -70,5 +69,3 @@ @Output() private update: EventEmitter<any> = new EventEmitter(true); | ||
constructor(private el: ElementRef) { | ||
this.change = this.ngModelChange; | ||
} | ||
constructor(private el: ElementRef) { } | ||
@@ -91,4 +88,11 @@ ngOnInit(): void { | ||
this.slider.on('set', (value: any) => { | ||
this.writeValue(toValue(value)); | ||
this.set.emit(this.value); | ||
let v = toValue(value); | ||
if (this.value == v || String(this.value) == String(v)) { | ||
return; | ||
} | ||
if(this.value !== undefined) { | ||
this.set.emit(v); | ||
this.onChange(v); | ||
} | ||
this.value = v; | ||
}); | ||
@@ -100,2 +104,6 @@ | ||
this.slider.on('change', () => { | ||
this.change.emit(this.value); | ||
}); | ||
this.slider.on('slide', () => { | ||
@@ -115,13 +123,2 @@ this.slide.emit(this.value); | ||
writeValue(value: any): void { | ||
if (this.value == value || String(this.value) == String(value)) { | ||
return; | ||
} | ||
// avoid triggering change event on slider initialization | ||
if (this.value !== undefined) { | ||
this.ngModelChange.emit(value); | ||
} | ||
this.value = value; | ||
if (this.slider) { | ||
@@ -128,0 +125,0 @@ this.slider.set(value); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96476
48
396