component ndentation

This commit is contained in:
Gerard Burns 2023-08-21 07:37:16 +01:00
parent a34390c986
commit e6a712f880
2 changed files with 13 additions and 3 deletions

View File

@ -21,6 +21,7 @@
export let id
export let showTooltip = false
export let selectedBy = null
export let compact = false
const scrollApi = getContext("scroll")
const dispatch = createEventDispatcher()
@ -80,8 +81,9 @@
{#if withArrow}
<div
class:opened
class:relative={indentLevel === 0}
class:absolute={indentLevel > 0}
class:relative={indentLevel === 0 && !compact}
class:absolute={indentLevel > 0 && !compact}
class:compact
class="icon arrow"
on:click={onIconClick}
>
@ -194,6 +196,13 @@
padding: 8px;
margin-left: -8px;
}
.compact {
position: absolute;
left: 4px;
padding: 8px;
margin-left: -8px;
}
.icon.arrow :global(svg) {
width: 12px;
height: 12px;

View File

@ -107,6 +107,7 @@
id={`component-${component._id}`}
>
<NavItem
compact
scrollable
draggable
on:dragend={dndStore.actions.reset}
@ -117,7 +118,7 @@
text={getComponentText(component)}
icon={getComponentIcon(component)}
withArrow={componentHasChildren(component)}
indentLevel={level + 1}
indentLevel={level}
selected={$store.selectedComponentId === component._id}
{opened}
highlighted={isChildOfSelectedComponent(component)}