ng2-nouislider
Advanced tools
Comparing version 1.2.0 to 1.3.0
@@ -50,7 +50,7 @@ import { Component } from '@angular/core'; | ||
} | ||
} | ||
}; | ||
public someKeyboard2: number[] = [1, 3]; | ||
private someKeyboard2EventHandler = (e: KeyboardEvent) => { | ||
public someKeyboard2EventHandler = (e: KeyboardEvent) => { | ||
console.log("overridden keyboard handler"); | ||
@@ -85,3 +85,3 @@ | ||
this.someKeyboard2 = newValue; | ||
} | ||
}; | ||
@@ -104,4 +104,4 @@ public someKeyboardConfig2: any = { | ||
keyboard: true, | ||
onKeydown: this.someKeyboard2EventHandler | ||
} | ||
onKeydown: this.someKeyboard2EventHandler, | ||
}; | ||
@@ -130,3 +130,3 @@ changeSomeValue(value: number) { | ||
this.keyupLabelOn = false; | ||
},450); | ||
}, 450); | ||
} | ||
@@ -138,4 +138,4 @@ | ||
this.keydownLabelOn = false; | ||
},450); | ||
}, 450); | ||
} | ||
} |
{ | ||
"name": "ng2-nouislider", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Angular2 noUiSlider component", | ||
@@ -5,0 +5,0 @@ "main": "src/nouislider.js", |
import { ElementRef, OnInit } from '@angular/core'; | ||
import { ControlValueAccessor } from '@angular/forms'; | ||
export declare function toValue(value: string[]): number | number[]; | ||
export declare function toValue(value: string[]): any | any[]; | ||
export interface NouiFormatter { | ||
to(value: any): any; | ||
from(value: any): any; | ||
} | ||
export declare class DefaultFormatter implements NouiFormatter { | ||
to(value: any): any; | ||
from(value: any): any; | ||
} | ||
export declare class NouisliderComponent implements ControlValueAccessor, OnInit { | ||
@@ -14,2 +22,3 @@ private el; | ||
private step; | ||
private format; | ||
private pageSteps; | ||
@@ -16,0 +25,0 @@ private config; |
@@ -16,6 +16,6 @@ "use strict"; | ||
if (value.length == 1) { | ||
return parseFloat(value[0]); | ||
return value[0]; | ||
} | ||
else if (value.length > 1) { | ||
return value.map(parseFloat); | ||
return value; | ||
} | ||
@@ -27,2 +27,15 @@ else { | ||
exports.toValue = toValue; | ||
var DefaultFormatter = (function () { | ||
function DefaultFormatter() { | ||
} | ||
DefaultFormatter.prototype.to = function (value) { | ||
return parseFloat(value); | ||
}; | ||
; | ||
DefaultFormatter.prototype.from = function (value) { | ||
return parseFloat(value).toFixed(2); | ||
}; | ||
return DefaultFormatter; | ||
}()); | ||
exports.DefaultFormatter = DefaultFormatter; | ||
var NouisliderComponent = (function () { | ||
@@ -69,8 +82,8 @@ function NouisliderComponent(el) { | ||
var newValue; | ||
if (typeof (_this.value) == "number") { | ||
newValue = _this.value + delta; | ||
if (Array.isArray(_this.value)) { | ||
newValue = [].concat(_this.value); | ||
newValue[index] = _this.config.format.to(parseFloat(_this.config.format.from(newValue[index])) + delta); | ||
} | ||
else { | ||
newValue = [].concat(_this.value); | ||
newValue[index] += delta; | ||
newValue = _this.config.format.to(parseFloat(_this.config.format.from(_this.value)) + delta); | ||
} | ||
@@ -93,2 +106,3 @@ _this.slider.set(newValue); | ||
})); | ||
inputsConfig.format = this.format || this.config.format || new DefaultFormatter(); | ||
this.slider = noUiSlider.create(this.el.nativeElement.querySelector('div'), Object.assign(this.config, inputsConfig)); | ||
@@ -182,2 +196,6 @@ this.handles = [].slice.call(this.el.nativeElement.querySelectorAll('.noUi-handle')); | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], NouisliderComponent.prototype, "format", void 0); | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Number) | ||
@@ -260,2 +278,2 @@ ], NouisliderComponent.prototype, "pageSteps", void 0); | ||
exports.NouisliderModule = NouisliderModule; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm91aXNsaWRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIm5vdWlzbGlkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUFBLElBQVksVUFBVSxXQUFNLFlBQVksQ0FBQyxDQUFBO0FBQ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xuICAgICAgICBicmVhaztcbiAgICB9XG5cbiAgICBkZWx0YSA9IHNpZ24gKiBtdWx0aXBsaWVyICogc3RlcDtcbiAgICBsZXQgbmV3VmFsdWU6IG51bWJlciB8IG51bWJlcltdO1xuXG4gICAgaWYoQXJyYXkuaXNBcnJheSh0aGlzLnZhbHVlKSkge1xuICAgICAgbmV3VmFsdWUgPSBbXS5jb25jYXQodGhpcy52YWx1ZSk7XG4gICAgICBuZXdWYWx1ZVtpbmRleF0gPSB0aGlzLmNvbmZpZy5mb3JtYXQudG8ocGFyc2VGbG9hdCh0aGlzLmNvbmZpZy5mb3JtYXQuZnJvbShuZXdWYWx1ZVtpbmRleF0pKSArIGRlbHRhKTtcbiAgICB9IGVsc2Uge1xuICAgICAgbmV3VmFsdWUgPSB0aGlzLmNvbmZpZy5mb3JtYXQudG8ocGFyc2VGbG9hdCh0aGlzLmNvbmZpZy5mb3JtYXQuZnJvbSh0aGlzLnZhbHVlKSkgKyBkZWx0YSk7XG4gICAgfVxuXG4gICAgdGhpcy5zbGlkZXIuc2V0KG5ld1ZhbHVlKTtcbiAgfVxufVxuXG5cbkBOZ01vZHVsZSh7XG4gIGltcG9ydHM6IFtdLFxuICBleHBvcnRzOiBbTm91aXNsaWRlckNvbXBvbmVudF0sXG4gIGRlY2xhcmF0aW9uczogW05vdWlzbGlkZXJDb21wb25lbnRdLFxufSlcbmV4cG9ydCBjbGFzcyBOb3Vpc2xpZGVyTW9kdWxlIHsgfVxuIl19 |
@@ -17,7 +17,7 @@ import * as noUiSlider from 'nouislider'; | ||
export function toValue(value: string[]): number|number[] { | ||
export function toValue(value: string[]): any | any[] { | ||
if (value.length == 1) { | ||
return parseFloat(value[0]); | ||
return value[0]; | ||
} else if (value.length > 1) { | ||
return value.map(parseFloat); | ||
return value; | ||
} else { | ||
@@ -28,2 +28,17 @@ return 0; | ||
export interface NouiFormatter { | ||
to(value: any): any; | ||
from(value: any): any; | ||
} | ||
export class DefaultFormatter implements NouiFormatter { | ||
to(value: any): any { | ||
return parseFloat(value); | ||
}; | ||
from(value: any): any { | ||
return parseFloat(value).toFixed(2); | ||
} | ||
} | ||
@Component({ | ||
@@ -51,2 +66,3 @@ selector: 'nouislider', | ||
export class NouisliderComponent implements ControlValueAccessor, OnInit { | ||
public slider: any; | ||
@@ -60,2 +76,3 @@ public handles: any[]; | ||
@Input() private step: number; | ||
@Input() private format: NouiFormatter; | ||
@Input() private pageSteps: number; | ||
@@ -91,2 +108,4 @@ @Input() private config: any = {}; | ||
inputsConfig.format = this.format || this.config.format || new DefaultFormatter(); | ||
this.slider = noUiSlider.create( | ||
@@ -121,3 +140,3 @@ this.el.nativeElement.querySelector('div'), | ||
} | ||
if(this.value !== undefined) { | ||
if (this.value !== undefined) { | ||
this.set.emit(v); | ||
@@ -197,8 +216,9 @@ this.onChange(v); | ||
if (typeof(this.value) == "number") { | ||
newValue = this.value + delta; | ||
if(Array.isArray(this.value)) { | ||
newValue = [].concat(this.value); | ||
newValue[index] = this.config.format.to(parseFloat(this.config.format.from(newValue[index])) + delta); | ||
} else { | ||
newValue = [].concat(this.value); | ||
newValue[index] += delta; | ||
newValue = this.config.format.to(parseFloat(this.config.format.from(this.value)) + delta); | ||
} | ||
this.slider.set(newValue); | ||
@@ -205,0 +225,0 @@ } |
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
70834
24
655