@verdocs/web-sdk 4.2.121 → 4.2.123

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 (167) hide show
  1. package/dist/cjs/index-a27a7f77.js +4 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{utils-6a8c3390.js → utils-5accd019.js} +1 -1
  4. package/dist/cjs/verdocs-button_3.cjs.entry.js +2 -2
  5. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  7. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +4 -2
  8. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +7 -7
  9. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +41 -13
  10. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +4 -4
  11. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-preview_9.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  14. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +9 -9
  15. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  16. package/dist/cjs/verdocs-sign.cjs.entry.js +78 -29
  17. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  23. package/dist/collection/components/controls/verdocs-button/verdocs-button.css +14 -0
  24. package/dist/collection/components/controls/verdocs-button/verdocs-button.js +3 -3
  25. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +1 -1
  26. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +18 -4
  27. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  28. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
  29. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +4 -3
  30. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +78 -27
  31. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +4 -3
  32. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  33. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +4 -2
  34. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
  35. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
  36. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +17 -25
  37. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +4 -1
  38. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +8 -1
  39. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  40. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +1 -1
  41. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +8 -8
  42. package/dist/collection/components/templates/verdocs-template-sender/verdocs-template-sender.js +1 -1
  43. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
  44. package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
  45. package/dist/collection/utils/utils.js +1 -1
  46. package/dist/components/utils.js +1 -1
  47. package/dist/components/verdocs-button2.js +2 -2
  48. package/dist/components/verdocs-envelope-document-page2.js +1 -1
  49. package/dist/components/verdocs-envelope-sidebar.js +4 -2
  50. package/dist/components/verdocs-envelopes-list.js +6 -6
  51. package/dist/components/verdocs-field-attachment2.js +27 -15
  52. package/dist/components/verdocs-field-date2.js +4 -1
  53. package/dist/components/verdocs-field-dropdown2.js +8 -1
  54. package/dist/components/verdocs-preview2.js +38 -32
  55. package/dist/components/verdocs-quick-functions.js +1 -1
  56. package/dist/components/verdocs-search-tabs.js +1 -1
  57. package/dist/components/verdocs-sign.js +80 -29
  58. package/dist/components/verdocs-status-indicator2.js +2 -2
  59. package/dist/components/verdocs-template-card.js +1 -1
  60. package/dist/components/verdocs-template-document-page2.js +37 -31
  61. package/dist/components/verdocs-template-role-properties2.js +8 -8
  62. package/dist/components/verdocs-template-sender2.js +1 -1
  63. package/dist/components/verdocs-template-star2.js +1 -1
  64. package/dist/components/verdocs-template-tags.js +1 -1
  65. package/dist/components/verdocs-upload-dialog2.js +25 -6
  66. package/dist/components/verdocs-view2.js +3 -3
  67. package/dist/esm/index-a68c7262.js +4 -4
  68. package/dist/esm/loader.js +1 -1
  69. package/dist/esm/{utils-8f3ace81.js → utils-6ecd6558.js} +1 -1
  70. package/dist/esm/verdocs-button_3.entry.js +2 -2
  71. package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
  72. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  73. package/dist/esm/verdocs-envelope-sidebar.entry.js +4 -2
  74. package/dist/esm/verdocs-envelopes-list.entry.js +7 -7
  75. package/dist/esm/verdocs-field-attachment_13.entry.js +41 -13
  76. package/dist/esm/verdocs-kba-dialog_2.entry.js +4 -4
  77. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  78. package/dist/esm/verdocs-preview_9.entry.js +1 -1
  79. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  80. package/dist/esm/verdocs-radio-button_3.entry.js +9 -9
  81. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  82. package/dist/esm/verdocs-sign.entry.js +79 -30
  83. package/dist/esm/verdocs-status-indicator.entry.js +2 -2
  84. package/dist/esm/verdocs-template-card.entry.js +1 -1
  85. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  86. package/dist/esm/verdocs-template-star.entry.js +1 -1
  87. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  88. package/dist/esm/verdocs-web-sdk.js +1 -1
  89. package/dist/esm-es5/index-a68c7262.js +1 -1
  90. package/dist/esm-es5/loader.js +1 -1
  91. package/dist/esm-es5/{utils-8f3ace81.js → utils-6ecd6558.js} +1 -1
  92. package/dist/esm-es5/verdocs-button_3.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-preview_9.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  111. package/dist/types/components/controls/verdocs-button/verdocs-button.d.ts +1 -1
  112. package/dist/types/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.d.ts +4 -2
  113. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -0
  114. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +1 -1
  115. package/dist/types/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.d.ts +1 -1
  116. package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +5 -8
  117. package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +2 -0
  118. package/dist/types/components.d.ts +11 -12
  119. package/dist/verdocs-web-sdk/p-02af8123.entry.js +1 -0
  120. package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
  121. package/dist/verdocs-web-sdk/{p-f3d00620.entry.js → p-28684a2b.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-d00fb7f3.system.entry.js → p-2ee3549e.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-60ae48fb.system.entry.js → p-3128b508.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-7a3a3c2c.system.entry.js → p-43a7fce5.system.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-b4b064ad.entry.js → p-48c2f79b.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/p-4ee43d61.entry.js +1 -0
  127. package/dist/verdocs-web-sdk/p-4f864f00.system.entry.js +1 -0
  128. package/dist/verdocs-web-sdk/{p-c5b6c6b0.entry.js → p-5313e672.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-04cb12eb.system.js → p-5381847c.system.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-aa599c94.entry.js → p-55f49f87.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-ae0ec155.entry.js → p-5b7fd148.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-2510a25a.system.entry.js → p-6a57c036.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-6885774c.entry.js → p-72b47a99.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/{p-24c226e1.system.entry.js → p-779a342d.system.entry.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-34439493.entry.js → p-77f12464.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/p-7cad3ec7.system.entry.js +1 -0
  137. package/dist/verdocs-web-sdk/{p-e621a28c.system.entry.js → p-7d7ca35a.system.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/p-826d6fb0.system.entry.js +1 -0
  139. package/dist/verdocs-web-sdk/{p-cb645d07.entry.js → p-8ce033ef.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-46f5c0f0.system.entry.js → p-8f3ed4da.system.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-6ab8ef68.system.entry.js → p-932ec5e5.system.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/p-93fc163b.entry.js +1 -0
  143. package/dist/verdocs-web-sdk/{p-6975a763.entry.js → p-98885cd8.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-e9513023.system.entry.js → p-a6be54b0.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-c539cdb9.entry.js → p-aace040e.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-e723c6b1.entry.js → p-acf595c9.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-2acc0c5c.system.entry.js → p-b52b2533.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-147f2526.entry.js → p-bc9928a8.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-e9c5d985.entry.js → p-c0018ff8.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/{p-d078d872.system.entry.js → p-c43f5df7.system.entry.js} +1 -1
  151. package/dist/verdocs-web-sdk/p-c5e65e9d.system.entry.js +1 -0
  152. package/dist/verdocs-web-sdk/{p-e2a9ee8d.entry.js → p-c9f545fe.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-34f114de.system.entry.js → p-cc5245b4.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-7798b826.system.entry.js → p-d119854a.system.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/p-e0ffd00f.entry.js +1 -0
  156. package/dist/verdocs-web-sdk/{p-68c7371d.system.entry.js → p-f96de332.system.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-3b6dfc9f.js → p-fae63f89.js} +1 -1
  158. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  159. package/package.json +1 -1
  160. package/dist/verdocs-web-sdk/p-070549e6.system.entry.js +0 -1
  161. package/dist/verdocs-web-sdk/p-3164d8c4.system.entry.js +0 -1
  162. package/dist/verdocs-web-sdk/p-4cdc47be.system.entry.js +0 -1
  163. package/dist/verdocs-web-sdk/p-68eceea2.entry.js +0 -1
  164. package/dist/verdocs-web-sdk/p-6cadd2b5.entry.js +0 -1
  165. package/dist/verdocs-web-sdk/p-a146e2b0.system.entry.js +0 -1
  166. package/dist/verdocs-web-sdk/p-af74d24f.entry.js +0 -1
  167. package/dist/verdocs-web-sdk/p-d93a51b0.entry.js +0 -1
@@ -4,12 +4,14 @@ const PaperclipIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewB
4
4
  /**
5
5
  * Display a file upload tool. Note that the file is not actually transmitted, so it may be used by
6
6
  * callers with a variety of workflows. Instead, data about the chosen file will be passed to the
7
- * caller via the onNext event handler.
7
+ * caller via the onNext event handler. A delete event is also exposed to delete existing attachments.
8
+ * To represent an existing attachment, set the existingFile property.
8
9
  */
9
10
  export class VerdocsUploadDialog {
10
11
  constructor() {
11
12
  this.existingFile = undefined;
12
13
  this.draggingOver = false;
14
+ this.confirmDelete = false;
13
15
  this.selectedFiles = [];
14
16
  }
15
17
  handleCancel() {
@@ -43,11 +45,15 @@ export class VerdocsUploadDialog {
43
45
  newFiles.splice(index, 1);
44
46
  this.selectedFiles = newFiles;
45
47
  }
46
- handleDeleteAttachment() {
48
+ handleDeleteAttachment(e) {
47
49
  var _a;
48
- // TODO: Discuss how we want to delete up to the server
50
+ // Stop the parent from seeing "next" and thinking an upload was done.
51
+ // TODO: Rethink having so many commonalities in nested dialogs (next/exit).
52
+ e.preventDefault();
53
+ e.stopPropagation();
49
54
  (_a = this.remove) === null || _a === void 0 ? void 0 : _a.emit();
50
55
  this.existingFile = null;
56
+ this.confirmDelete = false;
51
57
  }
52
58
  handleSelectFile() {
53
59
  var _a;
@@ -62,7 +68,14 @@ export class VerdocsUploadDialog {
62
68
  }
63
69
  }
64
70
  render() {
65
- return (h(Host, { key: 'ea7aaec178e0708c73e6ad4f12253f4ff73b9310' }, h("div", { key: '7d769afe448df6edfb40800bc08237d60c924d95', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'cd32c34e98c48b1e48b1792bead1634ca70df871', class: "dialog" }, h("div", { key: 'eb7f1782c643b531c2ff6faf17e2248f803cde39', class: "heading" }, "Upload attachment"), this.selectedFiles.length < 1 && this.existingFile && (h(Fragment, { key: '2feac9b495828147f2be51e2368c7d03b039f64a' }, h("div", { key: '9ead90c769215c71bd952bb585a3cbde16c7e518', class: "current-label" }, "Current Attachment"), h("div", { key: '671e35179c26f14823ae504a1fc40f4506117e2e', class: "attachments", style: { marginTop: '0' } }, h("div", { key: '2ae16fe846ee84db2f0fdb2cfb39d1e0a30f85f2', class: "attachment" }, h("div", { key: '8db0145b16b3568d7fd5e1287a4a81b3a8822c3f', class: "icon", innerHTML: PaperclipIcon }), h("div", { key: '5c9c54ce036cec26e721fc32e4a9c8326735f221', class: "name" }, this.existingFile.name), h("div", { key: '99c17d1a88f6f8c07b346b37836969c60c1ee31d', class: "icon trash", innerHTML: TrashIcon, onClick: () => this.handleDeleteAttachment() }))))), this.selectedFiles.length < 1 && !this.existingFile && (h("div", { key: 'eec6e965857fca674db531ebad805c6931a2daf2', class: { 'drop-target': true, 'dragging-over': this.draggingOver }, onDragOver: e => this.handleDragOver(e), onDragLeave: e => this.handleDragLeave(e), onDrop: e => this.handleDrop(e) }, h("p", { key: '4dc240eacbd3724a54f6613113d98f5446c6c478' }, "Drag and drop a ", !!this.existingFile && 'replacement', " here..."), h("p", { key: 'af261cba2d009aa6733891e670029e4a2fec6a4d' }, "- or -"), h("verdocs-button", { key: 'f922efbffa39aa22b58b30b50697f17edcdd0f48', label: !!this.existingFile ? 'Replace file...' : 'Select a file...', onClick: () => this.handleSelectFile() }), h("input", { key: '504ae2231657a1ff6f27405b789c239f41f4fdce', type: "file", ref: el => (this.fileInput = el), style: { display: 'none' }, onChange: () => this.handleFileChange() }))), this.selectedFiles.length > 0 && (h("div", { key: 'e225969a1e6073a883e3e47fbeeec1bf88085f82', class: "attachments" }, this.selectedFiles.map((file, index) => (h("div", { class: "attachment" }, h("div", { class: "icon", innerHTML: PaperclipIcon }), h("div", { class: "name" }, file.name), h("div", { class: "icon trash", innerHTML: TrashIcon, onClick: () => this.handleRemoveAttachment(index) })))))), h("div", { key: 'b34ab1a0be4e5b7bfeb9f52b2e4820e8dce3a40a', class: "buttons" }, h("verdocs-button", { key: '9e35669d8a39a493b53434d680d66745610d4828', label: "Cancel", variant: "outline", onClick: () => this.handleCancel() }), h("verdocs-button", { key: '9b41014e538eecdec86221c637c09c8f00b9b3af', label: "Upload", onClick: () => this.handleDone(), disabled: this.selectedFiles.length < 1 }))))));
71
+ var _a;
72
+ const existingFile = ((_a = this.existingFile) === null || _a === void 0 ? void 0 : _a.name) ? this.existingFile : null;
73
+ return (h(Host, { key: '1659eb29f75e9bf3866a011a1ce39767f045e58c' }, h("div", { key: '764f802db78676a02d17fbf2ee93dd859c90494c', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'c28580308a52defdd648f197aa5d1e74a1ff366c', class: "upload-dialog-content" }, h("div", { key: '6de50a3f71d93a176b4db5a248a49da4cf8d404d', class: "heading" }, "Upload attachment"), this.selectedFiles.length < 1 && existingFile && (h(Fragment, { key: '0882e3e5cae1dae105645f6f4b5dd8986c336e1f' }, h("div", { key: 'a762a4dbf4f1be8a29d637e6bee196ab4b960c60', class: "current-label" }, "Current Attachment"), h("div", { key: 'ada0b184bb53583dc6012ab5393be2a36714eba4', class: "attachments", style: { marginTop: '0' } }, h("div", { key: '3d9555cf0f7876ba192e3efec76bf677eec137cf', class: "attachment" }, h("div", { key: 'cea6d0e30448b6ea003a32d838bd64d642a621f3', class: "icon", innerHTML: PaperclipIcon }), h("div", { key: '20b87ade4eb56de78db2e0c1a7fe5c1f88d9f2c7', class: "name" }, existingFile.name), h("div", { key: '6359ea1dffd674d708afcd6b1e4f5be38062b861', class: "icon trash", innerHTML: TrashIcon, onClick: () => (this.confirmDelete = true) }))))), this.selectedFiles.length < 1 && !existingFile && (h("div", { key: 'c554239826339af3008fd9b4ef235efe6b4bf138', class: { 'drop-target': true, 'dragging-over': this.draggingOver }, onDragOver: e => this.handleDragOver(e), onDragLeave: e => this.handleDragLeave(e), onDrop: e => this.handleDrop(e) }, h("p", { key: 'a2bcc388981e79a1c6c3325081546ea41d7fd96f' }, "Drag and drop a ", !!existingFile && 'replacement', " here..."), h("p", { key: '23c7c1e2c8c369a8b85d83fc9a7d2e03bd26f6d9' }, "- or -"), h("verdocs-button", { key: 'cba655d0b392f5f03776f769cd3ee626b432b846', label: !!existingFile ? 'Replace file...' : 'Select a file...', onClick: () => this.handleSelectFile() }), h("input", { key: 'cbaa00e587959f418709c89b531a173512f5b9fa', type: "file", ref: el => (this.fileInput = el), style: { display: 'none' }, onChange: () => this.handleFileChange() }))), this.selectedFiles.length > 0 && (h("div", { key: '35f7be5ad20ecab5947c2f90f4ac529775ec51ce', class: "attachments" }, this.selectedFiles.map((file, index) => (h("div", { class: "attachment" }, h("div", { class: "icon", innerHTML: PaperclipIcon }), h("div", { class: "name" }, file.name), h("div", { class: "icon trash", innerHTML: TrashIcon, onClick: () => this.handleRemoveAttachment(index) })))))), h("div", { key: 'ea437cefbfa71cd4853f4fd77d1d1a78b576e032', class: "buttons" }, h("verdocs-button", { key: '2be19df5ae677ee0d0893266fd2f72aeff609e95', label: "Cancel", variant: "outline", onClick: () => this.handleCancel() }), h("verdocs-button", { key: '2013efb5dba9d6b3236ad280dbc6883473eebabf', label: "Upload", onClick: () => this.handleDone(), disabled: this.selectedFiles.length < 1 })))), this.confirmDelete && (h("verdocs-ok-dialog", { key: 'd55cbad44c7d50d9c479a87917b14fc0ae488a2b', heading: "Delete Attachment?", message: "Are you sure you wish to delete this attachment? This action cannot be undone.", showCancel: true, onExit: e => {
74
+ // So we don't close the upload dialog
75
+ e.preventDefault();
76
+ e.stopPropagation();
77
+ this.confirmDelete = false;
78
+ }, onNext: e => this.handleDeleteAttachment(e) }))));
66
79
  }
67
80
  static get is() { return "verdocs-upload-dialog"; }
68
81
  static get originalStyleUrls() {
@@ -99,6 +112,7 @@ export class VerdocsUploadDialog {
99
112
  static get states() {
100
113
  return {
101
114
  "draggingOver": {},
115
+ "confirmDelete": {},
102
116
  "selectedFiles": {}
103
117
  };
104
118
  }
@@ -19,7 +19,7 @@ export class VerdocsQuickFunctions {
19
19
  this.createDocument.emit();
20
20
  }
21
21
  render() {
22
- return (h("div", { key: 'ab46c28e7f1420c3d38537fa3f1df68e3a4552bd', class: "container" }, h("p", { key: '1fedfcb6362e8c94e20c5ab0b8dae925f0a50542', class: "title" }, "Quick Create"), h("button", { key: 'eb7816bba752b3a2b531166413b8004f239db36d', onClick: () => this.handleCreateTemplate(), innerHTML: TemplateIcon }, "Template"), h("button", { key: 'c551132ca96ce060bf0fcd18f017b20b9a27cfda', onClick: () => this.handleCreateDocument(), innerHTML: DocumentIcon }, "Document")));
22
+ return (h("div", { key: '99840e81fe2f2b825efb6253f72a6583d0354504', class: "container" }, h("p", { key: '7a814db57ae3bfad6aaba12cdab17b0e900e9080', class: "title" }, "Quick Create"), h("button", { key: '84d518a21e8fb43818efbc26f94b545821465af1', onClick: () => this.handleCreateTemplate(), innerHTML: TemplateIcon }, "Template"), h("button", { key: 'c7b9ea58cf880ef8356e2fdb80a1f76b4ab8b014', onClick: () => this.handleCreateDocument(), innerHTML: DocumentIcon }, "Document")));
23
23
  }
24
24
  static get is() { return "verdocs-quick-functions"; }
25
25
  static get originalStyleUrls() {
@@ -4,7 +4,7 @@ export class VerdocsSearchTabs {
4
4
  this.selected = 'all';
5
5
  }
6
6
  render() {
7
- return h("div", { key: 'afc8ae06fa51a4aa236c12b7ed057e16112ce8a8' }, "\u00A0");
7
+ return h("div", { key: '476b2a3baba29b498e5d91a9866f8e1f5070b8c3' }, "\u00A0");
8
8
  }
9
9
  static get is() { return "verdocs-search-tabs"; }
10
10
  static get originalStyleUrls() {
@@ -98,7 +98,7 @@ verdocs-sign .loading-indicator {
98
98
  width: 100%;
99
99
  display: flex;
100
100
  z-index: 1000;
101
- flex: 0 0 56px;
101
+ flex: 0 0 46px;
102
102
  font-size: 12px;
103
103
  column-gap: 15px;
104
104
  align-items: center;
@@ -111,7 +111,7 @@ verdocs-sign .loading-indicator {
111
111
  width: 100%;
112
112
  display: flex;
113
113
  margin: 0 auto;
114
- padding: 0 20px;
114
+ padding: 0 12px;
115
115
  max-width: 1200px;
116
116
  align-items: center;
117
117
  flex-direction: row;
@@ -129,7 +129,8 @@ verdocs-sign .loading-indicator {
129
129
  padding: 0 10px 0 0;
130
130
  text-overflow: ellipsis;
131
131
  }
132
- #verdocs-sign-header .spinner-overlay {
132
+
133
+ .spinner-overlay {
133
134
  position: fixed;
134
135
  top: 0;
135
136
  left: 0;
@@ -58,13 +58,15 @@ export class VerdocsSign {
58
58
  this.declined = false;
59
59
  this.isDone = false;
60
60
  this.showDone = false;
61
+ this.showCanceled = false;
62
+ this.showDeclined = false;
61
63
  this.showLoadError = false;
62
64
  this.finishLater = false;
63
65
  this.showFinishLater = false;
64
66
  this.agreed = false;
65
67
  this.documentsSingularPlural = 'document';
66
68
  this.kbaStep = '';
67
- this.showSpinner = true;
69
+ this.showSpinner = false;
68
70
  }
69
71
  componentWillLoad() {
70
72
  if (!this.endpoint) {
@@ -109,10 +111,15 @@ export class VerdocsSign {
109
111
  else {
110
112
  console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);
111
113
  }
114
+ // TODO: Envelope "complete" | "declined" | "canceled"
115
+ // TODO: Recipient "canceled"
112
116
  this.submitted = this.recipient.status === 'submitted';
113
117
  this.declined = this.recipient.status === 'declined';
114
118
  this.canceled = this.envelope.status === 'canceled';
115
119
  this.isDone = this.submitted || this.declined || this.canceled;
120
+ this.showDone = this.submitted;
121
+ this.showCanceled = this.canceled;
122
+ this.showDeclined = this.declined;
116
123
  if (this.agreed) {
117
124
  this.nextButtonLabel = 'Next';
118
125
  }
@@ -180,16 +187,17 @@ export class VerdocsSign {
180
187
  (_c = this.envelopeUpdated) === null || _c === void 0 ? void 0 : _c.emit({ endpoint: this.endpoint, envelope: this.envelope, event: 'declined' });
181
188
  this.submitting = false;
182
189
  this.declined = true;
183
- console.log('[SIGN] Reloading envelope');
184
- getEnvelope(this.endpoint, this.envelopeId)
185
- .then(envelope => {
186
- this.envelope = envelope;
187
- this.isDone = true;
188
- })
189
- .catch(e => {
190
- this.isDone = true;
191
- console.log('[SIGN] Error reloading envelope', e);
192
- });
190
+ this.showDeclined = true;
191
+ // console.log('[SIGN] Reloading envelope');
192
+ // getEnvelope(this.endpoint, this.envelopeId)
193
+ // .then(envelope => {
194
+ // this.envelope = envelope;
195
+ // this.isDone = true;
196
+ // })
197
+ // .catch(e => {
198
+ // this.isDone = true;
199
+ // console.log('[SIGN] Error reloading envelope', e);
200
+ // });
193
201
  }
194
202
  break;
195
203
  case 'print':
@@ -306,7 +314,7 @@ export class VerdocsSign {
306
314
  case 'phone':
307
315
  return isValidPhone(value);
308
316
  default:
309
- return value !== '';
317
+ return (value || '').trim() !== '';
310
318
  }
311
319
  case 'signature':
312
320
  return value === 'signed';
@@ -422,12 +430,20 @@ export class VerdocsSign {
422
430
  }
423
431
  }
424
432
  attachFieldAttributes(pageInfo, field, el) {
425
- // console.log('attach', field.name);
433
+ // We can get called multiple times as rendering completes and it's hard to avoid that
434
+ // because it's a ton of work for the callers to know it's been done already. But we
435
+ // don't want to attach multiple event listeners or we get dupe event handling, like
436
+ // calling the server twice on every field update. Since JS has no removeAllEventListeners()
437
+ // option, using removeEventListener() isn't reliable the way Stencil binds local function
438
+ // contexts, and cloneNode messes up the rest of the rendering, we just track it with a flag.
439
+ if (el.getAttribute('attached') === '1') {
440
+ return;
441
+ }
442
+ el.setAttribute('attached', '1');
426
443
  el.addEventListener('input', (e) => {
427
444
  // console.log('[SIGN] onfieldInput', e.detail, e.target.value);
428
445
  // These field types don't emit fieldChange. Should we standardize on that? We don't tap "input" for fields like
429
446
  // text boxes because we'd be updating the field on every keystroke. We do those on blur which fires fieldChange.
430
- console.log('onInput', e.target.type, e.target.name);
431
447
  if (e.target.type === 'radio' || e.target.type === 'checkbox') {
432
448
  // if (e.target.type === 'radio' || e.target.name.includes('date') || e.target.name.includes('checkbox')) {
433
449
  this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());
@@ -441,10 +457,11 @@ export class VerdocsSign {
441
457
  console.log('[SIGN] onAttached', e.detail, e.target.value);
442
458
  this.showSpinner = true;
443
459
  try {
444
- const r = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);
445
- console.log('upload result', r);
446
- // this.updateRecipientFieldValue(fieldName, updateResult)
460
+ const updateResult = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);
461
+ this.updateRecipientFieldValue(field.name, updateResult);
447
462
  this.checkRecipientFields();
463
+ const newEl = renderDocumentField(field, pageInfo, { disabled: false, editable: false, draggable: false, done: this.isDone });
464
+ this.attachFieldAttributes(pageInfo, field, newEl);
448
465
  this.showSpinner = false;
449
466
  }
450
467
  catch (e) {
@@ -453,14 +470,23 @@ export class VerdocsSign {
453
470
  this.showSpinner = false;
454
471
  }
455
472
  });
456
- el.addEventListener('remove', (e) => {
457
- console.log('[SIGN] onRemoved', e.detail, e.target.value);
458
- deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name)
459
- .then(r => {
460
- console.log('[SIGN] Deleted attachment', r);
461
- // this.updateRecipientFieldValue(fieldName, updateResult)
462
- })
463
- .catch(e => console.log('[SIGN] Error deleting attachment', e));
473
+ el.addEventListener('deleted', async (e) => {
474
+ console.log('[SIGN] onDeleted', e.detail, e.target.value);
475
+ this.showSpinner = true;
476
+ try {
477
+ const updateResult = await deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name);
478
+ console.log('[SIGN] Deleted attachment', updateResult);
479
+ this.updateRecipientFieldValue(field.name, updateResult);
480
+ this.checkRecipientFields();
481
+ const newEl = renderDocumentField(field, pageInfo, { disabled: false, editable: false, draggable: false, done: this.isDone });
482
+ this.attachFieldAttributes(pageInfo, field, newEl);
483
+ this.showSpinner = false;
484
+ }
485
+ catch (e) {
486
+ console.log('Error uploading attachment', e);
487
+ VerdocsToast('Unable to upload attachment, please try again later', { style: 'error' });
488
+ this.showSpinner = false;
489
+ }
464
490
  });
465
491
  el.addEventListener('focusout', e => {
466
492
  // These field types trigger focusout as they're used, even without a value change
@@ -490,6 +516,7 @@ export class VerdocsSign {
490
516
  if (field.page !== pageInfo.pageNumber) {
491
517
  return;
492
518
  }
519
+ // TODO: Review possible workflow/race conditions vs rendering in -document-page.
493
520
  const el = renderDocumentField(field, pageInfo, { disabled: false, editable: false, draggable: false, done: this.isDone }, tabIndex);
494
521
  if (!el) {
495
522
  return;
@@ -532,9 +559,21 @@ export class VerdocsSign {
532
559
  return (h(Host, null, h("verdocs-loader", null)));
533
560
  }
534
561
  if (this.isDone) {
535
- return (h(Host, { class: { agreed: this.agreed } }, h("verdocs-view", { endpoint: this.endpoint, envelopeId: this.envelopeId, envelope: this.envelope, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } }), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), this.showDone && (h("verdocs-ok-dialog", { heading: "You're Done!", message: `You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`, onNext: () => {
562
+ return (h(Host, { class: { agreed: this.agreed } }, h("verdocs-view", { endpoint: this.endpoint, envelopeId: this.envelopeId, envelope: this.envelope, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } }), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), this.showDone && (h("verdocs-ok-dialog", { heading: "You're Done!", message: `You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`, onNext: (e) => {
563
+ e.preventDefault();
564
+ e.stopPropagation();
536
565
  this.showDone = false;
537
566
  this.isDone = true;
567
+ } })), this.showCanceled && (h("verdocs-ok-dialog", { heading: "Document Canceled", message: `This envelope has been canceled. Please contact the sender.`, onNext: (e) => {
568
+ e.preventDefault();
569
+ e.stopPropagation();
570
+ // We don't allow this to be hidden
571
+ // this.showCanceled = false;
572
+ } })), this.showDeclined && (h("verdocs-ok-dialog", { heading: "Declined to Sign", message: `You have declined to sign this document. Please contact the sender.`, onNext: (e) => {
573
+ e.preventDefault();
574
+ e.stopPropagation();
575
+ // We don't allow this to be hidden
576
+ // this.showDeclined = false;
538
577
  } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null)))));
539
578
  }
540
579
  if (!this.agreed) {
@@ -556,7 +595,7 @@ export class VerdocsSign {
556
595
  });
557
596
  } })))));
558
597
  }
559
- return (h(Host, null, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
598
+ return (h(Host, null, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
560
599
  const pageNumbers = integerSequence(1, envelopeDocument.pages);
561
600
  return (h(Fragment, null, pageNumbers.map(pageNumber => {
562
601
  // In signing mode we show the original template page with all the recipient fields so we can show source formatting and
@@ -575,6 +614,16 @@ export class VerdocsSign {
575
614
  })), this.showFinishLater && (h("verdocs-ok-dialog", { heading: "You've saved your document to finish later.", message: `To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`, onNext: () => (this.showFinishLater = false) })), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), this.showDone && (h("verdocs-ok-dialog", { heading: "You're Done!", message: `You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`, onNext: () => {
576
615
  this.showDone = false;
577
616
  this.isDone = true;
617
+ } })), this.showCanceled && (h("verdocs-ok-dialog", { heading: "Document Canceled", message: `This envelope has been canceled. Please contact the sender.`, onNext: (e) => {
618
+ e.preventDefault();
619
+ e.stopPropagation();
620
+ // We don't allow this to be hidden
621
+ // this.showCanceled = false;
622
+ } })), this.showDeclined && (h("verdocs-ok-dialog", { heading: "Declined to Sign", message: `You have declined to sign this document. Please contact the sender.`, onNext: (e) => {
623
+ e.preventDefault();
624
+ e.stopPropagation();
625
+ // We don't allow this to be hidden
626
+ // this.showDeclined = false;
578
627
  } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null))), this.showSpinner && (h("verdocs-portal", null, h("div", { class: "spinner-overlay" }, h("verdocs-spinner", null))))));
579
628
  }
580
629
  static get is() { return "verdocs-sign"; }
@@ -703,6 +752,8 @@ export class VerdocsSign {
703
752
  "declined": {},
704
753
  "isDone": {},
705
754
  "showDone": {},
755
+ "showCanceled": {},
756
+ "showDeclined": {},
706
757
  "showLoadError": {},
707
758
  "finishLater": {},
708
759
  "showFinishLater": {},
@@ -1,6 +1,7 @@
1
1
  import { cancelEnvelope, getDocumentDownloadLink, getEnvelope, integerSequence, userCanCancelEnvelope, VerdocsEndpoint } from "@verdocs/js-sdk";
2
2
  import { h, Host, Fragment } from "@stencil/core";
3
3
  import { saveEnvelopesAsZip } from "../../../utils/utils";
4
+ // import {IDocumentPageInfo} from '../../../utils/Types';
4
5
  import { SDKError } from "../../../utils/errors";
5
6
  /**
6
7
  * Render the documents attached to an envelope in read-only (view) mode. All documents are
@@ -56,9 +57,9 @@ export class VerdocsView {
56
57
  headerTarget.append(headerEl);
57
58
  }
58
59
  }
59
- handlePageRendered(e) {
60
- const pageInfo = e.detail;
61
- console.log('[VIEW] Page rendered', pageInfo);
60
+ handlePageRendered(_e) {
61
+ // const pageInfo = e.detail as IDocumentPageInfo;
62
+ // console.log('[VIEW] Page rendered', pageInfo);
62
63
  }
63
64
  async handleOptionSelected(e) {
64
65
  var _a, _b;
@@ -74,7 +74,7 @@ export class VerdocsEnvelopeDocumentPage {
74
74
  }
75
75
  render() {
76
76
  const height = `${this.renderedHeight}px`;
77
- return (h(Host, { key: 'd0b33866715373307c93aa63a2d669180d137c31', id: `${this.containerId}`, style: { height, flex: `0 0 ${height}` } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-envelope-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-envelope-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
77
+ return (h(Host, { key: 'cca4f6b0c00556a1662ee175292d59b249b17604', id: `${this.containerId}`, style: { height, flex: `0 0 ${height}` } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-envelope-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-envelope-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
78
78
  // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
79
79
  // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
80
80
  // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
@@ -118,7 +118,7 @@ export class VerdocsEnvelopeSidebar {
118
118
  }
119
119
  (_a = this.envelopeUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, envelope: (_b = this.store) === null || _b === void 0 ? void 0 : _b.state, event: id });
120
120
  }
121
- cancelEnvelope() {
121
+ handleCancelEnvelope() {
122
122
  this.loading = true;
123
123
  cancelEnvelope(this.endpoint, this.envelopeId)
124
124
  .then(async (r) => {
@@ -248,6 +248,8 @@ export class VerdocsEnvelopeSidebar {
248
248
  case 'completed':
249
249
  entries.push({ icon: 'done_all', message: `Envelope was completed.`, date: new Date(history.created_at) });
250
250
  break;
251
+ // TODO: Final answer?
252
+ case 'envelope:canceled':
251
253
  case 'envelope_canceled':
252
254
  case 'canceled':
253
255
  case 'owner:canceled':
@@ -327,7 +329,7 @@ export class VerdocsEnvelopeSidebar {
327
329
  this.handleSetReminders(this.initialReminder, this.followupReminders);
328
330
  } })), h("div", { class: "form-row" }, h("div", { class: "form-label" }, "Next Reminder:"), h("div", { style: { color: '#dddddd' } }, format(new Date((_y = (_x = this.store) === null || _x === void 0 ? void 0 : _x.state) === null || _y === void 0 ? void 0 : _y.next_reminder), 'P p'))))))), isEnvelopeOwner && (h("verdocs-button", { class: "manage-recipients-button", variant: "standard", label: "Cancel Envelope", onClick: () => (this.showCancelDialog = !functionsDisabled), disabled: functionsDisabled })))), this.activeTab === 3 && (h("div", { class: "content" }, h("div", { class: "title" }, "History"), historyEntries.map(entry => (h("div", { class: "history-entry" }, h("div", { class: "activity-icon", innerHTML: ActivityIcons[entry.icon] || entry.icon }), h("div", { class: "activity-details" }, h("div", { class: "activity-text" }, entry.message), h("div", { class: "activity-date" }, format(entry.date, FORMAT_TIMESTAMP)))))))), this.showRecipientDialog && (h("verdocs-envelope-recipient-link", { envelopeId: this.envelopeId, roleName: this.showRecipientDialog, onNext: () => (this.showRecipientDialog = '') })), this.showCancelDialog && (h("verdocs-ok-dialog", { heading: "Cancel Envelope?", message: 'Are you sure you want to cancel this Envelope? This action cannot be undone.', onNext: () => {
329
331
  this.showCancelDialog = false;
330
- this.cancelEnvelope();
332
+ this.handleCancelEnvelope();
331
333
  } }))));
332
334
  }
333
335
  static get is() { return "verdocs-envelope-sidebar"; }
@@ -191,18 +191,18 @@ export class VerdocsEnvelopesList {
191
191
  });
192
192
  }
193
193
  render() {
194
- return (h(Host, { key: '108b5afd94968cb2801ed59a0ac22415b69089d2' }, h("div", { key: 'ce4fc0e1f129cb7628cfc3f6f082074637cff0b7', class: "header" }, h("div", { key: 'ad67a17d11cd9b599242813f3868b58e4296d82d', class: "filter" }, h("verdocs-text-input", { key: '3c516592fdfc4215734c8c84c3553ff368867652', id: "verdocs-filter-name", value: this.match, clearable: true, autocomplete: "off", placeholder: "Filter by Name, Recipient, or Field...", onFocusout: (e) => {
194
+ return (h(Host, { key: '65d29f9d52c1e4580e335015941be7f8f20197a9' }, h("div", { key: '64a021af11c8a291981bb49f88cddedf5253593d', class: "header" }, h("div", { key: '12ae24224cc5bae515cad1b6382b1fa64fce1223', class: "filter" }, h("verdocs-text-input", { key: 'b895bcdfa7829a5a78460759291890859d5cf6b5', id: "verdocs-filter-name", value: this.match, clearable: true, autocomplete: "off", placeholder: "Filter by Name, Recipient, or Field...", onFocusout: (e) => {
195
195
  var _a;
196
196
  // We don't locally filter envelopes because there are too many fields to match against efficiently.
197
197
  this.match = e.target.value.trim();
198
198
  (_a = this.changeMatch) === null || _a === void 0 ? void 0 : _a.emit(this.match);
199
- } })), h("verdocs-quick-filter", { key: '215d014e581b9bff84a56ee919810b6329a2789e', label: "View", value: this.view, options: ViewFilters, onOptionSelected: e => {
199
+ } })), h("verdocs-quick-filter", { key: '72e6e429edabd43c71a24d5d74e7be57b44073b8', label: "View", value: this.view, options: ViewFilters, onOptionSelected: e => {
200
200
  this.view = e.detail.value;
201
- } }), this.view === 'all' && (h("verdocs-quick-filter", { key: '69f79850d7165d1150383f845909dd3cfd23255e', label: "Status", value: this.status, options: StatusFilters, onOptionSelected: e => {
201
+ } }), this.view === 'all' && (h("verdocs-quick-filter", { key: '883d9ed133ad696a6fa1a572aa331aad753296ea', label: "Status", value: this.status, options: StatusFilters, onOptionSelected: e => {
202
202
  this.status = e.detail.value;
203
- } })), this.view === 'all' && (h("verdocs-quick-filter", { key: 'eb5b7ff77417c2432a9963fa1cffb30e09bf3e05', label: "Sort By", value: this.sort, options: SortFilters, onOptionSelected: e => {
203
+ } })), this.view === 'all' && (h("verdocs-quick-filter", { key: '626d712a6760eb30c9d10a142358f0e9c3ad6548', label: "Sort By", value: this.sort, options: SortFilters, onOptionSelected: e => {
204
204
  this.sort = e.detail.value;
205
- } })), this.loading && h("verdocs-spinner", { key: 'a1869793d432b972161301903df300a9e972728b', mode: "dark", size: 24 }), h("div", { key: '9ad9261f2c1fac268483b2caf7c5f4b67f1a5236', style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { key: '47d7186632c3823a573f4b034e8c301dc842992e', label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
205
+ } })), this.loading && h("verdocs-spinner", { key: '391ee75435dfe6203eef29e29b14f74cda3a32ab', mode: "dark", size: 24 }), h("div", { key: 'd12b2ce01d44e81728189968947c7b5e9e778293', style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { key: 'c2d20419257993759e8cd7c5ea5e58a20db5b15e', label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
206
206
  var _a;
207
207
  const recipientsWithActions = getRecipientsWithActions(envelope);
208
208
  const userCanCancel = userCanCancelEnvelope(this.endpoint.profile, envelope);
@@ -243,7 +243,7 @@ export class VerdocsEnvelopesList {
243
243
  break;
244
244
  }
245
245
  } }))));
246
- }), !this.initiallyLoaded && (h("div", { key: '8b16c1e78ed0b9263e6831e8e84c7f92863a5225', style: { width: '100%' } }, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "envelope-placeholder" }))))), this.initiallyLoaded && !this.envelopes.length && h("div", { key: '9b7aeee48c38402025afec1e8584be15c9160eb1', class: "empty-text" }, "No matching envelopes found. Please adjust your filters and try again."), this.initiallyLoaded && this.envelopes.length && this.showPagination ? (h("div", { style: { marginTop: '20px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: this.rowsPerPage, itemCount: this.count, onSelectPage: e => {
246
+ }), !this.initiallyLoaded && (h("div", { key: '3c1f1711abdeaaf92c12129e8f7e5ab13c06db1d', style: { width: '100%' } }, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "envelope-placeholder" }))))), this.initiallyLoaded && !this.envelopes.length && h("div", { key: '1f14c23162b105b4947e3b574e0192fee0f164b5', class: "empty-text" }, "No matching envelopes found. Please adjust your filters and try again."), this.initiallyLoaded && this.envelopes.length && this.showPagination ? (h("div", { style: { marginTop: '20px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: this.rowsPerPage, itemCount: this.count, onSelectPage: e => {
247
247
  this.selectedPage = e.detail.selectedPage;
248
248
  } }))) : (h("div", null))));
249
249
  }
@@ -238,11 +238,11 @@ export class VerdocsStatusIndicator {
238
238
  }
239
239
  const icon = this.getStatusIcon(status);
240
240
  const statusMessage = this.getStatusMessage(status);
241
- return (h(Host, { key: 'a579d2ed18289b75beaaaf5fef322db25d0a4e93', ref: el => (this.summaryComponent = el), class: `${this.theme} ${this.size} ${this.envelope ? 'has-document' : ''}`, "aria-label": "Click to View Details", onClick: e => {
241
+ return (h(Host, { key: '3111e544a8f287a2b5a501cae08fc88752186477', ref: el => (this.summaryComponent = el), class: `${this.theme} ${this.size} ${this.envelope ? 'has-document' : ''}`, "aria-label": "Click to View Details", onClick: e => {
242
242
  e.stopPropagation();
243
243
  e.preventDefault();
244
244
  this.envelope && this.toggleDropdown();
245
- }, onBlur: e => this.envelope && this.handleHideDropdown(e) }, h("span", { key: 'c59f8b21dce6f4fe2cd7bdc1124c6af339e70de7', class: "icon", innerHTML: icon }), h("span", { key: '1c96b95b111836c791a14e22c28defc43db1cc48', class: "content" }, statusMessage), h("div", { key: 'd673852a5e1a03656cb15d39d7f469a6e43f45a9', class: "detail-panel", ref: el => (this.detailPanel = el) }, h("div", { key: '0d1597689117ca7419f556fc38ff55711644f55f', id: `${this.containerId}` }), this.recipientStatusIcons.map(icon => (h("span", { innerHTML: icon.icon, style: { position: 'absolute', top: `${icon.y}px`, left: `${icon.x}px` } }))))));
245
+ }, onBlur: e => this.envelope && this.handleHideDropdown(e) }, h("span", { key: '2dd4397db22358d7dd8e495f601c3f31687e400e', class: "icon", innerHTML: icon }), h("span", { key: 'fb37993d036b1a1552f19fc2bc57565bf3026a44', class: "content" }, statusMessage), h("div", { key: '5bc4ea53d9eec94c0dfd34662437bf90aaf76d60', class: "detail-panel", ref: el => (this.detailPanel = el) }, h("div", { key: 'e073e793dc4f0bef2d9826fb5b70f62f2495fa45', id: `${this.containerId}` }), this.recipientStatusIcons.map(icon => (h("span", { innerHTML: icon.icon, style: { position: 'absolute', top: `${icon.y}px`, left: `${icon.x}px` } }))))));
246
246
  }
247
247
  static get is() { return "verdocs-status-indicator"; }
248
248
  static get originalStyleUrls() {
@@ -4,7 +4,8 @@ import { getRoleIndex, getTemplateRoleStore } from "../../../utils/TemplateRoleS
4
4
  import { getTemplateFieldStore } from "../../../utils/TemplateFieldStore";
5
5
  import { SettingsIcon } from "../../../utils/Icons";
6
6
  const PaperclipIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>`;
7
- const AttachedIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104.69 122.88"><g><path d="M31.54,86.95c-1.74,0-3.16-1.43-3.16-3.19c0-1.76,1.41-3.19,3.16-3.19h20.5c1.74,0,3.16,1.43,3.16,3.19 c0,1.76-1.41,3.19-3.16,3.19H31.54L31.54,86.95z M31.54,42.27c-1.74,0-3.15-1.41-3.15-3.15c0-1.74,1.41-3.15,3.15-3.15h41.61 c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15H31.54L31.54,42.27z M66.57,108.66c-1.36-1.08-1.59-3.06-0.5-4.42 c1.08-1.36,3.06-1.59,4.42-0.5l9.57,7.59l18.21-22.27c1.1-1.35,3.09-1.54,4.43-0.44c1.35,1.1,1.54,3.09,0.44,4.43l-20.17,24.67l0,0 c-1.09,1.33-3.04,1.54-4.39,0.47L66.57,108.66L66.57,108.66z M56.85,116.58c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15 H7.33c-2.02,0-3.85-0.82-5.18-2.15C0.82,119.4,0,117.57,0,115.55V7.33c0-2.02,0.82-3.85,2.15-5.18C3.48,0.82,5.31,0,7.33,0h90.02 c2.02,0,3.85,0.82,5.18,2.15c1.33,1.33,2.15,3.16,2.15,5.18V72.6c0,1.74-1.41,3.15-3.15,3.15c-1.74,0-3.15-1.41-3.15-3.15V7.33 c0-0.28-0.12-0.54-0.3-0.73c-0.19-0.19-0.45-0.3-0.73-0.3H7.33c-0.28,0-0.54,0.12-0.73,0.3C6.42,6.8,6.3,7.05,6.3,7.33v108.21 c0,0.28,0.12,0.54,0.3,0.73c0.19,0.19,0.45,0.3,0.73,0.3H56.85L56.85,116.58z M31.54,64.59c-1.74,0-3.15-1.41-3.15-3.15 c0-1.74,1.41-3.15,3.15-3.15h41.61c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15H31.54L31.54,64.59z"/></g></svg>`;
7
+ // const AttachedIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104.69 122.88"><g><path d="M31.54,86.95c-1.74,0-3.16-1.43-3.16-3.19c0-1.76,1.41-3.19,3.16-3.19h20.5c1.74,0,3.16,1.43,3.16,3.19 c0,1.76-1.41,3.19-3.16,3.19H31.54L31.54,86.95z M31.54,42.27c-1.74,0-3.15-1.41-3.15-3.15c0-1.74,1.41-3.15,3.15-3.15h41.61 c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15H31.54L31.54,42.27z M66.57,108.66c-1.36-1.08-1.59-3.06-0.5-4.42 c1.08-1.36,3.06-1.59,4.42-0.5l9.57,7.59l18.21-22.27c1.1-1.35,3.09-1.54,4.43-0.44c1.35,1.1,1.54,3.09,0.44,4.43l-20.17,24.67l0,0 c-1.09,1.33-3.04,1.54-4.39,0.47L66.57,108.66L66.57,108.66z M56.85,116.58c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15 H7.33c-2.02,0-3.85-0.82-5.18-2.15C0.82,119.4,0,117.57,0,115.55V7.33c0-2.02,0.82-3.85,2.15-5.18C3.48,0.82,5.31,0,7.33,0h90.02 c2.02,0,3.85,0.82,5.18,2.15c1.33,1.33,2.15,3.16,2.15,5.18V72.6c0,1.74-1.41,3.15-3.15,3.15c-1.74,0-3.15-1.41-3.15-3.15V7.33 c0-0.28-0.12-0.54-0.3-0.73c-0.19-0.19-0.45-0.3-0.73-0.3H7.33c-0.28,0-0.54,0.12-0.73,0.3C6.42,6.8,6.3,7.05,6.3,7.33v108.21 c0,0.28,0.12,0.54,0.3,0.73c0.19,0.19,0.45,0.3,0.73,0.3H56.85L56.85,116.58z M31.54,64.59c-1.74,0-3.15-1.41-3.15-3.15 c0-1.74,1.41-3.15,3.15-3.15h41.61c1.74,0,3.15,1.41,3.15,3.15c0,1.74-1.41,3.15-3.15,3.15H31.54L31.54,64.59z"/></g></svg>`;
8
+ const AttachedIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#339933" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-check"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="m9 15 2 2 4-4"/></svg>`;
8
9
  /**
9
10
  * Displays an attachment field.
10
11
  */
@@ -19,6 +20,14 @@ export class VerdocsFieldAttachment {
19
20
  this.selectedFile = e.detail[0];
20
21
  (_a = this.attached) === null || _a === void 0 ? void 0 : _a.emit(e.detail[0]);
21
22
  };
23
+ this.handleUploadRemove = (e) => {
24
+ var _a;
25
+ e.preventDefault();
26
+ e.stopPropagation();
27
+ this.dialogOpen = false;
28
+ this.selectedFile = null;
29
+ (_a = this.deleted) === null || _a === void 0 ? void 0 : _a.emit({ fieldName: this.fieldname });
30
+ };
22
31
  this.endpoint = VerdocsEndpoint.getDefault();
23
32
  this.templateid = '';
24
33
  this.fieldname = '';
@@ -37,6 +46,7 @@ export class VerdocsFieldAttachment {
37
46
  async focusField() {
38
47
  // Our input field is fake, so we fake the flash too
39
48
  this.focused = true;
49
+ this.dialogOpen = true;
40
50
  setTimeout(() => {
41
51
  this.focused = false;
42
52
  }, 500);
@@ -63,7 +73,6 @@ export class VerdocsFieldAttachment {
63
73
  render() {
64
74
  const { templateid, fieldname = '', editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1 } = this;
65
75
  const field = this.fieldStore.get('fields').find(field => field.name === fieldname);
66
- console.log('Rendering attachment', field);
67
76
  const { required = false, role_name = '', value = '', label = '', settings = {} } = field || {};
68
77
  const backgroundColor = getRGBA(getRoleIndex(this.roleStore, role_name));
69
78
  const hasFile = value || !!this.selectedFile;
@@ -81,9 +90,7 @@ export class VerdocsFieldAttachment {
81
90
  var _a;
82
91
  (_a = this.settingsChanged) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
83
92
  return this.hideSettingsPanel();
84
- }, helpText: 'Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow.' }))))), this.dialogOpen && (h("verdocs-portal", null, h("verdocs-upload-dialog", { existingFile: settings, onNext: e => this.handleUploadNext(e), onExit: () => (this.dialogOpen = false), onRemove: e => {
85
- console.log('remove', e);
86
- } })))));
93
+ }, helpText: 'Attachments allow the user to attach their own documents (e.g. resumes or disclosures) to a signing flow.' }))))), this.dialogOpen && (h("verdocs-portal", null, h("verdocs-upload-dialog", { existingFile: settings, onNext: e => this.handleUploadNext(e), onRemove: e => this.handleUploadRemove(e), onExit: () => (this.dialogOpen = false) })))));
87
94
  }
88
95
  static get is() { return "verdocs-field-attachment"; }
89
96
  static get originalStyleUrls() {
@@ -314,21 +321,6 @@ export class VerdocsFieldAttachment {
314
321
  }
315
322
  }
316
323
  }
317
- }, {
318
- "method": "deleted",
319
- "name": "deleted",
320
- "bubbles": true,
321
- "cancelable": true,
322
- "composed": true,
323
- "docs": {
324
- "tags": [],
325
- "text": "Event fired when the field is deleted. Note that this is for the FIELD (e.g. in\nBuild) not for any attachments (during signing)."
326
- },
327
- "complexType": {
328
- "original": "{fieldName: string}",
329
- "resolved": "{ fieldName: string; }",
330
- "references": {}
331
- }
332
324
  }, {
333
325
  "method": "attached",
334
326
  "name": "attached",
@@ -351,18 +343,18 @@ export class VerdocsFieldAttachment {
351
343
  }
352
344
  }
353
345
  }, {
354
- "method": "remove",
355
- "name": "remove",
346
+ "method": "deleted",
347
+ "name": "deleted",
356
348
  "bubbles": true,
357
349
  "cancelable": true,
358
350
  "composed": true,
359
351
  "docs": {
360
352
  "tags": [],
361
- "text": "Event fired when a file attachment is removed by the signer."
353
+ "text": "Event fired when the field is deleted. Note that this is for the FIELD (e.g. in\nBuild) not for any attachments (during signing)."
362
354
  },
363
355
  "complexType": {
364
- "original": "any",
365
- "resolved": "any",
356
+ "original": "{fieldName: string}",
357
+ "resolved": "{ fieldName: string; }",
366
358
  "references": {}
367
359
  }
368
360
  }];
