-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6839 from surveyjs/bug/6758
Remove tooltip errors from multiple text
- Loading branch information
Showing
52 changed files
with
727 additions
and
497 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 4 additions & 9 deletions
13
packages/survey-angular-ui/src/questions/multipletext.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
<table [class]="model.cssClasses.root" #contentElement> | ||
<tbody> | ||
<tr | ||
*ngFor="let row of model.getRows(); index as rowIndex; trackBy: trackRowBy" | ||
[class]="model.cssClasses.row" | ||
> | ||
<ng-container *ngFor="let item of row; trackBy: trackItemBy" > | ||
<td [class]="model.cssClasses.cell" [question]="model" [model]="item" sv-ng-multipletext-item></td> | ||
</ng-container> | ||
</tr> | ||
<ng-container *ngFor="let row of model.getRows(); index as rowIndex; trackBy: trackRowBy"> | ||
<sv-ng-multipletext-row [model]="row" [question]="model"></sv-ng-multipletext-row> | ||
</ng-container> | ||
</tbody> | ||
</table> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 28 additions & 5 deletions
33
packages/survey-angular-ui/src/questions/multipletextitem.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,38 @@ | ||
import { MultipleTextItemModel, QuestionMultipleTextModel, QuestionTextModel } from "survey-core"; | ||
import { Component, Input } from "@angular/core"; | ||
import { MultipleTextCell, MultipleTextItemModel, QuestionMultipleTextModel, QuestionTextModel } from "survey-core"; | ||
import { Component, DoCheck, Input, OnDestroy } from "@angular/core"; | ||
import { BaseAngular } from "../base-angular"; | ||
|
||
@Component({ | ||
selector: "'[sv-ng-multipletext-item]'", | ||
templateUrl: "./mutlipletextitem.component.html" | ||
}) | ||
export class MultipleTextItemComponent extends BaseAngular<QuestionTextModel> { | ||
export class MultipleTextItemComponent extends BaseAngular<QuestionTextModel> implements DoCheck, OnDestroy { | ||
@Input() question!: QuestionMultipleTextModel; | ||
@Input() model!: MultipleTextItemModel; | ||
@Input() model!: MultipleTextCell; | ||
protected getModel(): QuestionTextModel { | ||
return this.model.editor; | ||
if(!this.model.isErrorsCell) { | ||
return this.model.item.editor; | ||
} | ||
return null as any; | ||
} | ||
public get item(): MultipleTextItemModel { | ||
return this.model.item; | ||
} | ||
public get editor(): QuestionTextModel { | ||
return this.model.item.editor; | ||
} | ||
override ngDoCheck(): void { | ||
super.ngDoCheck(); | ||
if(this.model.isErrorsCell) { | ||
this.editor.registerFunctionOnPropertyValueChanged("errors", () => { | ||
this.update(); | ||
}, "__ngSubscription") | ||
} | ||
} | ||
override ngOnDestroy(): void { | ||
super.ngOnDestroy(); | ||
if(this.model.isErrorsCell) { | ||
this.editor.unRegisterFunctionOnPropertyValueChanged("errors", "__ngSubscription") | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/survey-angular-ui/src/questions/multipletextrow.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<ng-template #template> | ||
<tr [class]="question.cssClasses.row" *ngIf="model.isVisible"> | ||
<ng-container *ngFor="let cell of model.cells; trackBy: trackItemBy"> | ||
<td [class]="cell.className" [question]="question" [model]="cell" sv-ng-multipletext-item></td> | ||
</ng-container> | ||
</tr> | ||
</ng-template> |
19 changes: 19 additions & 0 deletions
19
packages/survey-angular-ui/src/questions/multipletextrow.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { MultipleTextCell, MultipleTextItemModel, MutlipleTextRow, QuestionMultipleTextModel, QuestionTextModel } from "survey-core"; | ||
import { Component, Input } from "@angular/core"; | ||
import { BaseAngular } from "../base-angular"; | ||
|
||
@Component({ | ||
selector: "sv-ng-multipletext-row", | ||
templateUrl: "./multipletextrow.component.html", | ||
styleUrls: ["../hide-host.scss"] | ||
}) | ||
export class MultipleTextRowComponent extends BaseAngular<MutlipleTextRow> { | ||
@Input() question!: QuestionMultipleTextModel; | ||
@Input() model!: MutlipleTextRow; | ||
protected getModel(): MutlipleTextRow { | ||
return this.model; | ||
} | ||
trackItemBy (_: number, cell: MultipleTextCell): string { | ||
return "item" + cell.item.editor.id; | ||
} | ||
} |
36 changes: 18 additions & 18 deletions
36
packages/survey-angular-ui/src/questions/mutlipletextitem.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<label [class]="question.getItemLabelCss(model)"> | ||
<span [class]="question.getItemTitleCss()"> | ||
<span *ngIf=" model.editor.isRequireTextBeforeTitle || model.editor.isRequireTextOnStart" | ||
[class]="question.cssClasses.requiredText">{{ model.editor.requiredText }}</span> | ||
<sv-ng-string [model]="model.locTitle"></sv-ng-string> | ||
<span | ||
*ngIf="model.editor.isRequireTextAfterTitle" | ||
[class]="question.cssClasses.requiredText" | ||
>{{ model.editor.requiredText }}</span | ||
> | ||
</span> | ||
<div [class]="question.getItemCss()" (focusin)="model.focusIn()"> | ||
<div *ngIf="model.editor.showErrorOnTop && model.editor.hasVisibleErrors" [element]="model.editor" sv-ng-errors></div> | ||
<sv-ng-text-question [model]="model.editor"></sv-ng-text-question> | ||
<div *ngIf="model.editor.showErrorOnBottom && model.editor.hasVisibleErrors" [element]="model.editor" sv-ng-errors></div> | ||
</div> | ||
<div *ngIf="model.editor.isErrorsModeTooltip && model.editor.hasVisibleErrors" [element]="model.editor" [location]="'tooltip'" sv-ng-errors></div> | ||
</label> | ||
<ng-container *ngIf="!model.isErrorsCell"> | ||
<label [class]="question.getItemLabelCss(item)"> | ||
<span [class]="question.getItemTitleCss()"> | ||
<span *ngIf=" item.editor.isRequireTextBeforeTitle || item.editor.isRequireTextOnStart" | ||
[class]="question.cssClasses.requiredText">{{ item.editor.requiredText }}</span> | ||
<sv-ng-string [model]="item.locTitle"></sv-ng-string> | ||
<span *ngIf="item.editor.isRequireTextAfterTitle"> </span> | ||
<span *ngIf="item.editor.isRequireTextAfterTitle" [class]="question.cssClasses.requiredText" aria-hidden="true">{{ | ||
item.editor.requiredText }}</span> | ||
</span> | ||
<div [class]="question.getItemCss()" (focusin)="item.focusIn()"> | ||
<sv-ng-text-question [model]="item.editor"></sv-ng-text-question> | ||
</div> | ||
</label> | ||
</ng-container> | ||
<ng-container *ngIf="model.isErrorsCell"> | ||
<div *ngIf="item.editor.hasVisibleErrors" [element]="item.editor" sv-ng-errors></div> | ||
</ng-container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.