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

Drawer Close Button Left or Right#716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
FalkWolsky merged 2 commits intolowcoder-org:devfromsudoischenny:main
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 44 additions & 31 deletionsclient/packages/lowcoder/src/comps/hooks/drawerComp.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
import { CloseOutlined } from "@ant-design/icons";
import { CloseOutlined, PropertySafetyFilled } from "@ant-design/icons";
import { default as Button } from "antd/es/button";
import { ContainerCompBuilder } from "comps/comps/containerBase/containerCompBuilder";
import { gridItemCompToGridItems, InnerGrid } from "comps/comps/containerComp/containerView";
import { AutoHeightControl } from "comps/controls/autoHeightControl";
import { BoolControl } from "comps/controls/boolControl";
import { StringControl } from "comps/controls/codeControl";
import { booleanExposingStateControl } from "comps/controls/codeStateControl";
import { PositionControl } from "comps/controls/dropdownControl";
import { PositionControl, LeftRightControl } from "comps/controls/dropdownControl";
import { closeEvent, eventHandlerControl } from "comps/controls/eventHandlerControl";
import { styleControl } from "comps/controls/styleControl";
import { DrawerStyle } from "comps/controls/styleControlConstants";
Expand DownExpand Up@@ -35,40 +35,22 @@ const DrawerWrapper = styled.div`
pointer-events: auto;
`;

const ButtonStyle = styled(Button)`
position: absolute;
left: 0;
top: 0;
z-index: 10;
font-weight: 700;
box-shadow: none;
color: rgba(0, 0, 0, 0.45);
height: 54px;
width: 54px;

svg {
width: 16px;
height: 16px;
}

&,
:hover,
:focus {
background-color: transparent;
border: none;
}

:hover,
:focus {
color: rgba(0, 0, 0, 0.75);
}
`;

// If it is a number, use the px unit by default
function transToPxSize(size: string | number) {
return isNumeric(size) ? size + "px" : (size as string);
}

const ClosePlacementOptions = [
{
label: trans("drawer.left"),
value: "left",
},
{
label: trans("drawer.right"),
value: "right",
},
] as const;

const PlacementOptions = [
{
label: trans("drawer.top"),
Expand All@@ -88,6 +70,7 @@ const PlacementOptions = [
},
] as const;


let TmpDrawerComp = (function () {
return new ContainerCompBuilder(
{
Expand All@@ -98,6 +81,7 @@ let TmpDrawerComp = (function () {
autoHeight: AutoHeightControl,
style: styleControl(DrawerStyle),
placement: PositionControl,
closePosition: withDefault(LeftRightControl, "left"),
maskClosable: withDefault(BoolControl, true),
showMask: withDefault(BoolControl, true),
},
Expand All@@ -119,6 +103,34 @@ let TmpDrawerComp = (function () {
},
[dispatch, isTopBom]
);
const ButtonStyle = styled(Button)`
position: absolute;
${props.closePosition === "right" ? "right: 0;" : "left: 0;"}
top: 0;
z-index: 10;
font-weight: 700;
box-shadow: none;
color: rgba(0, 0, 0, 0.45);
height: 54px;
width: 54px;

svg {
width: 16px;
height: 16px;
}

&,
:hover,
:focus {
background-color: transparent;
border: none;
}

:hover,
:focus {
color: rgba(0, 0, 0, 0.75);
}
`;
return (
<BackgroundColorContext.Provider value={props.style.background}>
<DrawerWrapper>
Expand DownExpand Up@@ -181,6 +193,7 @@ let TmpDrawerComp = (function () {
.setPropertyViewFn((children) => (
<>
<Section name={sectionNames.basic}>
{children.closePosition.propertyView({ label: trans("drawer.closePosition"), radioButton: true })}
{children.placement.propertyView({ label: trans("drawer.placement"), radioButton: true })}
{["top", "bottom"].includes(children.placement.getView())
? children.autoHeight.getPropertyView()
Expand Down
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/i18n/locales/de.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1347,6 +1347,7 @@ export const de = {
"title": "Angezeigter Container-Titel"
},
"drawer": {
"closePosition": "Platzierung der Verschlusses",
"placement": "Platzierung der Schubladen",
"size": "Größe",
"top": "Top",
Expand Down
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/i18n/locales/en.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1500,6 +1500,7 @@ export const en = {
"title": "Displayed Container Title"
},
"drawer": {
"closePosition": "Close Button Placement",
"placement": "Drawer Placement",
"size": "Size",
"top": "Top",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1335,6 +1335,7 @@
"title": "Angezeigter Container-Titel"
},
"drawer": {
"closePosition": "Platzierung der Verschlusses",
"placement": "Platzierung der Schubladen",
"size": "Größe",
"top": "Top",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1399,6 +1399,7 @@
"title": "Displayed Container Title"
},
"drawer": {
"closePosition": "Close Button Placement",
"placement": "Drawer Placement",
"size": "Size",
"top": "Top",
Expand Down
View file
Open in desktop

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/i18n/locales/zh.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1469,6 +1469,7 @@ container: {
title: "容器标题",
},
drawer: {
closePosition: "关闭位置",
placement: "抽屉位置",
size: "大小",
top: "顶部",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp