Skip to content
Snippets Groups Projects
Commit e754e401 authored by jojohoch's avatar jojohoch
Browse files

Add `mat-form-field` wrapper to `TextFieldComponent`

parent 4429b4f8
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,9 @@ import { DropdownComponent } from './element-components/dropdown.component'; ...@@ -39,7 +39,9 @@ import { DropdownComponent } from './element-components/dropdown.component';
MatRadioModule, MatRadioModule,
MatCheckboxModule, MatCheckboxModule,
ReactiveFormsModule, ReactiveFormsModule,
FormsModule FormsModule,
MatFormFieldModule,
MatInputModule
], ],
declarations: [ declarations: [
ButtonComponent, ButtonComponent,
......
...@@ -5,22 +5,24 @@ import { FormElementComponent } from '../form-element-component.directive'; ...@@ -5,22 +5,24 @@ import { FormElementComponent } from '../form-element-component.directive';
@Component({ @Component({
selector: 'app-text-field', selector: 'app-text-field',
template: ` template: `
<input *ngIf="elementModel.multiline === false" matInput <mat-form-field>
placeholder="{{elementModel.placeholder}}" <input *ngIf="elementModel.multiline === false" matInput
[formControl]="formElementControl"> placeholder="{{elementModel.placeholder}}"
<textarea *ngIf="elementModel.multiline === true" matInput [formControl]="formElementControl">
placeholder="{{elementModel.placeholder}}" <textarea *ngIf="elementModel.multiline === true" matInput
[formControl]="formElementControl" placeholder="{{elementModel.placeholder}}"
[style.width.px]="elementModel.width" [formControl]="formElementControl"
[style.height.px]="elementModel.height" [style.width.px]="elementModel.width"
[style.background-color]="elementModel.backgroundColor" [style.height.px]="elementModel.height"
[style.color]="elementModel.fontColor" [style.background-color]="elementModel.backgroundColor"
[style.font-family]="elementModel.font" [style.color]="elementModel.fontColor"
[style.font-size.px]="elementModel.fontSize" [style.font-family]="elementModel.font"
[style.font-weight]="elementModel.bold ? 'bold' : ''" [style.font-size.px]="elementModel.fontSize"
[style.font-style]="elementModel.italic ? 'italic' : ''" [style.font-weight]="elementModel.bold ? 'bold' : ''"
[style.text-decoration]="elementModel.underline ? 'underline' : ''"> [style.font-style]="elementModel.italic ? 'italic' : ''"
</textarea> [style.text-decoration]="elementModel.underline ? 'underline' : ''">
</textarea>
</mat-form-field>
` `
}) })
export class TextFieldComponent extends FormElementComponent { export class TextFieldComponent extends FormElementComponent {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment