Skip to content

Commit

Permalink
Merge pull request #1055 from MenamAfzal/feat/toggle-modal-close
Browse files Browse the repository at this point in the history
toggle modal close
  • Loading branch information
FalkWolsky authored Jul 23, 2024
2 parents 3e84c3b + b19d7fb commit 0a18b11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/packages/lowcoder/src/comps/hooks/modalComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ let TmpModalComp = (function () {
style: styleControl(ModalStyle),
maskClosable: withDefault(BoolControl, true),
showMask: withDefault(BoolControl, true),
toggleClose:withDefault(BoolControl,true)
},
(props, dispatch) => {
const userViewMode = useUserViewMode();
Expand Down Expand Up @@ -147,6 +148,7 @@ let TmpModalComp = (function () {
<BackgroundColorContext.Provider value={props.style.background}>
<ModalWrapper>
<StyledModal
closable={props.toggleClose}
height={height}
resizeHandles={resizeHandles}
onResizeStop={onResizeStop}
Expand All @@ -160,10 +162,10 @@ let TmpModalComp = (function () {
$titleAlign={props.titleAlign}
width={width}
onCancel={(e) => {
props.visible.onChange(false);
props.toggleClose&&props.visible.onChange(false);
}}
afterClose={() => {
props.onEvent("close");
props.toggleClose&&props.onEvent("close");
}}
zIndex={Layers.modal}
modalRender={(node) => <ModalStyled $style={props.style}>{node}</ModalStyled>}
Expand Down Expand Up @@ -208,6 +210,9 @@ let TmpModalComp = (function () {
{children.showMask.propertyView({
label: trans("prop.showMask"),
})}
{children.toggleClose.propertyView({
label: trans("prop.toggleClose"),
})}
</Section>
<Section name={sectionNames.interaction}>{children.onEvent.getPropertyView()}</Section>
<Section name={sectionNames.style}>{children.style.getPropertyView()}</Section>
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const en = {
"innerSider" : "Inner Sider",
"showFooter": "Show Footer",
"maskClosable": "Click Outside to Close",
"toggleClose": "Enable Close Button",
"showMask": "Show Mask",
"textOverflow": "Text Overflow",
"scrollbar" : "Show Scrollbars",
Expand Down

0 comments on commit 0a18b11

Please sign in to comment.