mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
UBERF-5552 (#4662)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
34b16ae88d
commit
f1d55bfc56
@ -45,6 +45,9 @@
|
||||
const client = getClient()
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
let matched = false
|
||||
$: matched = values.includes(newValue.trim())
|
||||
|
||||
async function save (): Promise<void> {
|
||||
if (value === undefined) {
|
||||
await client.createDoc(core.class.Enum, core.space.Model, {
|
||||
@ -62,8 +65,8 @@
|
||||
|
||||
function add () {
|
||||
newValue = newValue.trim()
|
||||
if (!newValue.length) return
|
||||
if (matched) return
|
||||
if (values.includes(newValue)) return
|
||||
values.push(newValue)
|
||||
values = values
|
||||
newValue = ''
|
||||
@ -146,7 +149,6 @@
|
||||
const selection: number = 0
|
||||
|
||||
// $: filtered = newValue.length > 0 ? values.filter((it) => it.includes(newValue)) : values
|
||||
$: matched = values.includes(newValue.trim())
|
||||
|
||||
// function onDelete () {
|
||||
// showPopup(
|
||||
@ -273,7 +275,11 @@
|
||||
size={'small'}
|
||||
tooltip={{ label: setting.string.Add }}
|
||||
on:click={() => {
|
||||
newItem = true
|
||||
if (newItem) {
|
||||
add()
|
||||
} else {
|
||||
newItem = true
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user