From 08d3811d78adc4d5323f5c620f1155301071d2f1 Mon Sep 17 00:00:00 2001 From: Jenny <32821331+jenny-s51@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:48:09 -0500 Subject: [PATCH] feat(context menu): Add the hideContextMenuKebab option to groups add feature to topology package demo --- .../demo-app-ts/src/demos/topologyPackageDemo/DemoGroup.tsx | 3 ++- packages/module/src/components/groups/DefaultGroup.tsx | 2 ++ .../module/src/components/groups/DefaultGroupCollapsed.tsx | 3 +++ packages/module/src/components/groups/DefaultGroupExpanded.tsx | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/demo-app-ts/src/demos/topologyPackageDemo/DemoGroup.tsx b/packages/demo-app-ts/src/demos/topologyPackageDemo/DemoGroup.tsx index 7116ccc7..34c2a8a7 100644 --- a/packages/demo-app-ts/src/demos/topologyPackageDemo/DemoGroup.tsx +++ b/packages/demo-app-ts/src/demos/topologyPackageDemo/DemoGroup.tsx @@ -51,7 +51,8 @@ const DemoGroup: React.FunctionComponent = ({ element, onContext return ( void; /** Flag indicating that the context menu for the node is currently open */ contextMenuOpen?: boolean; + /** Hide context menu kebab for the group */ + hideContextMenuKebab?: boolean; /** Flag indicating whether to use hull layout or rect layout for expanded groups. Defaults to hull (true) */ hulledOutline?: boolean; } diff --git a/packages/module/src/components/groups/DefaultGroupCollapsed.tsx b/packages/module/src/components/groups/DefaultGroupCollapsed.tsx index 0eff33ae..5711fc8b 100644 --- a/packages/module/src/components/groups/DefaultGroupCollapsed.tsx +++ b/packages/module/src/components/groups/DefaultGroupCollapsed.tsx @@ -32,6 +32,7 @@ type DefaultGroupCollapsedProps = { label?: string; // Defaults to element.getLabel() secondaryLabel?: string; showLabel?: boolean; // Defaults to true + hideContextMenuKebab?: boolean; labelPosition?: LabelPosition; // Defaults to bottom truncateLength?: number; // Defaults to 13 labelIconClass?: string; // Icon to show in label @@ -72,6 +73,7 @@ const DefaultGroupCollapsed: React.FunctionComponent dropTarget, onContextMenu, contextMenuOpen, + hideContextMenuKebab, dragging, labelPosition, badge, @@ -174,6 +176,7 @@ const DefaultGroupCollapsed: React.FunctionComponent labelIconPadding={labelIconPadding} onContextMenu={onContextMenu} contextMenuOpen={contextMenuOpen} + hideContextMenuKebab={hideContextMenuKebab} hover={isHover || labelHover} actionIcon={collapsible ? : undefined} onActionIconClick={() => onCollapseChange(element, false)} diff --git a/packages/module/src/components/groups/DefaultGroupExpanded.tsx b/packages/module/src/components/groups/DefaultGroupExpanded.tsx index 39e7d2a1..e3ce10b8 100644 --- a/packages/module/src/components/groups/DefaultGroupExpanded.tsx +++ b/packages/module/src/components/groups/DefaultGroupExpanded.tsx @@ -32,6 +32,7 @@ type DefaultGroupExpandedProps = { secondaryLabel?: string; showLabel?: boolean; // Defaults to true showLabelOnHover?: boolean; + hideContextMenuKebab?: boolean; truncateLength?: number; // Defaults to 13 badge?: string; badgeColor?: string; @@ -128,6 +129,7 @@ const DefaultGroupExpanded: React.FunctionComponent = dropTarget, onContextMenu, contextMenuOpen, + hideContextMenuKebab, dragging, dragNodeRef, badge, @@ -270,6 +272,7 @@ const DefaultGroupExpanded: React.FunctionComponent = labelIconPadding={labelIconPadding} onContextMenu={onContextMenu} contextMenuOpen={contextMenuOpen} + hideContextMenuKebab={hideContextMenuKebab} hover={isHover || labelHover} actionIcon={collapsible ? : undefined} onActionIconClick={() => onCollapseChange(element, true)}