-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better mock data & make machines reassignanle
- Loading branch information
1 parent
c561422
commit 8b33f51
Showing
7 changed files
with
77 additions
and
19 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<script lang="ts"> | ||
import type { Selected } from 'bits-ui'; | ||
import { writable } from 'svelte/store'; | ||
import * as Select from '$lib/components/ui/select'; | ||
import type { User } from '$lib/api'; | ||
export let users: User[] | undefined; | ||
export let selected: string | undefined; | ||
const sel = writable<Selected<string | undefined>>({ value: selected, label: selected }); | ||
sel.subscribe(({ value }) => (selected = value)); | ||
</script> | ||
|
||
<Select.Root bind:selected={$sel} required> | ||
<Select.Trigger> | ||
<Select.Value /> | ||
</Select.Trigger> | ||
|
||
<Select.Content class="!mt-0"> | ||
<Select.Group> | ||
{#each users || [] as user} | ||
<Select.Item value={user.name}>{user.name}</Select.Item> | ||
{/each} | ||
</Select.Group> | ||
</Select.Content> | ||
</Select.Root> |
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