@tehw0lf/contact-form 0.14.4 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -46
- package/esm2022/index.mjs +2 -0
- package/esm2022/lib/contact-form/contact-form.component.mjs +115 -0
- package/fesm2022/tehw0lf-contact-form.mjs +122 -0
- package/fesm2022/tehw0lf-contact-form.mjs.map +1 -0
- package/index.d.ts +0 -1
- package/lib/contact-form/contact-form.component.d.ts +28 -20
- package/package.json +14 -25
- package/esm2020/index.mjs +0 -3
- package/esm2020/lib/contact-form/contact-form.component.mjs +0 -97
- package/esm2020/lib/contact-form.module.mjs +0 -42
- package/esm2020/lib/email-api.service.mjs +0 -32
- package/fesm2015/tehw0lf-contact-form.mjs +0 -166
- package/fesm2015/tehw0lf-contact-form.mjs.map +0 -1
- package/fesm2020/tehw0lf-contact-form.mjs +0 -166
- package/fesm2020/tehw0lf-contact-form.mjs.map +0 -1
- package/lib/contact-form.module.d.ts +0 -13
- package/lib/email-api.service.d.ts +0 -13
- package/schematics/collection.json +0 -16
- package/schematics/ng-add/index.d.ts +0 -3
- package/schematics/ng-add/index.js +0 -46
- package/schematics/ng-add/index.js.map +0 -1
- package/schematics/ng-add/index.spec.d.ts +0 -1
- package/schematics/ng-add/index.spec.js +0 -102
- package/schematics/ng-add/index.spec.js.map +0 -1
- package/schematics/ng-add/package-config.d.ts +0 -12
- package/schematics/ng-add/package-config.js +0 -48
- package/schematics/ng-add/package-config.js.map +0 -1
- package/schematics/ng-add/schema.d.ts +0 -3
- package/schematics/ng-add/schema.js +0 -3
- package/schematics/ng-add/schema.js.map +0 -1
- package/schematics/ng-add/schema.json +0 -16
- package/schematics/ng-add/setup.d.ts +0 -3
- package/schematics/ng-add/setup.js +0 -50
- package/schematics/ng-add/setup.js.map +0 -1
- package/schematics/testing/file-content.d.ts +0 -10
- package/schematics/testing/file-content.js +0 -13
- package/schematics/testing/file-content.js.map +0 -1
- package/schematics/testing/test-app.d.ts +0 -12
- package/schematics/testing/test-app.js +0 -44
- package/schematics/testing/test-app.js.map +0 -1
- package/schematics/testing/test-library.d.ts +0 -11
- package/schematics/testing/test-library.js +0 -21
- package/schematics/testing/test-library.js.map +0 -1
- package/schematics/testing/test-project.d.ts +0 -11
- package/schematics/testing/test-project.js +0 -29
- package/schematics/testing/test-project.js.map +0 -1
- /package/{esm2020 → esm2022}/tehw0lf-contact-form.mjs +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
|
2
|
-
import { UntypedFormBuilder, UntypedFormControl, Validators } from '@angular/forms';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import { takeUntil, tap } from 'rxjs/operators';
|
|
5
|
-
import { EmailApiService } from '../email-api.service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/forms";
|
|
8
|
-
import * as i2 from "../email-api.service";
|
|
9
|
-
import * as i3 from "@angular/common";
|
|
10
|
-
import * as i4 from "@angular/material/form-field";
|
|
11
|
-
import * as i5 from "@angular/material/input";
|
|
12
|
-
export class ContactFormComponent {
|
|
13
|
-
constructor(builder, emailService) {
|
|
14
|
-
this.builder = builder;
|
|
15
|
-
this.emailService = emailService;
|
|
16
|
-
this.buttonStyle = {
|
|
17
|
-
'background-color': '#333333',
|
|
18
|
-
border: 'none',
|
|
19
|
-
color: '#cc7832'
|
|
20
|
-
};
|
|
21
|
-
this.formStyle = {
|
|
22
|
-
color: '#437da8',
|
|
23
|
-
'background-color': 'rgba(34, 34, 34, 0.75)',
|
|
24
|
-
'backdrop-filter': 'blur(50px)',
|
|
25
|
-
'box-shadow': '0 2px 10px rgba(0, 0, 0, 0.075)'
|
|
26
|
-
};
|
|
27
|
-
this.inputStyle = {
|
|
28
|
-
color: '#282b2e'
|
|
29
|
-
};
|
|
30
|
-
this.textStyle = { color: '#cc7832' };
|
|
31
|
-
this.nameLabel = 'Your Name';
|
|
32
|
-
this.emailAddressLabel = 'Your E-Mail Address';
|
|
33
|
-
this.messageLabel = 'Your Message';
|
|
34
|
-
this.sendText = 'Send';
|
|
35
|
-
this.sendSuccessfulText = 'E-Mail successfully sent';
|
|
36
|
-
this.sendErrorText = 'Send error';
|
|
37
|
-
this.apiURL = 'https://forwardmethis.com/';
|
|
38
|
-
this.email = '';
|
|
39
|
-
this.emailSent = new Subject();
|
|
40
|
-
this.emailSent$ = this.emailSent.asObservable();
|
|
41
|
-
this.unsubscribe$ = new Subject();
|
|
42
|
-
this.emailSent.next(null);
|
|
43
|
-
this.formGroup = this.builder.group({
|
|
44
|
-
name: new UntypedFormControl('', [Validators.required]),
|
|
45
|
-
email: new UntypedFormControl('', [Validators.required, Validators.email]),
|
|
46
|
-
message: new UntypedFormControl('', [Validators.required])
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
ngOnDestroy() {
|
|
50
|
-
this.unsubscribe$.next();
|
|
51
|
-
this.unsubscribe$.complete();
|
|
52
|
-
}
|
|
53
|
-
submitFormData(formData) {
|
|
54
|
-
this.emailService
|
|
55
|
-
.sendEmail(`${this.apiURL}${this.email}`, formData.value)
|
|
56
|
-
.pipe(tap((response) => {
|
|
57
|
-
if (response === 'OK') {
|
|
58
|
-
this.emailSent.next(true);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
this.emailSent.next(false);
|
|
62
|
-
}
|
|
63
|
-
}), takeUntil(this.unsubscribe$))
|
|
64
|
-
.subscribe();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
ContactFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, deps: [{ token: i1.UntypedFormBuilder }, { token: i2.EmailApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
-
ContactFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ContactFormComponent, selector: "contact-form", inputs: { buttonStyle: "buttonStyle", formStyle: "formStyle", inputStyle: "inputStyle", textStyle: "textStyle", nameLabel: "nameLabel", emailAddressLabel: "emailAddressLabel", messageLabel: "messageLabel", sendText: "sendText", sendSuccessfulText: "sendSuccessfulText", sendErrorText: "sendErrorText", apiURL: "apiURL", email: "email" }, ngImport: i0, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None });
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, decorators: [{
|
|
70
|
-
type: Component,
|
|
71
|
-
args: [{ selector: 'contact-form', encapsulation: ViewEncapsulation.None, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"] }]
|
|
72
|
-
}], ctorParameters: function () { return [{ type: i1.UntypedFormBuilder }, { type: i2.EmailApiService }]; }, propDecorators: { buttonStyle: [{
|
|
73
|
-
type: Input
|
|
74
|
-
}], formStyle: [{
|
|
75
|
-
type: Input
|
|
76
|
-
}], inputStyle: [{
|
|
77
|
-
type: Input
|
|
78
|
-
}], textStyle: [{
|
|
79
|
-
type: Input
|
|
80
|
-
}], nameLabel: [{
|
|
81
|
-
type: Input
|
|
82
|
-
}], emailAddressLabel: [{
|
|
83
|
-
type: Input
|
|
84
|
-
}], messageLabel: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], sendText: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}], sendSuccessfulText: [{
|
|
89
|
-
type: Input
|
|
90
|
-
}], sendErrorText: [{
|
|
91
|
-
type: Input
|
|
92
|
-
}], apiURL: [{
|
|
93
|
-
type: Input
|
|
94
|
-
}], email: [{
|
|
95
|
-
type: Input
|
|
96
|
-
}] } });
|
|
97
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFjdC1mb3JtLmNvbXBvbmVudC5qcyIsIn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lkXCJcbiAgPlxuICAgIHt7IHNlbmRUZXh0IH19XG4gIDwvYnV0dG9uPlxuICA8ZGl2XG4gICAgW25nU3R5bGVdPVwidGV4dFN0eWxlXCJcbiAgICBjbGFzcz1cImZvcm0tc3RhdHVzXCJcbiAgICAqbmdJZj1cIihlbWFpbFNlbnQkIHwgYXN5bmMpID09PSB0cnVlXCJcbiAgPlxuICAgIHt7IHNlbmRTdWNjZXNzZnVsVGV4dCB9fVxuICA8L2Rpdj5cbiAgPGRpdlxuICAgIFtuZ1N0eWxlXT1cInRleHRTdHlsZVwiXG4gICAgY2xhc3M9XCJmb3JtLXN0YXR1c1wiXG4gICAgKm5nSWY9XCIoZW1haWxTZW50JCB8IGFzeW5jKSA9PT0gZmFsc2VcIlxuICA+XG4gICAge3sgc2VuZEVycm9yVGV4dCB9fVxuICA8L2Rpdj5cbjwvZm9ybT5cbiJdfQ==
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { HttpClientModule } from '@angular/common/http';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
|
-
import { MatInputModule } from '@angular/material/input';
|
|
7
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
8
|
-
import { ContactFormComponent } from './contact-form/contact-form.component';
|
|
9
|
-
import { EmailApiService } from './email-api.service';
|
|
10
|
-
import * as i0 from "@angular/core";
|
|
11
|
-
export class ContactFormModule {
|
|
12
|
-
}
|
|
13
|
-
ContactFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
14
|
-
ContactFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, declarations: [ContactFormComponent], imports: [CommonModule,
|
|
15
|
-
HttpClientModule,
|
|
16
|
-
BrowserAnimationsModule,
|
|
17
|
-
ReactiveFormsModule,
|
|
18
|
-
MatFormFieldModule,
|
|
19
|
-
MatInputModule], exports: [ContactFormComponent] });
|
|
20
|
-
ContactFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, providers: [EmailApiService], imports: [CommonModule,
|
|
21
|
-
HttpClientModule,
|
|
22
|
-
BrowserAnimationsModule,
|
|
23
|
-
ReactiveFormsModule,
|
|
24
|
-
MatFormFieldModule,
|
|
25
|
-
MatInputModule] });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, decorators: [{
|
|
27
|
-
type: NgModule,
|
|
28
|
-
args: [{
|
|
29
|
-
imports: [
|
|
30
|
-
CommonModule,
|
|
31
|
-
HttpClientModule,
|
|
32
|
-
BrowserAnimationsModule,
|
|
33
|
-
ReactiveFormsModule,
|
|
34
|
-
MatFormFieldModule,
|
|
35
|
-
MatInputModule
|
|
36
|
-
],
|
|
37
|
-
declarations: [ContactFormComponent],
|
|
38
|
-
exports: [ContactFormComponent],
|
|
39
|
-
providers: [EmailApiService]
|
|
40
|
-
}]
|
|
41
|
-
}] });
|
|
42
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFjdC1mb3JtLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvY29udGFjdC1mb3JtL3NyYy9saWIvY29udGFjdC1mb3JtLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLGdCQUFnQixFQUFF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GlvbnM6IFtDb250YWN0Rm9ybUNvbXBvbmVudF0sXG4gIGV4cG9ydHM6IFtDb250YWN0Rm9ybUNvbXBvbmVudF0sXG4gIHByb3ZpZGVyczogW0VtYWlsQXBpU2VydmljZV1cbn0pXG5leHBvcnQgY2xhc3MgQ29udGFjdEZvcm1Nb2R1bGUge31cbiJdfQ==
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { of } from 'rxjs';
|
|
4
|
-
import { catchError, map } from 'rxjs/operators';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@angular/common/http";
|
|
7
|
-
export class EmailApiService {
|
|
8
|
-
constructor(http) {
|
|
9
|
-
this.http = http;
|
|
10
|
-
this.httpOptions = {
|
|
11
|
-
headers: new HttpHeaders({
|
|
12
|
-
'Content-Type': 'application/json'
|
|
13
|
-
})
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
sendEmail(apiURL, data) {
|
|
17
|
-
return this.http.post(apiURL, JSON.stringify(data), this.httpOptions).pipe(map((response) => {
|
|
18
|
-
return response;
|
|
19
|
-
}), catchError((error) => {
|
|
20
|
-
return of(error.statusText);
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
EmailApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
25
|
-
EmailApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, providedIn: 'root' });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, decorators: [{
|
|
27
|
-
type: Injectable,
|
|
28
|
-
args: [{
|
|
29
|
-
providedIn: 'root'
|
|
30
|
-
}]
|
|
31
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
32
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1haWwtYXBpLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvbnRhY3QtZm9ybS9zcmMvbGliL2VtYWlsLWFwaS5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsV0FBVyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDL0QsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQWMsRUFBRSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQ3RDLE9BQU8sRUFBRSxVQUFVLEVBQUUsR0FBRyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7OztBQUtqRCxNQUFNLE9BQU8sZUFBZTtJQU0xQixZQUFvQixJQUFnQjtRQUFoQixTQUFJLEdBQUosSUFBSSxDQUFZO1FBTHBDLGdCQUFXLEdBQUc7WUFDWixPQUFPLEVBQUUsSUFBSSxXQUFXLENBQUM7Z0JBQ3ZCLGNBQWMsRUFBRSxrQkFBa0I7YUFDbkMsQ0FBQztTQUNILENBQUM7SUFDcUMsQ0FBQztJQUV4QyxTQUFTLENBQUMsTUFBYyxFQUFFLElBQVM7UUFDakMsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsRUFBRSxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUMsSUFBSSxDQUN4RSxHQUFHLENBQUMsQ0FBQyxRQUFhLEVBQUUsRUFBRTtZQUNwQixPQUFPLFF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XMuaHR0cE9wdGlvbnMpLnBpcGUoXG4gICAgICBtYXAoKHJlc3BvbnNlOiBhbnkpID0+IHtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgfSksXG4gICAgICBjYXRjaEVycm9yKChlcnJvcjogYW55KSA9PiB7XG4gICAgICAgIHJldHVybiBvZihlcnJvci5zdGF0dXNUZXh0KTtcbiAgICAgIH0pXG4gICAgKTtcbiAgfVxufVxuIl19
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import * as i3 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i1 from '@angular/common/http';
|
|
4
|
-
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
5
|
-
import * as i0 from '@angular/core';
|
|
6
|
-
import { Injectable, Component, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
7
|
-
import * as i1$1 from '@angular/forms';
|
|
8
|
-
import { UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as i4 from '@angular/material/form-field';
|
|
10
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
-
import * as i5 from '@angular/material/input';
|
|
12
|
-
import { MatInputModule } from '@angular/material/input';
|
|
13
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
14
|
-
import { of, Subject } from 'rxjs';
|
|
15
|
-
import { map, catchError, tap, takeUntil } from 'rxjs/operators';
|
|
16
|
-
|
|
17
|
-
class EmailApiService {
|
|
18
|
-
constructor(http) {
|
|
19
|
-
this.http = http;
|
|
20
|
-
this.httpOptions = {
|
|
21
|
-
headers: new HttpHeaders({
|
|
22
|
-
'Content-Type': 'application/json'
|
|
23
|
-
})
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
sendEmail(apiURL, data) {
|
|
27
|
-
return this.http.post(apiURL, JSON.stringify(data), this.httpOptions).pipe(map((response) => {
|
|
28
|
-
return response;
|
|
29
|
-
}), catchError((error) => {
|
|
30
|
-
return of(error.statusText);
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
EmailApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
-
EmailApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, providedIn: 'root' });
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, decorators: [{
|
|
37
|
-
type: Injectable,
|
|
38
|
-
args: [{
|
|
39
|
-
providedIn: 'root'
|
|
40
|
-
}]
|
|
41
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
42
|
-
|
|
43
|
-
class ContactFormComponent {
|
|
44
|
-
constructor(builder, emailService) {
|
|
45
|
-
this.builder = builder;
|
|
46
|
-
this.emailService = emailService;
|
|
47
|
-
this.buttonStyle = {
|
|
48
|
-
'background-color': '#333333',
|
|
49
|
-
border: 'none',
|
|
50
|
-
color: '#cc7832'
|
|
51
|
-
};
|
|
52
|
-
this.formStyle = {
|
|
53
|
-
color: '#437da8',
|
|
54
|
-
'background-color': 'rgba(34, 34, 34, 0.75)',
|
|
55
|
-
'backdrop-filter': 'blur(50px)',
|
|
56
|
-
'box-shadow': '0 2px 10px rgba(0, 0, 0, 0.075)'
|
|
57
|
-
};
|
|
58
|
-
this.inputStyle = {
|
|
59
|
-
color: '#282b2e'
|
|
60
|
-
};
|
|
61
|
-
this.textStyle = { color: '#cc7832' };
|
|
62
|
-
this.nameLabel = 'Your Name';
|
|
63
|
-
this.emailAddressLabel = 'Your E-Mail Address';
|
|
64
|
-
this.messageLabel = 'Your Message';
|
|
65
|
-
this.sendText = 'Send';
|
|
66
|
-
this.sendSuccessfulText = 'E-Mail successfully sent';
|
|
67
|
-
this.sendErrorText = 'Send error';
|
|
68
|
-
this.apiURL = 'https://forwardmethis.com/';
|
|
69
|
-
this.email = '';
|
|
70
|
-
this.emailSent = new Subject();
|
|
71
|
-
this.emailSent$ = this.emailSent.asObservable();
|
|
72
|
-
this.unsubscribe$ = new Subject();
|
|
73
|
-
this.emailSent.next(null);
|
|
74
|
-
this.formGroup = this.builder.group({
|
|
75
|
-
name: new UntypedFormControl('', [Validators.required]),
|
|
76
|
-
email: new UntypedFormControl('', [Validators.required, Validators.email]),
|
|
77
|
-
message: new UntypedFormControl('', [Validators.required])
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
ngOnDestroy() {
|
|
81
|
-
this.unsubscribe$.next();
|
|
82
|
-
this.unsubscribe$.complete();
|
|
83
|
-
}
|
|
84
|
-
submitFormData(formData) {
|
|
85
|
-
this.emailService
|
|
86
|
-
.sendEmail(`${this.apiURL}${this.email}`, formData.value)
|
|
87
|
-
.pipe(tap((response) => {
|
|
88
|
-
if (response === 'OK') {
|
|
89
|
-
this.emailSent.next(true);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
this.emailSent.next(false);
|
|
93
|
-
}
|
|
94
|
-
}), takeUntil(this.unsubscribe$))
|
|
95
|
-
.subscribe();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
ContactFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, deps: [{ token: i1$1.UntypedFormBuilder }, { token: EmailApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
-
ContactFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ContactFormComponent, selector: "contact-form", inputs: { buttonStyle: "buttonStyle", formStyle: "formStyle", inputStyle: "inputStyle", textStyle: "textStyle", nameLabel: "nameLabel", emailAddressLabel: "emailAddressLabel", messageLabel: "messageLabel", sendText: "sendText", sendSuccessfulText: "sendSuccessfulText", sendErrorText: "sendErrorText", apiURL: "apiURL", email: "email" }, ngImport: i0, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None });
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, decorators: [{
|
|
101
|
-
type: Component,
|
|
102
|
-
args: [{ selector: 'contact-form', encapsulation: ViewEncapsulation.None, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"] }]
|
|
103
|
-
}], ctorParameters: function () { return [{ type: i1$1.UntypedFormBuilder }, { type: EmailApiService }]; }, propDecorators: { buttonStyle: [{
|
|
104
|
-
type: Input
|
|
105
|
-
}], formStyle: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], inputStyle: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], textStyle: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}], nameLabel: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], emailAddressLabel: [{
|
|
114
|
-
type: Input
|
|
115
|
-
}], messageLabel: [{
|
|
116
|
-
type: Input
|
|
117
|
-
}], sendText: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}], sendSuccessfulText: [{
|
|
120
|
-
type: Input
|
|
121
|
-
}], sendErrorText: [{
|
|
122
|
-
type: Input
|
|
123
|
-
}], apiURL: [{
|
|
124
|
-
type: Input
|
|
125
|
-
}], email: [{
|
|
126
|
-
type: Input
|
|
127
|
-
}] } });
|
|
128
|
-
|
|
129
|
-
class ContactFormModule {
|
|
130
|
-
}
|
|
131
|
-
ContactFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
132
|
-
ContactFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, declarations: [ContactFormComponent], imports: [CommonModule,
|
|
133
|
-
HttpClientModule,
|
|
134
|
-
BrowserAnimationsModule,
|
|
135
|
-
ReactiveFormsModule,
|
|
136
|
-
MatFormFieldModule,
|
|
137
|
-
MatInputModule], exports: [ContactFormComponent] });
|
|
138
|
-
ContactFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, providers: [EmailApiService], imports: [CommonModule,
|
|
139
|
-
HttpClientModule,
|
|
140
|
-
BrowserAnimationsModule,
|
|
141
|
-
ReactiveFormsModule,
|
|
142
|
-
MatFormFieldModule,
|
|
143
|
-
MatInputModule] });
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, decorators: [{
|
|
145
|
-
type: NgModule,
|
|
146
|
-
args: [{
|
|
147
|
-
imports: [
|
|
148
|
-
CommonModule,
|
|
149
|
-
HttpClientModule,
|
|
150
|
-
BrowserAnimationsModule,
|
|
151
|
-
ReactiveFormsModule,
|
|
152
|
-
MatFormFieldModule,
|
|
153
|
-
MatInputModule
|
|
154
|
-
],
|
|
155
|
-
declarations: [ContactFormComponent],
|
|
156
|
-
exports: [ContactFormComponent],
|
|
157
|
-
providers: [EmailApiService]
|
|
158
|
-
}]
|
|
159
|
-
}] });
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Generated bundle index. Do not edit.
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
export { ContactFormComponent, ContactFormModule };
|
|
166
|
-
//# sourceMappingURL=tehw0lf-contact-form.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tehw0lf-contact-form.mjs","sources":["../../../../libs/contact-form/src/lib/email-api.service.ts","../../../../libs/contact-form/src/lib/contact-form/contact-form.component.ts","../../../../libs/contact-form/src/lib/contact-form/contact-form.component.html","../../../../libs/contact-form/src/lib/contact-form.module.ts","../../../../libs/contact-form/src/tehw0lf-contact-form.ts"],"sourcesContent":["import { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class EmailApiService {\n httpOptions = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n };\n constructor(private http: HttpClient) {}\n\n sendEmail(apiURL: string, data: any): Observable<any> {\n return this.http.post(apiURL, JSON.stringify(data), this.httpOptions).pipe(\n map((response: any) => {\n return response;\n }),\n catchError((error: any) => {\n return of(error.statusText);\n })\n );\n }\n}\n","import { Component, Input, OnDestroy, ViewEncapsulation } from '@angular/core';\nimport { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';\nimport { Subject } from 'rxjs';\nimport { takeUntil, tap } from 'rxjs/operators';\n\nimport { EmailApiService } from '../email-api.service';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'contact-form',\n templateUrl: './contact-form.component.html',\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./contact-form.component.scss']\n})\nexport class ContactFormComponent implements OnDestroy {\n @Input() buttonStyle = {\n 'background-color': '#333333',\n border: 'none',\n color: '#cc7832'\n };\n\n @Input() formStyle = {\n color: '#437da8',\n 'background-color': 'rgba(34, 34, 34, 0.75)',\n 'backdrop-filter': 'blur(50px)',\n 'box-shadow': '0 2px 10px rgba(0, 0, 0, 0.075)'\n };\n\n @Input() inputStyle = {\n color: '#282b2e'\n };\n\n @Input() textStyle = { color: '#cc7832' };\n\n @Input() nameLabel = 'Your Name';\n\n @Input() emailAddressLabel = 'Your E-Mail Address';\n\n @Input() messageLabel = 'Your Message';\n\n @Input() sendText = 'Send';\n\n @Input() sendSuccessfulText = 'E-Mail successfully sent';\n\n @Input() sendErrorText = 'Send error';\n\n @Input() apiURL = 'https://forwardmethis.com/';\n @Input() email = '';\n\n formGroup: UntypedFormGroup;\n emailSent: Subject<boolean | null> = new Subject();\n emailSent$ = this.emailSent.asObservable();\n\n private unsubscribe$: Subject<void> = new Subject();\n\n constructor(\n private builder: UntypedFormBuilder,\n private emailService: EmailApiService\n ) {\n this.emailSent.next(null);\n this.formGroup = this.builder.group({\n name: new UntypedFormControl('', [Validators.required]),\n email: new UntypedFormControl('', [Validators.required, Validators.email]),\n message: new UntypedFormControl('', [Validators.required])\n });\n }\n\n ngOnDestroy(): void {\n this.unsubscribe$.next();\n this.unsubscribe$.complete();\n }\n\n submitFormData(formData: UntypedFormGroup) {\n this.emailService\n .sendEmail(`${this.apiURL}${this.email}`, formData.value)\n .pipe(\n tap((response: string) => {\n if (response === 'OK') {\n this.emailSent.next(true);\n } else {\n this.emailSent.next(false);\n }\n }),\n takeUntil(this.unsubscribe$)\n )\n .subscribe();\n }\n}\n","<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n","import { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\n\nimport { ContactFormComponent } from './contact-form/contact-form.component';\nimport { EmailApiService } from './email-api.service';\n\n@NgModule({\n imports: [\n CommonModule,\n HttpClientModule,\n BrowserAnimationsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule\n ],\n declarations: [ContactFormComponent],\n exports: [ContactFormComponent],\n providers: [EmailApiService]\n})\nexport class ContactFormModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.EmailApiService"],"mappings":";;;;;;;;;;;;;;;;MAQa,eAAe,CAAA;AAM1B,IAAA,WAAA,CAAoB,IAAgB,EAAA;AAAhB,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;QALpC,IAAA,CAAA,WAAW,GAAG;YACZ,OAAO,EAAE,IAAI,WAAW,CAAC;AACvB,gBAAA,cAAc,EAAE,kBAAkB;aACnC,CAAC;SACH,CAAC;KACsC;IAExC,SAAS,CAAC,MAAc,EAAE,IAAS,EAAA;QACjC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAA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EAAA,CAJb,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAPjC,YAAY;QACZ,gBAAgB;QAChB,uBAAuB;QACvB,mBAAmB;QACnB,kBAAkB;QAClB,cAAc,aAGN,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGnB,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,EAFjB,SAAA,EAAA,CAAC,eAAe,CAAC,YAT1B,YAAY;QACZ,gBAAgB;QAChB,uBAAuB;QACvB,mBAAmB;QACnB,kBAAkB;QAClB,cAAc,CAAA,EAAA,CAAA,CAAA;2FAML,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAb7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,uBAAuB;wBACvB,mBAAmB;wBACnB,kBAAkB;wBAClB,cAAc;AACf,qBAAA;oBACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,SAAS,EAAE,CAAC,eAAe,CAAC;iBAC7B,CAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import * as i3 from '@angular/common';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import * as i1 from '@angular/common/http';
|
|
4
|
-
import { HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
5
|
-
import * as i0 from '@angular/core';
|
|
6
|
-
import { Injectable, Component, ViewEncapsulation, Input, NgModule } from '@angular/core';
|
|
7
|
-
import * as i1$1 from '@angular/forms';
|
|
8
|
-
import { UntypedFormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
-
import * as i4 from '@angular/material/form-field';
|
|
10
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
11
|
-
import * as i5 from '@angular/material/input';
|
|
12
|
-
import { MatInputModule } from '@angular/material/input';
|
|
13
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
14
|
-
import { of, Subject } from 'rxjs';
|
|
15
|
-
import { map, catchError, tap, takeUntil } from 'rxjs/operators';
|
|
16
|
-
|
|
17
|
-
class EmailApiService {
|
|
18
|
-
constructor(http) {
|
|
19
|
-
this.http = http;
|
|
20
|
-
this.httpOptions = {
|
|
21
|
-
headers: new HttpHeaders({
|
|
22
|
-
'Content-Type': 'application/json'
|
|
23
|
-
})
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
sendEmail(apiURL, data) {
|
|
27
|
-
return this.http.post(apiURL, JSON.stringify(data), this.httpOptions).pipe(map((response) => {
|
|
28
|
-
return response;
|
|
29
|
-
}), catchError((error) => {
|
|
30
|
-
return of(error.statusText);
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
EmailApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
35
|
-
EmailApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, providedIn: 'root' });
|
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailApiService, decorators: [{
|
|
37
|
-
type: Injectable,
|
|
38
|
-
args: [{
|
|
39
|
-
providedIn: 'root'
|
|
40
|
-
}]
|
|
41
|
-
}], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
|
|
42
|
-
|
|
43
|
-
class ContactFormComponent {
|
|
44
|
-
constructor(builder, emailService) {
|
|
45
|
-
this.builder = builder;
|
|
46
|
-
this.emailService = emailService;
|
|
47
|
-
this.buttonStyle = {
|
|
48
|
-
'background-color': '#333333',
|
|
49
|
-
border: 'none',
|
|
50
|
-
color: '#cc7832'
|
|
51
|
-
};
|
|
52
|
-
this.formStyle = {
|
|
53
|
-
color: '#437da8',
|
|
54
|
-
'background-color': 'rgba(34, 34, 34, 0.75)',
|
|
55
|
-
'backdrop-filter': 'blur(50px)',
|
|
56
|
-
'box-shadow': '0 2px 10px rgba(0, 0, 0, 0.075)'
|
|
57
|
-
};
|
|
58
|
-
this.inputStyle = {
|
|
59
|
-
color: '#282b2e'
|
|
60
|
-
};
|
|
61
|
-
this.textStyle = { color: '#cc7832' };
|
|
62
|
-
this.nameLabel = 'Your Name';
|
|
63
|
-
this.emailAddressLabel = 'Your E-Mail Address';
|
|
64
|
-
this.messageLabel = 'Your Message';
|
|
65
|
-
this.sendText = 'Send';
|
|
66
|
-
this.sendSuccessfulText = 'E-Mail successfully sent';
|
|
67
|
-
this.sendErrorText = 'Send error';
|
|
68
|
-
this.apiURL = 'https://forwardmethis.com/';
|
|
69
|
-
this.email = '';
|
|
70
|
-
this.emailSent = new Subject();
|
|
71
|
-
this.emailSent$ = this.emailSent.asObservable();
|
|
72
|
-
this.unsubscribe$ = new Subject();
|
|
73
|
-
this.emailSent.next(null);
|
|
74
|
-
this.formGroup = this.builder.group({
|
|
75
|
-
name: new UntypedFormControl('', [Validators.required]),
|
|
76
|
-
email: new UntypedFormControl('', [Validators.required, Validators.email]),
|
|
77
|
-
message: new UntypedFormControl('', [Validators.required])
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
ngOnDestroy() {
|
|
81
|
-
this.unsubscribe$.next();
|
|
82
|
-
this.unsubscribe$.complete();
|
|
83
|
-
}
|
|
84
|
-
submitFormData(formData) {
|
|
85
|
-
this.emailService
|
|
86
|
-
.sendEmail(`${this.apiURL}${this.email}`, formData.value)
|
|
87
|
-
.pipe(tap((response) => {
|
|
88
|
-
if (response === 'OK') {
|
|
89
|
-
this.emailSent.next(true);
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
this.emailSent.next(false);
|
|
93
|
-
}
|
|
94
|
-
}), takeUntil(this.unsubscribe$))
|
|
95
|
-
.subscribe();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
ContactFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, deps: [{ token: i1$1.UntypedFormBuilder }, { token: EmailApiService }], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
-
ContactFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ContactFormComponent, selector: "contact-form", inputs: { buttonStyle: "buttonStyle", formStyle: "formStyle", inputStyle: "inputStyle", textStyle: "textStyle", nameLabel: "nameLabel", emailAddressLabel: "emailAddressLabel", messageLabel: "messageLabel", sendText: "sendText", sendSuccessfulText: "sendSuccessfulText", sendErrorText: "sendErrorText", apiURL: "apiURL", email: "email" }, ngImport: i0, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i5.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None });
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormComponent, decorators: [{
|
|
101
|
-
type: Component,
|
|
102
|
-
args: [{ selector: 'contact-form', encapsulation: ViewEncapsulation.None, template: "<form\n [ngStyle]=\"formStyle\"\n class=\"contact-form\"\n [formGroup]=\"formGroup\"\n (ngSubmit)=\"submitFormData(formGroup)\"\n fxLayout=\"column\"\n fxFlex\n>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"name\">{{ nameLabel }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"text\"\n name=\"name\"\n formControlName=\"name\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"email\">{{\n emailAddressLabel\n }}</mat-label>\n <input\n [ngStyle]=\"textStyle\"\n matInput\n class=\"form-control\"\n type=\"email\"\n name=\"email\"\n formControlName=\"email\"\n />\n </mat-form-field>\n <mat-form-field class=\"form-field\" appearance=\"outline\" fxFlex>\n <mat-label [ngStyle]=\"textStyle\" for=\"message\">\n {{ messageLabel }}\n </mat-label>\n <textarea\n [ngStyle]=\"inputStyle\"\n matInput\n formControlName=\"message\"\n name=\"message\"\n >\n </textarea>\n </mat-form-field>\n <button\n [ngStyle]=\"buttonStyle\"\n class=\"form-button\"\n type=\"submit\"\n [disabled]=\"!formGroup.valid\"\n >\n {{ sendText }}\n </button>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === true\"\n >\n {{ sendSuccessfulText }}\n </div>\n <div\n [ngStyle]=\"textStyle\"\n class=\"form-status\"\n *ngIf=\"(emailSent$ | async) === false\"\n >\n {{ sendErrorText }}\n </div>\n</form>\n", styles: [".contact-form{max-width:500px;margin:auto;padding:40px;box-sizing:border-box}.form-button{margin-top:3rem;display:block;border-radius:.25rem;width:98%;padding:.375rem .75rem}.form-status{margin-top:2rem}textarea{color:inherit!important;background:none!important;overflow:auto;resize:vertical}.mat-form-field-appearance-outline .mat-form-field-infix{border:0;padding:1em 0 .5em}.mat-form-field-appearance-outline .mat-form-field-wrapper{padding-bottom:.25em}.mat-form-field-label{transition:none!important}.mat-form-field-should-float .mat-form-field-label-wrapper{top:-.1em;padding-top:.1em}.mat-form-field-should-float .mat-form-field-label{transition:none!important}.form-field{align-self:center;width:98%}.form-field:last-of-type{margin-top:1rem}\n"] }]
|
|
103
|
-
}], ctorParameters: function () { return [{ type: i1$1.UntypedFormBuilder }, { type: EmailApiService }]; }, propDecorators: { buttonStyle: [{
|
|
104
|
-
type: Input
|
|
105
|
-
}], formStyle: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], inputStyle: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], textStyle: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}], nameLabel: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}], emailAddressLabel: [{
|
|
114
|
-
type: Input
|
|
115
|
-
}], messageLabel: [{
|
|
116
|
-
type: Input
|
|
117
|
-
}], sendText: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}], sendSuccessfulText: [{
|
|
120
|
-
type: Input
|
|
121
|
-
}], sendErrorText: [{
|
|
122
|
-
type: Input
|
|
123
|
-
}], apiURL: [{
|
|
124
|
-
type: Input
|
|
125
|
-
}], email: [{
|
|
126
|
-
type: Input
|
|
127
|
-
}] } });
|
|
128
|
-
|
|
129
|
-
class ContactFormModule {
|
|
130
|
-
}
|
|
131
|
-
ContactFormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
132
|
-
ContactFormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, declarations: [ContactFormComponent], imports: [CommonModule,
|
|
133
|
-
HttpClientModule,
|
|
134
|
-
BrowserAnimationsModule,
|
|
135
|
-
ReactiveFormsModule,
|
|
136
|
-
MatFormFieldModule,
|
|
137
|
-
MatInputModule], exports: [ContactFormComponent] });
|
|
138
|
-
ContactFormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, providers: [EmailApiService], imports: [CommonModule,
|
|
139
|
-
HttpClientModule,
|
|
140
|
-
BrowserAnimationsModule,
|
|
141
|
-
ReactiveFormsModule,
|
|
142
|
-
MatFormFieldModule,
|
|
143
|
-
MatInputModule] });
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ContactFormModule, decorators: [{
|
|
145
|
-
type: NgModule,
|
|
146
|
-
args: [{
|
|
147
|
-
imports: [
|
|
148
|
-
CommonModule,
|
|
149
|
-
HttpClientModule,
|
|
150
|
-
BrowserAnimationsModule,
|
|
151
|
-
ReactiveFormsModule,
|
|
152
|
-
MatFormFieldModule,
|
|
153
|
-
MatInputModule
|
|
154
|
-
],
|
|
155
|
-
declarations: [ContactFormComponent],
|
|
156
|
-
exports: [ContactFormComponent],
|
|
157
|
-
providers: [EmailApiService]
|
|
158
|
-
}]
|
|
159
|
-
}] });
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Generated bundle index. Do not edit.
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
export { ContactFormComponent, ContactFormModule };
|
|
166
|
-
//# sourceMappingURL=tehw0lf-contact-form.mjs.map
|