@@ -21,21 +21,21 @@ import {
21
21
import { useExtensions } from "base/codeEditor/extensions" ;
22
22
import { EditorContext } from "comps/editorState" ;
23
23
import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
24
- import { AutoHeightControl } from "@lowcoder-ee/index.sdk" ;
24
+ import { AutoHeightControl , BoolControl } from "@lowcoder-ee/index.sdk" ;
25
25
26
26
/**
27
27
* JsonEditor Comp
28
28
*/
29
29
30
- const Wrapper = styled . div < { $height : boolean } > `
30
+ const Wrapper = styled . div < { $height : boolean ; $showVerticalScrollbar : boolean } > `
31
31
background-color: #fff;
32
32
border: 1px solid #d7d9e0;
33
33
border-radius: 4px;
34
34
overflow: scroll;
35
35
height: ${ ( props ) => ( props . $height ? '100%' : '300px' ) } ;
36
36
&::-webkit-scrollbar {
37
37
width: 16px;
38
- display:block !important;
38
+ display: ${ props => props . $showVerticalScrollbar && ' block !important' } ;
39
39
}
40
40
` ;
41
41
@@ -71,6 +71,7 @@ const childrenMap = {
71
71
value : jsonValueExposingStateControl ( 'value' , defaultData ) ,
72
72
onEvent : ChangeEventHandlerControl ,
73
73
autoHeight : AutoHeightControl ,
74
+ showVerticalScrollbar :BoolControl ,
74
75
label : withDefault ( LabelControl , { position : 'column' } ) ,
75
76
style : styleControl ( JsonEditorStyle , 'style' ) ,
76
77
animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
@@ -127,7 +128,14 @@ let JsonEditorTmpComp = (function () {
127
128
return props . label ( {
128
129
style : props . style ,
129
130
animationStyle : props . animationStyle ,
130
- children : < Wrapper ref = { wrapperRef } onFocus = { ( ) => ( editContent . current = "focus" ) } $height = { props . autoHeight } /> ,
131
+ children : (
132
+ < Wrapper
133
+ ref = { wrapperRef }
134
+ onFocus = { ( ) => ( editContent . current = 'focus' ) }
135
+ $height = { props . autoHeight }
136
+ $showVerticalScrollbar = { props . showVerticalScrollbar }
137
+ />
138
+ ) ,
131
139
} ) ;
132
140
} )
133
141
. setPropertyViewFn ( ( children ) => {
@@ -148,6 +156,9 @@ let JsonEditorTmpComp = (function () {
148
156
< Section name = { trans ( 'prop.height' ) } >
149
157
{ children . autoHeight . propertyView ( { label : trans ( 'prop.height' ) } ) }
150
158
</ Section >
159
+ < Section name = { sectionNames . layout } >
160
+ { children . showVerticalScrollbar . propertyView ( { label :trans ( 'prop.showVerticalScrollbar' ) } ) }
161
+ </ Section >
151
162
{ ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && ( children . label . getPropertyView ( ) ) }
152
163
{ ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
153
164
< >
0 commit comments