ng-jhipster
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -78,3 +78,3 @@ { | ||
}, | ||
"version": "0.0.13" | ||
"version": "0.0.14" | ||
} |
@@ -1,4 +0,6 @@ | ||
import { ElementRef, Renderer } from '@angular/core'; | ||
export declare class ShowValidationDirective { | ||
constructor(el: ElementRef, renderer: Renderer); | ||
import { ElementRef, AfterViewInit } from '@angular/core'; | ||
export declare class ShowValidationDirective implements AfterViewInit { | ||
private el; | ||
constructor(el: ElementRef); | ||
ngAfterViewInit(): void; | ||
} |
@@ -1,22 +0,18 @@ | ||
import { Directive, ElementRef, Renderer } from '@angular/core'; | ||
import { Directive, ElementRef } from '@angular/core'; | ||
export var ShowValidationDirective = (function () { | ||
function ShowValidationDirective(el, renderer) { | ||
var formElements = el.nativeElement.querySelectorAll('.form-group'); | ||
Array.prototype.forEach.call(formElements, function (formGroup) { | ||
// TODO this needs to be properly tested | ||
function ShowValidationDirective(el) { | ||
this.el = el; | ||
} | ||
ShowValidationDirective.prototype.ngAfterViewInit = function () { | ||
var formElements = this.el.nativeElement.querySelectorAll('.form-group'); | ||
formElements.forEach(function (formGroup) { | ||
var inputs = formGroup.querySelectorAll('input[(ngModel)],textarea[(ngModel)],select[(ngModel)]'); | ||
if (inputs !== null) { | ||
Array.prototype.forEach.call(inputs, function (input) { | ||
// TODO this logic needs to be checked and fixed accordingly | ||
if (inputs) { | ||
inputs.forEach(function (input) { | ||
var isInvalid = input.classList.contains('ng-invalid') && input.classList.contains('ng-dirty'); | ||
formGroup.classList.toggle('has-error', isInvalid); | ||
/*scope.$watch(function() { | ||
return $input.hasClass('ng-invalid') && $input.hasClass('ng-dirty'); | ||
}, function(isInvalid) { | ||
$formGroup.toggleClass('has-error', isInvalid); | ||
});*/ | ||
}); | ||
} | ||
}); | ||
} | ||
}; | ||
ShowValidationDirective.decorators = [ | ||
@@ -28,5 +24,4 @@ { type: Directive, args: [{ selector: 'form[jhiShowValidation]' },] }, | ||
{ type: ElementRef, }, | ||
{ type: Renderer, }, | ||
]; }; | ||
return ShowValidationDirective; | ||
}()); |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"ShowValidationDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[jhiShowValidation]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"}]}]}}}},{"__symbolic":"module","version":1,"metadata":{"ShowValidationDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[jhiShowValidation]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"},{"__symbolic":"reference","module":"@angular/core","name":"Renderer"}]}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"ShowValidationDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[jhiShowValidation]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"ShowValidationDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"form[jhiShowValidation]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterViewInit":[{"__symbolic":"method"}]}}}}] |
@@ -18,3 +18,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
*/ | ||
if (interceptors.length > 0) { | ||
if (interceptors && interceptors.length > 0) { | ||
interceptors.reduce(function (chain, current) { | ||
@@ -43,6 +43,6 @@ chain.successor = current; | ||
InterceptableHttp.prototype.getRequestOptionArgs = function (options) { | ||
if (options == null) { | ||
if (!options) { | ||
options = new RequestOptions(); | ||
} | ||
if (options.headers == null) { | ||
if (!options.headers) { | ||
options.headers = new Headers(); | ||
@@ -49,0 +49,0 @@ } |
import { FilterPipe, KeysPipe, OrderByPipe, TruncateCharactersPipe } from './pipe'; | ||
import { ShowValidationDirective, JhiSortByDirective } from './directive'; | ||
import { MaxbytesValidatorDirective, MinbytesValidatorDirective, ShowValidationDirective, JhiSortDirective, JhiSortByDirective } from './directive'; | ||
import { JhiItemCountComponent } from './component'; | ||
import { DataUtils, DateUtils, EventManager, ParseLinks, PaginationUtil, Base64 } from './service'; | ||
export declare const JHI_PIPES: (typeof TruncateCharactersPipe | typeof OrderByPipe | typeof FilterPipe | typeof KeysPipe)[]; | ||
export declare const JHI_DIRECTIVES: (typeof ShowValidationDirective | typeof JhiSortByDirective)[]; | ||
export declare const JHI_DIRECTIVES: (typeof MaxbytesValidatorDirective | typeof MinbytesValidatorDirective | typeof ShowValidationDirective | typeof JhiSortDirective | typeof JhiSortByDirective)[]; | ||
export declare const JHI_COMPONENTS: typeof JhiItemCountComponent[]; | ||
export declare const JHI_SERVICES: (typeof PaginationUtil | typeof ParseLinks | typeof DataUtils | typeof DateUtils | typeof EventManager | typeof Base64)[]; |
import { PipeTransform } from '@angular/core'; | ||
export declare class OrderByPipe implements PipeTransform { | ||
transform(value: Array<any>, predicate: string, reverse: boolean): any; | ||
transform(values: any[], predicate?: string, reverse?: boolean): any; | ||
} |
@@ -5,15 +5,17 @@ import { Pipe } from '@angular/core'; | ||
} | ||
OrderByPipe.prototype.transform = function (value, predicate, reverse) { | ||
value = value.slice(0).sort(function (a, b) { | ||
OrderByPipe.prototype.transform = function (values, predicate, reverse) { | ||
if (predicate === void 0) { predicate = ''; } | ||
if (reverse === void 0) { reverse = false; } | ||
if (predicate === '') { | ||
return reverse ? values.sort().reverse() : values.sort(); | ||
} | ||
return values.sort(function (a, b) { | ||
if (a[predicate] < b[predicate]) { | ||
return -1; | ||
return reverse ? 1 : -1; | ||
} | ||
else if ([b[predicate] < a[predicate]]) { | ||
return 1; | ||
else if (b[predicate] < a[predicate]) { | ||
return reverse ? -1 : 1; | ||
} | ||
else { | ||
return 0; | ||
} | ||
return 0; | ||
}); | ||
return reverse ? value.reverse() : value; | ||
}; | ||
@@ -20,0 +22,0 @@ OrderByPipe.decorators = [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
907654
7847