Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(form): replace matAutosize by cdkAutosize (DEV-968) #754

Merged
merged 2 commits into from May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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