@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
|
@@ -458,11 +458,9 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
458
458
|
}
|
|
459
459
|
focusNextFieldAfter(field) {
|
|
460
460
|
setTimeout(() => {
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
this.focusFieldElement(fields[currentIndex + 1]);
|
|
465
|
-
}
|
|
461
|
+
const next = this.getNextUnfilledField(field);
|
|
462
|
+
if (next)
|
|
463
|
+
this.focusFieldElement(next);
|
|
466
464
|
}, 100);
|
|
467
465
|
}
|
|
468
466
|
focusFieldElement(field) {
|
|
@@ -477,11 +475,6 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
477
475
|
handleStartSigning() {
|
|
478
476
|
this.markEnvelopeStarted();
|
|
479
477
|
this.signingProgressMode = 'signing';
|
|
480
|
-
const fields = this.getSortedFillableFields();
|
|
481
|
-
const startField = fields.find(field => !this.isFieldActuallyFilled(field)) || fields[0];
|
|
482
|
-
if (startField) {
|
|
483
|
-
this.focusFieldElement(startField);
|
|
484
|
-
}
|
|
485
478
|
this.adoptingSignature = true;
|
|
486
479
|
}
|
|
487
480
|
async handleFieldChange(field, e) {
|
|
@@ -642,12 +635,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
642
635
|
}
|
|
643
636
|
return;
|
|
644
637
|
}
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
this.focusFieldElement(nextUnfilled);
|
|
650
|
-
}
|
|
638
|
+
const currentField = this.getSortedFillableFields().find(f => f.name === this.focusedField);
|
|
639
|
+
const next = this.getNextUnfilledField(currentField);
|
|
640
|
+
if (next)
|
|
641
|
+
this.focusFieldElement(next);
|
|
651
642
|
}
|
|
652
643
|
handleNextOptional() {
|
|
653
644
|
const unfilledOptional = this.getSortedFillableFields().filter(f => !f.required && !this.isFieldActuallyFilled(f));
|
|
@@ -671,8 +662,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
671
662
|
}
|
|
672
663
|
// See if everything that "needs to be" filled in is, and all "fillable fields" are valid
|
|
673
664
|
checkRecipientFields() {
|
|
674
|
-
const
|
|
675
|
-
|
|
665
|
+
const allFields = this.getSortedFillableFields();
|
|
666
|
+
const requiredIncomplete = allFields.some(f => f.required && !this.isFieldActuallyFilled(f));
|
|
667
|
+
const invalidFilled = allFields.some(f => this.isFieldActuallyFilled(f) && !isFieldValid(f, this.getRecipientFields()));
|
|
668
|
+
if (!requiredIncomplete && !invalidFilled) {
|
|
676
669
|
this.nextButtonLabel = 'Finish';
|
|
677
670
|
if (!this.nextSubmits) {
|
|
678
671
|
this.nextSubmits = true;
|
|
@@ -716,20 +709,15 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
716
709
|
(field.type !== 'radio' || field.value === 'true') &&
|
|
717
710
|
(field.type !== 'checkbox' || field.value === 'true'));
|
|
718
711
|
}
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
return this.getNextFieldFromList(allUnfilled);
|
|
729
|
-
}
|
|
730
|
-
return null;
|
|
731
|
-
}
|
|
732
|
-
return this.getNextFieldFromList(emptyFields);
|
|
712
|
+
getNextUnfilledField(after) {
|
|
713
|
+
const allFields = this.getSortedFillableFields();
|
|
714
|
+
const startIndex = after ? allFields.findIndex(f => f.name === after.name) + 1 : 0;
|
|
715
|
+
// Look forward from current position first
|
|
716
|
+
const nextAfter = allFields.slice(startIndex).find(f => !this.isFieldActuallyFilled(f));
|
|
717
|
+
if (nextAfter)
|
|
718
|
+
return nextAfter;
|
|
719
|
+
// Wrap to beginning if nothing unfilled ahead
|
|
720
|
+
return allFields.slice(0, startIndex).find(f => !this.isFieldActuallyFilled(f)) || null;
|
|
733
721
|
}
|
|
734
722
|
getNextFieldFromList(fields) {
|
|
735
723
|
const focusedIndex = fields.findIndex(field => field.name === this.focusedField);
|
|
@@ -762,14 +750,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
762
750
|
// Remove existing flags
|
|
763
751
|
const existingFlags = controlsDiv.querySelectorAll('.verdocs-flag-instance');
|
|
764
752
|
existingFlags.forEach(el => el.remove());
|
|
765
|
-
let nextField = this.getNextRequiredField();
|
|
766
753
|
const focusedFieldObj = this.getRecipientFields().find(f => f.name === this.focusedField);
|
|
767
|
-
// If the currently focused field is unfilled,
|
|
768
|
-
//
|
|
769
|
-
|
|
754
|
+
// If the currently focused field is unfilled, point the flag to it.
|
|
755
|
+
// Otherwise find the next unfilled field forward from the current position.
|
|
756
|
+
let nextField;
|
|
770
757
|
if (focusedFieldObj && !this.isFieldActuallyFilled(focusedFieldObj)) {
|
|
771
758
|
nextField = focusedFieldObj;
|
|
772
759
|
}
|
|
760
|
+
else {
|
|
761
|
+
nextField = this.getNextUnfilledField(focusedFieldObj);
|
|
762
|
+
}
|
|
773
763
|
if (nextField && nextField.page === pageInfo.pageNumber && nextField.document_id === pageInfo.documentId) {
|
|
774
764
|
const variant = 'fill';
|
|
775
765
|
let label = 'FILL';
|
|
@@ -1106,7 +1096,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
1106
1096
|
return (h("span", { class: "remaining-count" }, remaining, " required field", remaining === 1 ? '' : 's', " left"));
|
|
1107
1097
|
}
|
|
1108
1098
|
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"))));
|
|
1109
|
-
})(), !this.finishLater && (h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel
|
|
1099
|
+
})(), !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: () => {
|
|
1110
1100
|
this.handleStartSigning();
|
|
1111
1101
|
}, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }), h("div", { class: `document signed-document-container zoom-${this.zoomLevel}` }, (this.envelope.documents || []).map(envelopeDocument => {
|
|
1112
1102
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|
|
@@ -1147,7 +1137,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
1147
1137
|
this.showSpinner = false;
|
|
1148
1138
|
this.adoptingSignature = false;
|
|
1149
1139
|
this.markEnvelopeStarted();
|
|
1150
|
-
// Apply the new signature/initials to the field that triggered the dialog.
|
|
1140
|
+
// Apply the new signature/initials to the field that triggered the dialog (e.g. user
|
|
1141
|
+
// clicked an existing sig/initial field). Track which field was applied so we can
|
|
1142
|
+
// advance forward from it rather than jumping back to the start of the document.
|
|
1143
|
+
let appliedToField = null;
|
|
1151
1144
|
if (this.focusedField) {
|
|
1152
1145
|
const fieldObj = this.getRecipientFields().find(f => f.name === this.focusedField);
|
|
1153
1146
|
if (fieldObj) {
|
|
@@ -1155,10 +1148,16 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
|
|
|
1155
1148
|
if (id) {
|
|
1156
1149
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, fieldObj.name, id, false);
|
|
1157
1150
|
this.updateRecipientFieldValue(fieldObj.name, updateResult);
|
|
1151
|
+
appliedToField = fieldObj;
|
|
1158
1152
|
}
|
|
1159
1153
|
}
|
|
1160
1154
|
this.focusedField = '';
|
|
1161
1155
|
}
|
|
1156
|
+
// Navigate to the next unfilled field: forward from where we applied (or from the
|
|
1157
|
+
// beginning when adopting at session start with no pre-focused field).
|
|
1158
|
+
const nextField = this.getNextUnfilledField(appliedToField !== null && appliedToField !== void 0 ? appliedToField : undefined);
|
|
1159
|
+
if (nextField)
|
|
1160
|
+
this.focusFieldElement(nextField);
|
|
1162
1161
|
// Update any existing field elements in the DOM with the new IDs. This prevents them from
|
|
1163
1162
|
// needing to show the adoption dialog again if they are clicked.
|
|
1164
1163
|
const sigFields = this.el.querySelectorAll('verdocs-field-signature');
|