|
|
|
|
@ -4,6 +4,7 @@
|
|
|
|
|
:steps="stepFields"
|
|
|
|
|
:values="values"
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
:with-label="!isAnonymousChecboxes"
|
|
|
|
|
:current-step="currentStepFields"
|
|
|
|
|
@focus-step="[saveStep(), goToStep($event, false, true), currentField.type !== 'checkbox' ? isFormVisible = true : '']"
|
|
|
|
|
/>
|
|
|
|
|
@ -182,7 +183,7 @@
|
|
|
|
|
/>
|
|
|
|
|
<div
|
|
|
|
|
v-else-if="currentField.type === 'checkbox'"
|
|
|
|
|
class="flex w-full"
|
|
|
|
|
class="flex w-full max-h-44 overflow-y-auto"
|
|
|
|
|
>
|
|
|
|
|
<input
|
|
|
|
|
type="hidden"
|
|
|
|
|
@ -192,6 +193,10 @@
|
|
|
|
|
<div
|
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
|
>
|
|
|
|
|
<template v-if="isAnonymousChecboxes">
|
|
|
|
|
Complete hightlighted checkboxes and click <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? 'submit' : 'next' }}</span>.
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div
|
|
|
|
|
v-for="(field, index) in currentStepFields"
|
|
|
|
|
:key="field.uuid"
|
|
|
|
|
@ -217,6 +222,7 @@
|
|
|
|
|
</span>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<ImageStep
|
|
|
|
|
@ -374,6 +380,9 @@ export default {
|
|
|
|
|
currentStepFields () {
|
|
|
|
|
return this.stepFields[this.currentStep]
|
|
|
|
|
},
|
|
|
|
|
isAnonymousChecboxes () {
|
|
|
|
|
return this.currentField.type === 'checkbox' && this.currentStepFields.every((e) => !e.name) && this.currentStepFields.length > 4
|
|
|
|
|
},
|
|
|
|
|
isButtonDisabled () {
|
|
|
|
|
return this.isSubmitting ||
|
|
|
|
|
(this.currentField.required && ['image', 'file'].includes(this.currentField.type) && !this.values[this.currentField.uuid]?.length) ||
|
|
|
|
|
|