Skip to content

Commit

Permalink
refactor(form): replace matAutosize by cdkAutosize (DEV-968) (#754)
Browse files Browse the repository at this point in the history
* refactor(form): replace matAutosize by cdkAutosize (DEV-968)

* refactor(form): replace matAutosize by cdkAutosize (DEV-968)
  • Loading branch information
kilchenmann committed May 31, 2022
1 parent 694cb06 commit 449493b
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 114 deletions.
Expand Up @@ -22,8 +22,8 @@

<mat-form-field class="large-field ontology-comment">
<textarea matInput [formControl]="ontologyForm.controls['comment']"
[placeholder]="'Comment'" [value]="ontologyComment"
matTextareaAutosize matAutosizeMinRows="6" matAutosizeMaxRows="12">
placeholder="Comment" [value]="ontologyComment"
[cdkTextareaAutosize]="true" [cdkAutosizeMinRows]="6" [cdkAutosizeMaxRows]="12">
</textarea>
</mat-form-field>

Expand Down
Expand Up @@ -65,7 +65,7 @@
<!-- comment/description -->
<div class="large-field string-literal-container">
<app-string-literal-input
[placeholder]="'Comment'"
placeholder="Comment"
[value]="comments"
[disabled]="(resClassIri && propertyInfo.propDef)"
[textarea]="true"
Expand Down
Expand Up @@ -34,7 +34,7 @@
<!-- description -->
<div class="large-field string-literal-container more-space-top">
<app-string-literal-input
[placeholder]="'Comment'"
placeholder="Comment"
[value]="resourceClassComments"
[textarea]="true"
(touched)="resourceClassCommentsTouched = $event"
Expand Down
10 changes: 0 additions & 10 deletions src/app/project/project-form/project-form.component.html
Expand Up @@ -41,16 +41,6 @@
{{ formErrors.description }}
</mat-hint>

<!-- <mat-form-field class="large-field">
<textarea matInput matTextareaAutosize matAutosizeMinRows="6" matAutosizeMaxRows="12"
[placeholder]=" 'appLabels.form.project.general.description' | translate "
[formControl]="form.controls['description']">
</textarea>
<mat-hint *ngIf="formErrors.description">
{{ formErrors.description }}
</mat-hint>
</mat-form-field> -->

<!-- institution -->
<!--
<mat-form-field class="large">
Expand Down
Expand Up @@ -19,9 +19,12 @@
</mat-form-field>

<mat-form-field class="large-field ontology-comment">
<textarea matInput [formControl]="form.controls['comment']"
[placeholder]="'Comment'"
matTextareaAutosize matAutosizeMinRows="6" matAutosizeMaxRows="12">
<textarea matInput
placeholder="Comment"
[formControl]="form.controls['comment']"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="6"
[cdkAutosizeMaxRows]="12">
</textarea>
</mat-form-field>

Expand Down
Expand Up @@ -14,15 +14,14 @@
</mat-error>
<mat-form-field class="large-field value-component-comment">
<textarea
matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -29,14 +29,13 @@
<mat-form-field class="large-field value-component-comment">
<textarea
matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -27,16 +27,16 @@

<!-- Comment field -->
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
</textarea>
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
</ng-template>
Expand Up @@ -21,15 +21,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -28,15 +28,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -21,15 +21,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -16,15 +16,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -35,15 +35,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -9,14 +9,23 @@
floatLabel="never">

<!-- default gui-element: simple text -->
<input *ngIf="guiElement === 'simpleText'" matInput [formControlName]="'value'" class="value"
placeholder="Text value" type="text" [errorStateMatcher]="matcher">
<input *ngIf="guiElement === 'simpleText'" matInput
class="value"
placeholder="Text value"
type="text"
[formControlName]="'value'"
[errorStateMatcher]="matcher">

<!-- gui-element: text area -->
<textarea *ngIf="guiElement === 'textArea'" matInput [formControlName]="'value'" class="value"
placeholder="Text value" type="text" [errorStateMatcher]="matcher"
matAutosizeMaxRows="12" matAutosizeMinRows="6"></textarea>
<!-- <textarea *ngSwitchCase="'richText'" matInput [formControlName]="'value'" MatTextareaAutosize [mat-autosize]="true" [matAutosizeMaxRows]="10" class="value" placeholder="Text value" type="text" [errorStateMatcher]="matcher"></textarea> -->
<textarea *ngIf="guiElement === 'textArea'" matInput
class="value"
placeholder="Text value"
[formControlName]="'value'"
[errorStateMatcher]="matcher"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="6"
[cdkAutosizeMaxRows]="12">
</textarea>

<mat-error *ngIf="valueFormControl.hasError('valueNotChanged') &&
(valueFormControl.touched || valueFormControl.dirty)">
Expand All @@ -37,8 +46,15 @@

<!-- comment -->
<mat-form-field *ngIf="!commentDisabled" class="large-field value-component-comment">
<textarea matInput cdkTextareaAutosize cdkAutosizeMinRows="1" cdkAutosizeMaxRows="6"
[formControlName]="'comment'" class="comment" placeholder="Comment" type="text" spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down
Expand Up @@ -16,16 +16,16 @@
<span [formGroup]="form">
<ckeditor [formControlName]="'value'" [config]="editorConfig" [editor]="editor"></ckeditor>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
</textarea>
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
</div>
Expand Down
Expand Up @@ -23,15 +23,15 @@
</mat-error>
</mat-form-field>
<mat-form-field class="large-field value-component-comment">
<textarea matInput
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="6"
[formControlName]="'comment'"
class="comment"
placeholder="Comment"
type="text"
spellcheck="false">
<textarea
matInput
class="comment"
placeholder="Comment"
spellcheck="false"
[cdkTextareaAutosize]="true"
[cdkAutosizeMinRows]="1"
[cdkAutosizeMaxRows]="6"
[formControlName]="'comment'">
</textarea>
</mat-form-field>
</span>
Expand Down

0 comments on commit 449493b

Please sign in to comment.