@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
3 lines (2 loc) • 1.21 kB
JavaScript
"use client";
import{jsx as e}from"react/jsx-runtime";import{TreeItem as t}from"@mui/x-tree-view";import o from"clsx";import{AssemblyTreeItemContent as i}from"./AssemblyTreeItemContent.component.js";import{AssemblyTreeItemLabel as n}from"./AssemblyTreeItemLabel.component.js";const r="NexusAssemblyTreeItem",s=m=>{const{sx:a,label:l,depth:d,children:c=[],className:u,labelIcon:b,actions:p,onNodeChanged:I,editable:h,visible:x=!0,...N}=m;return e(t,{sx:[{color:x?void 0:"text.disabled","& >.MuiTreeItem-content":{minHeight:28,borderRadius:"unset"},"& .MuiTreeItem-group":{marginLeft:0},"& > .NexusAssemblyTreeItemContent-root":{pl:4*d+2.5,"& > .NexusAssemblyTreeItemContent-iconContainer":{width:20,"& svg":{fontSize:20}}},"& >.MuiTreeItem-content:hover .NexusActionGroup-iconButtonInactive":{visibility:"visible"},"& >.MuiTreeItem-content:hover .NexusActionGroup-root,":{display:"unset"}},...Array.isArray(a)?a:[a]],ContentComponent:i,label:e(n,{itemId:m.itemId,editable:h,onNodeChanged:I,actions:p,icon:b,children:l},N.itemId),"data-testid":`${r}-root`,className:o(`${r}-root`,u),...N,children:c.map((t=>e(s,{depth:d+1,editable:h,onNodeChanged:I,actions:p,...t},t.itemId)))})};export{s as AssemblyTreeItem};