-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some dropdown filters to the scheme browsing page
- Loading branch information
1 parent
3d14558
commit 7f4485a
Showing
2 changed files
with
89 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
import FormElement from "../govuk/FormElement.svelte"; | ||
export let label: string; | ||
// A unique (per page) ID | ||
export let id: string; | ||
// A list of [value, label] representing the choices | ||
export let choices: [string, string][]; | ||
// Make the first option the empty string | ||
export let emptyOption = true; | ||
// The current value | ||
export let value: string; | ||
</script> | ||
|
||
<FormElement {label} {id}> | ||
<select class="govuk-select" {id} bind:value> | ||
{#if emptyOption} | ||
<option value="" /> | ||
{/if} | ||
|
||
{#each choices as [thisValue, thisLabel]} | ||
<option value={thisValue}>{thisLabel}</option> | ||
{/each} | ||
</select> | ||
</FormElement> |
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