-
Notifications
You must be signed in to change notification settings - Fork 823
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* work for "Title cover" : step 1 * work for "Title cover" : step 2 add vertical aligment & * work for "Title cover" : step 3 add title & description components * work for "Title cover" : step 4 add background image * work for "Title cover" : step 5 save cover into theme * work for "Title cover" : step 6 change layouting * Work for #248 - Cover - implemented cover elements positioning * Fixed titleView default to pass tests - surveyjs/private-tasks#248 * work for "Title cover" : small fixes * Work for surveyjs/private-tasks#248 - implemented cover for react and vue2 * Fixed lint * Work for surveyjs/private-tasks#248 - implemented cover for vue3 * Work for surveyjs/private-tasks#248 - implemented cover for angular * Work for surveyjs/private-tasks#248 - fixed text width (allow be greater than cell width) * Work for surveyjs/private-tasks#248 - added cover in titleView setter + generate default cover * Work for surveyjs/private-tasks#248 - added cover in titleView setter + generate default cover - added vr-test * Removed test.only * Work for surveyjs/private-tasks#248 - try to fix PR * work for "Title cover" : update etalon & try fix vue3 * work for "Title cover" : fix vue3 * work for "Title cover" : exclude jquery for knockout tests * work for "Title cover" : exclude jquery for knockout tests * work for "Title cover" : fix angular layout --------- Co-authored-by: OlgaLarina <[email protected]> Co-authored-by: tsv2013 <[email protected]> Co-authored-by: tsv2013 <[email protected]>
- Loading branch information
1 parent
f5ff072
commit cde9938
Showing
41 changed files
with
945 additions
and
23 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
18 changes: 18 additions & 0 deletions
18
packages/survey-angular-ui/src/components/cover/cover-cell.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,18 @@ | ||
|
||
<ng-template #template> | ||
<div [class]="model.css" [style]="model.style"> | ||
<div class="sv-cover__cell-content" [style]="model.contentStyle"> | ||
<div *ngIf="model.showLogo" class="sv-cover__logo"> | ||
<div [class]="model.survey.logoClassNames"> | ||
<ng-template [component]="{ name: model.survey.getElementWrapperComponentName(model.survey, 'logo-image'), data: { data: model.survey.getElementWrapperComponentData(model.survey, 'logo-image') } }"></ng-template> | ||
</div> | ||
</div> | ||
<div *ngIf="model.showTitle" class="sv-cover__title" [style]="{ maxWidth: model.textWidth }"> | ||
<sv-ng-element-title [element]="model.survey"></sv-ng-element-title> | ||
</div> | ||
<div *ngIf="model.showDescription" class="sv-cover__description" [style]="{ maxWidth: model.textWidth }"> | ||
<h5 *ngIf="model.survey.renderedHasDescription" [class]="model.survey.css.description" [model]="model.survey.locDescription" sv-ng-string></h5> | ||
</div> | ||
</div> | ||
</div> | ||
</ng-template> |
Empty file.
17 changes: 17 additions & 0 deletions
17
packages/survey-angular-ui/src/components/cover/cover-cell.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,17 @@ | ||
import { Component, Input, ViewChild, ViewContainerRef } from "@angular/core"; | ||
import { BaseAngular } from "../../base-angular"; | ||
import { EmbeddedViewContentComponent } from "../../embedded-view-content.component"; | ||
import { AngularComponentFactory } from "../../component-factory"; | ||
import { Cover, CoverCell, SurveyModel } from "survey-core"; | ||
|
||
@Component({ | ||
selector: "sv-ng-cover-cell", | ||
templateUrl: "./cover-cell.component.html", | ||
styles: [":host { display: none; }"], | ||
}) | ||
export class CoverCellComponent extends EmbeddedViewContentComponent { | ||
@Input() model!: CoverCell; | ||
@ViewChild("actionContent", { read: ViewContainerRef, static: true }) actionContent!: ViewContainerRef; | ||
} | ||
|
||
AngularComponentFactory.Instance.registerComponent("sv-cover-cell", CoverCellComponent); |
10 changes: 10 additions & 0 deletions
10
packages/survey-angular-ui/src/components/cover/cover.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,10 @@ | ||
<ng-template #template> | ||
<div *ngIf="(survey.titleView === 'cover' && survey.renderedHasHeader)" [class]="model.coverClasses" [style]="{ height: model.renderedHeight, backgroundColor: model.backgroundColor }"> | ||
<div *ngIf="!!model.backgroundImage" [style]="model.backgroundImageStyle" [class]="model.backgroundImageClasses"></div> | ||
<div [class]="model.contentClasses"> | ||
<ng-container *ngFor="let cell of model.cells"> | ||
<sv-ng-cover-cell [model]="cell"></sv-ng-cover-cell> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</ng-template> |
Empty file.
21 changes: 21 additions & 0 deletions
21
packages/survey-angular-ui/src/components/cover/cover.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,21 @@ | ||
import { Component, ElementRef, Input, ViewChild } from "@angular/core"; | ||
import { AngularComponentFactory } from "../../component-factory"; | ||
import { BaseAngular } from "../../base-angular"; | ||
import { Cover, CoverCell, SurveyModel } from "survey-core"; | ||
|
||
@Component({ | ||
selector: "sv-cover, sv-ng-cover", | ||
templateUrl: "./cover.component.html", | ||
styles: [":host { display: none }"] | ||
}) | ||
export class CoverComponent extends BaseAngular<Cover> { | ||
@Input() model!: Cover; | ||
@Input() survey!: SurveyModel; | ||
@ViewChild("container") container!: ElementRef<HTMLDivElement>; | ||
getModel(): Cover { | ||
this.model.survey = this.survey; | ||
return this.model; | ||
} | ||
} | ||
|
||
AngularComponentFactory.Instance.registerComponent("sv-cover", CoverComponent); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<div :class="model.coverClasses" :style="{ 'height': model.renderedHeight, 'backgroundColor': model.backgroundColor }"> | ||
<div v-if="!!model.backgroundImage" :class="model.backgroundImageClasses" :style="model.backgroundImageStyle"></div> | ||
<div :class="model.contentClasses"> | ||
<sv-cover-cell | ||
v-for="cell in model.cells" | ||
:model="cell" | ||
></sv-cover-cell> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { Base, SurveyModel, Cover, CoverCell } from "survey-core"; | ||
import { useBase } from "@/base"; | ||
import { onMounted, onUnmounted, ref } from "vue"; | ||
const props = defineProps<{ | ||
model: Cover; | ||
survey: SurveyModel; | ||
}>(); | ||
useBase(() => { | ||
props.model.survey = props.survey | ||
return props.model; | ||
}); | ||
</script> |
35 changes: 35 additions & 0 deletions
35
packages/survey-vue3-ui/src/components/cover/CoverCell.vue
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,35 @@ | ||
<template> | ||
<div :class="model.css" :style="model.style"> | ||
<div class="sv-cover__cell-content" :style="model.contentStyle"> | ||
<div v-if="model.showLogo" class="sv-cover__logo"> | ||
<div :class="model.survey.logoClassNames"> | ||
<img | ||
:class="model.survey.css.logoImage" | ||
:src="model.survey.locLogo.renderedHtml" | ||
:width="model.survey.renderedLogoWidth" | ||
:height="model.survey.renderedLogoHeight" | ||
:alt="model.survey.locTitle.renderedHtml" | ||
:style="{ 'objectFit': model.survey.logoFit as any, 'width': model.survey.renderedStyleLogoWidth, 'height': model.survey.renderedStyleLogoHeight }" | ||
/> | ||
</div> | ||
</div> | ||
<div v-if="model.showTitle" class="sv-cover__title" :style="{ 'maxWidth': model.textWidth }"> | ||
<survey-element-title :element="model.survey" :css="model.survey.css" /> | ||
</div> | ||
<div v-if="model.showDescription" class="sv-cover__description" :style="{ 'maxWidth': model.textWidth }"> | ||
<h5 v-if="model.survey.renderedHasDescription" :class="model.survey.css.description"> | ||
<survey-string :locString="model.survey.locDescription" /> | ||
</h5> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { Base, SurveyModel, Cover, CoverCell } from "survey-core"; | ||
import { onMounted, onUnmounted, ref } from "vue"; | ||
const props = defineProps<{ | ||
model: CoverCell; | ||
}>(); | ||
</script> |
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.