[Task modal, subtask modal] BE

This commit is contained in:
Matej Glasnák committed 2023-02-10 03:38:54 +01:00
1 parent 37331335ce
commit 1024f73ab5
12 files changed
+477 -489

No files matched your search

@@ -1,7 +1,7 @@
<template>
<div class="wrapper">
<v-text-field
label="Vyhľadať zamestnanca"
:label="label"
variant="solo"
v-model="search"
@keydown.enter="optionSelected()"
@@ -27,6 +27,11 @@ export default {
emits: ['option-selected'],
props: {
label: {
type: String,
required: false,
},
options: {
type: Array,
required: true
@@ -35,6 +40,16 @@ export default {
validations: {
type: Object || null,
required: false
},
clearOnSubmit: {
type: Boolean,
required: false,
default: () => true
},
value: {
required: false
}
},
@@ -72,22 +87,39 @@ export default {
}
},
mounted() {
if (this.value)
this.search = this.value
},
methods: {
optionSelected() {
if (!this.suggestion)
return
this.$emit('option-selected', this.suggestion)
this.search = ''
if (this.clearOnSubmit)
this.search = ''
else
this.search = this.suggestion.value
},
_normalize(value) {
if (!value) return ''
return value
.trim()
.toLowerCase()
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "")
}
},
watch: {
value(value) {
this.search = value
}
}
}
</script>