add clearbable for script picker (#6071)

This commit is contained in:
dieriba
2025-06-26 17:22:09 +02:00
committed by GitHub
parent 09ba1522da
commit 1d390a8e84
10 changed files with 13 additions and 1 deletions
@@ -29,6 +29,7 @@
allowRefresh?: boolean
allowEdit?: boolean
allowView?: boolean
clearable?: boolean
}
let {
@@ -40,7 +41,8 @@
disabled = false,
allowRefresh = false,
allowEdit = true,
allowView = true
allowView = true,
clearable = false
}: Props = $props()
let items: { value: string; label: string }[] = $state([])
@@ -128,6 +130,7 @@
}
class="grow shrink max-w-full"
{items}
{clearable}
placeholder="Pick {itemKind === 'app' ? 'an' : 'a'} {itemKind}"
/>
{/if}
@@ -348,6 +348,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button
@@ -538,6 +538,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
@@ -349,6 +349,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button
@@ -360,6 +360,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button
@@ -351,6 +351,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button
@@ -526,6 +526,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path) && is_flow === false}
@@ -875,6 +875,7 @@
on:select={(e) => {
loadScript(e.detail.path)
}}
clearable
/>
{:else}
<Alert type="info" title="Runnable path cannot be edited" collapsible>
@@ -343,6 +343,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button
@@ -412,6 +412,7 @@
bind:scriptPath={script_path}
allowRefresh={can_write}
allowEdit={!$userStore?.operator}
clearable
/>
{#if emptyString(script_path)}
<Button