-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
118 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
apps/frontend/src/lib/components/blocks/forms/form-readonly.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script lang="ts"> | ||
import { getTable } from "$lib/store/table.store" | ||
import { formId } from "$lib/store/tab.store" | ||
import FormDisplay from "$lib/components/blocks/forms/form-display.svelte" | ||
const table = getTable() | ||
$: form = $formId ? $table.forms?.getFormById($formId) : $table.forms?.forms[0] | ||
</script> | ||
|
||
{#if form} | ||
<FormDisplay readonly {form} /> | ||
{/if} |
37 changes: 37 additions & 0 deletions
37
apps/frontend/src/lib/components/blocks/forms/forms-readonly.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script lang="ts"> | ||
import { getTable } from "$lib/store/table.store" | ||
import * as Resizable from "$lib/components/ui/resizable" | ||
import { formId } from "$lib/store/tab.store" | ||
import FormReadonly from "./form-readonly.svelte" | ||
import { cn } from "$lib/utils" | ||
import { ClipboardTypeIcon } from "lucide-svelte" | ||
export let table = getTable() | ||
$: forms = $table.forms?.forms ?? [] | ||
</script> | ||
|
||
<main class="h-full w-full"> | ||
<Resizable.PaneGroup direction="horizontal"> | ||
<Resizable.Pane defaultSize={25} maxSize={30} minSize={20}> | ||
<ul class="h-full w-full space-y-3 px-2 py-4"> | ||
{#each forms as form} | ||
{@const active = $formId === form.id || (!$formId && form.id === forms[0].id)} | ||
<button | ||
on:click={() => ($formId = form.id)} | ||
class={cn( | ||
"flex w-full items-center rounded-md border px-4 py-2 shadow-sm ring-offset-current transition-all duration-300 ease-out", | ||
active && "ring-primary font-semibold shadow-inner ring-1 ring-offset-1", | ||
)} | ||
> | ||
<ClipboardTypeIcon class="mr-2 h-4 w-4" /> | ||
{form.name} | ||
</button> | ||
{/each} | ||
</ul> | ||
</Resizable.Pane> | ||
<Resizable.Handle /> | ||
<Resizable.Pane defaultSize={75}> | ||
<FormReadonly /> | ||
</Resizable.Pane> | ||
</Resizable.PaneGroup> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters