@hubsync/esign-web-sdk 6.5.3 → 6.5.5
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 +40 -31
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +40 -31
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-sign.js +40 -31
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +40 -31
- 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/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -1
- package/dist/verdocs-web-sdk/p-1UWKyp9k.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-3c05be8a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-3c05be8a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-bac24b35.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-bac24b35.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-CRNRCDCr.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-cc1ba953.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-cc1ba953.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-da7d065e.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-da7d065e.system.entry.js.map +0 -1
|
@@ -388,6 +388,8 @@ const VerdocsSign = class {
|
|
|
388
388
|
if (e.detail === null) {
|
|
389
389
|
console.log('[SIGN] Clearing initial');
|
|
390
390
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
|
|
391
|
+
updateResult.value = null;
|
|
392
|
+
this.initialId = null;
|
|
391
393
|
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
392
394
|
}
|
|
393
395
|
// If we already have an initials block, apply it
|
|
@@ -428,6 +430,8 @@ const VerdocsSign = class {
|
|
|
428
430
|
if (e.detail === null) {
|
|
429
431
|
console.log('[SIGN] Clearing signature');
|
|
430
432
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
|
|
433
|
+
updateResult.value = null;
|
|
434
|
+
this.signatureId = null;
|
|
431
435
|
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
432
436
|
}
|
|
433
437
|
// If we already have a signature block, apply it
|
|
@@ -497,13 +501,13 @@ const VerdocsSign = class {
|
|
|
497
501
|
}
|
|
498
502
|
return;
|
|
499
503
|
}
|
|
500
|
-
const
|
|
501
|
-
if (
|
|
502
|
-
const id = getFieldId(
|
|
504
|
+
const nextField = this.getNextFieldInOrder();
|
|
505
|
+
if (nextField) {
|
|
506
|
+
const id = getFieldId(nextField);
|
|
503
507
|
const el = document.getElementById(id);
|
|
504
508
|
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
505
509
|
el === null || el === void 0 ? void 0 : el.focusField();
|
|
506
|
-
this.focusedField =
|
|
510
|
+
this.focusedField = nextField.name;
|
|
507
511
|
}
|
|
508
512
|
}
|
|
509
513
|
getRecipientFields() {
|
|
@@ -525,24 +529,36 @@ const VerdocsSign = class {
|
|
|
525
529
|
}
|
|
526
530
|
this.updateAllFlags();
|
|
527
531
|
}
|
|
528
|
-
|
|
529
|
-
// Find
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
// console.log(
|
|
533
|
-
// '[SIGN] Pending fields',
|
|
534
|
-
// emptyFields.map(f => `${f.name} (${f.type}) req=${f.required}`),
|
|
535
|
-
// );
|
|
536
|
-
if (emptyFields.length === 0) {
|
|
537
|
-
const allUnfilled = this.getSortedFillableFields().filter(field => !isFieldFilled(field, this.getRecipientFields()));
|
|
538
|
-
sortFields(allUnfilled);
|
|
539
|
-
if (allUnfilled.length > 0) {
|
|
540
|
-
// If we are here, there are no required fields left, but there are optional ones.
|
|
541
|
-
return this.getNextFieldFromList(allUnfilled);
|
|
542
|
-
}
|
|
532
|
+
getNextFieldInOrder() {
|
|
533
|
+
// Find the next incomplete field in overall order (required + optional).
|
|
534
|
+
const fields = this.getSortedFillableFields();
|
|
535
|
+
if (fields.length === 0)
|
|
543
536
|
return null;
|
|
537
|
+
const recipientFields = this.getRecipientFields();
|
|
538
|
+
const focusedIndex = fields.findIndex(field => field.name === this.focusedField);
|
|
539
|
+
const startIndex = focusedIndex >= 0 ? focusedIndex + 1 : 0;
|
|
540
|
+
for (let i = 0; i < fields.length; i++) {
|
|
541
|
+
const idx = (startIndex + i) % fields.length;
|
|
542
|
+
const field = fields[idx];
|
|
543
|
+
if (!this.isFieldFilledForNav(field, recipientFields)) {
|
|
544
|
+
return field;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
isFieldFilledForNav(field, recipientFields) {
|
|
550
|
+
if (field.type === 'signature' || field.type === 'initial') {
|
|
551
|
+
const value = typeof field.value === 'string' ? field.value.trim() : field.value;
|
|
552
|
+
if (!value)
|
|
553
|
+
return false;
|
|
554
|
+
if (value === 'signed' || value === 'initialed')
|
|
555
|
+
return false;
|
|
556
|
+
return true;
|
|
557
|
+
}
|
|
558
|
+
if (field.type === 'dropdown') {
|
|
559
|
+
return isFieldFilled(field, recipientFields) && !!field.value;
|
|
544
560
|
}
|
|
545
|
-
return
|
|
561
|
+
return isFieldFilled(field, recipientFields);
|
|
546
562
|
}
|
|
547
563
|
getNextFieldFromList(fields) {
|
|
548
564
|
const focusedIndex = fields.findIndex(field => field.name === this.focusedField);
|
|
@@ -580,12 +596,12 @@ const VerdocsSign = class {
|
|
|
580
596
|
// Remove existing flags
|
|
581
597
|
const existingFlags = controlsDiv.querySelectorAll('.verdocs-flag-instance');
|
|
582
598
|
existingFlags.forEach(el => el.remove());
|
|
583
|
-
let nextField = this.
|
|
599
|
+
let nextField = this.getNextFieldInOrder();
|
|
584
600
|
const focusedFieldObj = this.getRecipientFields().find(f => f.name === this.focusedField);
|
|
585
601
|
// If the currently focused field is unfilled, we should point the flag to IT, not the next one.
|
|
586
|
-
//
|
|
602
|
+
// getNextFieldInOrder() is designed for the "Next" button (skipping current), but the visual flag
|
|
587
603
|
// should guide the user to the current task if it's incomplete.
|
|
588
|
-
if (focusedFieldObj && !
|
|
604
|
+
if (focusedFieldObj && !this.isFieldFilledForNav(focusedFieldObj, this.getRecipientFields())) {
|
|
589
605
|
nextField = focusedFieldObj;
|
|
590
606
|
}
|
|
591
607
|
if (nextField && nextField.page === pageInfo.pageNumber && nextField.document_id === pageInfo.documentId) {
|
|
@@ -603,13 +619,6 @@ const VerdocsSign = class {
|
|
|
603
619
|
onSkip: () => {
|
|
604
620
|
this.handleNext();
|
|
605
621
|
},
|
|
606
|
-
onClick: () => {
|
|
607
|
-
var _a;
|
|
608
|
-
const id = getFieldId(nextField);
|
|
609
|
-
const el = document.getElementById(id);
|
|
610
|
-
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
611
|
-
(_a = el === null || el === void 0 ? void 0 : el.focusField) === null || _a === void 0 ? void 0 : _a.call(el);
|
|
612
|
-
},
|
|
613
622
|
});
|
|
614
623
|
}
|
|
615
624
|
}
|
|
@@ -926,7 +935,7 @@ const VerdocsSign = class {
|
|
|
926
935
|
}
|
|
927
936
|
return (h("verdocs-signing-progress", { mode: mode, current: Math.max(1, currentIndex), total: totalFields, remainingFields: remainingFields, progress: progress, fieldLabel: getFieldLabel(focusedFieldObj), fieldCompleted: focusedFieldObj ? !!isFilled(focusedFieldObj) : false, onStarted: () => {
|
|
928
937
|
this.adoptingSignature = true;
|
|
929
|
-
|
|
938
|
+
this.handleNext();
|
|
930
939
|
}, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }));
|
|
931
940
|
})(), h("div", { class: `document signed-document-container zoom-${this.zoomLevel}` }, (this.envelope.documents || []).map(envelopeDocument => {
|
|
932
941
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|