Simplify
This commit is contained in:
parent
1272414a57
commit
7ad05930e1
|
@ -14,7 +14,6 @@
|
|||
export let autocomplete = false
|
||||
export let sort = false
|
||||
export let autoWidth = false
|
||||
export let fetchTerm = null
|
||||
export let searchTerm = null
|
||||
export let useFetch = false
|
||||
export let customPopoverHeight
|
||||
|
@ -91,7 +90,6 @@
|
|||
{options}
|
||||
isPlaceholder={!arrayValue.length}
|
||||
{autocomplete}
|
||||
bind:fetchTerm
|
||||
bind:searchTerm
|
||||
bind:open
|
||||
{useFetch}
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
export let autoWidth = false
|
||||
export let autocomplete = false
|
||||
export let sort = false
|
||||
export let fetchTerm = null
|
||||
export let searchTerm = null
|
||||
export let useFetch = false
|
||||
export let customPopoverHeight
|
||||
|
@ -82,7 +81,7 @@
|
|||
}
|
||||
|
||||
const getFilteredOptions = (options, term, getLabel) => {
|
||||
if (autocomplete && term && !fetchTerm) {
|
||||
if (autocomplete && term && !useFetch) {
|
||||
const lowerCaseTerm = term.toLowerCase()
|
||||
return options.filter(option => {
|
||||
return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)
|
||||
|
@ -163,9 +162,8 @@
|
|||
>
|
||||
{#if autocomplete}
|
||||
<Search
|
||||
value={useFetch ? fetchTerm : searchTerm}
|
||||
on:change={event =>
|
||||
useFetch ? (fetchTerm = event.detail) : (searchTerm = event.detail)}
|
||||
value={searchTerm}
|
||||
on:change={event => (searchTerm = event.detail)}
|
||||
{disabled}
|
||||
placeholder="Search"
|
||||
/>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
export let tag = null
|
||||
export let customPopoverOffsetBelow
|
||||
export let customPopoverMaxHeight
|
||||
export let fetchTerm = null
|
||||
export let searchTerm = null
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
@ -67,7 +66,6 @@
|
|||
<Picker
|
||||
on:click
|
||||
bind:open
|
||||
bind:fetchTerm
|
||||
bind:searchTerm
|
||||
{quiet}
|
||||
{id}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
export let sort = false
|
||||
export let autoWidth = false
|
||||
export let autocomplete = false
|
||||
export let fetchTerm = null
|
||||
export let searchTerm = null
|
||||
export let useFetch = false
|
||||
export let customPopoverHeight
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
|||
{autoWidth}
|
||||
{autocomplete}
|
||||
{customPopoverHeight}
|
||||
bind:fetchTerm
|
||||
bind:searchTerm
|
||||
{useFetch}
|
||||
on:change={onChange}
|
||||
on:click
|
||||
|
|
|
@ -256,7 +256,7 @@
|
|||
<div class="controls">
|
||||
<div class="select">
|
||||
<Multiselect
|
||||
bind:fetchTerm={userSearchTerm}
|
||||
bind:searchTerm={userSearchTerm}
|
||||
useFetch
|
||||
placeholder="All users"
|
||||
label="Users"
|
||||
|
|
Loading…
Reference in New Issue