@@ -6,11 +6,11 @@ import { DocumentViewer } from "react-documents";
66import styled , { css } from "styled-components" ;
77import { Section , sectionNames } from "lowcoder-design" ;
88import { StringControl } from "../controls/codeControl" ;
9- import { UICompBuilder } from "../generators" ;
9+ import { UICompBuilder , withDefault } from "../generators" ;
1010import { NameConfig , NameConfigHidden , withExposingConfigs } from "../generators/withExposing" ;
1111import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
1212import { trans } from "i18n" ;
13-
13+ import { AutoHeightControl , BoolControl } from "@lowcoder-ee/index.sdk" ;
1414import { useContext } from "react" ;
1515import { EditorContext } from "comps/editorState" ;
1616
@@ -67,6 +67,8 @@ const DraggableFileViewer = (props: { src: string; style: FileViewerStyleType,an
6767let FileViewerBasicComp = ( function ( ) {
6868 const childrenMap = {
6969 src : StringControl ,
70+ autoHeight : withDefault ( AutoHeightControl , 'auto' ) ,
71+ showVerticalScrollbar : withDefault ( BoolControl , false ) ,
7072 style : styleControl ( FileViewerStyle , 'style' ) ,
7173 animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
7274 } ;
@@ -100,6 +102,14 @@ let FileViewerBasicComp = (function () {
100102 { hiddenPropertyView ( children ) }
101103 </ Section >
102104 ) }
105+ < Section name = { sectionNames . layout } >
106+ { children . autoHeight . getPropertyView ( ) }
107+ { ! children . autoHeight . getView ( ) && (
108+ children . showVerticalScrollbar . propertyView ( {
109+ label : trans ( "prop.showVerticalScrollbar" ) ,
110+ } )
111+ ) }
112+ </ Section >
103113
104114 { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
105115 < >
@@ -119,7 +129,7 @@ let FileViewerBasicComp = (function () {
119129
120130FileViewerBasicComp = class extends FileViewerBasicComp {
121131 override autoHeight ( ) : boolean {
122- return false ;
132+ return this . children . autoHeight . getView ( ) ;
123133 }
124134} ;
125135
0 commit comments