{#each content as { type, name, valid }, i} {@const is_selected = ( type === "file" ? selected_files : selected_folders ).some((x) => x[0] === name && x.length === 1)}
  • { e.stopPropagation(); if (selectable) { handle_select([...index_path, i], [...path, name], type); } }} onkeydown={(e) => { if (selectable && (e.key === " " || e.key === "Enter")) { handle_select([...index_path, i], [...path, name], type); } }} > {#if interactive} {#if type === "folder" && file_count === "single"} {:else} { oncheck?.({ path: [...path, name], checked, type }); if (selectable) { handle_select([...index_path, i], [...path, name], type); } if (type === "folder" && checked) { open_folder(i); } }} /> {/if} {/if} {#if type === "folder"} { e.stopPropagation(); toggle_open_folder(i); }} role="button" aria-label="expand directory" tabindex="0" onkeydown={(e) => { if (e.key === " " || e.key === "Enter") { toggle_open_folder(i); } }}> {:else} file icon {/if} {name} {#if type === "folder" && opened_folders.includes(i)} x[0] === name) .map((x) => x.slice(1))} selected_folders={selected_folders .filter((x) => x[0] === name) .map((x) => x.slice(1))} is_selected_entirely={selected_folders.some( (x) => x[0] === name && x.length === 1 )} {interactive} {selectable} {ls_fn} {file_count} valid_for_selection={valid ?? false} {oncheck} {onselect} /> {/if}
  • {/each}