{#if fields.length}
{#if showEditColumn}
{#if allowSelectRows}
{:else}
Edit
{/if}
{/if}
{#each fields as field}
sortBy(schema[field])}
>
{getDisplayName(schema[field])}
{#if schema[field]?.autocolumn}
{/if}
{#if sortColumn === field}
{/if}
{#if allowEditColumns && schema[field]?.editable !== false}
{/if}
{/each}
{/if}
{#if sortedRows?.length}
{#each sortedRows as row, idx}
{#if showEditColumn}
{
toggleSelectRow(row)
e.stopPropagation()
}}
>
selectedRow._id === row._id
) !== -1}
onEdit={e => editRow(e, row)}
{allowSelectRows}
{allowEditRows}
/>
{/if}
{#each fields as field}
{
if (!schema[field]?.preventSelectRow) {
dispatch("click", row)
toggleSelectRow(row)
}
}}
>
{/each}
{/each}
{:else}
{#if customPlaceholder}
{:else}
{/if}
{/if}