add signature format settings

pull/217/head
Pete Matsyburka 2 years ago
parent 151a5b85f3
commit 26d7c2f047

@ -254,7 +254,7 @@
:key="currentField.uuid"
v-model="values[currentField.uuid]"
:field="currentField"
:previous-value="previousSignatureValue"
:previous-value="previousSignatureValueFor(currentField)"
:is-direct-upload="isDirectUpload"
:with-typed-signature="withTypedSignature"
:attachments-index="attachmentsIndex"
@ -566,11 +566,6 @@ export default {
submitterSlug () {
return this.submitter.slug
},
previousSignatureValue () {
const signatureField = [...this.fields].reverse().find((field) => field.type === 'signature' && !!this.values[field.uuid])
return this.values[signatureField?.uuid]
},
previousInitialsValue () {
const initialsField = [...this.fields].reverse().find((field) => field.type === 'initials' && !!this.values[field.uuid])
@ -736,6 +731,13 @@ export default {
})
})
},
previousSignatureValueFor (field) {
const signatureField = [...this.fields].reverse().find((f) =>
f.type === 'signature' && field.preferences?.format === f.preferences?.format && !!this.values[f.uuid]
)
return this.values[signatureField?.uuid]
},
goToStep (step, scrollToArea = false, clickUpload = false) {
this.currentStep = this.stepFields.indexOf(step)
this.showFillAllRequiredFields = false

@ -6,7 +6,7 @@
>{{ showFieldNames && field.name ? field.name : t('signature') }}</label>
<div class="space-x-2 flex">
<span
v-if="isTextSignature"
v-if="isTextSignature && field.preferences?.format !== 'typed'"
class="tooltip"
:data-tip="t('draw_signature')"
>
@ -23,7 +23,7 @@
</a>
</span>
<span
v-else-if="withTypedSignature"
v-else-if="withTypedSignature && field.preferences?.format !== 'typed' && field.preferences?.format !== 'drawn'"
class="tooltip ml-2"
:data-tip="t('type_text')"
>
@ -40,6 +40,7 @@
</a>
</span>
<span
v-if="field.preferences?.format !== 'typed'"
class="tooltip"
:data-tip="t('take_photo')"
>
@ -185,7 +186,7 @@ export default {
return {
isSignatureStarted: !!this.previousValue,
isUsePreviousValue: true,
isTextSignature: false
isTextSignature: this.field.preferences?.format === 'typed'
}
},
computed: {

@ -142,6 +142,43 @@
{{ t('format') }}
</label>
</div>
<div
v-if="field.type === 'signature'"
class="py-1.5 px-1 relative"
@click.stop
>
<select
:placeholder="t('format')"
class="select select-bordered select-xs font-normal w-full max-w-xs !h-7 !outline-0"
@change="[field.preferences.format = $event.target.value, save()]"
>
<option
value="any"
:selected="!field.preferences?.format || field.preferences.format === 'any'"
>
{{ t('any') }}
</option>
<option
value="drawn"
:selected="field.preferences?.format === 'drawn'"
>
{{ t('drawn') }}
</option>
<option
value="typed"
:selected="field.preferences?.format === 'typed'"
>
{{ t('typed') }}
</option>
</select>
<label
:style="{ backgroundColor: backgroundColor }"
class="absolute -top-1 left-2.5 px-1 h-4"
style="font-size: 8px"
>
{{ t('format') }}
</label>
</div>
<li
v-if="field.type != 'phone'"
@click.stop

@ -6,6 +6,9 @@ const en = {
checked: 'Checked',
save: 'Save',
cancel: 'Cancel',
any: 'Any',
drawn: 'Drawn',
typed: 'Typed',
draw_field_on_the_document: 'Draw {field} field on the document',
click_to_upload: 'Click to upload',
or_drag_and_drop_files: 'or drag and drop files',

Loading…
Cancel
Save