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