Skip to content

Commit 7f75647

Browse files
committed
pull from dev
2 parents ac126e6 + 9279376 commit 7f75647

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

client/packages/lowcoder/src/comps/hooks/drawerComp.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ const DrawerWrapper = styled.div`
4141
}
4242
`;
4343

44-
const StyledDrawer = styled(Drawer)<{$titleAlign?: string}>`
44+
const StyledDrawer = styled(Drawer)<{$titleAlign?: string, $drawerScrollbar: boolean}>`
4545
.ant-drawer-header-title {
4646
margin: 0px 20px !important;
4747
text-align: ${(props) => props.$titleAlign || "center"};
4848
}
49+
div.ant-drawer-body div.react-grid-layout::-webkit-scrollbar {
50+
display: ${(props) => props.$drawerScrollbar ? "block" : "none"};
51+
}
4952
`;
5053

5154
const ButtonStyle = styled(Button)<{$closePosition?: string, $title? :string}>`
@@ -93,6 +96,7 @@ let TmpDrawerComp = (function () {
9396
titleAlign: HorizontalAlignmentControl,
9497
horizontalGridCells: SliderControl,
9598
autoHeight: AutoHeightControl,
99+
drawerScrollbar: withDefault(BoolControl, true),
96100
style: styleControl(DrawerStyle),
97101
placement: PositionControl,
98102
closePosition: withDefault(LeftRightControl, "left"),
@@ -137,6 +141,7 @@ let TmpDrawerComp = (function () {
137141
}}
138142
title={props.title}
139143
$titleAlign={props.titleAlign}
144+
$drawerScrollbar={props.drawerScrollbar}
140145
closable={false}
141146
placement={props.placement}
142147
open={props.visible.value}
@@ -209,6 +214,7 @@ let TmpDrawerComp = (function () {
209214
{children.horizontalGridCells.propertyView({
210215
label: trans('prop.horizontalGridCells'),
211216
})}
217+
{children.drawerScrollbar.propertyView({ label: trans("prop.drawerScrollbar") })}
212218
{children.maskClosable.propertyView({
213219
label: trans("prop.maskClosable"),
214220
})}

client/packages/lowcoder/src/comps/hooks/modalComp.tsx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const EventOptions = [
2929
{ label: trans("modalComp.close"), value: "close", description: trans("modalComp.closeDesc") },
3030
] as const;
3131

32-
const getStyle = (style: ModalStyleType) => {
32+
const getStyle = (style: ModalStyleType, modalScrollbar: boolean) => {
3333
return css`
3434
.ant-modal-content {
3535
border-radius: ${style.radius};
@@ -49,6 +49,9 @@ const getStyle = (style: ModalStyleType) => {
4949
background-color: ${style.background};
5050
}
5151
}
52+
div.ant-modal-body div.react-grid-layout::-webkit-scrollbar {
53+
display: ${modalScrollbar ? "block" : "none"};
54+
}
5255
.ant-modal-close {
5356
inset-inline-end: 10px !important;
5457
top: 10px;
@@ -80,8 +83,8 @@ function extractMarginValues(style: ModalStyleType) {
8083
return valuesarray;
8184
}
8285

83-
const ModalStyled = styled.div<{ $style: ModalStyleType }>`
84-
${(props) => props.$style && getStyle(props.$style)}
86+
const ModalStyled = styled.div<{ $style: ModalStyleType, $modalScrollbar: boolean }>`
87+
${(props) => props.$style && getStyle(props.$style, props.$modalScrollbar)}
8588
`;
8689

8790
const ModalWrapper = styled.div`
@@ -105,6 +108,7 @@ let TmpModalComp = (function () {
105108
autoHeight: AutoHeightControl,
106109
title: StringControl,
107110
titleAlign: HorizontalAlignmentControl,
111+
modalScrollbar: withDefault(BoolControl, false),
108112
style: styleControl(ModalStyle),
109113
maskClosable: withDefault(BoolControl, true),
110114
showMask: withDefault(BoolControl, true),
@@ -174,7 +178,7 @@ let TmpModalComp = (function () {
174178
if (open) props.onEvent("open");
175179
}}
176180
zIndex={Layers.modal}
177-
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
181+
modalRender={(node) => <ModalStyled $style={props.style} $modalScrollbar={props.modalScrollbar}>{node}</ModalStyled>}
178182
mask={props.showMask}
179183
className={props.className as string}
180184
data-testid={props.dataTestId as string}
@@ -203,6 +207,10 @@ let TmpModalComp = (function () {
203207
label: trans('prop.horizontalGridCells'),
204208
})}
205209
{children.autoHeight.getPropertyView()}
210+
{!children.autoHeight.getView() &&
211+
children.modalScrollbar.propertyView({
212+
label: trans("prop.modalScrollbar")
213+
})}
206214
{!children.autoHeight.getView() &&
207215
children.height.propertyView({
208216
label: trans("modalComp.modalHeight"),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ export const en = {
204204
"showHorizontalScrollbar" : "Show Horizontal Scrollbar",
205205
"siderScrollbar" : "Show Scrollbars in Sider",
206206
"mainScrollbar": "Show Scrollbars in main content",
207+
"modalScrollbar": "Show Scrollbars in Modal",
208+
"drawerScrollbar": "Show Scrollbars in Drawer",
207209
"siderRight" : "Show sider on the Right",
208210
"siderWidth" : "Sider Width",
209211
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ export const en = {
197197
"scrollbar": "Show Scrollbars",
198198
"siderScrollbar": "Show Scrollbars in Sider",
199199
"mainScrollbar": "Show Scrollbars in main content",
200+
"modalScrollbar": "Show Scrollbars in Modal",
201+
"drawerScrollbar": "Show Scrollbars in Drawer",
200202
"siderRight": "Show sider on the Right",
201203
"siderWidth": "Sider Width",
202204
"siderWidthTooltip": "Sider width supports percentages (%) and pixels (px).",

translations/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ export const en = {
202202
"scrollbar": "Show Scrollbars",
203203
"siderScrollbar" : "Show Scrollbars in Sider",
204204
"mainScrollbar": "Show Scrollbars in main content",
205+
"modalScrollbar": "Show Scrollbars in Modal",
206+
"drawerScrollbar": "Show Scrollbars in Drawer",
205207
"siderRight" : "Show sider on the Right",
206208
"siderWidth" : "Sider Width",
207209
"siderWidthTooltip" : "Sider width supports percentages (%) and pixels (px).",

0 commit comments

Comments
 (0)