Skip to content

Commit ab549e4

Browse files
authored
Merge pull request #1334 from lowcoder-org/feature-extension
Feature extension
2 parents d6d7a88 + 4e4e906 commit ab549e4

File tree

8 files changed

+798
-128
lines changed

8 files changed

+798
-128
lines changed

client/packages/lowcoder/src/components/DraggableTree/DraggableItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Wrapper = styled.div<{
1515
$itemHeight?: number;
1616
}>`
1717
position: relative;
18-
width: 100%;
18+
width: auto;
1919
height: ${(props) => props.$itemHeight ?? 30}px;
2020
/* border: 1px solid #d7d9e0; */
2121
border-radius: 4px;

client/packages/lowcoder/src/components/DraggableTree/DroppableMenuItem.tsx

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { DraggableTreeContext } from "./DraggableTreeContext";
66
import DroppablePlaceholder from "./DroppablePlaceHolder";
77
import { DraggableTreeNode, DraggableTreeNodeItemRenderProps, IDragData, IDropData } from "./types";
88
import { checkDroppableFlag } from "./util";
9+
import { Flex } from "antd";
910

1011
const DraggableMenuItemWrapper = styled.div`
1112
position: relative;
@@ -88,29 +89,34 @@ export default function DraggableMenuItem(props: IDraggableMenuItemProps) {
8889
disabled={isDragging || disabled}
8990
/>
9091
)}
91-
<DraggableItem
92-
path={path}
93-
id={id}
94-
dropInAsSub={dropInAsSub && canDropIn !== false}
95-
isOver={isOver}
96-
ref={(node) => {
97-
setDragNodeRef(node);
98-
setDropNodeRef(node);
99-
}}
100-
{...dragListeners}
101-
>
102-
{renderContent?.({
103-
node: item,
104-
isOver,
105-
path,
106-
isOverlay,
107-
hasChildren: items.length > 0,
108-
dragging: !!(isDragging || parentDragging),
109-
isFolded: isFold,
110-
onDelete: () => onDelete?.(path),
111-
onToggleFold: () => context.toggleFold(id),
112-
}) || null}
113-
</DraggableItem>
92+
<Flex style={{paddingLeft: '15px'}} align="center">
93+
<DraggableItem
94+
path={path}
95+
id={id}
96+
dropInAsSub={dropInAsSub && canDropIn !== false}
97+
isOver={isOver}
98+
ref={(node) => {
99+
setDragNodeRef(node);
100+
setDropNodeRef(node);
101+
}}
102+
{...dragListeners}
103+
>
104+
<span style={{cursor: "default"}}></span>
105+
</DraggableItem>
106+
<div style={{flex: 1}}>
107+
{renderContent?.({
108+
node: item,
109+
isOver,
110+
path,
111+
isOverlay,
112+
hasChildren: items.length > 0,
113+
dragging: !!(isDragging || parentDragging),
114+
isFolded: isFold,
115+
onDelete: () => onDelete?.(path),
116+
onToggleFold: () => context.toggleFold(id),
117+
}) || null}
118+
</div>
119+
</Flex>
114120
</DraggableMenuItemWrapper>
115121
{items.length > 0 && !isFold && (
116122
<div className="sub-menu-list">

client/packages/lowcoder/src/constants/reduxActionConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const ReduxActionTypes = {
99
FETCH_RAW_CURRENT_USER_SUCCESS: "FETCH_RAW_CURRENT_USER_SUCCESS",
1010
FETCH_API_KEYS: "FETCH_API_KEYS",
1111
FETCH_API_KEYS_SUCCESS: "FETCH_API_KEYS_SUCCESS",
12-
12+
MOVE_TO_FOLDER2_SUCCESS: "MOVE_TO_FOLDER2_SUCCESS",
1313

1414
/* plugin RELATED */
1515
FETCH_DATA_SOURCE_TYPES: "FETCH_DATA_SOURCE_TYPES",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,7 @@ export const en = {
27852785
"switch": "Switch Component: "
27862786
},
27872787
"module": {
2788+
"folderNotEmpty": "Folder is not empty",
27882789
"emptyText": "No Data",
27892790
"docLink": "Read More About Modules...",
27902791
"documentationText" : "Modules are complete Applications, that can get included and repeated in other Applications and it functions just like a single component. As modules can get embedded, they need to be able to interact with your outside apps or websites. This four settings help to support communication with a Module.",

0 commit comments

Comments
 (0)