feat(ui): extend shared tree actions and BIM tool menus

This commit is contained in:
Codex
2026-11-14 21:55:07 +03:00
parent 91a5ebe8da
commit 6f2f9644fe
8 changed files with 35 additions and 13 deletions
+4 -1
View File
@@ -38,6 +38,8 @@ export interface ToolbarProps<T extends string = string> {
hideDelay?: number;
gap?: number;
label?: string;
/** Dropdown width; placement still clamps to the visible viewport. */
menuWidth?: number;
className?: string;
/** Render inside a positioned viewport; edge reveal follows that viewport. */
container?: HTMLElement;
@@ -66,6 +68,7 @@ export function Toolbar<T extends string = string>({
hideDelay = NODEDC_TOOLBAR_DEFAULTS.hideDelay,
gap = NODEDC_TOOLBAR_DEFAULTS.gap,
label = "Панель инструментов",
menuWidth = 220,
className,
container,
}: ToolbarProps<T>) {
@@ -392,7 +395,7 @@ export function Toolbar<T extends string = string>({
if(placement==="left")return {...b.toJSON(),left:t.left,right:t.left+pad,width:pad};
if(placement==="bottom")return {...b.toJSON(),top:t.bottom-pad,bottom:t.bottom,height:pad};
return {...b.toJSON(),top:t.top,bottom:t.top+pad,height:pad};
}} width={220} trigger={button} onPointerDownOutside={event=>{
}} width={Number.isFinite(menuWidth)?Math.max(180,Math.min(600,menuWidth)):220} trigger={button} onPointerDownOutside={event=>{
const target=event.target as Element;
// Dismiss a menu before a viewport tool can turn this same click into an edit.
if(container?.contains(target)&&!target.closest('button,input,select,textarea,a,[role="button"],[role="tab"]')){