mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-20 15:01:41 +02:00
34 lines
529 B
Svelte
34 lines
529 B
Svelte
<!--
|
|
Copyright © 2024 Hardcore Engineering Inc.
|
|
-->
|
|
|
|
<script lang="ts">
|
|
import { EditBox } from '@hcengineering/ui'
|
|
|
|
export let value: string
|
|
export let readonly = false
|
|
|
|
let editBox: EditBox | undefined = undefined
|
|
export function focus (): void {
|
|
if (editBox) {
|
|
editBox.focus()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
{#if readonly}
|
|
{value}
|
|
{:else}
|
|
<EditBox
|
|
bind:this={editBox}
|
|
kind="editbox"
|
|
fullSize
|
|
bind:value
|
|
on:value
|
|
on:change
|
|
on:input
|
|
on:keydown
|
|
disabled={readonly}
|
|
/>
|
|
{/if}
|