{ rawValue = JSON.stringify(value, null, 2) editor?.setCode(rawValue) }} readOnlyMode={false} />
{#if diffStatus && typeof diffStatus === 'object' && diffStatus.diff !== 'same'}
{/if} {#if displayHeader} {/if} {#if description}
{description}
{/if}
{#if inputCat == 'number'} {#if extra['min'] != undefined && extra['max'] != undefined} {:else if extra['seconds'] !== undefined} {:else if extra?.currency} {:else}
{ ignoreValueUndefined = true }} class={valid ? '' : 'border border-red-700 border-opacity-30 focus:border-red-700 focus:border-opacity-30 bg-red-100'} placeholder={placeholder ?? defaultValue ?? ''} bind:value min={extra['min']} max={extra['max']} />
{/if} {:else if inputCat == 'boolean'}
{ e?.stopPropagation() }} {disabled} 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' && !isListJson}
{#if Array.isArray(itemsType?.multiselect) && Array.isArray(value)}
{ dispatch('focus') }} />
{:else if itemsType?.enum != undefined && Array.isArray(itemsType?.enum) && Array.isArray(value)}
{ dispatch('focus') }} />
{:else}
{#key redraw} {#if Array.isArray(value)} {#each value ?? [] as v, i} {#if i < itemsLimit}
{#if itemsType?.type == 'number'} {:else if itemsType?.type == 'string' && itemsType?.contentEncoding == 'base64'} fileChanged(x, (val) => (value[i] = val))} multiple={false} /> {:else if itemsType?.type == 'object' && itemsType?.resourceType === undefined && itemsType?.properties === undefined} {#await import('$lib/components/JsonEditor.svelte')} {:then Module} {/await} {:else if Array.isArray(itemsType?.enum)} { dispatch('focus') }} on:blur={(e) => { dispatch('blur') }} {defaultValue} {valid} {disabled} {autofocus} bind:value={v} enum_={itemsType?.enum ?? []} enumLabels={extra['enumLabels']} /> {:else if itemsType?.type == 'resource' && itemsType?.resourceType && resourceTypes?.includes(itemsType.resourceType)} {:else if itemsType?.type == 'resource'} {#await import('$lib/components/JsonEditor.svelte')} {:then Module} { dispatch('focus') }} on:blur={(e) => { dispatch('blur') }} code={JSON.stringify(v, null, 2)} bind:value={v} /> {/await} {:else if itemsType?.type === 'object' && itemsType?.properties}
{:else} {/if}
{/if} {/each} {#if value.length > itemsLimit} {/if} {/if} {/key}
{/if}
{ // Once the user has changed the input type, we should not change it back automatically if (!hasIsListJsonChanged) { hasIsListJsonChanged = true } evalValueToRaw() isListJson = !isListJson }} checked={isListJson} textClass="text-secondary" size="xs" options={{ right: 'json' }} />
{:else if inputCat == 'dynselect'} {:else if inputCat == 'resource-object' && resourceTypes == undefined} Loading resource types... {:else if inputCat == 'resource-object' && (resourceTypes == undefined || (format.split('-').length > 1 && resourceTypes.includes(format.substring('resource-'.length))))} { defaultValue = null }} {showSchemaExplorer} /> {:else if inputCat == 'resource-object' && format.split('-').length > 1 && format .replace('resource-', '') .replace('_', '') .toLowerCase() == 's3object'}
{#if s3FileUploadRawMode} {#await import('$lib/components/JsonEditor.svelte')} {:then Module} { dispatch('focus') }} on:blur={(e) => { dispatch('blur') }} code={JSON.stringify(value ?? defaultValue ?? { s3: '' }, null, 2)} bind:value /> {/await} {:else} { value = { s3: evt.detail?.path ?? '', filename: evt.detail?.filename ?? '' } }} on:deletion={(evt) => { value = { s3: '' } }} defaultValue={defaultValue?.s3} /> {/if}
{:else if inputCat == 'object' || inputCat == 'resource-object' || isListJson} {#if oneOf && oneOf.length >= 2}
{#if oneOf && oneOf.length >= 2} { value = { label: oneOfSelected } redraw += 1 }} > {#each oneOf as obj} {/each} {#if oneOfSelected} {@const objIdx = oneOf.findIndex((o) => o.title === oneOfSelected)} {@const obj = oneOf[objIdx]} {#if obj && obj.properties && Object.keys(obj.properties).length > 0} {#key redraw}
{#if orderEditable} { if (oneOf && oneOf[objIdx]) { const keys = e.detail oneOf[objIdx].order = keys } }} on:change={() => { dispatch('nestedChange') }} on:nestedChange {shouldDispatchChanges} /> {:else} { dispatch('nestedChange') }} on:nestedChange /> {/if}
{/key} {:else if disabled}