-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Implemented #7181 - Cover mobile view * Work for #7181 - Cover mobile view - added components for Angular, Vue2 and Vue3 * Work for #7181 - Cover mobile view - renamed sv-cover to sv-header * Work for #7181 - Cover mobile view - renamed some files * Work for #7181 - Cover mobile view - added VR-test * Work for #7181 - Advanced header mobile view - fixed renderin for all platforms * Work for #7181 - Advanced header mobile view - fixed Vue3 build * Work for #7181 - Advanced header mobile view - try fix build --------- Co-authored-by: tsv2013 <[email protected]>
- Loading branch information
Showing
39 changed files
with
422 additions
and
184 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
8 changes: 4 additions & 4 deletions
8
...omponents/cover/cover-cell.component.html → ...ponents/header/header-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
File renamed without changes.
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
16 changes: 16 additions & 0 deletions
16
packages/survey-angular-ui/src/components/header/header-mobile.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,16 @@ | ||
|
||
<ng-template #template> | ||
<div class="sv-header--mobile"> | ||
<div *ngIf="model.survey.hasLogo" class="sv-header__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.survey.hasTitle" class="sv-header__title" [style]="{ maxWidth: model.textAreaWidth }"> | ||
<sv-ng-element-title [element]="model.survey"></sv-ng-element-title> | ||
</div> | ||
<div *ngIf="model.survey.renderedHasDescription" class="sv-header__description" [style]="{ maxWidth: model.textAreaWidth }"> | ||
<h5 *ngIf="model.survey.renderedHasDescription" [class]="model.survey.css.description" [model]="model.survey.locDescription" sv-ng-string></h5> | ||
</div> | ||
</div> | ||
</ng-template> |
File renamed without changes.
17 changes: 17 additions & 0 deletions
17
packages/survey-angular-ui/src/components/header/header-mobile.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-header-mobile", | ||
templateUrl: "./header-mobile.component.html", | ||
styles: [":host { display: none; }"], | ||
}) | ||
export class HeaderMobileComponent extends EmbeddedViewContentComponent { | ||
@Input() model!: Cover; | ||
@ViewChild("actionContent", { read: ViewContainerRef, static: true }) actionContent!: ViewContainerRef; | ||
} | ||
|
||
AngularComponentFactory.Instance.registerComponent("sv-header-cell", HeaderMobileComponent); |
7 changes: 5 additions & 2 deletions
7
...src/components/cover/cover.component.html → ...c/components/header/header.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,10 +1,13 @@ | ||
<ng-template #template> | ||
<div *ngIf="(survey.headerView === 'advanced' && survey.renderedHasHeader)" [class]="model.coverClasses" [style]="{ height: model.renderedHeight }"> | ||
<div *ngIf="!!model.backgroundImage" [style]="model.backgroundImageStyle" [class]="model.backgroundImageClasses"></div> | ||
<div [class]="model.contentClasses" [style.width]="model.maxWidth"> | ||
<div *ngIf="!survey.isMobile" [class]="model.contentClasses" [style.width]="model.maxWidth"> | ||
<ng-container *ngFor="let cell of model.cells"> | ||
<sv-ng-cover-cell [model]="cell"></sv-ng-cover-cell> | ||
<sv-ng-header-cell [model]="cell"></sv-ng-header-cell> | ||
</ng-container> | ||
</div> | ||
<div *ngIf="survey.isMobile"> | ||
<sv-ng-header-mobile [model]="model"></sv-ng-header-mobile> | ||
</div> | ||
</div> | ||
</ng-template> |
Empty file.
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
9 changes: 6 additions & 3 deletions
9
...ey-vue3-ui/src/components/cover/Cover.vue → ...-vue3-ui/src/components/header/Header.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
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: 33 additions & 0 deletions
33
packages/survey-vue3-ui/src/components/header/HeaderMobile.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,33 @@ | ||
<template> | ||
<div class="sv-header--mobile"> | ||
<div v-if="model.survey.hasLogo" class="sv-header__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, 'width': model.survey.renderedStyleLogoWidth, 'height': model.survey.renderedStyleLogoHeight } as any" | ||
/> | ||
</div> | ||
</div> | ||
<div v-if="model.survey.hasTitle" class="sv-header__title" :style="{ 'maxWidth': model.textAreaWidth }"> | ||
<survey-element-title :element="model.survey" :css="model.survey.css" /> | ||
</div> | ||
<div v-if="model.survey.renderedHasDescription" class="sv-header__description" :style="{ 'maxWidth': model.textAreaWidth }"> | ||
<h5 v-if="model.survey.renderedHasDescription" :class="model.survey.css.description"> | ||
<survey-string :locString="model.survey.locDescription" /> | ||
</h5> | ||
</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: Cover; | ||
}>(); | ||
</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.