@hubsync/esign-web-sdk 6.9.11 → 6.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-sign.cjs.entry.js +37 -38
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +37 -38
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-sign.js +37 -38
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +37 -38
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/overrides.css +20 -20
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -1
- package/dist/verdocs-web-sdk/p-5550c6cc.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-5550c6cc.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-CVGpj4Sw.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d73be6e2.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-d73be6e2.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-FlyHYxx7.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e4044982.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e4044982.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-fd61ee63.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-fd61ee63.system.entry.js.map +0 -1
|
@@ -432,11 +432,9 @@ const VerdocsSign = class {
|
|
|
432
432
|
}
|
|
433
433
|
focusNextFieldAfter(field) {
|
|
434
434
|
setTimeout(() => {
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
this.focusFieldElement(fields[currentIndex + 1]);
|
|
439
|
-
}
|
|
435
|
+
const next = this.getNextUnfilledField(field);
|
|
436
|
+
if (next)
|
|
437
|
+
this.focusFieldElement(next);
|
|
440
438
|
}, 100);
|
|
441
439
|
}
|
|
442
440
|
focusFieldElement(field) {
|
|
@@ -451,11 +449,6 @@ const VerdocsSign = class {
|
|
|
451
449
|
handleStartSigning() {
|
|
452
450
|
this.markEnvelopeStarted();
|
|
453
451
|
this.signingProgressMode = 'signing';
|
|
454
|
-
const fields = this.getSortedFillableFields();
|
|
455
|
-
const startField = fields.find(field => !this.isFieldActuallyFilled(field)) || fields[0];
|
|
456
|
-
if (startField) {
|
|
457
|
-
this.focusFieldElement(startField);
|
|
458
|
-
}
|
|
459
452
|
this.adoptingSignature = true;
|
|
460
453
|
}
|
|
461
454
|
async handleFieldChange(field, e) {
|
|
@@ -616,12 +609,10 @@ const VerdocsSign = class {
|
|
|
616
609
|
}
|
|
617
610
|
return;
|
|
618
611
|
}
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
this.focusFieldElement(nextUnfilled);
|
|
624
|
-
}
|
|
612
|
+
const currentField = this.getSortedFillableFields().find(f => f.name === this.focusedField);
|
|
613
|
+
const next = this.getNextUnfilledField(currentField);
|
|
614
|
+
if (next)
|
|
615
|
+
this.focusFieldElement(next);
|
|
625
616
|
}
|
|
626
617
|
handleNextOptional() {
|
|
627
618
|
const unfilledOptional = this.getSortedFillableFields().filter(f => !f.required && !this.isFieldActuallyFilled(f));
|
|
@@ -645,8 +636,10 @@ const VerdocsSign = class {
|
|
|
645
636
|
}
|
|
646
637
|
// See if everything that "needs to be" filled in is, and all "fillable fields" are valid
|
|
647
638
|
checkRecipientFields() {
|
|
648
|
-
const
|
|
649
|
-
|
|
639
|
+
const allFields = this.getSortedFillableFields();
|
|
640
|
+
const requiredIncomplete = allFields.some(f => f.required && !this.isFieldActuallyFilled(f));
|
|
641
|
+
const invalidFilled = allFields.some(f => this.isFieldActuallyFilled(f) && !isFieldValid(f, this.getRecipientFields()));
|
|
642
|
+
if (!requiredIncomplete && !invalidFilled) {
|
|
650
643
|
this.nextButtonLabel = 'Finish';
|
|
651
644
|
if (!this.nextSubmits) {
|
|
652
645
|
this.nextSubmits = true;
|
|
@@ -690,20 +683,15 @@ const VerdocsSign = class {
|
|
|
690
683
|
(field.type !== 'radio' || field.value === 'true') &&
|
|
691
684
|
(field.type !== 'checkbox' || field.value === 'true'));
|
|
692
685
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
return this.getNextFieldFromList(allUnfilled);
|
|
703
|
-
}
|
|
704
|
-
return null;
|
|
705
|
-
}
|
|
706
|
-
return this.getNextFieldFromList(emptyFields);
|
|
686
|
+
getNextUnfilledField(after) {
|
|
687
|
+
const allFields = this.getSortedFillableFields();
|
|
688
|
+
const startIndex = after ? allFields.findIndex(f => f.name === after.name) + 1 : 0;
|
|
689
|
+
// Look forward from current position first
|
|
690
|
+
const nextAfter = allFields.slice(startIndex).find(f => !this.isFieldActuallyFilled(f));
|
|
691
|
+
if (nextAfter)
|
|
692
|
+
return nextAfter;
|
|
693
|
+
// Wrap to beginning if nothing unfilled ahead
|
|
694
|
+
return allFields.slice(0, startIndex).find(f => !this.isFieldActuallyFilled(f)) || null;
|
|
707
695
|
}
|
|
708
696
|
getNextFieldFromList(fields) {
|
|
709
697
|
const focusedIndex = fields.findIndex(field => field.name === this.focusedField);
|
|
@@ -736,14 +724,16 @@ const VerdocsSign = class {
|
|
|
736
724
|
// Remove existing flags
|
|
737
725
|
const existingFlags = controlsDiv.querySelectorAll('.verdocs-flag-instance');
|
|
738
726
|
existingFlags.forEach(el => el.remove());
|
|
739
|
-
let nextField = this.getNextRequiredField();
|
|
740
727
|
const focusedFieldObj = this.getRecipientFields().find(f => f.name === this.focusedField);
|
|
741
|
-
// If the currently focused field is unfilled,
|
|
742
|
-
//
|
|
743
|
-
|
|
728
|
+
// If the currently focused field is unfilled, point the flag to it.
|
|
729
|
+
// Otherwise find the next unfilled field forward from the current position.
|
|
730
|
+
let nextField;
|
|
744
731
|
if (focusedFieldObj && !this.isFieldActuallyFilled(focusedFieldObj)) {
|
|
745
732
|
nextField = focusedFieldObj;
|
|
746
733
|
}
|
|
734
|
+
else {
|
|
735
|
+
nextField = this.getNextUnfilledField(focusedFieldObj);
|
|
736
|
+
}
|
|
747
737
|
if (nextField && nextField.page === pageInfo.pageNumber && nextField.document_id === pageInfo.documentId) {
|
|
748
738
|
const variant = 'fill';
|
|
749
739
|
let label = 'FILL';
|
|
@@ -1080,7 +1070,7 @@ const VerdocsSign = class {
|
|
|
1080
1070
|
return (h("span", { class: "remaining-count" }, remaining, " required field", remaining === 1 ? '' : 's', " left"));
|
|
1081
1071
|
}
|
|
1082
1072
|
return (h("span", { class: "remaining-count" }, h("span", { class: "check-icon", innerHTML: CheckCircleIcon }), "All required fields complete", optionalLeft > 0 && h("span", { class: "separator" }, "|"), optionalLeft > 0 && (h("span", { class: "review-optional", onClick: () => this.handleNextOptional() }, "Review ", optionalLeft, " optional"))));
|
|
1083
|
-
})(), !this.finishLater && (h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel
|
|
1073
|
+
})(), !this.finishLater && (h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel, disabled: !this.agreed || this.submitting, onClick: () => this.handleNext() })), h("div", { class: { 'icon-button': true, 'minus': true, 'disabled': this.zoomLevel === 'normal' }, innerHTML: ToolbarMinusIcon, onClick: () => this.handleZoomOut() }), h("div", { class: { 'icon-button': true, 'plus': true, 'disabled': this.zoomLevel === 'zoom2' }, innerHTML: ToolbarPlusIcon, onClick: () => this.handleZoomIn() }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) })))), this.toolbarStyle === 'controls' && (h("div", { class: "controls-toolbar" }, h("div", { class: "left-controls" }, h("div", { class: "title" }, this.envelope.name)), h("div", { class: "center-controls", style: { display: 'none' } }, h("span", { class: "label" }, "Page"), h("div", { class: "select-wrapper" }, h("verdocs-select-input", { options: pageOptions, value: this.pageNumber.toString(), onInput: e => this.handlePageSelect(e) })), h("span", { class: "count" }, "of ", totalPages)), h("div", { class: "right-controls" }, h("verdocs-button", { class: "mobile-next-button", label: this.nextButtonLabel, size: "xsmall", disabled: !this.agreed || this.submitting, onClick: () => this.handleNext() }), h("div", { class: { 'icon-button': true, 'minus': true, 'disabled': this.zoomLevel === 'normal' }, innerHTML: ToolbarMinusIcon, onClick: () => this.handleZoomOut() }), h("div", { class: { 'icon-button': true, 'plus': true, 'disabled': this.zoomLevel === 'zoom2' }, innerHTML: ToolbarPlusIcon, onClick: () => this.handleZoomIn() }), h("div", { class: "icon-button download", innerHTML: ToolbarDownloadIcon, onClick: () => this.handleOptionSelected({ detail: { id: 'download' } }) }), h("div", { class: "icon-button print", innerHTML: ToolbarPrintIcon, onClick: () => this.handleOptionSelected({ detail: { id: 'print' } }) })))), h("verdocs-signing-progress", { mode: this.signingProgressMode, focusedField: this.focusedField, fields: this.getSortedFillableFields(), recipientFields: this.getRecipientFields(), onStarted: () => {
|
|
1084
1074
|
this.handleStartSigning();
|
|
1085
1075
|
}, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }), h("div", { class: `document signed-document-container zoom-${this.zoomLevel}` }, (this.envelope.documents || []).map(envelopeDocument => {
|
|
1086
1076
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|
|
@@ -1121,7 +1111,10 @@ const VerdocsSign = class {
|
|
|
1121
1111
|
this.showSpinner = false;
|
|
1122
1112
|
this.adoptingSignature = false;
|
|
1123
1113
|
this.markEnvelopeStarted();
|
|
1124
|
-
// Apply the new signature/initials to the field that triggered the dialog.
|
|
1114
|
+
// Apply the new signature/initials to the field that triggered the dialog (e.g. user
|
|
1115
|
+
// clicked an existing sig/initial field). Track which field was applied so we can
|
|
1116
|
+
// advance forward from it rather than jumping back to the start of the document.
|
|
1117
|
+
let appliedToField = null;
|
|
1125
1118
|
if (this.focusedField) {
|
|
1126
1119
|
const fieldObj = this.getRecipientFields().find(f => f.name === this.focusedField);
|
|
1127
1120
|
if (fieldObj) {
|
|
@@ -1129,10 +1122,16 @@ const VerdocsSign = class {
|
|
|
1129
1122
|
if (id) {
|
|
1130
1123
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, fieldObj.name, id, false);
|
|
1131
1124
|
this.updateRecipientFieldValue(fieldObj.name, updateResult);
|
|
1125
|
+
appliedToField = fieldObj;
|
|
1132
1126
|
}
|
|
1133
1127
|
}
|
|
1134
1128
|
this.focusedField = '';
|
|
1135
1129
|
}
|
|
1130
|
+
// Navigate to the next unfilled field: forward from where we applied (or from the
|
|
1131
|
+
// beginning when adopting at session start with no pre-focused field).
|
|
1132
|
+
const nextField = this.getNextUnfilledField(appliedToField !== null && appliedToField !== void 0 ? appliedToField : undefined);
|
|
1133
|
+
if (nextField)
|
|
1134
|
+
this.focusFieldElement(nextField);
|
|
1136
1135
|
// Update any existing field elements in the DOM with the new IDs. This prevents them from
|
|
1137
1136
|
// needing to show the adoption dialog again if they are clicked.
|
|
1138
1137
|
const sigFields = this.el.querySelectorAll('verdocs-field-signature');
|