openaire-library/contact-us/contact-us.component.ts

33 lines
1.1 KiB
TypeScript

import {Component, EventEmitter, Input, Output} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {EnvProperties} from "../utils/properties/env-properties";
import {properties} from "../../../environments/environment";
@Component({
selector: 'contact-us',
templateUrl: './contact-us.component.html'
})
export class ContactUsComponent {
@Input() public contactForm: FormGroup;
@Input() public formTitle: string;
@Input() public organizationTypes: string[];
@Input() public buttonClass: string;
@Input() public alignButton: "left" | "right" | "center" = "left";
@Input() public sendButton: string = "Send";
@Input() public smallForm: boolean = false;
@Input() public sending: boolean = false;
@Output() sendEmitter: EventEmitter<any> = new EventEmitter<any>();
public properties: EnvProperties = properties;
public send() {
this.sendEmitter.emit({
valid: this.contactForm.valid
});
}
public handleRecaptcha(captchaResponse: string) {
this.contactForm.get('recaptcha').setValue(captchaResponse);
}
}