Refactor promptitem
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<input
|
||||
class={"border border-darkborderc focus:border-borderc rounded-md shadow-sm text-textcolor bg-transparent numinput focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((className) ? (' ' + className) : '')}
|
||||
class={"border border-darkborderc focus:border-borderc rounded-md shadow-sm bg-transparent numinput focus:ring-borderc focus:ring-2 focus:outline-none transition-colors duration-200" + ((className) ? (' ' + className) : '')}
|
||||
class:text-sm={size === 'sm'}
|
||||
class:text-md={size === 'md'}
|
||||
class:text-lg={size === 'lg'}
|
||||
class:text-textcolor={!disabled}
|
||||
class:text-textcolor2={disabled}
|
||||
class:px-4={size === 'md' && padding}
|
||||
class:py-2={size === 'md' && padding}
|
||||
class:px-2={size === 'sm' && padding}
|
||||
@@ -16,6 +18,7 @@
|
||||
min={min}
|
||||
max={max}
|
||||
id={id}
|
||||
disabled={disabled}
|
||||
bind:value
|
||||
on:change={onChange}
|
||||
/>
|
||||
@@ -32,6 +35,7 @@
|
||||
export let fullh = false
|
||||
export let onChange = () => {}
|
||||
export let className = ''
|
||||
export let disabled = false
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
currentprompt.rangeStart = -2
|
||||
currentprompt.rangeEnd = 'end'
|
||||
}
|
||||
promptItem = currentprompt
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -76,14 +77,12 @@
|
||||
</SelectInput>
|
||||
{/if}
|
||||
{#if promptItem.type === 'chat'}
|
||||
<CheckInput name={language.advanced} check={promptItem.rangeStart !== -2} onChange={chatPromptChange}/>
|
||||
|
||||
|
||||
{#if promptItem.rangeStart !== -2}
|
||||
<span>{language.rangeStart}</span>
|
||||
<NumberInput bind:value={promptItem.rangeStart} />
|
||||
<span>{language.rangeEnd}</span>
|
||||
{#if promptItem.rangeEnd === 'end'}
|
||||
<NumberInput value={0} marginBottom disabled/>
|
||||
<CheckInput name={language.untilChatEnd} check={true} onChange={() => {
|
||||
if(promptItem.type === 'chat'){
|
||||
promptItem.rangeEnd = 0
|
||||
@@ -101,6 +100,7 @@
|
||||
<CheckInput name={language.chatAsOriginalOnSystem} bind:check={promptItem.chatAsOriginalOnSystem}/>
|
||||
{/if}
|
||||
{/if}
|
||||
<CheckInput name={language.advanced} check={promptItem.rangeStart !== -2} onChange={chatPromptChange} className="my-2"/>
|
||||
{/if}
|
||||
{#if promptItem.type === 'authornote'}
|
||||
<span>{language.defaultPrompt}</span>
|
||||
|
||||
Reference in New Issue
Block a user