@@ -14,6 +14,7 @@ export class VerdocsFieldDate {
14
14
  constructor() {
15
15
  this.fieldStore = null;
16
16
  this.roleStore = null;
17
+ this.picker = null;
17
18
  this.templateid = '';
18
19
  this.fieldname = '';
19
20
  this.disabled = false;
@@ -29,8 +30,10 @@ export class VerdocsFieldDate {
29
30
  this.focused = false;
30
31
  }
31
32
  async focusField() {
33
+ var _a;
32
34
  // Our input field is fake, so we fake the flash too
33
35
  this.focused = true;
36
+ (_a = this.picker) === null || _a === void 0 ? void 0 : _a.show();
34
37
  setTimeout(() => {
35
38
  this.focused = false;
36
39
  }, 500);
@@ -44,7 +47,7 @@ export class VerdocsFieldDate {
44
47
  this.roleStore = getTemplateRoleStore(this.templateid);
45
48
  }
46
49
  componentDidLoad() {
47
- new AirDatepicker(`#${this.containerId}`, {
50
+ this.picker = new AirDatepicker(`#${this.containerId}`, {
48
51
  locale: localeEn,
49
52
  isMobile: true,
50
53
  autoClose: true,
@@ -51,11 +51,18 @@ export class VerdocsFieldDropdown {
51
51
  render() {
52
52
  const { templateid, fieldname = '', editable = false, done = false, disabled = false, focused, xscale = 1, yscale = 1 } = this;
53
53
  const field = this.fieldStore.get('fields').find(field => field.name === fieldname);
54
- const { required = false, role_name = '', value = '', label = '', options = [] } = field || {};
54
+ let { required = false, role_name = '', value = '', label = '', options } = field || {};
55
55
  const backgroundColor = getRGBA(getRoleIndex(this.roleStore, role_name));
56
56
  if (done) {
57
57
  return h(Host, { class: { done } }, value);
58
58
  }
59
+ // TODO: Look for other places this mistaken assumption was made.
60
+ // Defaults only apply in destructuring if undefined. null doesn't trigger it.
61
+ options || (options = []);
62
+ if (!options.length) {
63
+ console.log('[DROPDOWN] Dropdown has no options, hiding field...', fieldname);
64
+ return h(Host, null);
65
+ }
59
66
  return (h(Host, { class: { required, disabled, done, focused }, style: { backgroundColor } }, label && h("label", null, label), h("select", { disabled: disabled, onChange: e => this.handleChange(e) }, h("option", { value: "" }, "Select..."), options.map(option => (h("option", { value: option.id, selected: option.id === value }, option.label)))), editable && (h(Fragment, null, h("div", { id: `verdocs-settings-panel-trigger-${fieldname}`, style: { transform: `scale(${Math.floor((1 / xscale) * 1000) / 1000}, ${Math.floor((1 / yscale) * 1000) / 1000})` }, class: "settings-icon", innerHTML: SettingsIcon, onClick: (e) => {
60
67
  e.stopPropagation();
61
68
  this.showingProperties = !this.showingProperties;