Skip to content

Commit 2ac504b

Browse files
committed
added expression to dis drag
1 parent 06168f0 commit 2ac504b

File tree

7 files changed

+14
-3
lines changed

7 files changed

+14
-3
lines changed

apps/web-widgets/drag-and-drop-widget/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "draganddropwidget",
33
"widgetName": "Draganddropwidget",
4-
"version": "3.0.3",
4+
"version": "3.0.4",
55
"description": "My widget description",
66
"copyright": "2022 Mendix Technology BV",
77
"author": "ahwelgemoed",

apps/web-widgets/drag-and-drop-widget/src/Draganddropwidget.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ const DndWidget: FunctionComponent<DraganddropwidgetContainerProps> = props => {
174174
onDrop={onDrop}
175175
allData={allData}
176176
isOverIndex={isOverIndex}
177+
canDrag={props.disableDrag.value as boolean}
177178
isDragging={isDragging}
178179
isColumn={props.isColumn}
179180
setIsDragging={setIsDragging}

apps/web-widgets/drag-and-drop-widget/src/Draganddropwidget.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<widget id="mendix.draganddropwidget.Draganddropwidget" pluginWidget="true" offlineCapable="true" xmlns="http://www.mendix.com/widget/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mendix.com/widget/1.0/ ../../node_modules/mendix/custom_widget.xsd">
33
<name>Draganddropwidget</name>
4-
<description>My widget description</description>
4+
<description>DND Widget</description>
55
<icon>iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZlSURBVHgB7ZpXaFRNFMdPgr1gAzv2CmpU7IoN9MHypAjqg4qIiqKCDey9K/giil2TkLckT8lLSIFAGqmQQHpC8pAQ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
8989
</property>
9090

91+
<property key="disableDrag" type="expression" defaultValue="false">
92+
<caption>Disable Drag</caption>
93+
<description></description>
94+
<returnType type="Boolean" />
95+
</property>
96+
9197
<property key="acceptedUuid" type="object" isList="true" required="false">
9298
<caption>Unique Container Name Accepts</caption>
9399
<description>Unique Container Name Accepts Drags/Drops From</description>

apps/web-widgets/drag-and-drop-widget/src/components/DroppableItem.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const DroppableItem: FunctionComponent<Type_Card_Props> = props => {
7676
type: props.droppedOnUUID,
7777
item: { ...props, ref }
7878
},
79+
canDrag: !props.canDrag,
7980
begin: () => {
8081
props.setIsDragging(true);
8182
},

apps/web-widgets/drag-and-drop-widget/src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="Draganddropwidget" version="3.0.3" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="Draganddropwidget" version="3.0.4" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="Draganddropwidget.xml"/>
66
</widgetFiles>

apps/web-widgets/drag-and-drop-widget/src/userTypes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export type Type_Card_Props = {
88
isColumn: boolean;
99
children: ReactNode;
1010
isDragging: boolean;
11+
canDrag: boolean;
1112
droppedOnUUID: string;
1213
acceptedUUids: string[];
1314
uuidStringParent: string;

apps/web-widgets/drag-and-drop-widget/typings/DraganddropwidgetProps.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export interface DraganddropwidgetContainerProps {
3434
sort: SortEnum;
3535
isColumn: boolean;
3636
uuidStringParent?: EditableValue<string>;
37+
disableDrag: DynamicValue<boolean>;
3738
acceptedUuid: AcceptedUuidType[];
3839
uuidStringParentExpression?: DynamicValue<string>;
3940
uuidStringCurrent: ListAttributeValue<string>;
@@ -58,6 +59,7 @@ export interface DraganddropwidgetPreviewProps {
5859
sort: SortEnum;
5960
isColumn: boolean;
6061
uuidStringParent: string;
62+
disableDrag: string;
6163
acceptedUuid: AcceptedUuidPreviewType[];
6264
uuidStringParentExpression: string;
6365
uuidStringCurrent: string;

0 commit comments

Comments
 (0)