summaryrefslogtreecommitdiffstats
path: root/apps/web-shared/src/components/table/tcell.svelte
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-06-01 22:10:32 +0200
committerivarlovlie <git@ivarlovlie.no>2022-06-01 22:10:32 +0200
commita640703f2da8815dc26ad1600a6f206be1624379 (patch)
treedbda195fb5783d16487e557e06471cf848b75427 /apps/web-shared/src/components/table/tcell.svelte
downloadgreatoffice-a640703f2da8815dc26ad1600a6f206be1624379.tar.xz
greatoffice-a640703f2da8815dc26ad1600a6f206be1624379.zip
feat: Initial after clean slate
Diffstat (limited to 'apps/web-shared/src/components/table/tcell.svelte')
-rw-r--r--apps/web-shared/src/components/table/tcell.svelte23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/web-shared/src/components/table/tcell.svelte b/apps/web-shared/src/components/table/tcell.svelte
new file mode 100644
index 0000000..76f500f
--- /dev/null
+++ b/apps/web-shared/src/components/table/tcell.svelte
@@ -0,0 +1,23 @@
+<script lang="ts">
+ export let thScope: "row"|"col"|"rowgroup"|"colgroup"|"";
+ export let colspan = "";
+ export let type: "th"|"td" = "td";
+ export let style;
+
+ $: shared_props = {
+ colspan: colspan || null,
+ style: style || null,
+ class: [type === "th" ? "int-table__cell--th" : "", "int-table__cell", $$restProps.class ?? ""].filter(Boolean).join(" "),
+ };
+</script>
+{#if type === "th"}
+ <th {thScope}
+ {...shared_props}>
+ <slot/>
+ </th>
+{/if}
+{#if type === "td"}
+ <td {...shared_props}>
+ <slot/>
+ </td>
+{/if}