Skip to content

Commit 2a55403

Browse files
committed
容器组件添加滚动条开关
container add scroll Switch
1 parent f4e0103 commit 2a55403

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

client/packages/lowcoder/src/comps/comps/containerComp/containerComp.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import { disabledPropertyView, hiddenPropertyView } from "comps/utils/propertyUt
1414
import { trans } from "i18n";
1515
import { BoolCodeControl } from "comps/controls/codeControl";
1616
import { DisabledContext } from "comps/generators/uiCompBuilder";
17+
import { BoolControl } from "@lowcoder-ee/comps/controls/boolControl";
1718

1819
export const ContainerBaseComp = (function () {
1920
const childrenMap = {
2021
disabled: BoolCodeControl,
22+
showScroll: BoolControl.DEFAULT_TRUE,
2123
};
2224
return new ContainerCompBuilder(childrenMap, (props, dispatch) => {
2325
return (
@@ -32,6 +34,8 @@ export const ContainerBaseComp = (function () {
3234
<Section name={sectionNames.interaction}>{disabledPropertyView(children)}</Section>
3335
<Section name={sectionNames.layout}>
3436
{children.container.getPropertyView()}
37+
{!children.container.children.autoHeight.getView() && children.showScroll.propertyView({
38+
label: trans("container.showScroll")})}
3539
{hiddenPropertyView(children)}
3640
</Section>
3741
<Section name={sectionNames.style}>{children.container.stylePropertyView()}</Section>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ const BodyInnerGrid = styled(InnerGrid)<{
3939
showBorder: boolean;
4040
backgroundColor: string;
4141
borderColor: string;
42+
showScroll?: boolean;
4243
}>`
4344
border-top: ${(props) => `${props.showBorder ? 1 : 0}px solid ${props.borderColor}`};
4445
flex: 1;
46+
overflow: ${(props) => `${props.showScroll ? 'auto' : 'hidden'}`};
4547
${(props) => props.backgroundColor && `background-color: ${props.backgroundColor};`}
4648
border-radius: 0;
4749
`;
@@ -59,6 +61,7 @@ const FooterInnerGrid = styled(InnerGrid)<{
5961

6062
export type TriContainerProps = TriContainerViewProps & {
6163
hintPlaceholder?: ReactNode;
64+
showScroll?: boolean;
6265
};
6366

6467
export function TriContainer(props: TriContainerProps) {
@@ -110,6 +113,7 @@ export function TriContainer(props: TriContainerProps) {
110113
hintPlaceholder={props.hintPlaceholder ?? HintPlaceHolder}
111114
backgroundColor={style?.background}
112115
borderColor={style?.border}
116+
showScroll={props?.showScroll}
113117
style={{padding: style.containerbodypadding}}
114118
/>
115119
</BackgroundColorContext.Provider>

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,7 @@ export const en = {
13551355
},
13561356
container: {
13571357
title: "Container title",
1358+
showScroll: "Show scroll",
13581359
},
13591360
drawer: {
13601361
placement: "Drawer placement",

client/packages/lowcoder/src/i18n/locales/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,7 @@ selectionControl: {
13331333
},
13341334
container: {
13351335
title: "容器标题",
1336+
showScroll: "显示滚动条",
13361337
},
13371338
drawer: {
13381339
placement: "抽屉位置",

0 commit comments

Comments
 (0)