aboutsummaryrefslogtreecommitdiffstats
path: root/old-apps/web-shared/src/components/table
diff options
context:
space:
mode:
Diffstat (limited to 'old-apps/web-shared/src/components/table')
-rw-r--r--old-apps/web-shared/src/components/table/index.ts15
-rw-r--r--old-apps/web-shared/src/components/table/paginator.svelte101
-rw-r--r--old-apps/web-shared/src/components/table/table.svelte3
-rw-r--r--old-apps/web-shared/src/components/table/tbody.svelte3
-rw-r--r--old-apps/web-shared/src/components/table/tcell.svelte23
-rw-r--r--old-apps/web-shared/src/components/table/thead.svelte10
-rw-r--r--old-apps/web-shared/src/components/table/trow.svelte6
7 files changed, 0 insertions, 161 deletions
diff --git a/old-apps/web-shared/src/components/table/index.ts b/old-apps/web-shared/src/components/table/index.ts
deleted file mode 100644
index 8390c0e..0000000
--- a/old-apps/web-shared/src/components/table/index.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import TablePaginator from "./paginator.svelte";
-import Table from "./table.svelte";
-import THead from "./thead.svelte";
-import TBody from "./tbody.svelte";
-import TCell from "./tcell.svelte";
-import TRow from "./trow.svelte";
-
-export {
- TablePaginator,
- Table,
- THead,
- TBody,
- TCell,
- TRow
-};
diff --git a/old-apps/web-shared/src/components/table/paginator.svelte b/old-apps/web-shared/src/components/table/paginator.svelte
deleted file mode 100644
index 53c6392..0000000
--- a/old-apps/web-shared/src/components/table/paginator.svelte
+++ /dev/null
@@ -1,101 +0,0 @@
-<script>
- import {createEventDispatcher, onMount} from "svelte";
- import {restrict_input_to_numbers} from "$shared/lib/helpers";
-
- const dispatch = createEventDispatcher();
- export let page = 1;
- export let pageCount = 1;
- let prevCount = page;
- let canIncrement = false;
- let canDecrement = false;
- $: canIncrement = page < pageCount;
- $: canDecrement = page > 1;
-
- onMount(() => {
- restrict_input_to_numbers(document.querySelector("#curr-page"));
- });
-
- function increment() {
- if (canIncrement) {
- page++;
- }
- }
-
- function decrement() {
- if (canDecrement) {
- page--;
- }
- }
-
- $: if (page) {
- handle_change();
- }
-
- function handle_change() {
- if (page === prevCount) {
- return;
- }
- prevCount = page;
- if (page > pageCount) {
- page = pageCount;
- }
- dispatch("value_change", {
- newValue: page,
- });
- }
-</script>
-
-<nav class="pagination"
- aria-label="Pagination">
- <ul class="pagination__list flex flex-wrap gap-xxxs justify-center justify-end@md">
- <li>
- <button on:click={decrement}
- class="reset pagination__item {canDecrement ? '' : 'c-disabled'}">
- <svg class="icon icon--xs flip-x"
- viewBox="0 0 16 16"
- ><title>Go to previous page</title>
- <polyline
- points="6 2 12 8 6 14"
- fill="none"
- stroke="currentColor"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- />
- </svg>
- </button>
- </li>
-
- <li>
- <span class="pagination__jumper flex items-center">
- <input
- aria-label="Page number"
- class="form-control"
- id="curr-page"
- type="text"
- on:change={handle_change}
- value={page}
- />
- <em>of {pageCount}</em>
- </span>
- </li>
-
- <li>
- <button on:click={increment}
- class="reset pagination__item {canIncrement ? '' : 'c-disabled'}">
- <svg class="icon icon--xs"
- viewBox="0 0 16 16"
- ><title>Go to next page</title>
- <polyline
- points="6 2 12 8 6 14"
- fill="none"
- stroke="currentColor"
- stroke-linecap="round"
- stroke-linejoin="round"
- stroke-width="2"
- />
- </svg>
- </button>
- </li>
- </ul>
-</nav>
diff --git a/old-apps/web-shared/src/components/table/table.svelte b/old-apps/web-shared/src/components/table/table.svelte
deleted file mode 100644
index 4acbf37..0000000
--- a/old-apps/web-shared/src/components/table/table.svelte
+++ /dev/null
@@ -1,3 +0,0 @@
-<table class="int-table {$$restProps.class ?? ''}">
- <slot/>
-</table>
diff --git a/old-apps/web-shared/src/components/table/tbody.svelte b/old-apps/web-shared/src/components/table/tbody.svelte
deleted file mode 100644
index f0617fa..0000000
--- a/old-apps/web-shared/src/components/table/tbody.svelte
+++ /dev/null
@@ -1,3 +0,0 @@
-<tbody class="int-table__body {$$restProps.class ?? ''}">
-<slot/>
-</tbody>
diff --git a/old-apps/web-shared/src/components/table/tcell.svelte b/old-apps/web-shared/src/components/table/tcell.svelte
deleted file mode 100644
index 76f500f..0000000
--- a/old-apps/web-shared/src/components/table/tcell.svelte
+++ /dev/null
@@ -1,23 +0,0 @@
-<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}
diff --git a/old-apps/web-shared/src/components/table/thead.svelte b/old-apps/web-shared/src/components/table/thead.svelte
deleted file mode 100644
index aa20bf0..0000000
--- a/old-apps/web-shared/src/components/table/thead.svelte
+++ /dev/null
@@ -1,10 +0,0 @@
-<script lang="ts">
- import TRow from "./trow.svelte";
-</script>
-
-
-<thead class="int-table__header {$$restProps.class ?? ''}">
-<TRow>
- <slot/>
-</TRow>
-</thead>
diff --git a/old-apps/web-shared/src/components/table/trow.svelte b/old-apps/web-shared/src/components/table/trow.svelte
deleted file mode 100644
index 35b34bb..0000000
--- a/old-apps/web-shared/src/components/table/trow.svelte
+++ /dev/null
@@ -1,6 +0,0 @@
-<script>
- export let dataId;
-</script>
-<tr class="int-table__row {$$restProps.class ?? ''}" data-id={dataId}>
- <slot/>
-</tr>