{#each tree as { type, path, children, children_visible, checked }, i}
-
dispatch_change(i)}
/>
{#if type === "folder"}
(tree[i].children_visible = !tree[i].children_visible)}
role="button"
aria-label="expand directory"
tabindex="0"
on:keydown={({ key }) =>
(key === " " || key === "Enter") &&
(tree[i].children_visible = !tree[i].children_visible)}
>
{:else if path === ""}
{:else}
{/if}
{path ? path : "."}
{#if children && children_visible}
{/if}
{/each}