|
|
|
@ -96,7 +96,7 @@ export class GfPortfolioFilterFormComponent |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public hasFilters(): boolean { |
|
|
|
public hasFilters() { |
|
|
|
const formValue = this.filterForm.value; |
|
|
|
|
|
|
|
return Object.values(formValue).some((value) => { |
|
|
|
@ -107,7 +107,7 @@ export class GfPortfolioFilterFormComponent |
|
|
|
public holdingComparisonFunction( |
|
|
|
option: PortfolioPosition, |
|
|
|
value: PortfolioPosition |
|
|
|
): boolean { |
|
|
|
) { |
|
|
|
if (value === null) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
@ -131,26 +131,26 @@ export class GfPortfolioFilterFormComponent |
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
} |
|
|
|
|
|
|
|
public onApplyFilters(): void { |
|
|
|
public onApplyFilters() { |
|
|
|
this.filterForm.markAsPristine(); |
|
|
|
this.onChange(this.filterForm.value as PortfolioFilterFormValue); |
|
|
|
this.applyFilters.emit(); |
|
|
|
} |
|
|
|
|
|
|
|
public onResetFilters(): void { |
|
|
|
public onResetFilters() { |
|
|
|
this.filterForm.reset({}, { emitEvent: true }); |
|
|
|
this.resetFilters.emit(); |
|
|
|
} |
|
|
|
|
|
|
|
public registerOnChange(fn: (value: PortfolioFilterFormValue) => void): void { |
|
|
|
public registerOnChange(fn: (value: PortfolioFilterFormValue) => void) { |
|
|
|
this.onChange = fn; |
|
|
|
} |
|
|
|
|
|
|
|
public registerOnTouched(fn: () => void): void { |
|
|
|
public registerOnTouched(fn: () => void) { |
|
|
|
this.onTouched = fn; |
|
|
|
} |
|
|
|
|
|
|
|
public setDisabledState(isDisabled: boolean): void { |
|
|
|
public setDisabledState(isDisabled: boolean) { |
|
|
|
this.disabled = isDisabled; |
|
|
|
|
|
|
|
if (this.disabled) { |
|
|
|
@ -162,7 +162,7 @@ export class GfPortfolioFilterFormComponent |
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
} |
|
|
|
|
|
|
|
public writeValue(value: PortfolioFilterFormValue | null): void { |
|
|
|
public writeValue(value: PortfolioFilterFormValue | null) { |
|
|
|
if (value) { |
|
|
|
this.filterForm.setValue( |
|
|
|
{ |
|
|
|
|