diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index 7e63876cdd..5001abf150 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -7,7 +7,7 @@ faPlus } from '@fortawesome/free-solid-svg-icons' - import { setInputCat as computeInputCat, type InputCat } from '$lib/utils' + import { setInputCat as computeInputCat } from '$lib/utils' import { Badge, Button } from './common' import { createEventDispatcher } from 'svelte' import Icon from 'svelte-awesome' @@ -450,19 +450,6 @@ {/if} {/if} - {#if !required && inputCat != 'resource-object'} - - {/if} {#if !compact || (error && error != '')} diff --git a/frontend/src/lib/components/LightweightArgInput.svelte b/frontend/src/lib/components/LightweightArgInput.svelte new file mode 100644 index 0000000000..487f838045 --- /dev/null +++ b/frontend/src/lib/components/LightweightArgInput.svelte @@ -0,0 +1,331 @@ + + +
+
+ {#if displayHeader} + + {/if} + + {#if description} +
+ {description} +
+ {/if} + +
+ {#if inputCat == 'number'} + {#if extra['min'] != undefined && extra['max'] != undefined} +
+ {extra['min']} +
+ +
+ {extra['max']} + {value} +
+ {:else} + { + window.dispatchEvent(new Event('pointerup')) + dispatch('focus') + }} + type="number" + class={valid + ? '' + : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'} + placeholder={defaultValue ?? ''} + bind:value + min={extra['min']} + max={extra['max']} + on:input={() => dispatch('input', { value, isRaw: true })} + /> + {/if} + {:else if inputCat == 'boolean'} + { + e?.stopPropagation() + window.dispatchEvent(new Event('pointerup')) + }} + class={valid + ? '' + : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'} + bind:checked={value} + /> + {#if type == 'boolean' && value == undefined} +   Not set + {/if} + {:else if inputCat == 'list'} +
+
+ {#each value ?? [] as v, i} +
+ {#if itemsType?.type == 'number'} + + {:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'} + fileChanged(x, (val) => (value[i] = val))} + multiple={false} + /> + {:else} + + {/if} + +
+ {/each} +
+ + + {(value ?? []).length} item{(value ?? []).length > 1 ? 's' : ''} + +
+ {:else if inputCat == 'resource-object'} + + {:else if inputCat == 'object'} + {#if properties && Object.keys(properties).length > 0} +
+ +
+ {:else} +