mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-07 16:41:31 +00:00
42 lines
865 B
Svelte
42 lines
865 B
Svelte
<script lang="ts">
|
|
import { Button, IconAdd, TextAreaEditor } from '@anticrm/ui'
|
|
import { createEventDispatcher } from 'svelte'
|
|
import board from '../plugin'
|
|
|
|
const dispatch = createEventDispatcher()
|
|
|
|
let isOpened = false
|
|
let value = ''
|
|
|
|
async function onAdd () {
|
|
if (!value) return
|
|
dispatch('add', value)
|
|
value = ''
|
|
isOpened = false
|
|
}
|
|
</script>
|
|
|
|
<div class="flex-col min-w-80 step-lr75">
|
|
{#if isOpened}
|
|
<TextAreaEditor
|
|
bind:value
|
|
placeholder={board.string.NewListPlaceholder}
|
|
submitLabel={board.string.AddList}
|
|
on:submit={onAdd}
|
|
on:cancel={() => {
|
|
isOpened = false
|
|
}}
|
|
/>
|
|
{:else}
|
|
<Button
|
|
icon={IconAdd}
|
|
label={board.string.NewList}
|
|
justify={'left'}
|
|
kind={'transparent'}
|
|
on:click={() => {
|
|
isOpened = true
|
|
}}
|
|
/>
|
|
{/if}
|
|
</div>
|