ng2-validation
Advanced tools
Comparing version 1.2.13 to 1.3.0
@@ -1,9 +0,2 @@ | ||
import { RangeLengthValidator } from "./directives/range-length"; | ||
import { MinValidator } from './directives/min'; | ||
import { MaxValidator } from './directives/max'; | ||
import { RangeValidator } from './directives/range'; | ||
import { DigitsValidator } from './directives/digits'; | ||
import { PhoneValidator } from './directives/phone'; | ||
import { UUIDValidator } from './directives/uuid'; | ||
import { EqualValidator } from './directives/equal'; | ||
export declare const CUSTOM_FORM_DIRECTIVES: (typeof RangeLengthValidator | typeof MinValidator | typeof MaxValidator | typeof RangeValidator | typeof DigitsValidator | typeof PhoneValidator | typeof UUIDValidator | typeof EqualValidator)[]; | ||
export declare const CUSTOM_FORM_DIRECTIVES: typeof DigitsValidator[]; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class EqualValidator implements Validator { | ||
export declare class EqualValidator implements Validator, OnInit { | ||
equal: string; | ||
private validator; | ||
constructor(equal: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var EqualValidator = (function () { | ||
function EqualValidator(equal) { | ||
this.validator = _1.CustomValidators.equal(equal); | ||
function EqualValidator() { | ||
} | ||
EqualValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.equal(this.equal); | ||
}; | ||
EqualValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', String) | ||
], EqualValidator.prototype, "equal", void 0); | ||
EqualValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [EQUAL_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('equal')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], EqualValidator); | ||
@@ -40,0 +42,0 @@ return EqualValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class MaxValidator implements Validator { | ||
export declare class MaxValidator implements Validator, OnInit { | ||
max: number; | ||
private validator; | ||
constructor(max: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var MaxValidator = (function () { | ||
function MaxValidator(max) { | ||
this.validator = _1.CustomValidators.max(parseFloat(max)); | ||
function MaxValidator() { | ||
} | ||
MaxValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.max(this.max); | ||
}; | ||
MaxValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Number) | ||
], MaxValidator.prototype, "max", void 0); | ||
MaxValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [MAX_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('max')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], MaxValidator); | ||
@@ -40,0 +42,0 @@ return MaxValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class MinValidator implements Validator { | ||
export declare class MinValidator implements Validator, OnInit { | ||
min: number; | ||
private validator; | ||
constructor(min: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var MinValidator = (function () { | ||
function MinValidator(min) { | ||
this.validator = _1.CustomValidators.min(parseFloat(min)); | ||
function MinValidator() { | ||
} | ||
MinValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.min(this.min); | ||
}; | ||
MinValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Number) | ||
], MinValidator.prototype, "min", void 0); | ||
MinValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [MIN_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('min')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], MinValidator); | ||
@@ -40,0 +42,0 @@ return MinValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class PhoneValidator implements Validator { | ||
export declare class PhoneValidator implements Validator, OnInit { | ||
phone: string; | ||
private validator; | ||
constructor(phone: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var PhoneValidator = (function () { | ||
function PhoneValidator(phone) { | ||
this.validator = _1.CustomValidators.phone(phone); | ||
function PhoneValidator() { | ||
} | ||
PhoneValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.phone(this.phone); | ||
}; | ||
PhoneValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', String) | ||
], PhoneValidator.prototype, "phone", void 0); | ||
PhoneValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [PHONE_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('phone')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], PhoneValidator); | ||
@@ -40,0 +42,0 @@ return PhoneValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class RangeLengthValidator implements Validator { | ||
export declare class RangeLengthValidator implements Validator, OnInit { | ||
rangeLength: [number]; | ||
private validator; | ||
constructor(rangeLength: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var RangeLengthValidator = (function () { | ||
function RangeLengthValidator(rangeLength) { | ||
this.validator = _1.CustomValidators.rangeLength(JSON.parse(rangeLength)); | ||
function RangeLengthValidator() { | ||
} | ||
RangeLengthValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.rangeLength(this.rangeLength); | ||
}; | ||
RangeLengthValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], RangeLengthValidator.prototype, "rangeLength", void 0); | ||
RangeLengthValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [RANGE_LENGTH_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('rangeLength')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], RangeLengthValidator); | ||
@@ -40,0 +42,0 @@ return RangeLengthValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class RangeValidator implements Validator { | ||
export declare class RangeValidator implements Validator, OnInit { | ||
range: [number]; | ||
private validator; | ||
constructor(range: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var RangeValidator = (function () { | ||
function RangeValidator(range) { | ||
this.validator = _1.CustomValidators.range(JSON.parse(range)); | ||
function RangeValidator() { | ||
} | ||
RangeValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.range(this.range); | ||
}; | ||
RangeValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Array) | ||
], RangeValidator.prototype, "range", void 0); | ||
RangeValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [RANGE_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('range')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], RangeValidator); | ||
@@ -40,0 +42,0 @@ return RangeValidator; |
@@ -0,5 +1,7 @@ | ||
import { OnInit } from '@angular/core'; | ||
import { Validator, AbstractControl } from '@angular/forms'; | ||
export declare class UUIDValidator implements Validator { | ||
export declare class UUIDValidator implements Validator, OnInit { | ||
uuid: any; | ||
private validator; | ||
constructor(uuid: string); | ||
ngOnInit(): void; | ||
validate(c: AbstractControl): { | ||
@@ -6,0 +8,0 @@ [key: string]: any; |
@@ -11,5 +11,2 @@ "use strict"; | ||
}; | ||
var __param = (this && this.__param) || function (paramIndex, decorator) { | ||
return function (target, key) { decorator(target, key, paramIndex); } | ||
}; | ||
var core_1 = require('@angular/core'); | ||
@@ -24,8 +21,14 @@ var forms_1 = require('@angular/forms'); | ||
var UUIDValidator = (function () { | ||
function UUIDValidator(uuid) { | ||
this.validator = _1.CustomValidators.uuid(uuid); | ||
function UUIDValidator() { | ||
} | ||
UUIDValidator.prototype.ngOnInit = function () { | ||
this.validator = _1.CustomValidators.uuid(this.uuid); | ||
}; | ||
UUIDValidator.prototype.validate = function (c) { | ||
return this.validator(c); | ||
}; | ||
__decorate([ | ||
core_1.Input(), | ||
__metadata('design:type', Object) | ||
], UUIDValidator.prototype, "uuid", void 0); | ||
UUIDValidator = __decorate([ | ||
@@ -35,5 +38,4 @@ core_1.Directive({ | ||
providers: [UUID_VALIDATOR] | ||
}), | ||
__param(0, core_1.Attribute('uuid')), | ||
__metadata('design:paramtypes', [String]) | ||
}), | ||
__metadata('design:paramtypes', []) | ||
], UUIDValidator); | ||
@@ -40,0 +42,0 @@ return UUIDValidator; |
{ | ||
"name": "ng2-validation", | ||
"version": "1.2.13", | ||
"version": "1.3.0", | ||
"description": "angular2 validation", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1089
89357
62
1
0