Skip to content
Permalink
Browse files
refactor(form): replace matAutosize by cdkAutosize (DEV-968) (#754)
* 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 449493bbdcad316e0c86390ee3ea46d593dd257f
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 114 deletions.
@@ -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>

@@ -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"
@@ -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"
@@ -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">
@@ -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>

@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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)">
@@ -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>
@@ -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>
@@ -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>

0 comments on commit 449493b

Please sign in to comment.