|  |  | @ -123,7 +123,7 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :areas-index="fieldAreasIndex[document.uuid]" |  |  |  |                 :areas-index="fieldAreasIndex[document.uuid]" | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :selected-submitter="selectedSubmitter" |  |  |  |                 :selected-submitter="selectedSubmitter" | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :document="document" |  |  |  |                 :document="document" | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :is-drag="!!dragFieldType" |  |  |  |                 :is-drag="!!dragField" | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 :draw-field="drawField" |  |  |  |                 :draw-field="drawField" | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :editable="editable" |  |  |  |                 :editable="editable" | 
			
		
	
		
		
			
				
					
					|  |  |  |                 :base-url="baseUrl" |  |  |  |                 :base-url="baseUrl" | 
			
		
	
	
		
		
			
				
					|  |  | @ -222,12 +222,13 @@ | 
			
		
	
		
		
			
				
					
					|  |  |  |             :fields="template.fields" |  |  |  |             :fields="template.fields" | 
			
		
	
		
		
			
				
					
					|  |  |  |             :submitters="template.submitters" |  |  |  |             :submitters="template.submitters" | 
			
		
	
		
		
			
				
					
					|  |  |  |             :selected-submitter="selectedSubmitter" |  |  |  |             :selected-submitter="selectedSubmitter" | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             :default-fields="defaultFields" | 
			
		
	
		
		
			
				
					
					|  |  |  |             :with-sticky-submitters="withStickySubmitters" |  |  |  |             :with-sticky-submitters="withStickySubmitters" | 
			
		
	
		
		
			
				
					
					|  |  |  |             :editable="editable" |  |  |  |             :editable="editable" | 
			
		
	
		
		
			
				
					
					|  |  |  |             @set-draw="drawField = $event" |  |  |  |             @set-draw="drawField = $event" | 
			
		
	
		
		
			
				
					
					|  |  |  |             @set-drag="dragFieldType = $event" |  |  |  |             @set-drag="dragField = $event" | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             @change-submitter="selectedSubmitter = $event" |  |  |  |             @change-submitter="selectedSubmitter = $event" | 
			
		
	
		
		
			
				
					
					|  |  |  |             @drag-end="dragFieldType = null" |  |  |  |             @drag-end="dragField = null" | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |             @scroll-to-area="scrollToArea" |  |  |  |             @scroll-to-area="scrollToArea" | 
			
		
	
		
		
			
				
					
					|  |  |  |           /> |  |  |  |           /> | 
			
		
	
		
		
			
				
					
					|  |  |  |         </div> |  |  |  |         </div> | 
			
		
	
	
		
		
			
				
					|  |  | @ -300,6 +301,16 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |       required: false, |  |  |  |       required: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |       default: true |  |  |  |       default: true | 
			
		
	
		
		
			
				
					
					|  |  |  |     }, |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     defaultFields: { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       type: Array, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       default: () => [] | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     defaultSubmitters: { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       type: Array, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       required: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       default: () => [] | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |     acceptFileTypes: { |  |  |  |     acceptFileTypes: { | 
			
		
	
		
		
			
				
					
					|  |  |  |       type: String, |  |  |  |       type: String, | 
			
		
	
		
		
			
				
					
					|  |  |  |       required: false, |  |  |  |       required: false, | 
			
		
	
	
		
		
			
				
					|  |  | @ -343,7 +354,7 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |       isSaving: false, |  |  |  |       isSaving: false, | 
			
		
	
		
		
			
				
					
					|  |  |  |       selectedSubmitter: null, |  |  |  |       selectedSubmitter: null, | 
			
		
	
		
		
			
				
					
					|  |  |  |       drawField: null, |  |  |  |       drawField: null, | 
			
		
	
		
		
			
				
					
					|  |  |  |       dragFieldType: null |  |  |  |       dragField: null | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  |   computed: { |  |  |  |   computed: { | 
			
		
	
	
		
		
			
				
					|  |  | @ -375,6 +386,13 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  |   created () { |  |  |  |   created () { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     this.defaultSubmitters.forEach((name, index) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       const submitter = (this.template.submitters[index] ||= {}) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       submitter.name = name | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       submitter.uuid ||= v4() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     this.selectedSubmitter = this.template.submitters[0] |  |  |  |     this.selectedSubmitter = this.template.submitters[0] | 
			
		
	
		
		
			
				
					
					|  |  |  |   }, |  |  |  |   }, | 
			
		
	
		
		
			
				
					
					|  |  |  |   mounted () { |  |  |  |   mounted () { | 
			
		
	
	
		
		
			
				
					|  |  | @ -567,13 +585,13 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |     onDropfield (area) { |  |  |  |     onDropfield (area) { | 
			
		
	
		
		
			
				
					
					|  |  |  |       const field = { |  |  |  |       const field = { | 
			
		
	
		
		
			
				
					
					|  |  |  |         name: '', |  |  |  |         name: '', | 
			
		
	
		
		
			
				
					
					|  |  |  |         type: this.dragFieldType, |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         uuid: v4(), |  |  |  |         uuid: v4(), | 
			
		
	
		
		
			
				
					
					|  |  |  |         submitter_uuid: this.selectedSubmitter.uuid, |  |  |  |         submitter_uuid: this.selectedSubmitter.uuid, | 
			
		
	
		
		
			
				
					
					|  |  |  |         required: this.dragFieldType !== 'checkbox' |  |  |  |         required: this.dragField.type !== 'checkbox', | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         ...this.dragField | 
			
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (['select', 'multiple', 'radio'].includes(this.dragFieldType)) { |  |  |  |       if (['select', 'multiple', 'radio'].includes(field.type)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         field.options = [''] |  |  |  |         field.options = [''] | 
			
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -588,27 +606,27 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       let baseArea |  |  |  |       let baseArea | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (this.selectedField?.type === this.dragFieldType) { |  |  |  |       if (this.selectedField?.type === field.type) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         baseArea = this.selectedAreaRef.value |  |  |  |         baseArea = this.selectedAreaRef.value | 
			
		
	
		
		
			
				
					
					|  |  |  |       } else if (previousField?.areas?.length) { |  |  |  |       } else if (previousField?.areas?.length) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         baseArea = previousField.areas[previousField.areas.length - 1] |  |  |  |         baseArea = previousField.areas[previousField.areas.length - 1] | 
			
		
	
		
		
			
				
					
					|  |  |  |       } else { |  |  |  |       } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (['checkbox'].includes(this.dragFieldType)) { |  |  |  |         if (['checkbox'].includes(field.type)) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           baseArea = { |  |  |  |           baseArea = { | 
			
		
	
		
		
			
				
					
					|  |  |  |             w: area.maskW / 30 / area.maskW, |  |  |  |             w: area.maskW / 30 / area.maskW, | 
			
		
	
		
		
			
				
					
					|  |  |  |             h: area.maskW / 30 / area.maskW * (area.maskW / area.maskH) |  |  |  |             h: area.maskW / 30 / area.maskW * (area.maskW / area.maskH) | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else if (this.dragFieldType === 'image') { |  |  |  |         } else if (field.type === 'image') { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           baseArea = { |  |  |  |           baseArea = { | 
			
		
	
		
		
			
				
					
					|  |  |  |             w: area.maskW / 5 / area.maskW, |  |  |  |             w: area.maskW / 5 / area.maskW, | 
			
		
	
		
		
			
				
					
					|  |  |  |             h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) |  |  |  |             h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else if (this.dragFieldType === 'signature') { |  |  |  |         } else if (field.type === 'signature') { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           baseArea = { |  |  |  |           baseArea = { | 
			
		
	
		
		
			
				
					
					|  |  |  |             w: area.maskW / 5 / area.maskW, |  |  |  |             w: area.maskW / 5 / area.maskW, | 
			
		
	
		
		
			
				
					
					|  |  |  |             h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) / 2 |  |  |  |             h: (area.maskW / 5 / area.maskW) * (area.maskW / area.maskH) / 2 | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else if (this.dragFieldType === 'initials') { |  |  |  |         } else if (field.type === 'initials') { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           baseArea = { |  |  |  |           baseArea = { | 
			
		
	
		
		
			
				
					
					|  |  |  |             w: area.maskW / 10 / area.maskW, |  |  |  |             w: area.maskW / 10 / area.maskW, | 
			
		
	
		
		
			
				
					
					|  |  |  |             h: area.maskW / 35 / area.maskW |  |  |  |             h: area.maskW / 35 / area.maskW | 
			
		
	
	
		
		
			
				
					|  |  | @ -625,7 +643,7 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |       fieldArea.h = baseArea.h |  |  |  |       fieldArea.h = baseArea.h | 
			
		
	
		
		
			
				
					
					|  |  |  |       fieldArea.y = fieldArea.y - baseArea.h / 2 |  |  |  |       fieldArea.y = fieldArea.y - baseArea.h / 2 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (this.dragFieldType === 'cells') { |  |  |  |       if (field.type === 'cells') { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         fieldArea.cell_w = baseArea.cell_w || (baseArea.w / 5) |  |  |  |         fieldArea.cell_w = baseArea.cell_w || (baseArea.w / 5) | 
			
		
	
		
		
			
				
					
					|  |  |  |       } |  |  |  |       } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | 
 |