|
|
|
@ -55,7 +55,7 @@
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
v-if="submitters.length > 1 && editable"
|
|
|
|
v-if="submitters.length > 1 && editable && submitter.name !== 'Me'"
|
|
|
|
class="px-2"
|
|
|
|
class="px-2"
|
|
|
|
@click.stop="remove(submitter)"
|
|
|
|
@click.stop="remove(submitter)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -63,7 +63,7 @@
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li v-if="submitters.length < 10 && editable">
|
|
|
|
<li v-if="submitters.length < 11 && editable">
|
|
|
|
<a
|
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
href="#"
|
|
|
|
class="flex px-2"
|
|
|
|
class="flex px-2"
|
|
|
|
@ -97,38 +97,9 @@
|
|
|
|
:class="colors[submitters.indexOf(selectedSubmitter)]"
|
|
|
|
:class="colors[submitters.indexOf(selectedSubmitter)]"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<!-- adding button to show and hide prefills -->
|
|
|
|
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
v-else
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
|
|
|
|
v-if="!showNewFields"
|
|
|
|
|
|
|
|
class="cursor-pointer rounded-md p-2 border border-base-300 w-full flex justify-between"
|
|
|
|
|
|
|
|
@click="$emit('add-prefills')"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
|
|
|
|
<span
|
|
|
|
|
|
|
|
style="background-color: grey;"
|
|
|
|
|
|
|
|
class="w-3 h-3 rounded-full"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="items-center space-x-2">Me (Fill Out Now)</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<label
|
|
|
|
|
|
|
|
v-else
|
|
|
|
|
|
|
|
:style="{ 'border-color': showNewFields ? 'black' : '' }"
|
|
|
|
|
|
|
|
class="cursor-pointer rounded-md p-2 border border-base-300 w-full flex justify-between"
|
|
|
|
|
|
|
|
@click="$emit('add-prefills')"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
|
|
|
|
<span
|
|
|
|
|
|
|
|
style="background-color: grey;"
|
|
|
|
|
|
|
|
class="w-3 h-3 rounded-full"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="items-center space-x-2">show submitter fields</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
tabindex="0"
|
|
|
|
tabindex="0"
|
|
|
|
class="cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 w-full flex justify-between"
|
|
|
|
class="cursor-pointer group/contenteditable-container rounded-md p-2 border border-base-300 w-full flex justify-between"
|
|
|
|
@ -136,13 +107,14 @@
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
class="w-3 h-3 rounded-full"
|
|
|
|
class="w-3 h-3 rounded-full"
|
|
|
|
:class="colors[submitters.indexOf(selectedSubmitter)]"
|
|
|
|
:class="selectedSubmitter.name !== 'Me' ? colors[submitters.indexOf(selectedSubmitter)] : ''"
|
|
|
|
|
|
|
|
:style="{ backgroundColor: selectedSubmitter.name === 'Me' ? colors[submitters.indexOf(selectedSubmitter)] : '' }"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<Contenteditable
|
|
|
|
<Contenteditable
|
|
|
|
v-model="selectedSubmitter.name"
|
|
|
|
v-model="selectedSubmitter.name"
|
|
|
|
class="cursor-text"
|
|
|
|
class="cursor-text"
|
|
|
|
:icon-inline="true"
|
|
|
|
:icon-inline="true"
|
|
|
|
:editable="editable"
|
|
|
|
:editable="selectedSubmitter.name==='Me'? false : editable"
|
|
|
|
:select-on-edit-click="true"
|
|
|
|
:select-on-edit-click="true"
|
|
|
|
:icon-width="18"
|
|
|
|
:icon-width="18"
|
|
|
|
@update:model-value="$emit('name-change', selectedSubmitter)"
|
|
|
|
@update:model-value="$emit('name-change', selectedSubmitter)"
|
|
|
|
@ -182,7 +154,7 @@
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
v-if="!compact && submitters.length > 1 && editable"
|
|
|
|
v-if="!compact && submitters.length > 1 && editable && submitter.name !== 'Me'"
|
|
|
|
class="hidden group-hover:block px-2"
|
|
|
|
class="hidden group-hover:block px-2"
|
|
|
|
@click.stop="remove(submitter)"
|
|
|
|
@click.stop="remove(submitter)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -190,7 +162,7 @@
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li v-if="submitters.length < 10 && editable">
|
|
|
|
<li v-if="submitters.length < 11 && editable">
|
|
|
|
<a
|
|
|
|
<a
|
|
|
|
href="#"
|
|
|
|
href="#"
|
|
|
|
class="flex px-2"
|
|
|
|
class="flex px-2"
|
|
|
|
@ -262,6 +234,7 @@ export default {
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
colors () {
|
|
|
|
colors () {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
|
|
|
|
'gray',
|
|
|
|
'bg-red-500',
|
|
|
|
'bg-red-500',
|
|
|
|
'bg-sky-500',
|
|
|
|
'bg-sky-500',
|
|
|
|
'bg-emerald-500',
|
|
|
|
'bg-emerald-500',
|
|
|
|
@ -276,6 +249,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
names () {
|
|
|
|
names () {
|
|
|
|
return [
|
|
|
|
return [
|
|
|
|
|
|
|
|
'Me',
|
|
|
|
'First Submitter',
|
|
|
|
'First Submitter',
|
|
|
|
'Second Submitter',
|
|
|
|
'Second Submitter',
|
|
|
|
'Third Submitter',
|
|
|
|
'Third Submitter',
|
|
|
|
@ -295,11 +269,15 @@ export default {
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
selectSubmitter (submitter) {
|
|
|
|
selectSubmitter (submitter) {
|
|
|
|
this.$emit('update:model-value', submitter.uuid)
|
|
|
|
this.$emit('update:model-value', submitter.uuid)
|
|
|
|
|
|
|
|
this.$emit('add-prefills', submitter.name)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
remove (submitter) {
|
|
|
|
remove (submitter) {
|
|
|
|
if (window.confirm('Are you sure?')) {
|
|
|
|
if (window.confirm('Are you sure?')) {
|
|
|
|
this.$emit('remove', submitter)
|
|
|
|
this.$emit('remove', submitter)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.submitters.length === 1) {
|
|
|
|
|
|
|
|
this.$emit('add-prefills', this.submitters[0].name)
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
addSubmitter () {
|
|
|
|
addSubmitter () {
|
|
|
|
const newSubmitter = {
|
|
|
|
const newSubmitter = {
|
|
|
|
@ -311,6 +289,7 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
this.$emit('update:model-value', newSubmitter.uuid)
|
|
|
|
this.$emit('update:model-value', newSubmitter.uuid)
|
|
|
|
this.$emit('new-submitter', newSubmitter)
|
|
|
|
this.$emit('new-submitter', newSubmitter)
|
|
|
|
|
|
|
|
this.$emit('add-prefills', newSubmitter.name)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
closeDropdown () {
|
|
|
|
closeDropdown () {
|
|
|
|
document.activeElement.blur()
|
|
|
|
document.activeElement.blur()
|
|
|
|
|