Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed folder or content title overflow in module panel and applied it… #1339

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function DraggableMenuItem(props: IDraggableMenuItemProps) {
>
<span style={{cursor: "default"}}>⣿</span>
</DraggableItem>
<div style={{flex: 1}}>
<div style={{ flex: 1 , maxWidth: "calc(100% - 12px)" }}>
{renderContent?.({
node: item,
isOver,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ const HighlightBorder = styled.div<{ $active: boolean; $foldable: boolean; $leve
max-width: 100%;
flex: 1;
display: flex;
padding-left: ${(props) => props.$level * 20 + (props.$foldable ? 0 : 14)}px;
padding-left: ${(props) => props.$level * 10 + (props.$foldable ? 0 : 14)}px;
border-radius: 4px;
border: 1px solid ${(props) => (props.$active ? BorderActiveColor : "transparent")};
align-items: center;
Expand Down
15 changes: 10 additions & 5 deletions client/packages/lowcoder/src/pages/editor/right/ModulePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const ItemWrapper = styled.div`
}
.module-container {
display: flex;
width: 195px;
}
.module-icon {
margin-right: 4px;
Expand Down Expand Up @@ -167,6 +168,7 @@ interface ModuleItemProps {
setSelectedType: (id: boolean) => void;
resComp: NodeType;
id: string;
$level: number;
}

function ModuleItem(props: ModuleItemProps) {
Expand All @@ -179,7 +181,8 @@ function ModuleItem(props: ModuleItemProps) {
selectedType,
setSelectedType,
resComp,
id
id,
$level,
} = props;
const dispatch = useDispatch();
const type = resComp.isFolder;
Expand Down Expand Up @@ -243,8 +246,9 @@ function ModuleItem(props: ModuleItemProps) {
>
<div className="module-container" >
<ModuleDocIcon className="module-icon"/>
<div style={{flexGrow: 1, marginRight: "8px", width: "calc(100% - 62px)"}}>
<EditText
<div style={{ flexGrow: 1, maxWidth: 174 - $level*10 }}>
<EditText
style={{ width: "100%" }}
text={meta.name}
forceClickIcon={false}
disabled={!isSelected || readOnly || isOverlay}
Expand All @@ -268,7 +272,7 @@ const HighlightBorder = styled.div<{ $active: boolean; $foldable: boolean; $leve
max-width: 100%;
flex: 1;
display: flex;
padding-left: ${(props) => props.$level * 20 + (props.$foldable ? 0 : 14)}px;
padding-left: ${(props) => props.$level * 10 + (props.$foldable ? 0 : 14)}px;
border-radius: 4px;
border: 1px solid ${(props) => (props.$active ? BorderActiveColor : "transparent")};
align-items: center;
Expand Down Expand Up @@ -479,7 +483,8 @@ function ModuleSidebarItem(props: ModuleSidebarItemProps) {
selectedType={selectedType}
setSelectedType={setSelectedType}
resComp = {resComp}
id = {id}
id={id}
$level={level}
/>}
{!readOnly && !isOverlay && (
<EditPopover del={() => onDelete()}>
Expand Down
Loading