|
|
|
@ -7,259 +7,290 @@
|
|
|
|
:current-step="currentStepFields"
|
|
|
|
:current-step="currentStepFields"
|
|
|
|
@focus-step="[saveStep(), goToStep($event, false, true)]"
|
|
|
|
@focus-step="[saveStep(), goToStep($event, false, true)]"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div>
|
|
|
|
<button
|
|
|
|
<form
|
|
|
|
v-if="!isFormVisible"
|
|
|
|
|
|
|
|
class="btn btn-neutral text-white absolute rounded-none border-x-0 md:border md:rounded-full bottom-0 w-full md:mb-4 text-base"
|
|
|
|
|
|
|
|
@click.prevent="isFormVisible = true"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Submit Form
|
|
|
|
|
|
|
|
<IconArrowsDiagonal
|
|
|
|
|
|
|
|
class="absolute right-0 mr-4"
|
|
|
|
|
|
|
|
:width="20"
|
|
|
|
|
|
|
|
:height="20"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-else
|
|
|
|
|
|
|
|
id="form_container"
|
|
|
|
|
|
|
|
class="shadow-md bg-base-100 absolute bottom-0 md:bottom-4 w-full border-base-200 border p-4 rounded"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<button
|
|
|
|
v-if="!isCompleted"
|
|
|
|
v-if="!isCompleted"
|
|
|
|
ref="form"
|
|
|
|
class="absolute right-0 mr-2 mt-2 top-0 hidden md:block"
|
|
|
|
:action="submitPath"
|
|
|
|
title="Minimize"
|
|
|
|
method="post"
|
|
|
|
@click.prevent="isFormVisible = false"
|
|
|
|
class="md:mx-16"
|
|
|
|
|
|
|
|
@submit.prevent="submitStep"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
<IconArrowsDiagonalMinimize2
|
|
|
|
type="hidden"
|
|
|
|
:width="20"
|
|
|
|
name="authenticity_token"
|
|
|
|
:height="20"
|
|
|
|
:value="authenticityToken"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
</button>
|
|
|
|
<input
|
|
|
|
<div>
|
|
|
|
value="put"
|
|
|
|
<form
|
|
|
|
name="_method"
|
|
|
|
v-if="!isCompleted"
|
|
|
|
type="hidden"
|
|
|
|
ref="form"
|
|
|
|
|
|
|
|
:action="submitPath"
|
|
|
|
|
|
|
|
method="post"
|
|
|
|
|
|
|
|
class="md:mx-16"
|
|
|
|
|
|
|
|
@submit.prevent="submitStep"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="md:mt-4">
|
|
|
|
<input
|
|
|
|
<div v-if="['cells', 'text'].includes(currentField.type)">
|
|
|
|
type="hidden"
|
|
|
|
<label
|
|
|
|
name="authenticity_token"
|
|
|
|
v-if="currentField.name"
|
|
|
|
:value="authenticityToken"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
>
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
<input
|
|
|
|
>{{ currentField.name }}
|
|
|
|
value="put"
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
name="_method"
|
|
|
|
</label>
|
|
|
|
type="hidden"
|
|
|
|
<div
|
|
|
|
>
|
|
|
|
v-else
|
|
|
|
<div class="md:mt-4">
|
|
|
|
class="py-1"
|
|
|
|
<div v-if="['cells', 'text'].includes(currentField.type)">
|
|
|
|
/>
|
|
|
|
<label
|
|
|
|
<div>
|
|
|
|
v-if="currentField.name"
|
|
|
|
<input
|
|
|
|
:for="currentField.uuid"
|
|
|
|
:id="currentField.uuid"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
>{{ currentField.name }}
|
|
|
|
class="base-input !text-2xl w-full"
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
:required="currentField.required"
|
|
|
|
</label>
|
|
|
|
:placeholder="`Type here...${currentField.required ? '' : ' (optional)'}`"
|
|
|
|
<div
|
|
|
|
type="text"
|
|
|
|
v-else
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
class="py-1"
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
|
|
:id="currentField.uuid"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
class="base-input !text-2xl w-full"
|
|
|
|
|
|
|
|
:required="currentField.required"
|
|
|
|
|
|
|
|
:placeholder="`Type here...${currentField.required ? '' : ' (optional)'}`"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else-if="currentField.type === 'date'">
|
|
|
|
<div v-else-if="currentField.type === 'date'">
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
v-if="currentField.name"
|
|
|
|
v-if="currentField.name"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
>{{ currentField.name }}
|
|
|
|
>{{ currentField.name }}
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-else
|
|
|
|
v-else
|
|
|
|
class="py-1"
|
|
|
|
class="py-1"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div class="text-center">
|
|
|
|
<div class="text-center">
|
|
|
|
<input
|
|
|
|
<input
|
|
|
|
:id="currentField.uuid"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
class="base-input !text-2xl text-center w-full"
|
|
|
|
|
|
|
|
:required="currentField.required"
|
|
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-else-if="currentField.type === 'select'">
|
|
|
|
|
|
|
|
<label
|
|
|
|
|
|
|
|
v-if="currentField.name"
|
|
|
|
|
|
|
|
:for="currentField.uuid"
|
|
|
|
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
|
|
|
|
>{{ currentField.name }}
|
|
|
|
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-else
|
|
|
|
|
|
|
|
class="py-1"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<select
|
|
|
|
:id="currentField.uuid"
|
|
|
|
:id="currentField.uuid"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
class="base-input !text-2xl text-center w-full"
|
|
|
|
|
|
|
|
:required="currentField.required"
|
|
|
|
:required="currentField.required"
|
|
|
|
type="date"
|
|
|
|
class="select base-input !text-2xl w-full text-center font-normal"
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
|
|
|
|
@change="values[currentField.uuid] = $event.target.value"
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<option
|
|
|
|
|
|
|
|
value=""
|
|
|
|
|
|
|
|
:selected="!values[currentField.uuid]"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
Select your option
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
<option
|
|
|
|
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:selected="values[currentField.uuid] == option"
|
|
|
|
|
|
|
|
:value="option"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ option }}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else-if="currentField.type === 'radio'">
|
|
|
|
<div v-else-if="currentField.type === 'select'">
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
v-if="currentField.name"
|
|
|
|
v-if="currentField.name"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
:for="currentField.uuid"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
>{{ currentField.name }}
|
|
|
|
>{{ currentField.name }}
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
<div class="flex w-full">
|
|
|
|
<div
|
|
|
|
<div class="space-y-3.5 mx-auto">
|
|
|
|
v-else
|
|
|
|
<div
|
|
|
|
class="py-1"
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<label
|
|
|
|
|
|
|
|
:for="currentField.uuid + option"
|
|
|
|
|
|
|
|
class="flex items-center space-x-3"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
|
|
:id="currentField.uuid + option"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
type="radio"
|
|
|
|
|
|
|
|
class="base-radio !h-7 !w-7"
|
|
|
|
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
|
|
|
|
:value="option"
|
|
|
|
|
|
|
|
:required="currentField.required"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="text-xl">
|
|
|
|
|
|
|
|
{{ option }}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<MultiSelectStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'multiple'"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<select
|
|
|
|
<div
|
|
|
|
:id="currentField.uuid"
|
|
|
|
v-else-if="currentField.type === 'checkbox'"
|
|
|
|
:required="currentField.required"
|
|
|
|
class="flex w-full"
|
|
|
|
class="select base-input !text-2xl w-full text-center font-normal"
|
|
|
|
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
|
|
|
|
@change="values[currentField.uuid] = $event.target.value"
|
|
|
|
|
|
|
|
@focus="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<option
|
|
|
|
<input
|
|
|
|
value=""
|
|
|
|
type="hidden"
|
|
|
|
:selected="!values[currentField.uuid]"
|
|
|
|
name="cast_boolean"
|
|
|
|
|
|
|
|
value="true"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
Select your option
|
|
|
|
<div
|
|
|
|
</option>
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
<option
|
|
|
|
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
:selected="values[currentField.uuid] == option"
|
|
|
|
|
|
|
|
:value="option"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ option }}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div v-else-if="currentField.type === 'radio'">
|
|
|
|
|
|
|
|
<label
|
|
|
|
|
|
|
|
v-if="currentField.name"
|
|
|
|
|
|
|
|
:for="currentField.uuid"
|
|
|
|
|
|
|
|
class="label text-2xl mb-2"
|
|
|
|
|
|
|
|
>{{ currentField.name }}
|
|
|
|
|
|
|
|
<template v-if="!currentField.required">(optional)</template>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
<div class="flex w-full">
|
|
|
|
|
|
|
|
<div class="space-y-3.5 mx-auto">
|
|
|
|
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="(option, index) in currentField.options"
|
|
|
|
v-for="(field, index) in currentStepFields"
|
|
|
|
:key="index"
|
|
|
|
:key="field.uuid"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<label
|
|
|
|
<label
|
|
|
|
:for="currentField.uuid + option"
|
|
|
|
:for="field.uuid"
|
|
|
|
class="flex items-center space-x-3"
|
|
|
|
class="flex items-center space-x-3"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
<input
|
|
|
|
:id="currentField.uuid + option"
|
|
|
|
type="hidden"
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
:name="`values[${field.uuid}]`"
|
|
|
|
type="radio"
|
|
|
|
:value="!!values[field.uuid]"
|
|
|
|
class="base-radio !h-7 !w-7"
|
|
|
|
>
|
|
|
|
:name="`values[${currentField.uuid}]`"
|
|
|
|
<input
|
|
|
|
:value="option"
|
|
|
|
:id="field.uuid"
|
|
|
|
:required="currentField.required"
|
|
|
|
type="checkbox"
|
|
|
|
|
|
|
|
class="base-checkbox !h-7 !w-7"
|
|
|
|
|
|
|
|
:checked="!!values[field.uuid]"
|
|
|
|
|
|
|
|
@click="[$refs.areas.scrollIntoField(field), values[field.uuid] = !values[field.uuid]]"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<span class="text-xl">
|
|
|
|
<span class="text-xl">
|
|
|
|
{{ option }}
|
|
|
|
{{ currentField.name || currentField.type + ' ' + (index + 1) }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</label>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<ImageStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'image'"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="[attachments.push($event), $refs.areas.scrollIntoField(currentField)]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<SignatureStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'signature'"
|
|
|
|
|
|
|
|
ref="currentStep"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
|
|
|
|
@start="$refs.areas.scrollIntoField(currentField)"
|
|
|
|
|
|
|
|
@minimize="isFormVisible = false"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<AttachmentStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'file'"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="[attachments.push($event), $refs.areas.scrollIntoField(currentField)]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<MultiSelectStep
|
|
|
|
<div class="mt-6 md:mt-8">
|
|
|
|
v-else-if="currentField.type === 'multiple'"
|
|
|
|
<button
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
type="submit"
|
|
|
|
:field="currentField"
|
|
|
|
class="base-button w-full flex justify-center"
|
|
|
|
/>
|
|
|
|
:disabled="isButtonDisabled"
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'checkbox'"
|
|
|
|
|
|
|
|
class="flex w-full"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
|
|
type="hidden"
|
|
|
|
|
|
|
|
name="cast_boolean"
|
|
|
|
|
|
|
|
value="true"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="space-y-3.5 mx-auto"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
<span class="flex">
|
|
|
|
v-for="(field, index) in currentStepFields"
|
|
|
|
<IconInnerShadowTop
|
|
|
|
:key="field.uuid"
|
|
|
|
v-if="isSubmitting"
|
|
|
|
>
|
|
|
|
class="mr-1 animate-spin"
|
|
|
|
<label
|
|
|
|
/>
|
|
|
|
:for="field.uuid"
|
|
|
|
<span v-if="stepFields.length === currentStep + 1">
|
|
|
|
class="flex items-center space-x-3"
|
|
|
|
Submit
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
<input
|
|
|
|
<span v-else>
|
|
|
|
type="hidden"
|
|
|
|
Next
|
|
|
|
:name="`values[${field.uuid}]`"
|
|
|
|
</span><span
|
|
|
|
:value="!!values[field.uuid]"
|
|
|
|
v-if="isSubmitting"
|
|
|
|
>
|
|
|
|
class="w-6 flex justify-start mr-1"
|
|
|
|
<input
|
|
|
|
><span>...</span></span>
|
|
|
|
:id="field.uuid"
|
|
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
|
|
class="base-checkbox !h-7 !w-7"
|
|
|
|
|
|
|
|
:checked="!!values[field.uuid]"
|
|
|
|
|
|
|
|
@click="[$refs.areas.scrollIntoField(field), values[field.uuid] = !values[field.uuid]]"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="text-xl">
|
|
|
|
|
|
|
|
{{ currentField.name || currentField.type + ' ' + (index + 1) }}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<ImageStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'image'"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="[attachments.push($event), $refs.areas.scrollIntoField(currentField)]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<SignatureStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'signature'"
|
|
|
|
|
|
|
|
ref="currentStep"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="attachments.push($event)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<AttachmentStep
|
|
|
|
|
|
|
|
v-else-if="currentField.type === 'file'"
|
|
|
|
|
|
|
|
v-model="values[currentField.uuid]"
|
|
|
|
|
|
|
|
:is-direct-upload="isDirectUpload"
|
|
|
|
|
|
|
|
:field="currentField"
|
|
|
|
|
|
|
|
:attachments-index="attachmentsIndex"
|
|
|
|
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
|
|
|
|
@attached="[attachments.push($event), $refs.areas.scrollIntoField(currentField)]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mt-6 md:mt-8">
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
type="submit"
|
|
|
|
|
|
|
|
class="base-button w-full flex justify-center"
|
|
|
|
|
|
|
|
:disabled="isButtonDisabled"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<span class="flex">
|
|
|
|
|
|
|
|
<IconInnerShadowTop
|
|
|
|
|
|
|
|
v-if="isSubmitting"
|
|
|
|
|
|
|
|
class="mr-1 animate-spin"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<span v-if="stepFields.length === currentStep + 1">
|
|
|
|
|
|
|
|
Submit
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<span v-else>
|
|
|
|
</button>
|
|
|
|
Next
|
|
|
|
</div>
|
|
|
|
</span><span
|
|
|
|
</form>
|
|
|
|
v-if="isSubmitting"
|
|
|
|
<FormCompleted
|
|
|
|
class="w-6 flex justify-start mr-1"
|
|
|
|
v-else
|
|
|
|
><span>...</span></span>
|
|
|
|
:is-demo="isDemo"
|
|
|
|
</span>
|
|
|
|
:can-send-email="canSendEmail"
|
|
|
|
</button>
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
</div>
|
|
|
|
/>
|
|
|
|
</form>
|
|
|
|
<div class="flex justify-center">
|
|
|
|
<FormCompleted
|
|
|
|
<div class="flex items-center mt-5 mb-1">
|
|
|
|
v-else
|
|
|
|
<a
|
|
|
|
:is-demo="isDemo"
|
|
|
|
v-for="(step, index) in stepFields"
|
|
|
|
:can-send-email="canSendEmail"
|
|
|
|
:key="step[0].uuid"
|
|
|
|
:submitter-slug="submitterSlug"
|
|
|
|
href="#"
|
|
|
|
/>
|
|
|
|
class="inline border border-base-300 h-3 w-3 rounded-full mx-1"
|
|
|
|
<div class="flex justify-center">
|
|
|
|
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': index < currentStep || isCompleted, 'bg-white': index > currentStep }"
|
|
|
|
<div class="flex items-center mt-5 mb-1">
|
|
|
|
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(step, true)]"
|
|
|
|
<a
|
|
|
|
/>
|
|
|
|
v-for="(step, index) in stepFields"
|
|
|
|
</div>
|
|
|
|
:key="step[0].uuid"
|
|
|
|
|
|
|
|
href="#"
|
|
|
|
|
|
|
|
class="inline border border-base-300 h-3 w-3 rounded-full mx-1"
|
|
|
|
|
|
|
|
:class="{ 'bg-base-300': index === currentStep, 'bg-base-content': index < currentStep || isCompleted, 'bg-white': index > currentStep }"
|
|
|
|
|
|
|
|
@click.prevent="isCompleted ? '' : [saveStep(), goToStep(step, true)]"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@ -272,7 +303,7 @@ import SignatureStep from './signature_step'
|
|
|
|
import AttachmentStep from './attachment_step'
|
|
|
|
import AttachmentStep from './attachment_step'
|
|
|
|
import MultiSelectStep from './multi_select_step'
|
|
|
|
import MultiSelectStep from './multi_select_step'
|
|
|
|
import FormCompleted from './completed'
|
|
|
|
import FormCompleted from './completed'
|
|
|
|
import { IconInnerShadowTop } from '@tabler/icons-vue'
|
|
|
|
import { IconInnerShadowTop, IconArrowsDiagonal, IconArrowsDiagonalMinimize2 } from '@tabler/icons-vue'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'SubmissionForm',
|
|
|
|
name: 'SubmissionForm',
|
|
|
|
@ -283,6 +314,8 @@ export default {
|
|
|
|
AttachmentStep,
|
|
|
|
AttachmentStep,
|
|
|
|
MultiSelectStep,
|
|
|
|
MultiSelectStep,
|
|
|
|
IconInnerShadowTop,
|
|
|
|
IconInnerShadowTop,
|
|
|
|
|
|
|
|
IconArrowsDiagonal,
|
|
|
|
|
|
|
|
IconArrowsDiagonalMinimize2,
|
|
|
|
FormCompleted
|
|
|
|
FormCompleted
|
|
|
|
},
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
props: {
|
|
|
|
@ -332,6 +365,7 @@ export default {
|
|
|
|
data () {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
isCompleted: false,
|
|
|
|
isCompleted: false,
|
|
|
|
|
|
|
|
isFormVisible: true,
|
|
|
|
currentStep: 0,
|
|
|
|
currentStep: 0,
|
|
|
|
isSubmitting: false
|
|
|
|
isSubmitting: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|