|
|
|
@ -4,7 +4,7 @@
|
|
|
|
:steps="stepFields"
|
|
|
|
:steps="stepFields"
|
|
|
|
:values="values"
|
|
|
|
:values="values"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:with-label="!isAnonymousChecboxes"
|
|
|
|
:with-label="!isAnonymousChecboxes && showFieldNames"
|
|
|
|
:current-step="currentStepFields"
|
|
|
|
:current-step="currentStepFields"
|
|
|
|
@focus-step="[saveStep(), goToStep($event, false, true), currentField.type !== 'checkbox' ? isFormVisible = true : '']"
|
|
|
|
@focus-step="[saveStep(), goToStep($event, false, true), currentField.type !== 'checkbox' ? isFormVisible = true : '']"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -64,6 +64,7 @@
|
|
|
|
<TextStep
|
|
|
|
<TextStep
|
|
|
|
:key="currentField.uuid"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
:field="currentField"
|
|
|
|
:field="currentField"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -72,12 +73,13 @@
|
|
|
|
v-else-if="currentField.type === 'date'"
|
|
|
|
v-else-if="currentField.type === 'date'"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
:field="currentField"
|
|
|
|
:field="currentField"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div v-else-if="currentField.type === 'select'">
|
|
|
|
<div v-else-if="currentField.type === 'select'">
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
v-if="currentField.name"
|
|
|
|
v-if="showFieldNames && currentField.name"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
dir="auto"
|
|
|
|
dir="auto"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
@ -116,17 +118,17 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else-if="currentField.type === 'radio'">
|
|
|
|
<div v-else-if="currentField.type === 'radio'">
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
v-if="currentField.name"
|
|
|
|
v-if="showFieldNames && currentField.name"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
dir="auto"
|
|
|
|
dir="auto"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
>{{ currentField.name }}
|
|
|
|
>{{ currentField.name }}
|
|
|
|
<template v-if="!currentField.required">({{ t('optional') }})</template>
|
|
|
|
<template v-if="!currentField.required">({{ t('optional') }})</template>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<div class="flex w-full">
|
|
|
|
<div class="flex w-full max-h-44 overflow-y-auto">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-if="currentField.options.length > 5"
|
|
|
|
v-if="!showFieldNames || (currentField.options.every((e) => !e.value) && currentField.options.length > 4)"
|
|
|
|
class="text-xl text-center w-full"
|
|
|
|
class="text-xl px-1"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
<span
|
|
|
|
@click="scrollIntoField(currentField)"
|
|
|
|
@click="scrollIntoField(currentField)"
|
|
|
|
@ -136,7 +138,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
:class="{ hidden: currentField.options.length > 5 }"
|
|
|
|
:class="{ hidden: !showFieldNames || (currentField.options.every((e) => !e.value) && currentField.options.length > 4) }"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
@ -167,6 +169,7 @@
|
|
|
|
v-else-if="currentField.type === 'multiple'"
|
|
|
|
v-else-if="currentField.type === 'multiple'"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
:is-last-step="stepFields.length === currentStep + 1"
|
|
|
|
:is-last-step="stepFields.length === currentStep + 1"
|
|
|
|
:field="currentField"
|
|
|
|
:field="currentField"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
@ -182,7 +185,7 @@
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template v-if="isAnonymousChecboxes">
|
|
|
|
<template v-if="isAnonymousChecboxes || !showFieldNames">
|
|
|
|
<span class="text-xl">
|
|
|
|
<span class="text-xl">
|
|
|
|
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? t('submit') : t('next') }}</span>.
|
|
|
|
{{ t('complete_hightlighted_checkboxes_and_click') }} <span class="font-semibold">{{ stepFields.length === currentStep + 1 ? t('submit') : t('next') }}</span>.
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
@ -242,6 +245,7 @@
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
@attached="[attachments.push($event), scrollIntoField(currentField)]"
|
|
|
|
@attached="[attachments.push($event), scrollIntoField(currentField)]"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<SignatureStep
|
|
|
|
<SignatureStep
|
|
|
|
@ -255,6 +259,7 @@
|
|
|
|
:with-typed-signature="withTypedSignature"
|
|
|
|
:with-typed-signature="withTypedSignature"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
@start="scrollIntoField(currentField)"
|
|
|
|
@start="scrollIntoField(currentField)"
|
|
|
|
@minimize="isFormVisible = false"
|
|
|
|
@minimize="isFormVisible = false"
|
|
|
|
@ -268,6 +273,7 @@
|
|
|
|
:previous-value="previousInitialsValue"
|
|
|
|
:previous-value="previousInitialsValue"
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
@start="scrollIntoField(currentField)"
|
|
|
|
@start="scrollIntoField(currentField)"
|
|
|
|
@ -290,6 +296,7 @@
|
|
|
|
:key="currentField.uuid"
|
|
|
|
:key="currentField.uuid"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
:field="currentField"
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:show-field-names="showFieldNames"
|
|
|
|
:default-value="submitter.phone"
|
|
|
|
:default-value="submitter.phone"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
@focus="scrollIntoField(currentField)"
|
|
|
|
@ -446,6 +453,11 @@ export default {
|
|
|
|
required: false,
|
|
|
|
required: false,
|
|
|
|
default: false
|
|
|
|
default: false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
showFieldNames: {
|
|
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
|
|
required: false,
|
|
|
|
|
|
|
|
default: true
|
|
|
|
|
|
|
|
},
|
|
|
|
withTypedSignature: {
|
|
|
|
withTypedSignature: {
|
|
|
|
type: Boolean,
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
required: false,
|
|
|
|
|