diff --git a/frontend/src/lib/components/ArgEnum.svelte b/frontend/src/lib/components/ArgEnum.svelte index 023d24ea52..3c10fc60bd 100644 --- a/frontend/src/lib/components/ArgEnum.svelte +++ b/frontend/src/lib/components/ArgEnum.svelte @@ -1,6 +1,7 @@ -{#if !customValue} - { - dispatch('focus') - }} - {disabled} - class="px-6" - bind:value - > - {#each enum_ ?? [] as e} - {e} - {/each} - -{:else} - - -{/if} + { + dispatch('focus') + }} + {disabled} + {autofocus} +/> -{#if !disabled} +{#if !disabled && !disableCustomValue} { diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index 1e78568fb8..6082e597ff 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -26,6 +26,8 @@ import ArrayTypeNarrowing from './ArrayTypeNarrowing.svelte' import DateTimeInput from './DateTimeInput.svelte' import S3FilePicker from './S3FilePicker.svelte' + import CurrencyInput from './apps/components/inputs/currency/CurrencyInput.svelte' + import Label from './Label.svelte' export let label: string = '' export let value: any @@ -234,6 +236,9 @@ {#if type == 'array'} + + + {:else if (type == 'string' && format != 'date-time') || ['number', 'object'].includes(type ?? '')} @@ -263,7 +268,12 @@ bind:contentEncoding /> {:else if type == 'number'} - + {:else if type == 'object'} {/if} @@ -293,20 +303,34 @@ {:else if extra['seconds'] !== undefined} - {:else} - + {:else} + + + {/if} {:else if inputCat == 'boolean'} + {:else if extra.multiselect} + + + {:else} {#key redraw} @@ -352,17 +385,19 @@ {:else if itemsType?.type == 'object'} {:else if Array.isArray(itemsType?.enum)} - { + { dispatch('focus') }} - class="px-6" + {defaultValue} + {valid} + {customValue} + {disabled} + {autofocus} bind:value={v} - > - {#each itemsType?.enum ?? [] as e} - {e} - {/each} - + disableCustomValue={true} + enum_={itemsType?.enum ?? []} + /> {:else} {/if} diff --git a/frontend/src/lib/components/LightweightArgInput.svelte b/frontend/src/lib/components/LightweightArgInput.svelte index aaa7c290ee..ac347e9912 100644 --- a/frontend/src/lib/components/LightweightArgInput.svelte +++ b/frontend/src/lib/components/LightweightArgInput.svelte @@ -15,6 +15,7 @@ import LightweightResourcePicker from './LightweightResourcePicker.svelte' import LightweightObjectResourceInput from './LightweightObjectResourceInput.svelte' import DateTimeInput from './DateTimeInput.svelte' + import CurrencyInput from './apps/components/inputs/currency/CurrencyInput.svelte' export let css: ComponentCustomCSS<'schemaformcomponent'> | undefined = undefined export let label: string = '' @@ -181,6 +182,18 @@ {extra['max']} {value} + {:else if extra?.currency} + {:else} { @@ -350,6 +363,15 @@ placeholder={defaultValue ?? ''} bind:value /> + {:else if inputCat == 'currency'} + {:else if inputCat == 'string'} diff --git a/frontend/src/lib/components/NumberTypeNarrowing.svelte b/frontend/src/lib/components/NumberTypeNarrowing.svelte index c5d35466b9..4acb971e15 100644 --- a/frontend/src/lib/components/NumberTypeNarrowing.svelte +++ b/frontend/src/lib/components/NumberTypeNarrowing.svelte @@ -1,8 +1,12 @@