From a3cfa5dd5bf9122def02b3ee77a3d56e5b0b3103 Mon Sep 17 00:00:00 2001 From: TSV Date: Mon, 27 Feb 2023 11:02:52 +0300 Subject: [PATCH] Work for #5551 - Implement TOC navigation - fixed vr-tests - header/footer containers rendering - no wrapper now --- .../src/components-container.component.html | 15 +++++++++++---- .../src/components-container.component.ts | 4 ++++ .../src/survey-content.component.html | 4 ++-- .../components-container.html | 16 +++++++++++++++- .../components-container/components-container.ts | 4 ++-- src/knockout/templates/index.html | 4 ++-- src/react/components/components-container.tsx | 8 ++++++++ src/react/reactSurvey.tsx | 4 ++-- 8 files changed, 46 insertions(+), 13 deletions(-) diff --git a/packages/survey-angular-ui/src/components-container.component.html b/packages/survey-angular-ui/src/components-container.component.html index 11410735d5..3f67502dc5 100644 --- a/packages/survey-angular-ui/src/components-container.component.html +++ b/packages/survey-angular-ui/src/components-container.component.html @@ -1,7 +1,14 @@ -
- - + +
+ + + +
+
+ + + + -
\ No newline at end of file diff --git a/packages/survey-angular-ui/src/components-container.component.ts b/packages/survey-angular-ui/src/components-container.component.ts index 78a8e091d2..d7ce05935f 100644 --- a/packages/survey-angular-ui/src/components-container.component.ts +++ b/packages/survey-angular-ui/src/components-container.component.ts @@ -11,8 +11,12 @@ import { EmbeddedViewContentComponent } from "./embedded-view-content.component" export class ComponentsContainerComponent extends EmbeddedViewContentComponent { @Input() survey!: SurveyModel; @Input() container!: string; + @Input() needRenderWrapper?: boolean; get components(): Array { return this.survey.getContainerContent(this.container as any); } + get isNeedRenderWrapper(): boolean { + return this.needRenderWrapper === false ? false : true; + } } AngularComponentFactory.Instance.registerComponent("sv-components-container", ComponentsContainerComponent); \ No newline at end of file diff --git a/packages/survey-angular-ui/src/survey-content.component.html b/packages/survey-angular-ui/src/survey-content.component.html index 4297ac6c4f..f8f8db589e 100644 --- a/packages/survey-angular-ui/src/survey-content.component.html +++ b/packages/survey-angular-ui/src/survey-content.component.html @@ -4,7 +4,7 @@
- + @@ -36,7 +36,7 @@ - +
0 --> +
@@ -9,6 +10,19 @@ - +
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/knockout/components/components-container/components-container.ts b/src/knockout/components/components-container/components-container.ts index 646782aebb..2f5e5b0e79 100644 --- a/src/knockout/components/components-container/components-container.ts +++ b/src/knockout/components/components-container/components-container.ts @@ -3,7 +3,7 @@ import { SurveyModel } from "survey-core"; const template: string = require("./components-container.html"); export class ComponentsContainer { - constructor(public survey: SurveyModel, private container: any) { + constructor(public survey: SurveyModel, private container: any, public needRenderWrapper: boolean = true) { } css = "sv-components-column"; get components(): Array { @@ -15,7 +15,7 @@ ko.components.register("sv-components-container", { viewModel: { createViewModel: (params: any) => { const survey = params.survey as SurveyModel; - return new ComponentsContainer(survey, params.container); + return new ComponentsContainer(survey, params.container, params.needRenderWrapper); }, }, template: template diff --git a/src/knockout/templates/index.html b/src/knockout/templates/index.html index 315483cb6a..0e1abbfc33 100644 --- a/src/knockout/templates/index.html +++ b/src/knockout/templates/index.html @@ -11,7 +11,7 @@ - +
@@ -28,7 +28,7 @@
- +
diff --git a/src/react/components/components-container.tsx b/src/react/components/components-container.tsx index ab46d43d83..303ef91efe 100644 --- a/src/react/components/components-container.tsx +++ b/src/react/components/components-container.tsx @@ -5,9 +5,17 @@ import { ReactElementFactory } from "../element-factory"; export class ComponentsContainer extends React.Component { render(): JSX.Element | null { const components: Array = this.props.survey.getContainerContent(this.props.container); + const needRenderWrapper = this.props.needRenderWrapper === false ? false : true; if(components.length == 0) { return null; } + if(!needRenderWrapper) { + return <> + {components.map(component => { + return ReactElementFactory.Instance.createElement(component.component as string, { survey: this.props.survey, model: component.data, key: component.id }); + })} + ; + } return
{components.map(component => { return ReactElementFactory.Instance.createElement(component.component as string, { survey: this.props.survey, model: component.data, key: component.id }); diff --git a/src/react/reactSurvey.tsx b/src/react/reactSurvey.tsx index 16ec3965e1..0daac3e0e6 100644 --- a/src/react/reactSurvey.tsx +++ b/src/react/reactSurvey.tsx @@ -110,9 +110,9 @@ export class Survey extends SurveyElementBase {customHeader}
{header} - + {renderResult} - +
{ this.survey.showBrandInfo ? : null }