{#if displayHeader}
{/if} {#if description}
{description}
{/if}
{#if inputCat == 'number'} {#if extra['min'] != undefined && extra['max'] != undefined}
{extra['min']}
{extra['max']}
{value}
{:else}
{ dispatch('focus') }} type="number" class={twMerge( 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']} /> {/if} {:else if inputCat == 'boolean'}
{ e?.stopPropagation() }} 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}
{ value = value.filter((el) => el != v) if (value.length == 0) { value = undefined } }} >
{/each}
{ if (value == undefined || !Array.isArray(value)) { value = [] } value = value.concat('') }} >
Add item
{(value ?? []).length} item{(value ?? []).length > 1 ? 's' : ''}
{:else if inputCat == 'resource-object'}
{:else if inputCat == 'object'} {#if properties && Object.keys(properties).length > 0}
{:else}
{ dispatch('focus') }} use:autosize style="max-height: {maxHeight}" class="col-span-10 {valid ? '' : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}" placeholder={defaultValue ? JSON.stringify(defaultValue, null, 4) : ''} bind:value={rawValue} /> {/if} {:else if inputCat == 'enum'}
{ dispatch('focus') }} class="px-6" bind:value > {#each enum_ ?? [] as e}
{e}
{/each}
{:else if inputCat == 'date'}
{:else if inputCat == 'base64'}
fileChanged(x, (val) => (value = val))} multiple={false} /> {:else if inputCat == 'resource-string'}
1 ? format.substring('resource-'.length) : undefined} /> {:else if inputCat == 'string'}
{ dispatch('focus') }} use:autosize type="text" class="col-span-10 {valid ? '' : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'}" placeholder={defaultValue ?? ''} bind:value on:pointerdown|stopPropagation={(e) => { dispatch('inputClicked', e) }} />
{/if}
{#if error && error != ''}
{#if error === ''} {:else} {error} {/if}
{/if}