@hubsync/esign-web-sdk 6.5.5 → 6.5.7
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/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_8.cjs.entry.js +3 -9
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +6 -2
- package/dist/cjs/verdocs-ok-dialog.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +130 -33
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +6 -2
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js.map +1 -1
- package/dist/collection/components/dialogs/verdocs-signing-progress/verdocs-signing-progress.js +5 -11
- package/dist/collection/components/dialogs/verdocs-signing-progress/verdocs-signing-progress.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +134 -34
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.css +4 -5
- package/dist/components/{p-DfItspZ0.js → p-1MIt5Mm9.js} +7 -7
- package/dist/components/{p-DfItspZ0.js.map → p-1MIt5Mm9.js.map} +1 -1
- package/dist/components/{p-RIeHu5V1.js → p-BBCbRcjI.js} +3 -3
- package/dist/components/{p-RIeHu5V1.js.map → p-BBCbRcjI.js.map} +1 -1
- package/dist/components/{p-LfDLlp5r.js → p-BvPd1sPA.js} +3 -3
- package/dist/components/p-BvPd1sPA.js.map +1 -0
- package/dist/components/{p-4olD14NA.js → p-By4lLDL5.js} +3 -3
- package/dist/components/{p-4olD14NA.js.map → p-By4lLDL5.js.map} +1 -1
- package/dist/components/{p-CMpYlbLu.js → p-C3q4mHaq.js} +4 -4
- package/dist/components/{p-CMpYlbLu.js.map → p-C3q4mHaq.js.map} +1 -1
- package/dist/components/{p-B-ZoFCli.js → p-CY3peFvA.js} +5 -11
- package/dist/components/p-CY3peFvA.js.map +1 -0
- package/dist/components/{p-BAwv4SNb.js → p-Cz6Y5nA8.js} +3 -3
- package/dist/components/{p-BAwv4SNb.js.map → p-Cz6Y5nA8.js.map} +1 -1
- package/dist/components/{p-Q4A8au3E.js → p-D3-Ing_B.js} +7 -7
- package/dist/components/{p-Q4A8au3E.js.map → p-D3-Ing_B.js.map} +1 -1
- package/dist/components/{p-CUrnqIyl.js → p-DnuBWvuE.js} +8 -4
- package/dist/components/p-DnuBWvuE.js.map +1 -0
- package/dist/components/{p-oa9K_bbZ.js → p-Dz20noaY.js} +6 -6
- package/dist/components/{p-oa9K_bbZ.js.map → p-Dz20noaY.js.map} +1 -1
- package/dist/components/verdocs-build.js +8 -8
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-ok-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-sign.js +136 -36
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-signing-progress.js +1 -1
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-upload-dialog.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_8.entry.js +3 -9
- package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +6 -2
- package/dist/esm/verdocs-ok-dialog.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +130 -33
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.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/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/dialogs/verdocs-signing-progress/verdocs-signing-progress.d.ts +2 -2
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +8 -1
- package/dist/types/components.d.ts +4 -4
- package/dist/verdocs-web-sdk/p-38577511.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-38577511.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-1b63fe0b.entry.js → p-3e12a9d6.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-3e12a9d6.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-615e3533.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-615e3533.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-2db89a87.system.entry.js → p-7389986e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2db89a87.system.entry.js.map → p-7389986e.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-e0253fa3.entry.js → p-7a2be757.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e0253fa3.entry.js.map → p-7a2be757.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-f24d6c61.system.entry.js → p-8777a11b.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-8777a11b.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-9e9fdb1a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-9e9fdb1a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-Bcp-PA2y.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-CnRDNxzf.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-f624338c.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-f624338c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-gUJxKxOG.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-DixucIng.system.js.map → p-qKdY3jhy.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-ok-dialog.entry.esm.js.map +1 -1
- 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 +2 -2
- package/dist/components/p-B-ZoFCli.js.map +0 -1
- package/dist/components/p-CUrnqIyl.js.map +0 -1
- package/dist/components/p-LfDLlp5r.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1UWKyp9k.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1b63fe0b.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-36950fda.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-36950fda.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3c05be8a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-3c05be8a.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CrAB6I_0.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-D85w8lT9.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-bac24b35.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-bac24b35.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f24d6c61.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f551f8e0.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-f551f8e0.system.entry.js.map +0 -1
|
@@ -4467,19 +4467,13 @@ const VerdocsSigningProgress = class {
|
|
|
4467
4467
|
if (this.mode === 'start') {
|
|
4468
4468
|
return h("div", { class: "field-label" }, this.fieldLabel);
|
|
4469
4469
|
}
|
|
4470
|
-
if (this.fieldCompleted) {
|
|
4471
|
-
return (h("div", { class: "field-completed" }, h("div", { class: "icon" }, this.renderSuccessIcon()), h("span", { class: "text" }, "Ready to submit.")));
|
|
4472
|
-
}
|
|
4473
4470
|
return h("div", { class: "field-label" }, this.fieldLabel);
|
|
4474
4471
|
}
|
|
4475
4472
|
renderFooter() {
|
|
4476
4473
|
if (this.mode === 'start') {
|
|
4477
4474
|
return (h("button", { class: "btn start", onClick: () => this.started.emit() }, "Start Signing"));
|
|
4478
4475
|
}
|
|
4479
|
-
return (h("div", { class: "nav-buttons" }, this.
|
|
4480
|
-
h("button", { class: "btn previous", disabled: this.current <= 1, onClick: () => this.previous.emit() }, "Previous"),
|
|
4481
|
-
h("button", { class: "btn next", disabled: this.current >= this.total, onClick: () => this.next.emit() }, "Next"),
|
|
4482
|
-
])));
|
|
4476
|
+
return (h("div", { class: "nav-buttons" }, h("button", { class: "btn previous", disabled: this.current <= 1, onClick: () => this.previous.emit() }, "Previous"), h("button", { class: "btn next", disabled: this.current >= this.total, onClick: () => this.next.emit() }, "Next")));
|
|
4483
4477
|
}
|
|
4484
4478
|
renderCompleted() {
|
|
4485
4479
|
return (h("div", { class: "card completed" }, h("div", { class: "header-completed" }, h("div", { class: "icon" }, this.renderSuccessIcon()), "Ready to Submit"), h("div", { class: "description" }, "You have entered all requested signatures. Select Submit to complete the signing process."), h("div", { class: "separator" }), h("button", { class: "btn submit", onClick: () => this.exit.emit() }, "Submit")));
|
|
@@ -4490,8 +4484,8 @@ const VerdocsSigningProgress = class {
|
|
|
4490
4484
|
}
|
|
4491
4485
|
return (h("div", { class: "card" }, h("div", { class: "header" }, this.progress
|
|
4492
4486
|
? [
|
|
4493
|
-
h("div", { class: "progress-line" }, this.progress.required.
|
|
4494
|
-
this.progress.optional.total > 0 ? (h("div", { class: "progress-line optional" }, this.progress.optional.
|
|
4487
|
+
h("div", { class: "progress-line" }, this.progress.required.filled, " of ", this.progress.required.total, " required fields completed"),
|
|
4488
|
+
this.progress.optional.total > 0 ? (h("div", { class: "progress-line optional" }, this.progress.optional.filled, " of ", this.progress.optional.total, " optional fields completed")) : null,
|
|
4495
4489
|
]
|
|
4496
4490
|
: this.remainingFields && this.remainingFields.length > 0
|
|
4497
4491
|
? `${this.remainingFields.length} fields remaining`
|
|
@@ -677,7 +677,7 @@ const VerdocsFieldInitial = class {
|
|
|
677
677
|
};
|
|
678
678
|
VerdocsFieldInitial.style = verdocsFieldInitialCss;
|
|
679
679
|
|
|
680
|
-
const verdocsFieldRadioCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-field-radio{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);width:14px;height:14px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left
|
|
680
|
+
const verdocsFieldRadioCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-field-radio{font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif);width:14px;height:14px;display:block;font-size:11px;position:relative;scroll-margin:20px 0;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-radio.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-radio svg{margin-top:4px}verdocs-field-radio.disabled.done{opacity:1}verdocs-field-radio div.label{top:0;left:16px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#4a4a99;border-radius:2px;white-space:nowrap}verdocs-field-radio div.group{top:14px;left:-1px;height:14px;color:white;padding:0 4px;font-size:9px;line-height:13px;position:absolute;background:#bb0589;border-bottom-left-radius:2px;border-bottom-right-radius:2px}verdocs-field-radio input{cursor:inherit}verdocs-field-radio.disabled input{opacity:0.5}verdocs-field-radio.done input[type=radio]{margin:0;padding:0;width:10px;height:10px}verdocs-field-radio:not(.done) input[type=radio]{position:absolute;opacity:0}verdocs-field-radio:not(.done) input[type=radio]+label:before{content:\"\";border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:12px;height:12px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio:not(.done) input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-field-radio:not(.done) input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio:not(.done) input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#f3f3fc;background:#f3f3fc}verdocs-field-radio:not(.done) input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio.required{border:1px solid var(--verdocs-required-field-border)}verdocs-field-radio.hide{display:none}verdocs-field-radio.focused{-webkit-animation:verdocs-field-pulse 0.4s 1;animation:verdocs-field-pulse 0.4s 1}verdocs-field-radio verdocs-button-panel{margin-left:-20px;margin-top:-7px;-webkit-transform:scale(0.7);transform:scale(0.7)}verdocs-field-radio .settings-icon{position:absolute;top:-6px;left:-20px;display:inline-block;cursor:pointer;opacity:0.3}verdocs-field-radio .settings-icon svg{fill:#707ae5}verdocs-field-radio .settings-icon:hover{opacity:1}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}";
|
|
681
681
|
|
|
682
682
|
const RadioIconUnselected = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>`;
|
|
683
683
|
const RadioIconSelected = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>`;
|
|
@@ -35,13 +35,17 @@ const VerdocsOkDialog = class {
|
|
|
35
35
|
// We need a separate event handler for clicking the background because it can receive events "through" other child components
|
|
36
36
|
handleDismiss(e) {
|
|
37
37
|
this.closed = true;
|
|
38
|
-
if (e.target.className === 'background-overlay') {
|
|
38
|
+
if (e && e.target && e.target.className === 'background-overlay') {
|
|
39
39
|
e.preventDefault();
|
|
40
40
|
this.exit.emit();
|
|
41
41
|
}
|
|
42
|
+
else {
|
|
43
|
+
// For X button click, treat it the same as OK button
|
|
44
|
+
this.handleOk();
|
|
45
|
+
}
|
|
42
46
|
}
|
|
43
47
|
render() {
|
|
44
|
-
return (h("verdocs-dialog", { key: '
|
|
48
|
+
return (h("verdocs-dialog", { key: 'ff7b556af3b2606225660a1889aae6e5b33813a5', onExit: e => this.handleDismiss(e) }, h("div", { key: '6bfc4858cadf223f7ae4279363d19ab480d53289', slot: "heading", class: "heading" }, h("div", { key: '1300fb84b5c72b49bc52fa026d5b5f8c9f683733', class: "icon" }, h("svg", { key: '52da497c35a04565ce08b7b27a0103adee373074', width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '23e3e4608d6950b6e40a0ced6f60876d14469f8e', "clip-path": "url(#clip0_34208_4881)" }, h("path", { key: '7eda7671b1c96eb6a7b731c9bb90cae5ce23edf3', d: "M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z", fill: "white" })), h("defs", { key: '38d1c5c31a6c9118290b83212379703ef69ce774' }, h("clipPath", { key: '265e55b6ccd6c7f4ab531dad0fccc531e55c3db0', id: "clip0_34208_4881" }, h("path", { key: 'd5bc6581f3b9032b1e3c244940ba77195bccef21', d: "M0.875 0.75H21.125V18.75H0.875V0.75Z", fill: "white" }))))), h("div", { key: 'fc38f8f671154450bb4939991af22aba25b62cc5', class: "title" }, " ", this.heading)), h("div", { key: '49793f431faf0a0c90b98f64a0e6ca517c66d1b6', slot: "content", class: "content", innerHTML: this.message }), h("div", { key: '313e428b62bd8ae4413bf7b231e943018c5e8a71', class: "footer", slot: "footer" }, h("div", { key: '6d44f94ce1ce3d0934909e91599e19974f70438c', class: "buttons" }, this.showCancel && (h("button", { key: '7ac7d0ea22202dec3f2c6f5df61cbd52069e5d0b', class: "cancel", onClick: () => this.handleCancel() }, "Cancel")), h("button", { key: '691f98cf0bb08d71616b80ef833e5ff551a9a870', class: !this.showCancel ? 'ok single' : 'ok', onClick: () => this.handleOk() }, "OK")))));
|
|
45
49
|
}
|
|
46
50
|
};
|
|
47
51
|
VerdocsOkDialog.style = verdocsOkDialogCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-ok-dialog.entry.js","sources":["src/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.scss?tag=verdocs-ok-dialog","src/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-ok-dialog {\n box-sizing: border-box;\n font-family: $primary-font;\n\n &.closed {\n display: none;\n }\n\n .buttons {\n gap: 12px;\n display: flex;\n margin-top: 0;\n flex-direction: row;\n justify-content: flex-end;\n\n button {\n padding: 8px 16px;\n height: 40px;\n display: flex;\n font-size: 14px;\n font-weight: 400;\n cursor: pointer;\n align-items: center;\n border-radius: var(--verdocs-button-radius, 4px);\n justify-content: center;\n transition: all 0.2s ease;\n\n &.cancel {\n background-color: transparent;\n border: var(--verdocs-button-secondary-border, 1px solid #d1d5db);\n color: var(--verdocs-button-secondary-color, #374151);\n }\n\n &.ok {\n background-color: var(--verdocs-primary-color, $verdocs-green);\n border: 1px solid transparent;\n color: #ffffff;\n\n &:hover {\n background-color: var(--verdocs-primary-color-hover, $verdocs-green-shade);\n }\n }\n\n &:disabled {\n background-color: var(--verdocs-button-disabled-bg, #e5e7eb);\n color: var(--verdocs-button-disabled-color, #9ca3af);\n cursor: not-allowed;\n }\n }\n }\n}\n","import {Component, Prop, h, Event, EventEmitter, State} from '@stencil/core';\n\n/**\n * Display a simple text dialog box with an Ok button. This adds a partially-transparent overlay and screen-centered dialog\n * box with a message and optional header/title. An OK button is shown that will dismiss the message.\n * It can also be dismissed by clicking the background overlay.\n */\n@Component({\n tag: 'verdocs-ok-dialog',\n styleUrl: 'verdocs-ok-dialog.scss',\n})\nexport class VerdocsOkDialog {\n /**\n * The title of the dialog. \"title\" is a reserved word, so we use heading.\n */\n @Prop() heading: string = '';\n\n /**\n * The message content to display.\n */\n @Prop() message: string = '';\n\n /**\n * Override the \"OK\" button's label\n */\n @Prop() buttonLabel: string = 'OK';\n\n /**\n * If set, a cancel button will also be displayed. Note that the dialog is always cancelable by clicking the background\n * overlay to dismiss it.\n */\n @Prop() showCancel: boolean = false;\n\n /**\n * Event fired when the user clicks the OK button.\n */\n @Event({composed: true}) next: EventEmitter;\n\n /**\n * Event fired when Cancel is pressed. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n @State() closed = false;\n\n handleOk() {\n this.next.emit();\n }\n\n handleCancel() {\n this.exit.emit();\n }\n\n // We need a separate event handler for clicking the background because it can receive events \"through\" other child components\n handleDismiss(e: any) {\n this.closed = true;\n if (e.target.className === 'background-overlay') {\n e.preventDefault();\n this.exit.emit();\n }\n }\n\n render() {\n return (\n <verdocs-dialog onExit={e => this.handleDismiss(e)}>\n <div slot=\"heading\" class=\"heading\">\n <div class=\"icon\">\n <svg width=\"22\" height=\"19\" viewBox=\"0 0 22 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_34208_4881)\">\n <path\n d=\"M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_34208_4881\">\n <path d=\"M0.875 0.75H21.125V18.75H0.875V0.75Z\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </div>\n\n <div class=\"title\"> {this.heading}</div>\n </div>\n\n <div slot=\"content\" class=\"content\" innerHTML={this.message} />\n\n <div class=\"footer\" slot=\"footer\">\n <div class=\"buttons\">\n {this.showCancel && (\n <button class=\"cancel\" onClick={() => this.handleCancel()}>\n Cancel\n </button>\n )}\n <button class={!this.showCancel ? 'ok single' : 'ok'} onClick={() => this.handleOk()}>\n OK\n </button>\n </div>\n </div>\n </verdocs-dialog>\n );\n }\n}\n"],"names":[],"mappings":";;AAAA,MAAM,kBAAkB,GAAG,iiDAAiiD;;MCW/iD,eAAe,GAAA,MAAA;AAJ5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;;AAKE;;AAEG;AACK,QAAA,IAAO,CAAA,OAAA,GAAW,EAAE;AAE5B;;AAEG;AACK,QAAA,IAAO,CAAA,OAAA,GAAW,EAAE;AAE5B;;AAEG;AACK,QAAA,IAAW,CAAA,WAAA,GAAW,IAAI;AAElC;;;AAGG;AACK,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAY1B,QAAA,IAAM,CAAA,MAAA,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"verdocs-ok-dialog.entry.js","sources":["src/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.scss?tag=verdocs-ok-dialog","src/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-ok-dialog {\n box-sizing: border-box;\n font-family: $primary-font;\n\n &.closed {\n display: none;\n }\n\n .buttons {\n gap: 12px;\n display: flex;\n margin-top: 0;\n flex-direction: row;\n justify-content: flex-end;\n\n button {\n padding: 8px 16px;\n height: 40px;\n display: flex;\n font-size: 14px;\n font-weight: 400;\n cursor: pointer;\n align-items: center;\n border-radius: var(--verdocs-button-radius, 4px);\n justify-content: center;\n transition: all 0.2s ease;\n\n &.cancel {\n background-color: transparent;\n border: var(--verdocs-button-secondary-border, 1px solid #d1d5db);\n color: var(--verdocs-button-secondary-color, #374151);\n }\n\n &.ok {\n background-color: var(--verdocs-primary-color, $verdocs-green);\n border: 1px solid transparent;\n color: #ffffff;\n\n &:hover {\n background-color: var(--verdocs-primary-color-hover, $verdocs-green-shade);\n }\n }\n\n &:disabled {\n background-color: var(--verdocs-button-disabled-bg, #e5e7eb);\n color: var(--verdocs-button-disabled-color, #9ca3af);\n cursor: not-allowed;\n }\n }\n }\n}\n","import { Component, Prop, h, Event, EventEmitter, State } from '@stencil/core';\n\n/**\n * Display a simple text dialog box with an Ok button. This adds a partially-transparent overlay and screen-centered dialog\n * box with a message and optional header/title. An OK button is shown that will dismiss the message.\n * It can also be dismissed by clicking the background overlay.\n */\n@Component({\n tag: 'verdocs-ok-dialog',\n styleUrl: 'verdocs-ok-dialog.scss',\n})\nexport class VerdocsOkDialog {\n /**\n * The title of the dialog. \"title\" is a reserved word, so we use heading.\n */\n @Prop() heading: string = '';\n\n /**\n * The message content to display.\n */\n @Prop() message: string = '';\n\n /**\n * Override the \"OK\" button's label\n */\n @Prop() buttonLabel: string = 'OK';\n\n /**\n * If set, a cancel button will also be displayed. Note that the dialog is always cancelable by clicking the background\n * overlay to dismiss it.\n */\n @Prop() showCancel: boolean = false;\n\n /**\n * Event fired when the user clicks the OK button.\n */\n @Event({ composed: true }) next: EventEmitter;\n\n /**\n * Event fired when Cancel is pressed. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({ composed: true }) exit: EventEmitter;\n\n @State() closed = false;\n\n handleOk() {\n this.next.emit();\n }\n\n handleCancel() {\n this.exit.emit();\n }\n\n // We need a separate event handler for clicking the background because it can receive events \"through\" other child components\n handleDismiss(e: any) {\n this.closed = true;\n if (e && e.target && e.target.className === 'background-overlay') {\n e.preventDefault();\n this.exit.emit();\n } else {\n // For X button click, treat it the same as OK button\n this.handleOk();\n }\n }\n\n render() {\n return (\n <verdocs-dialog onExit={e => this.handleDismiss(e)}>\n <div slot=\"heading\" class=\"heading\">\n <div class=\"icon\">\n <svg width=\"22\" height=\"19\" viewBox=\"0 0 22 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_34208_4881)\">\n <path\n d=\"M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_34208_4881\">\n <path d=\"M0.875 0.75H21.125V18.75H0.875V0.75Z\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n </div>\n\n <div class=\"title\"> {this.heading}</div>\n </div>\n\n <div slot=\"content\" class=\"content\" innerHTML={this.message} />\n\n <div class=\"footer\" slot=\"footer\">\n <div class=\"buttons\">\n {this.showCancel && (\n <button class=\"cancel\" onClick={() => this.handleCancel()}>\n Cancel\n </button>\n )}\n <button class={!this.showCancel ? 'ok single' : 'ok'} onClick={() => this.handleOk()}>\n OK\n </button>\n </div>\n </div>\n </verdocs-dialog>\n );\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -46,7 +46,7 @@ const VerdocsSign = class {
|
|
|
46
46
|
/**
|
|
47
47
|
* The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
|
|
48
48
|
*/
|
|
49
|
-
this.endpoint = new VerdocsEndpoint({ sessionType: 'signing' });
|
|
49
|
+
this.endpoint = new VerdocsEndpoint({ sessionType: 'signing', baseURL: 'https://esign-dev.hubsync.com/api' });
|
|
50
50
|
/**
|
|
51
51
|
* The ID of the envelope to sign.
|
|
52
52
|
*/
|
|
@@ -105,6 +105,9 @@ const VerdocsSign = class {
|
|
|
105
105
|
this.delegated = false;
|
|
106
106
|
this.kbaChoices = [];
|
|
107
107
|
this.showDownloadDialog = false;
|
|
108
|
+
this.signingStarted = false;
|
|
109
|
+
this.skippedOptionalFields = [];
|
|
110
|
+
this.visitedFieldNames = [];
|
|
108
111
|
this.loading = true;
|
|
109
112
|
this.envelope = null;
|
|
110
113
|
this.zoomLevel = 'normal';
|
|
@@ -217,6 +220,9 @@ const VerdocsSign = class {
|
|
|
217
220
|
this.agreed = recipient.agreed;
|
|
218
221
|
this.signatureId = ((_e = (_d = response.signatures) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.id) || null;
|
|
219
222
|
this.initialId = ((_g = (_f = response.initials) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.id) || null;
|
|
223
|
+
this.signingStarted = false;
|
|
224
|
+
this.skippedOptionalFields = [];
|
|
225
|
+
this.visitedFieldNames = [];
|
|
220
226
|
this.submitted = recipient.status === 'submitted';
|
|
221
227
|
this.loading = false;
|
|
222
228
|
this.isDone = this.submitted;
|
|
@@ -324,6 +330,9 @@ const VerdocsSign = class {
|
|
|
324
330
|
}
|
|
325
331
|
updateRecipientFieldValue(fieldName, updateResult) {
|
|
326
332
|
console.log('[SIGN] updateRecipientFieldValue', fieldName, updateResult);
|
|
333
|
+
if (this.skippedOptionalFields.includes(fieldName)) {
|
|
334
|
+
this.skippedOptionalFields = this.skippedOptionalFields.filter(name => name !== fieldName);
|
|
335
|
+
}
|
|
327
336
|
this.getRecipientFields().forEach(oldField => {
|
|
328
337
|
if (oldField.name === fieldName) {
|
|
329
338
|
oldField.value = updateResult.value;
|
|
@@ -361,6 +370,8 @@ const VerdocsSign = class {
|
|
|
361
370
|
});
|
|
362
371
|
}
|
|
363
372
|
async handleFieldChange(field, e) {
|
|
373
|
+
this.signingStarted = true;
|
|
374
|
+
this.markFieldVisited(field.name);
|
|
364
375
|
const { value, checked } = e.target;
|
|
365
376
|
switch (field.type) {
|
|
366
377
|
// TODO: Remove legacy type when no longer needed
|
|
@@ -482,8 +493,46 @@ const VerdocsSign = class {
|
|
|
482
493
|
sortFields(recipientFields);
|
|
483
494
|
return recipientFields;
|
|
484
495
|
}
|
|
496
|
+
markFieldVisited(fieldName) {
|
|
497
|
+
if (!fieldName || this.visitedFieldNames.includes(fieldName)) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this.visitedFieldNames = [...this.visitedFieldNames, fieldName];
|
|
501
|
+
}
|
|
502
|
+
focusField(field, scrollInline = 'center') {
|
|
503
|
+
var _a;
|
|
504
|
+
if (!field)
|
|
505
|
+
return;
|
|
506
|
+
const id = getFieldId(field);
|
|
507
|
+
const el = document.getElementById(id);
|
|
508
|
+
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: scrollInline });
|
|
509
|
+
(_a = el === null || el === void 0 ? void 0 : el.focusField) === null || _a === void 0 ? void 0 : _a.call(el);
|
|
510
|
+
this.focusedField = field.name;
|
|
511
|
+
this.markFieldVisited(field.name);
|
|
512
|
+
this.checkRecipientFields();
|
|
513
|
+
}
|
|
514
|
+
handleSkipField(fieldToSkip) {
|
|
515
|
+
if (fieldToSkip.required) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
this.signingStarted = true;
|
|
519
|
+
this.markFieldVisited(fieldToSkip.name);
|
|
520
|
+
if (!this.skippedOptionalFields.includes(fieldToSkip.name)) {
|
|
521
|
+
this.skippedOptionalFields = [...this.skippedOptionalFields, fieldToSkip.name];
|
|
522
|
+
}
|
|
523
|
+
const fields = this.getSortedFillableFields();
|
|
524
|
+
const currentIndex = fields.findIndex(field => field.name === fieldToSkip.name);
|
|
525
|
+
const nextField = currentIndex >= 0 && currentIndex < fields.length - 1 ? fields[currentIndex + 1] : null;
|
|
526
|
+
if (nextField) {
|
|
527
|
+
this.focusField(nextField);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
// If this was the last field, still re-evaluate completion/submit state.
|
|
531
|
+
this.checkRecipientFields([fieldToSkip.name]);
|
|
532
|
+
}
|
|
485
533
|
handleNext() {
|
|
486
534
|
var _a;
|
|
535
|
+
this.signingStarted = true;
|
|
487
536
|
if (this.nextSubmits) {
|
|
488
537
|
try {
|
|
489
538
|
// Patches the date picker to be forcibly removed if still showing during submission
|
|
@@ -501,23 +550,31 @@ const VerdocsSign = class {
|
|
|
501
550
|
}
|
|
502
551
|
return;
|
|
503
552
|
}
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
const el = document.getElementById(id);
|
|
508
|
-
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
509
|
-
el === null || el === void 0 ? void 0 : el.focusField();
|
|
510
|
-
this.focusedField = nextField.name;
|
|
553
|
+
const fields = this.getSortedFillableFields();
|
|
554
|
+
if (fields.length < 1) {
|
|
555
|
+
return;
|
|
511
556
|
}
|
|
557
|
+
if (!this.focusedField) {
|
|
558
|
+
this.focusField(fields[0]);
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
const nextField = this.getNextFieldFromList(fields);
|
|
562
|
+
this.focusField(nextField);
|
|
512
563
|
}
|
|
513
564
|
getRecipientFields() {
|
|
514
565
|
var _a;
|
|
515
566
|
return ((_a = this.envelope) === null || _a === void 0 ? void 0 : _a.fields.filter(field => field.role_name === this.recipient.role_name)) || [];
|
|
516
567
|
}
|
|
517
568
|
// See if everything that "needs to be" filled in is, and all "fillable fields" are valid
|
|
518
|
-
checkRecipientFields() {
|
|
519
|
-
const
|
|
520
|
-
|
|
569
|
+
checkRecipientFields(extraVisitedFieldNames = []) {
|
|
570
|
+
const recipientFields = this.getRecipientFields();
|
|
571
|
+
const fillableFields = this.getSortedFillableFields();
|
|
572
|
+
const requiredFields = fillableFields.filter(field => !!field.required);
|
|
573
|
+
const allRequiredFieldsSubmitted = requiredFields.every(field => this.isFieldValidForRecipient(field, recipientFields));
|
|
574
|
+
const visitedFieldNames = new Set([...this.visitedFieldNames, ...extraVisitedFieldNames]);
|
|
575
|
+
const allFieldsVisited = fillableFields.every(field => visitedFieldNames.has(field.name));
|
|
576
|
+
const canSubmit = allRequiredFieldsSubmitted && allFieldsVisited;
|
|
577
|
+
if (canSubmit) {
|
|
521
578
|
this.nextButtonLabel = 'Finish';
|
|
522
579
|
if (!this.nextSubmits) {
|
|
523
580
|
this.nextSubmits = true;
|
|
@@ -529,6 +586,12 @@ const VerdocsSign = class {
|
|
|
529
586
|
}
|
|
530
587
|
this.updateAllFlags();
|
|
531
588
|
}
|
|
589
|
+
isFieldValidForRecipient(field, recipientFields) {
|
|
590
|
+
if (field.type === 'signature' || field.type === 'initial') {
|
|
591
|
+
return !field.required || this.isFieldFilledForNav(field, recipientFields);
|
|
592
|
+
}
|
|
593
|
+
return isFieldValid(field, recipientFields);
|
|
594
|
+
}
|
|
532
595
|
getNextFieldInOrder() {
|
|
533
596
|
// Find the next incomplete field in overall order (required + optional).
|
|
534
597
|
const fields = this.getSortedFillableFields();
|
|
@@ -547,13 +610,38 @@ const VerdocsSign = class {
|
|
|
547
610
|
return null;
|
|
548
611
|
}
|
|
549
612
|
isFieldFilledForNav(field, recipientFields) {
|
|
613
|
+
if (!field.required && this.skippedOptionalFields.includes(field.name)) {
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
550
616
|
if (field.type === 'signature' || field.type === 'initial') {
|
|
617
|
+
const settings = (field.settings || {});
|
|
618
|
+
const idKey = field.type === 'signature' ? 'signature_id' : 'initial_id';
|
|
619
|
+
const hasSignatureId = Object.prototype.hasOwnProperty.call(settings, 'signature_id');
|
|
620
|
+
const hasInitialId = Object.prototype.hasOwnProperty.call(settings, 'initial_id');
|
|
621
|
+
// For signature/initial fields, settings.* id is the authoritative state.
|
|
622
|
+
// This avoids stale top-level field.value (e.g. "signed") after clearing.
|
|
623
|
+
if (Object.prototype.hasOwnProperty.call(settings, idKey) || hasSignatureId || hasInitialId) {
|
|
624
|
+
const idValue = Object.prototype.hasOwnProperty.call(settings, idKey)
|
|
625
|
+
? settings[idKey]
|
|
626
|
+
: hasSignatureId
|
|
627
|
+
? settings.signature_id
|
|
628
|
+
: settings.initial_id;
|
|
629
|
+
return typeof idValue === 'string' ? idValue.trim().length > 0 : !!idValue;
|
|
630
|
+
}
|
|
631
|
+
if (Object.prototype.hasOwnProperty.call(settings, 'value')) {
|
|
632
|
+
const settingsValue = typeof settings.value === 'string' ? settings.value.trim() : settings.value;
|
|
633
|
+
return !!settingsValue;
|
|
634
|
+
}
|
|
635
|
+
if (Object.prototype.hasOwnProperty.call(settings, 'result')) {
|
|
636
|
+
const settingsResult = typeof settings.result === 'string' ? settings.result.trim() : settings.result;
|
|
637
|
+
return !!settingsResult;
|
|
638
|
+
}
|
|
639
|
+
if (Object.prototype.hasOwnProperty.call(settings, 'base64')) {
|
|
640
|
+
const settingsBase64 = typeof settings.base64 === 'string' ? settings.base64.trim() : settings.base64;
|
|
641
|
+
return !!settingsBase64;
|
|
642
|
+
}
|
|
551
643
|
const value = typeof field.value === 'string' ? field.value.trim() : field.value;
|
|
552
|
-
|
|
553
|
-
return false;
|
|
554
|
-
if (value === 'signed' || value === 'initialed')
|
|
555
|
-
return false;
|
|
556
|
-
return true;
|
|
644
|
+
return !!value;
|
|
557
645
|
}
|
|
558
646
|
if (field.type === 'dropdown') {
|
|
559
647
|
return isFieldFilled(field, recipientFields) && !!field.value;
|
|
@@ -570,16 +658,11 @@ const VerdocsSign = class {
|
|
|
570
658
|
return fields[nextFocusedIndex];
|
|
571
659
|
}
|
|
572
660
|
handlePrev() {
|
|
573
|
-
|
|
661
|
+
this.signingStarted = true;
|
|
574
662
|
const allFields = this.getSortedFillableFields();
|
|
575
663
|
const focusedIndex = allFields.findIndex(f => f.name === this.focusedField);
|
|
576
664
|
if (focusedIndex > 0) {
|
|
577
|
-
|
|
578
|
-
const id = getFieldId(prevField);
|
|
579
|
-
const el = document.getElementById(id);
|
|
580
|
-
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
581
|
-
(_a = el === null || el === void 0 ? void 0 : el.focusField) === null || _a === void 0 ? void 0 : _a.call(el);
|
|
582
|
-
this.focusedField = prevField.name;
|
|
665
|
+
this.focusField(allFields[focusedIndex - 1]);
|
|
583
666
|
}
|
|
584
667
|
}
|
|
585
668
|
updateAllFlags() {
|
|
@@ -616,8 +699,12 @@ const VerdocsSign = class {
|
|
|
616
699
|
variant,
|
|
617
700
|
label,
|
|
618
701
|
showSkip,
|
|
702
|
+
onClick: () => {
|
|
703
|
+
this.signingStarted = true;
|
|
704
|
+
this.focusField(nextField);
|
|
705
|
+
},
|
|
619
706
|
onSkip: () => {
|
|
620
|
-
this.
|
|
707
|
+
this.handleSkipField(nextField);
|
|
621
708
|
},
|
|
622
709
|
});
|
|
623
710
|
}
|
|
@@ -690,8 +777,15 @@ const VerdocsSign = class {
|
|
|
690
777
|
el.addEventListener('fieldChange', e => {
|
|
691
778
|
this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());
|
|
692
779
|
});
|
|
780
|
+
el.addEventListener('click', () => {
|
|
781
|
+
this.focusedField = field.name;
|
|
782
|
+
this.markFieldVisited(field.name);
|
|
783
|
+
this.checkRecipientFields();
|
|
784
|
+
});
|
|
693
785
|
el.addEventListener('adopt', () => {
|
|
694
786
|
this.focusedField = field.name;
|
|
787
|
+
this.markFieldVisited(field.name);
|
|
788
|
+
this.checkRecipientFields();
|
|
695
789
|
this.adoptingSignature = true;
|
|
696
790
|
});
|
|
697
791
|
el.setAttribute('templateid', this.envelope.template_id);
|
|
@@ -881,7 +975,8 @@ const VerdocsSign = class {
|
|
|
881
975
|
inProgressMenuOptions.unshift({ id: 'delegate', label: 'Delegate' });
|
|
882
976
|
}
|
|
883
977
|
console.log('this.getRecipientFields()', this.getRecipientFields());
|
|
884
|
-
const
|
|
978
|
+
const recipientFields = this.getRecipientFields();
|
|
979
|
+
const invalidFields = recipientFields.filter(field => !this.isFieldValidForRecipient(field, recipientFields));
|
|
885
980
|
invalidFields.length > 0
|
|
886
981
|
? console.log('[SIGN] Invalid fields remaining', invalidFields.map(field => field.name))
|
|
887
982
|
: console.log('[SIGN] All field valid');
|
|
@@ -894,18 +989,20 @@ const VerdocsSign = class {
|
|
|
894
989
|
// Calculate detailed progress
|
|
895
990
|
const allFields = this.getSortedFillableFields();
|
|
896
991
|
const recipientFields = this.getRecipientFields();
|
|
897
|
-
const isFilled = (f) =>
|
|
992
|
+
const isFilled = (f) => this.isFieldFilledForNav(f, recipientFields);
|
|
898
993
|
const requiredFields = allFields.filter(f => f.required);
|
|
899
994
|
const requiredRemaining = requiredFields.filter(f => !isFilled(f)).length;
|
|
995
|
+
const requiredFilled = requiredFields.length - requiredRemaining;
|
|
900
996
|
const optionalFields = allFields.filter(f => !f.required);
|
|
901
997
|
const optionalRemaining = optionalFields.filter(f => !isFilled(f)).length;
|
|
998
|
+
const optionalFilled = optionalFields.length - optionalRemaining;
|
|
902
999
|
const progress = {
|
|
903
1000
|
required: {
|
|
904
|
-
|
|
1001
|
+
filled: requiredFilled,
|
|
905
1002
|
total: requiredFields.length,
|
|
906
1003
|
},
|
|
907
1004
|
optional: {
|
|
908
|
-
|
|
1005
|
+
filled: optionalFilled,
|
|
909
1006
|
total: optionalFields.length,
|
|
910
1007
|
},
|
|
911
1008
|
};
|
|
@@ -924,18 +1021,18 @@ const VerdocsSign = class {
|
|
|
924
1021
|
filledFields: recipientFields.filter(f => isFilled(f)).map(f => ({ name: f.name, type: f.type, val: f.value })),
|
|
925
1022
|
});
|
|
926
1023
|
let mode = 'start';
|
|
927
|
-
// We only consider the user to have started "signing" if they have filled out at least one *fillable* field.
|
|
928
|
-
// Readonly fields do not count.
|
|
929
|
-
const anyFieldFilled = requiredRemaining < requiredFields.length || optionalRemaining < optionalFields.length;
|
|
930
1024
|
if (this.nextSubmits) {
|
|
931
1025
|
mode = 'completed';
|
|
932
1026
|
}
|
|
933
|
-
else if (
|
|
1027
|
+
else if (this.signingStarted) {
|
|
934
1028
|
mode = 'signing';
|
|
935
1029
|
}
|
|
936
1030
|
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: () => {
|
|
1031
|
+
this.signingStarted = true;
|
|
937
1032
|
this.adoptingSignature = true;
|
|
938
|
-
this.
|
|
1033
|
+
const fields = this.getSortedFillableFields();
|
|
1034
|
+
const startField = fields.find(f => f.name === this.focusedField) || fields[0];
|
|
1035
|
+
this.focusField(startField || null);
|
|
939
1036
|
}, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }));
|
|
940
1037
|
})(), h("div", { class: `document signed-document-container zoom-${this.zoomLevel}` }, (this.envelope.documents || []).map(envelopeDocument => {
|
|
941
1038
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|