resolving errors of my signature and initials.

pull/150/merge^2
iozeey 2 years ago
parent b20aa059a4
commit 1a6fefa976

@ -140,14 +140,14 @@
:id="field.uuid" :id="field.uuid"
:src="mySignatureUrl.url" :src="mySignatureUrl.url"
class="d-flex justify-center w-full h-full" class="d-flex justify-center w-full h-full"
style="z-index: 50;" style="z-index: 50; border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; background-color: transparent;"
@click="handleMySignatureClick" @click="handleMySignatureClick"
> >
<img <img
v-else v-else
:id="field.uuid" :id="field.uuid"
class="d-flex justify-center w-full h-full" class="d-flex justify-center w-full h-full"
style="z-index: 50;" style="z-index: 50; border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; background-color: transparent;"
@click="handleMySignatureClick" @click="handleMySignatureClick"
> >
</div> </div>
@ -162,14 +162,14 @@
:id="field.uuid" :id="field.uuid"
:src="myInitialsUrl.url" :src="myInitialsUrl.url"
class="d-flex justify-center w-full h-full" class="d-flex justify-center w-full h-full"
style="z-index: 50;" style="z-index: 50; border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; background-color: transparent;"
@click="handleMyInitialClick" @click="handleMyInitialClick"
> >
<img <img
v-else v-else
:id="field.uuid" :id="field.uuid"
class="d-flex justify-center w-full h-full" class="d-flex justify-center w-full h-full"
style="z-index: 50;" style="z-index: 50; border-width: 2px; --tw-bg-opacity: 1; --tw-border-opacity: 0.2; background-color: transparent;"
@click="handleMyInitialClick" @click="handleMyInitialClick"
> >
</div> </div>
@ -216,6 +216,9 @@
</div> </div>
<div <div
v-if="showMySignature" v-if="showMySignature"
@pointerdown.stop
@mousedown.stop="startDrag"
@touchstart="startTouchDrag"
> >
<MySignature <MySignature
:key="field.uuid" :key="field.uuid"
@ -233,6 +236,9 @@
</div> </div>
<div <div
v-if="showMyInitials" v-if="showMyInitials"
@pointerdown.stop
@mousedown.stop="startDrag"
@touchstart="startTouchDrag"
> >
<MyInitials <MyInitials
:key="field.uuid" :key="field.uuid"
@ -244,7 +250,7 @@
:template="template" :template="template"
:attachments-index="attachmentsIndex" :attachments-index="attachmentsIndex"
@attached="handleMyInitialsAttachment" @attached="handleMyInitialsAttachment"
@hide="showMySignature = false" @hide="showMyInitials = false"
@start="$refs.areas.scrollIntoField(field)" @start="$refs.areas.scrollIntoField(field)"
/> />
</div> </div>
@ -509,10 +515,12 @@ export default {
handleMyInitialsAttachment (attachment) { handleMyInitialsAttachment (attachment) {
this.templateAttachments.push(attachment) this.templateAttachments.push(attachment)
this.makeMyInitials(attachment.uuid) this.makeMyInitials(attachment.uuid)
this.save()
}, },
handleMySignatureAttachment (attachment) { handleMySignatureAttachment (attachment) {
this.templateAttachments.push(attachment) this.templateAttachments.push(attachment)
this.makeMySignature(attachment.uuid) this.makeMySignature(attachment.uuid)
this.save()
}, },
onNameFocus (e) { onNameFocus (e) {
this.selectedAreaRef.value = this.area this.selectedAreaRef.value = this.area

@ -4,96 +4,102 @@
style="z-index: 50;" style="z-index: 50;"
:style="{ ...mySignatureStyle }" :style="{ ...mySignatureStyle }"
> >
<div class="flex justify-between items-center w-full mb-2"> <div
<label style="min-height: 250px; min-width: 250px;"
class="label text-2xl" >
>{{ field.name || t('initials') }}</label> <div class="flex justify-between items-center w-full mb-2">
<div class="space-x-2 flex"> <label
<span class="label text-2xl"
v-if="isDrawInitials" >{{ field.name || t('initials') }}</label>
class="tooltip" <div class="space-x-2 flex">
:data-tip="t('type_initials')" <span
> v-if="isDrawInitials"
class="tooltip"
:data-tip="t('type_initials')"
>
<a
id="type_text_button"
href="#"
class="btn btn-outline font-medium btn-sm"
@click.prevent="toggleTextInput"
>
<IconTextSize :width="16" />
</a>
</span>
<span
v-else
class="tooltip"
:data-tip="t('draw_initials')"
>
<a
id="type_text_button"
href="#"
class="btn btn-outline font-medium btn-sm"
@click.prevent="toggleTextInput"
>
<IconSignature :width="16" />
</a>
</span>
<a <a
id="type_text_button" v-if="modelValue || computedPreviousValue"
href="#" href="#"
class="btn btn-outline font-medium btn-sm" class="tooltip btn font-medium btn-outline btn-sm"
@click.prevent="toggleTextInput" :data-tip="'redraw'"
@click.prevent="remove"
> >
<IconTextSize :width="16" /> <IconReload :width="16" />
</a> </a>
</span>
<span
v-else
class="tooltip"
:data-tip="t('draw_initials')"
>
<a <a
id="type_text_button" v-else
href="#" href="#"
class="btn btn-outline font-medium btn-sm" class="tooltip btn font-medium btn-outline btn-sm"
@click.prevent="toggleTextInput" :data-tip="'clear'"
@click.prevent="clear"
> >
<IconSignature :width="16" /> <IconReload :width="16" />
</a> </a>
</span> <div
<a class="tooltip btn btn-outline btn-sm font-medium"
v-if="modelValue || computedPreviousValue" :data-tip="'close'"
href="#" @click="$emit('hide')"
class="btn font-medium btn-outline btn-sm" >
@click.prevent="remove" <IconTrashX :width="16" />
> </div>
<IconReload :width="16" />
</a>
<a
v-else
href="#"
class="btn font-medium btn-outline btn-sm"
@click.prevent="clear"
>
<IconReload :width="16" />
</a>
<div
class="tooltip btn btn-outline btn-sm font-medium"
:data-tip="'close'"
@click="$emit('hide')"
>
<IconTrashX :width="16" />
</div> </div>
</div> </div>
<input
:value="modelValue || computedPreviousValue"
type="hidden"
:name="`values[${field.uuid}]`"
>
<img
v-if="modelValue || computedPreviousValue"
:src="attachmentsIndex[modelValue || computedPreviousValue].url"
class="mx-auto bg-white border border-base-300 rounded max-h-72 w-full"
>
<canvas
v-show="!modelValue && !computedPreviousValue"
ref="canvas"
class="bg-white border border-base-300 rounded-2xl max-h-72 w-full"
/>
<input
v-if="!isDrawInitials && !modelValue && !computedPreviousValue"
id="initials_text_input"
ref="textInput"
class="base-input !text-2xl w-full mt-6 text-center"
:required="field.required && !isInitialsStarted"
:placeholder="`${t('type_initial_here')}...`"
type="text"
@focus="$emit('focus')"
@input="updateWrittenInitials"
>
<button
class="btn btn-outline w-full mt-2"
@click="submit"
>
<span> Submit </span>
</button>
</div> </div>
<input
:value="modelValue || computedPreviousValue"
type="hidden"
:name="`values[${field.uuid}]`"
>
<img
v-if="modelValue || computedPreviousValue"
:src="attachmentsIndex[modelValue || computedPreviousValue].url"
class="mx-auto bg-white border border-base-300 rounded max-h-72"
>
<canvas
v-show="!modelValue && !computedPreviousValue"
ref="canvas"
class="bg-white border border-base-300 rounded-2xl"
/>
<input
v-if="!isDrawInitials && !modelValue && !computedPreviousValue"
id="initials_text_input"
ref="textInput"
class="base-input !text-2xl w-full mt-6 text-center"
:required="field.required && !isInitialsStarted"
:placeholder="`${t('type_initial_here')}...`"
type="text"
@focus="$emit('focus')"
@input="updateWrittenInitials"
>
<button
class="btn btn-outline w-full mt-2"
@click="submit"
>
<span> Submit </span>
</button>
</div> </div>
</template> </template>

@ -56,16 +56,17 @@
<a <a
v-if="modelValue || computedPreviousValue" v-if="modelValue || computedPreviousValue"
href="#" href="#"
class="btn btn-outline btn-sm font-medium" class="tooltip btn btn-outline btn-sm font-medium"
:data-tip="'redraw'"
@click.prevent="remove" @click.prevent="remove"
> >
<IconReload :width="16" /> <IconReload :width="16" />
{{ t('redraw') }}
</a> </a>
<a <a
v-else v-else
href="#" href="#"
class="btn btn-outline btn-sm font-medium" class="tooltip btn btn-outline btn-sm font-medium"
:data-tip="'clear'"
@click.prevent="clear" @click.prevent="clear"
> >
<IconReload :width="16" /> <IconReload :width="16" />
@ -86,13 +87,13 @@
<img <img
v-if="modelValue || computedPreviousValue" v-if="modelValue || computedPreviousValue"
:src="attachmentsIndex[modelValue || computedPreviousValue].url" :src="attachmentsIndex[modelValue || computedPreviousValue].url"
class="mx-auto bg-white border border-base-300 rounded max-h-72" class="mx-auto bg-white border border-base-300 rounded max-h-72 w-full"
> >
<canvas <canvas
v-show="!modelValue && !computedPreviousValue" v-show="!modelValue && !computedPreviousValue"
ref="canvas" ref="canvas"
style="padding: 1px; 0" style="padding: 1px; 0"
class="bg-white border border-base-300 rounded-2xl" class="bg-white border border-base-300 rounded-2xl w-full"
/> />
<input <input
v-if="isTextSignature" v-if="isTextSignature"

Loading…
Cancel
Save