|
|
@ -2,6 +2,7 @@ |
|
|
|
import type Project from "../models/project"; |
|
|
|
import projectStore from "../stores/project"; |
|
|
|
import projectGroupStore from "../stores/projectGroup"; |
|
|
|
|
|
|
|
interface OptGroup { |
|
|
|
status: string |
|
|
|
projects: Project[] |
|
|
@ -10,6 +11,7 @@ import projectGroupStore from "../stores/projectGroup"; |
|
|
|
export let value = ""; |
|
|
|
export let name = ""; |
|
|
|
export let groupId = ""; |
|
|
|
export let placeholder = "None"; |
|
|
|
export let disabled = false; |
|
|
|
export let optional = false; |
|
|
|
export let forceGroup = false; |
|
|
@ -85,7 +87,7 @@ import projectGroupStore from "../stores/projectGroup"; |
|
|
|
|
|
|
|
<select name={name} bind:value={value} disabled={disabled || $projectStore.loading}> |
|
|
|
{#if optional} |
|
|
|
<option value={""} selected={"" === value}>{$projectStore.loading ? "Loading..." : "None"}</option> |
|
|
|
<option value={""} selected={"" === value}>{$projectStore.loading ? "Loading..." : placeholder}</option> |
|
|
|
{/if} |
|
|
|
{#each optGroups as group (group.status)} |
|
|
|
{#if group.projects.length > 0} |
|
|
|