@@ -6,11 +6,11 @@ import { DocumentViewer } from "react-documents";
6
6
import styled , { css } from "styled-components" ;
7
7
import { Section , sectionNames } from "lowcoder-design" ;
8
8
import { StringControl } from "../controls/codeControl" ;
9
- import { UICompBuilder } from "../generators" ;
9
+ import { UICompBuilder , withDefault } from "../generators" ;
10
10
import { NameConfig , NameConfigHidden , withExposingConfigs } from "../generators/withExposing" ;
11
11
import { hiddenPropertyView } from "comps/utils/propertyUtils" ;
12
12
import { trans } from "i18n" ;
13
-
13
+ import { AutoHeightControl , BoolControl } from "@lowcoder-ee/index.sdk" ;
14
14
import { useContext } from "react" ;
15
15
import { EditorContext } from "comps/editorState" ;
16
16
@@ -67,6 +67,8 @@ const DraggableFileViewer = (props: { src: string; style: FileViewerStyleType,an
67
67
let FileViewerBasicComp = ( function ( ) {
68
68
const childrenMap = {
69
69
src : StringControl ,
70
+ autoHeight : withDefault ( AutoHeightControl , 'auto' ) ,
71
+ showVerticalScrollbar : withDefault ( BoolControl , false ) ,
70
72
style : styleControl ( FileViewerStyle , 'style' ) ,
71
73
animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
72
74
} ;
@@ -100,6 +102,14 @@ let FileViewerBasicComp = (function () {
100
102
{ hiddenPropertyView ( children ) }
101
103
</ Section >
102
104
) }
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 >
103
113
104
114
{ [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
105
115
< >
@@ -119,7 +129,7 @@ let FileViewerBasicComp = (function () {
119
129
120
130
FileViewerBasicComp = class extends FileViewerBasicComp {
121
131
override autoHeight ( ) : boolean {
122
- return false ;
132
+ return this . children . autoHeight . getView ( ) ;
123
133
}
124
134
} ;
125
135
0 commit comments