2021-03-31 11:59:07 +02:00
|
|
|
<script>
|
|
|
|
import { createEventDispatcher } from "svelte"
|
2021-04-15 20:28:08 +02:00
|
|
|
import Multiselect from "./Core/Multiselect.svelte"
|
2021-04-15 12:50:56 +02:00
|
|
|
import Field from "./Field.svelte"
|
2021-03-31 11:59:07 +02:00
|
|
|
|
2021-04-19 15:04:07 +02:00
|
|
|
export let value = []
|
|
|
|
export let label = null
|
2021-03-31 11:59:07 +02:00
|
|
|
export let disabled = false
|
2021-04-19 15:04:07 +02:00
|
|
|
export let readonly = false
|
2021-04-15 12:50:56 +02:00
|
|
|
export let labelPosition = "above"
|
|
|
|
export let error = null
|
|
|
|
export let placeholder = null
|
|
|
|
export let options = []
|
|
|
|
export let getOptionLabel = option => option
|
|
|
|
export let getOptionValue = option => option
|
2024-04-01 13:31:16 +02:00
|
|
|
export let getOptionIcon = () => null
|
|
|
|
export let getOptionIconTooltip = () => null
|
|
|
|
export let getOptionTooltip = () => null
|
|
|
|
export let isOptionEnabled = () => true
|
2021-08-20 11:03:21 +02:00
|
|
|
export let sort = false
|
2022-06-29 20:03:32 +02:00
|
|
|
export let autoWidth = false
|
2023-02-13 10:47:08 +01:00
|
|
|
export let autocomplete = false
|
2023-09-22 13:07:02 +02:00
|
|
|
export let searchTerm = null
|
2023-02-22 13:31:04 +01:00
|
|
|
export let customPopoverHeight
|
2023-11-20 16:05:58 +01:00
|
|
|
export let helpText = null
|
2024-04-01 13:31:16 +02:00
|
|
|
export let align
|
2023-02-13 10:47:08 +01:00
|
|
|
|
2021-04-15 12:50:56 +02:00
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
const onChange = e => {
|
|
|
|
value = e.detail
|
2021-04-20 13:49:02 +02:00
|
|
|
dispatch("change", e.detail)
|
2021-03-31 11:59:07 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2023-11-20 16:05:58 +01:00
|
|
|
<Field {helpText} {label} {labelPosition} {error}>
|
2021-04-15 12:50:56 +02:00
|
|
|
<Multiselect
|
2024-04-01 13:31:16 +02:00
|
|
|
{isOptionEnabled}
|
|
|
|
{getOptionIcon}
|
|
|
|
{getOptionIconTooltip}
|
|
|
|
{getOptionTooltip}
|
2021-04-15 12:50:56 +02:00
|
|
|
{error}
|
|
|
|
{disabled}
|
2021-06-15 20:36:56 +02:00
|
|
|
{readonly}
|
2021-04-15 12:50:56 +02:00
|
|
|
{value}
|
|
|
|
{options}
|
|
|
|
{placeholder}
|
2021-08-20 11:03:21 +02:00
|
|
|
{sort}
|
2021-04-15 12:50:56 +02:00
|
|
|
{getOptionLabel}
|
|
|
|
{getOptionValue}
|
2022-06-29 20:03:32 +02:00
|
|
|
{autoWidth}
|
2023-02-13 10:47:08 +01:00
|
|
|
{autocomplete}
|
2023-02-22 13:31:04 +01:00
|
|
|
{customPopoverHeight}
|
2024-04-01 13:31:16 +02:00
|
|
|
{align}
|
2023-09-22 13:07:02 +02:00
|
|
|
bind:searchTerm
|
2021-04-19 15:04:07 +02:00
|
|
|
on:change={onChange}
|
2021-05-04 12:04:42 +02:00
|
|
|
on:click
|
|
|
|
/>
|
2021-04-15 12:50:56 +02:00
|
|
|
</Field>
|