Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7758d4a

Browse files
author
FalkWolsky
committed
Update Scrollbars
1 parent5cadfc3 commit7758d4a

File tree

6 files changed

+36
-24
lines changed

6 files changed

+36
-24
lines changed

‎client/packages/lowcoder-design/src/components/ScrollBar.tsx‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,19 @@ interface IProps {
5858
hideScrollbar?:boolean;
5959
}
6060

61-
exportconstScrollBar=({ height="100%", className, children, style, scrollableNodeProps, hideScrollbar, ...otherProps}:IProps)=>{
61+
exportconstScrollBar=({ height="100%", className, children, style, scrollableNodeProps, hideScrollbar=false, ...otherProps}:IProps)=>{
6262
// You can now use the style prop directly or pass it to SimpleBar
6363
constcombinedStyle={ ...style, height};// Example of combining height with passed style
6464

65-
return(hideScrollbar??false) ?(
65+
returnhideScrollbar ?(
66+
<ScrollBarWrapperclassName={className}>
67+
{children}
68+
</ScrollBarWrapper>
69+
) :(
6670
<ScrollBarWrapperclassName={className}>
6771
<SimpleBarstyle={combinedStyle}scrollableNodeProps={scrollableNodeProps}{...otherProps}>
6872
{children}
6973
</SimpleBar>
7074
</ScrollBarWrapper>
71-
)
72-
:(
73-
<ScrollBarWrapperclassName={className}>
74-
{children}
75-
</ScrollBarWrapper>
7675
);
7776
};

‎client/packages/lowcoder/src/comps/comps/listViewComp/listView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export function ListView(props: Props) {
215215
<BackgroundColorContext.Providervalue={style.background}>
216216
<ListViewWrapper$style={style}$paddingWidth={paddingWidth}>
217217
<BodyWrapperref={ref}$autoHeight={autoHeight}>
218-
<ScrollBarstyle={{height:autoHeight ?"auto" :"100%",margin:"0px",padding:"0px"}}hideScrollbar={scrollbars}>
218+
<ScrollBarstyle={{height:autoHeight ?"auto" :"100%",margin:"0px",padding:"0px"}}hideScrollbar={!scrollbars}>
219219
<>{<ReactResizeDetectoronResize={(width?:number,height?:number)=>{if(height)setListHeight(height);}}observerOptions={{box:"border-box"}}>
220220
<divstyle={{height:autoHeight ?"auto" :"100%"}}>{renders}</div>
221221
</ReactResizeDetector>}</>

‎client/packages/lowcoder/src/comps/comps/moduleComp/moduleComp.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ class ModuleTmpComp extends ModuleCompBase {
505505
constModuleCompWithView=withViewFn(ModuleTmpComp,(comp)=>{
506506
constappId=comp.children.appId.getView();
507507
consterror=comp.children.error.getView();
508+
constscrollbars=comp.children.scrollbars.getView();
508509

509510
constmoduleExternalState:ExternalEditorContextState=useMemo(
510511
()=>({
@@ -530,7 +531,7 @@ const ModuleCompWithView = withViewFn(ModuleTmpComp, (comp) => {
530531
if(comp.moduleRootComp&&comp.isReady){
531532
content=(
532533
<WrapperclassName="module-wrapper">
533-
<ScrollBarstyle={{height:comp.children.scrollbars.getView() ?"100%" :"auto",margin:"0px",padding:"0px"}}>
534+
<ScrollBarstyle={{height:comp.autoHeight() ?"100%" :"auto",margin:"0px",padding:"0px"}}hideScrollbar={!scrollbars}>
534535
<ExternalEditorContext.Providervalue={moduleExternalState}>
535536
{comp.moduleRootComp.getView()}
536537
</ExternalEditorContext.Provider>

‎client/packages/lowcoder/src/comps/comps/tabs/tabbedContainerComp.tsx‎

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { JSONObject, JSONValue } from "util/jsonTypes";
33
import{CompAction,CompActionTypes,deleteCompAction,wrapChildAction}from"lowcoder-core";
44
import{DispatchType,RecordConstructorToView,wrapDispatch}from"lowcoder-core";
55
import{AutoHeightControl}from"comps/controls/autoHeightControl";
6-
import{BooleanStateControl,booleanExposingStateControl,stringExposingStateControl}from"comps/controls/codeStateControl";
6+
import{stringExposingStateControl}from"comps/controls/codeStateControl";
77
import{eventHandlerControl}from"comps/controls/eventHandlerControl";
88
import{TabsOptionControl}from"comps/controls/optionsControl";
99
import{styleControl}from"comps/controls/styleControl";
@@ -12,7 +12,7 @@ import { sameTypeMap, UICompBuilder, withDefault } from "comps/generators";
1212
import{addMapChildAction}from"comps/generators/sameTypeMap";
1313
import{NameConfig,NameConfigHidden,withExposingConfigs}from"comps/generators/withExposing";
1414
import{NameGenerator}from"comps/utils";
15-
import{ControlNode,Section,sectionNames}from"lowcoder-design";
15+
import{ScrollBar,Section,sectionNames}from"lowcoder-design";
1616
import{HintPlaceHolder}from"lowcoder-design";
1717
import_from"lodash";
1818
importReact,{useCallback,useContext}from"react";
@@ -33,6 +33,7 @@ import { DisabledContext } from "comps/generators/uiCompBuilder";
3333
import{EditorContext}from"comps/editorState";
3434
import{checkIsMobile}from"util/commonUtils";
3535
import{messageInstance}from"lowcoder-design";
36+
import{BoolControl}from"comps/controls/boolControl";
3637

3738
constEVENT_OPTIONS=[
3839
{
@@ -50,9 +51,10 @@ const childrenMap = {
5051
1:{layout:{},items:{}},
5152
}),
5253
autoHeight:AutoHeightControl,
54+
scrollbars:withDefault(BoolControl,false),
5355
onEvent:eventHandlerControl(EVENT_OPTIONS),
5456
disabled:BoolCodeControl,
55-
showHeader:withDefault(BooleanStateControl,"true"),
57+
showHeader:withDefault(BoolControl,true),
5658
style:styleControl(TabContainerStyle),
5759
headerStyle:styleControl(ContainerHeaderStyle),
5860
bodyStyle:styleControl(ContainerBodyStyle),
@@ -211,7 +213,7 @@ const TabbedContainer = (props: TabbedContainerProps) => {
211213
consteditorState=useContext(EditorContext);
212214
constmaxWidth=editorState.getAppSettings().maxWidth;
213215
constisMobile=checkIsMobile(maxWidth);
214-
constshowHeader=props.showHeader.value;
216+
constshowHeader=props.showHeader.valueOf();
215217
constpaddingWidth=isMobile ?8 :0;
216218

217219
consttabItems=visibleTabs.map((tab)=>{
@@ -236,14 +238,16 @@ const TabbedContainer = (props: TabbedContainerProps) => {
236238
forceRender:true,
237239
children:(
238240
<BackgroundColorContext.Providervalue={bodyStyle.background}>
239-
<ContainerInTab
240-
layout={containerProps.layout.getView()}
241-
items={gridItemCompToGridItems(containerProps.items.getView())}
242-
positionParams={containerProps.positionParams.getView()}
243-
dispatch={childDispatch}
244-
autoHeight={props.autoHeight}
245-
containerPadding={[paddingWidth,20]}
246-
/>
241+
<ScrollBarstyle={{height:props.autoHeight ?"100%" :"auto",margin:"0px",padding:"0px"}}hideScrollbar={!props.scrollbars}>
242+
<ContainerInTab
243+
layout={containerProps.layout.getView()}
244+
items={gridItemCompToGridItems(containerProps.items.getView())}
245+
positionParams={containerProps.positionParams.getView()}
246+
dispatch={childDispatch}
247+
autoHeight={props.autoHeight}
248+
containerPadding={[paddingWidth,20]}
249+
/>
250+
</ScrollBar>
247251
</BackgroundColorContext.Provider>
248252
)
249253
}
@@ -307,6 +311,11 @@ export const TabbedContainerBaseComp = (function () {
307311
<>
308312
<Sectionname={sectionNames.layout}>
309313
{children.autoHeight.getPropertyView()}
314+
{!children.autoHeight.getView()&&(
315+
children.scrollbars.propertyView({
316+
label:trans("prop.scrollbar"),
317+
})
318+
)}
310319
</Section>
311320
<Sectionname={sectionNames.style}>
312321
{children.style.getPropertyView()}

‎client/packages/lowcoder/src/comps/comps/triContainerComp/triContainer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function TriContainer(props: TriContainerProps) {
147147
)}
148148
{showBody&&(
149149
<BackgroundColorContext.Providervalue={bodyStyle.background}>
150-
<ScrollBarstyle={{height:container.autoHeight ?"auto" :"100%",margin:"0px",padding:"0px"}}hideScrollbar={scrollbars}>
150+
<ScrollBarstyle={{height:container.autoHeight ?"auto" :"100%",margin:"0px",padding:"0px"}}hideScrollbar={!scrollbars}>
151151
<BodyInnerGrid
152152
$showBorder={showHeader}
153153
{...otherBodyProps}

‎client/packages/lowcoder/src/comps/comps/triContainerComp/triContainerComp.tsx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,15 @@ export class TriContainerComp extends TriContainerBaseComp implements IContainer
125125
this.children.showHeader.propertyView({label:trans("prop.showHeader")}),
126126
this.children.showBody.propertyView({label:trans("prop.showBody")}),
127127
this.children.showFooter.propertyView({label:trans("prop.showFooter")}),
128-
(!this.children.autoHeight.getView())&&this.children.scrollbars.propertyView({label:trans("prop.scrollbar")}),
128+
129129
];
130130
}
131131

132132
heightPropertyView(){
133-
returnthis.children.autoHeight.getPropertyView();
133+
return[
134+
this.children.autoHeight.getPropertyView(),
135+
(!this.children.autoHeight.getView())&&this.children.scrollbars.propertyView({label:trans("prop.scrollbar")})
136+
];
134137
}
135138

136139
stylePropertyView(){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp