* feat(frontend): add global css * feat(frontend): working styling * feat(frontend): Add default classes * wip * wip * wip * wip * wip * wip * wip * wip * feat(frontend): Add global css v0 * feat(frontend): Add global css v0 * add css workers * fix(frontend): Fix overflow issue * wip * feat(frontend): check for EE before injecting global css * wip * wip * wip * fix(frontend): fix typing issues * fix(frontend): fix typing issues * fix(frontend): fix global css * fix(frontend): add missing mapping * fix(frontend): Fix how styles are loaded * fix(frontend): fix preview * feat(frontend): fix everything * feat(frontend): fix class autocomplete * feat(frontend): remove console.log * feat(frontend): update tooltup * feat(frontend): eval * feat(frontend): eval * feat(frontend): fix build * feat(frontend): fix initial binding * feat(frontend): wip * wip * feat(frontend): Finish theme v0 * feat(frontend): Fix resource page * feat(frontend): fix build * feat(frontend): theme UI * feat(frontend): theme UI * feat(frontend): theme UI * feat(frontend): fix EE * feat(frontend): add missing warning * feat(frontend): fix preview * feat(frontend): fix global css by component initialisation * feat(frontend): remove unused libraries * feat(frontend): fix EE check * feat(frontend): fix EE check * feat(frontend): fix preview * feat(frontend): Fix migration * feat(frontend): Fix issues * feat(frontend): add missing disabled in migration modal * feat(frontend): Fix preview * feat(frontend): Fix preview * all * all * all * sqlx --------- Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
40 lines
951 B
Svelte
40 lines
951 B
Svelte
<script lang="ts">
|
|
import Cell from './table/Cell.svelte'
|
|
import DataTable from './table/DataTable.svelte'
|
|
import Head from './table/Head.svelte'
|
|
|
|
export let headers: string[] | undefined
|
|
export let data: any[] | undefined // Object containing the data
|
|
export let keys: string[]
|
|
export let size: 'sm' | 'md' | 'lg' = 'md'
|
|
</script>
|
|
|
|
<div class="mt-2 w-full">
|
|
<DataTable {size}>
|
|
<Head>
|
|
<tr>
|
|
{#if headers}
|
|
{#each headers as header, i}
|
|
<Cell first={i == 0} last={i == headers.length - 1} head>{header}</Cell>
|
|
{/each}
|
|
{/if}
|
|
</tr>
|
|
</Head>
|
|
<tbody class="divide-y">
|
|
{#if data && keys && data.length > 0}
|
|
{#each data as row}
|
|
<tr>
|
|
{#each keys as key, i}
|
|
<Cell first={i == 0} last={i == keys.length - 1} class="w-1/3 whitespace-pre-wrap">
|
|
{row[key] ?? ''}
|
|
</Cell>
|
|
{/each}
|
|
</tr>
|
|
{/each}
|
|
{:else}
|
|
<tr>Loading...</tr>
|
|
{/if}
|
|
</tbody>
|
|
</DataTable>
|
|
</div>
|