mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-13 19:58:09 +00:00
Added parameter to disable TextArea (#2446)
Signed-off-by: Oleg Solodkov <oleg.solodkov@ezthera.com>
This commit is contained in:
parent
cbf83a55ff
commit
9bb045e53a
@ -26,6 +26,7 @@
|
||||
export let placeholder: IntlString = plugin.string.EditBoxPlaceholder
|
||||
export let placeholderParam: any | undefined = undefined
|
||||
export let noFocusBorder: boolean = false
|
||||
export let disabled: boolean = false
|
||||
|
||||
let input: HTMLTextAreaElement
|
||||
let phTraslate: string = ''
|
||||
@ -47,7 +48,7 @@
|
||||
|
||||
<div class="textarea" class:no-focus-border={noFocusBorder} style:width style:height>
|
||||
{#if label}<div class="label"><Label {label} /></div>{/if}
|
||||
<textarea bind:value bind:this={input} on:keydown={onKeydown} placeholder={phTraslate} />
|
||||
<textarea bind:value bind:this={input} on:keydown={onKeydown} {disabled} placeholder={phTraslate} />
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
@ -13,6 +13,7 @@
|
||||
export let height: string | undefined = undefined
|
||||
export let submitLabel: IntlString = ui.string.Save
|
||||
export let placeholder: IntlString | undefined = undefined
|
||||
export let disabled: boolean = false
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
let isEditing = false
|
||||
@ -57,16 +58,19 @@
|
||||
{placeholder}
|
||||
{height}
|
||||
{width}
|
||||
{disabled}
|
||||
bind:this={inputRef}
|
||||
bind:value
|
||||
on:keydown={onKeydown}
|
||||
noFocusBorder={true}
|
||||
/>
|
||||
</div>
|
||||
<div class="flex-row-center mt-3">
|
||||
<Button label={submitLabel} kind="no-border" size="medium" on:click={submit} />
|
||||
<div class="ml-2" on:click={cancel}>
|
||||
<ActionIcon icon={IconClose} size="medium" action={cancel} />
|
||||
{#if !disabled}
|
||||
<div class="flex-row-center mt-3">
|
||||
<Button label={submitLabel} kind="no-border" size="medium" on:click={submit} />
|
||||
<div class="ml-2" on:click={cancel}>
|
||||
<ActionIcon icon={IconClose} size="medium" action={cancel} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user