@verdocs/web-sdk 2.0.22 → 2.0.25

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 (194) hide show
  1. package/dist/cjs/{EnvelopeStore-b60a1bd3.js → EnvelopeStore-c2f0d4ca.js} +1 -1
  2. package/dist/cjs/{Envelopes-01c2e7e4.js → Envelopes-19ff627a.js} +15 -17
  3. package/dist/cjs/{Permissions-1be8039d.js → Permissions-1436f847.js} +3 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{utils-65c99e57.js → utils-fe5b1d83.js} +1 -1
  6. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +19 -2
  8. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +2 -2
  9. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  10. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +3 -3
  11. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +3 -3
  12. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +63 -57
  13. package/dist/cjs/verdocs-field-attachment.cjs.entry.js +2 -2
  14. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
  15. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
  16. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
  18. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
  20. package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
  21. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -2
  23. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
  24. package/dist/cjs/verdocs-pagination_3.cjs.entry.js +6 -7
  25. package/dist/cjs/verdocs-preview.cjs.entry.js +2 -2
  26. package/dist/cjs/verdocs-send.cjs.entry.js +2 -2
  27. package/dist/cjs/verdocs-sign.cjs.entry.js +7 -7
  28. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +2 -2
  29. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
  30. package/dist/cjs/verdocs-templates-list.cjs.entry.js +15 -6
  31. package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
  32. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  33. package/dist/collection/components/controls/verdocs-pagination/verdocs-pagination.js +4 -5
  34. package/dist/collection/components/controls/verdocs-pagination/verdocs-pagination.stories.js +1 -1
  35. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.css +15 -0
  36. package/dist/collection/components/controls/verdocs-text-input/verdocs-text-input.js +38 -3
  37. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +5 -5
  38. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +3 -3
  39. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.css +8 -2
  40. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +164 -80
  41. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +6 -2
  42. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +19 -7
  43. package/dist/components/Envelopes.js +15 -17
  44. package/dist/components/Permissions.js +3 -1
  45. package/dist/components/verdocs-envelopes-list.js +66 -58
  46. package/dist/components/verdocs-pagination2.js +4 -5
  47. package/dist/components/verdocs-sign.js +5 -5
  48. package/dist/components/verdocs-templates-list.js +17 -7
  49. package/dist/components/verdocs-text-input2.js +21 -3
  50. package/dist/docs.json +105 -32
  51. package/dist/esm/{EnvelopeStore-26315437.js → EnvelopeStore-ca60f0ab.js} +1 -1
  52. package/dist/esm/{Envelopes-9ccae245.js → Envelopes-5e32159f.js} +15 -17
  53. package/dist/esm/{Permissions-391258bd.js → Permissions-f2eb0421.js} +3 -1
  54. package/dist/esm/loader.js +1 -1
  55. package/dist/esm/{utils-a3504472.js → utils-51d998e2.js} +1 -1
  56. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  57. package/dist/esm/verdocs-checkbox_5.entry.js +20 -3
  58. package/dist/esm/verdocs-contact-picker.entry.js +2 -2
  59. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  60. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  61. package/dist/esm/verdocs-envelope-sidebar.entry.js +3 -3
  62. package/dist/esm/verdocs-envelopes-list.entry.js +63 -57
  63. package/dist/esm/verdocs-field-attachment.entry.js +2 -2
  64. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  65. package/dist/esm/verdocs-field-date.entry.js +2 -2
  66. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  67. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  68. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  69. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  70. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  71. package/dist/esm/verdocs-field-textarea.entry.js +2 -2
  72. package/dist/esm/verdocs-field-textbox.entry.js +2 -2
  73. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  74. package/dist/esm/verdocs-pagination_3.entry.js +6 -7
  75. package/dist/esm/verdocs-preview.entry.js +2 -2
  76. package/dist/esm/verdocs-send.entry.js +2 -2
  77. package/dist/esm/verdocs-sign.entry.js +7 -7
  78. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  79. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  80. package/dist/esm/verdocs-templates-list.entry.js +15 -6
  81. package/dist/esm/verdocs-view.entry.js +3 -3
  82. package/dist/esm/verdocs-web-sdk.js +1 -1
  83. package/dist/esm-es5/{EnvelopeStore-26315437.js → EnvelopeStore-ca60f0ab.js} +1 -1
  84. package/dist/esm-es5/Envelopes-5e32159f.js +1 -0
  85. package/dist/esm-es5/loader.js +1 -1
  86. package/dist/esm-es5/{utils-a3504472.js → utils-51d998e2.js} +1 -1
  87. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  107. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  108. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  112. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  113. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  114. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +6 -0
  115. package/dist/types/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.d.ts +40 -13
  116. package/dist/types/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.d.ts +2 -2
  117. package/dist/types/components/templates/verdocs-templates-list/verdocs-templates-list.d.ts +3 -1
  118. package/dist/types/components.d.ts +51 -19
  119. package/dist/types/utils/utils.d.ts +2 -2
  120. package/dist/verdocs-web-sdk/{p-10a58bc0.system.entry.js → p-01ec9d6d.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-761cd04f.entry.js → p-0331a582.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-13da9776.system.entry.js → p-043eab3f.system.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-3ff21704.system.entry.js → p-06e445b1.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-6ce6c81f.entry.js → p-0d590026.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/{p-d339db07.system.entry.js → p-0e08012c.system.entry.js} +1 -1
  126. package/dist/verdocs-web-sdk/p-11e34f77.system.js +1 -0
  127. package/dist/verdocs-web-sdk/{p-d1020e11.system.js → p-169fa979.system.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-32d173cf.system.entry.js → p-19860fa1.system.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/{p-5e3559ff.entry.js → p-1d7846c9.entry.js} +1 -1
  130. package/dist/verdocs-web-sdk/{p-7d9d22d9.system.entry.js → p-205b6235.system.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/p-28b22c54.system.entry.js +1 -0
  132. package/dist/verdocs-web-sdk/{p-c98dc1dc.entry.js → p-2ea70113.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/p-31211dfc.entry.js +1 -0
  134. package/dist/verdocs-web-sdk/{p-02bda176.system.js → p-353d7e71.system.js} +1 -1
  135. package/dist/verdocs-web-sdk/{p-67a4588a.system.entry.js → p-37c09dd4.system.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/p-38d827d3.js +1 -0
  137. package/dist/verdocs-web-sdk/{p-e23b9c03.entry.js → p-3a7d47ba.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-aa637390.js → p-3dac1048.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-bd287aad.entry.js → p-42efc13c.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-86433cb0.js → p-449f38bb.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-e36f0402.entry.js → p-4911d1f9.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-a5239b05.entry.js → p-4b0a633d.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/p-4c9d9cd6.entry.js +1 -0
  144. package/dist/verdocs-web-sdk/{p-3b1bef0f.system.entry.js → p-4f0c253e.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-53447ca3.system.entry.js → p-5314386f.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-543d12af.system.entry.js → p-54e215c5.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-0ec94d1b.system.entry.js → p-5cb78c1b.system.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/{p-08c75409.system.entry.js → p-5d6c7546.system.entry.js} +1 -1
  149. package/dist/verdocs-web-sdk/{p-43d78f20.entry.js → p-607a2dfe.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  151. package/dist/verdocs-web-sdk/{p-e6616a5e.entry.js → p-675c95e8.entry.js} +1 -1
  152. package/dist/verdocs-web-sdk/p-68487ce7.system.entry.js +1 -0
  153. package/dist/verdocs-web-sdk/{p-466ae9b3.system.entry.js → p-6cd5db91.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-5464c8f3.system.entry.js → p-750b37cd.system.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-0100e5cd.entry.js → p-752fe35b.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-4e60b427.entry.js → p-7d6c3d5b.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/p-80843a19.entry.js +1 -0
  158. package/dist/verdocs-web-sdk/{p-71cce1d5.entry.js → p-8e83ea1e.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-bbdb47e7.entry.js → p-a00ea81e.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/p-a7d7ccc7.system.entry.js +1 -0
  161. package/dist/verdocs-web-sdk/{p-e749e4b8.entry.js → p-aac295bd.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/{p-e16eedbd.entry.js → p-b48a2f14.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/p-b4ac7a21.entry.js +1 -0
  164. package/dist/verdocs-web-sdk/{p-689fc011.system.entry.js → p-b4aefba1.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-890cd7fd.system.entry.js → p-b650d3c1.system.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/{p-f26a6d84.system.entry.js → p-bf8bded0.system.entry.js} +1 -1
  167. package/dist/verdocs-web-sdk/{p-704b515e.system.entry.js → p-c125f51e.system.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-00b90b95.system.entry.js → p-c2e3d476.system.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/p-c391fa41.entry.js +1 -0
  170. package/dist/verdocs-web-sdk/{p-8dbb3599.system.entry.js → p-c69b5a99.system.entry.js} +1 -1
  171. package/dist/verdocs-web-sdk/{p-cbefbfda.entry.js → p-cd92a456.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-369ea745.entry.js → p-cef5dd3e.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-5567acac.entry.js → p-e2d0d0cc.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-94f811f6.system.entry.js → p-f05e18ba.system.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-b8ba7838.entry.js → p-f8a2988e.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-6785d5ea.system.entry.js → p-fb9b8d32.system.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/{p-d08dde38.entry.js → p-fd059523.entry.js} +1 -1
  178. package/dist/verdocs-web-sdk/{p-00229e30.system.entry.js → p-ff2d4284.system.entry.js} +1 -1
  179. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  180. package/package.json +2 -2
  181. package/dist/esm-es5/Envelopes-9ccae245.js +0 -1
  182. package/dist/verdocs-web-sdk/p-0b0a2fbd.system.js +0 -1
  183. package/dist/verdocs-web-sdk/p-1708f25d.entry.js +0 -1
  184. package/dist/verdocs-web-sdk/p-3a0ba0b8.entry.js +0 -1
  185. package/dist/verdocs-web-sdk/p-657dacc4.system.entry.js +0 -1
  186. package/dist/verdocs-web-sdk/p-70ca15f7.system.entry.js +0 -1
  187. package/dist/verdocs-web-sdk/p-b288f867.system.entry.js +0 -1
  188. package/dist/verdocs-web-sdk/p-b5591ddc.js +0 -1
  189. package/dist/verdocs-web-sdk/p-d6941876.entry.js +0 -1
  190. package/dist/verdocs-web-sdk/p-e2ef1a46.entry.js +0 -1
  191. package/dist/verdocs-web-sdk/p-e81819d8.entry.js +0 -1
  192. /package/dist/esm-es5/{Permissions-391258bd.js → Permissions-f2eb0421.js} +0 -0
  193. /package/dist/verdocs-web-sdk/{p-65e7b32a.system.js → p-1d60151a.system.js} +0 -0
  194. /package/dist/verdocs-web-sdk/{p-beb02ef7.js → p-29f64c27.js} +0 -0
@@ -315,10 +315,10 @@ export class VerdocsSign {
315
315
  this.isDone = true;
316
316
  // TODO: This is a temporary hack. After submitting, if we immediately show the View component it won't have re-renedered the
317
317
  // pages yet with our submitted data.
318
- setTimeout(() => {
319
- console.log('[SIGN] Reloading');
320
- window.location.reload();
321
- }, 1000);
318
+ // setTimeout(() => {
319
+ // console.log('[SIGN] Reloading');
320
+ // window.location.reload();
321
+ // }, 250);
322
322
  }
323
323
  catch (e) {
324
324
  console.log('[SIGN] Error submitting', e);
@@ -454,7 +454,7 @@ export class VerdocsSign {
454
454
  this.isDone = true;
455
455
  } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null)))));
456
456
  }
457
- return (h(Host, { class: { agreed: this.agreed } }, !this.agreed && !this.finishLater && (h("div", { class: "intro" }, h("div", { class: "inner" }, "Please review and act on these documents."))), h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, !this.agreed ? (h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "I agree to use electronic records and signatures.", onInput: () => this.handleClickAgree() }))) : (h(Fragment, null, 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) }))), !this.agreed ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }), h("div", { class: "document", style: { paddingTop: this.headerTargetId ? '70px' : '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
457
+ return (h(Host, { class: { agreed: this.agreed } }, !this.agreed && !this.finishLater && (h("div", { class: "intro" }, h("div", { class: "inner" }, "Please review and act on these documents."))), h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, !this.agreed ? (h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "I agree to use electronic records and signatures.", onInput: () => this.handleClickAgree() }))) : (h(Fragment, null, 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) }))), !this.agreed && h("div", { class: "cover" }), h("div", { class: "document", style: { paddingTop: this.headerTargetId ? '70px' : '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
458
458
  const pageNumbers = integerSequence(1, envelopeDocument.page_numbers);
459
459
  return (h(Fragment, null, pageNumbers.map(pageNumber => {
460
460
  // In signing mode we show the original template page with all the recipient fields so we can show source formatting and
@@ -3,9 +3,9 @@ export default {
3
3
  title: 'Embeds/Sign',
4
4
  component: 'verdocs-sign',
5
5
  args: {
6
- envelopeId: '1dbb69bd-5d0d-4678-978d-962dd0775aaa',
7
- roleId: 'Recipient 1',
8
- inviteCode: '203d4d671b40db359e92a14fa54c1c3a',
6
+ envelopeId: '',
7
+ roleId: '',
8
+ inviteCode: '',
9
9
  },
10
10
  argTypes: {
11
11
  envelopeId: {
@@ -5,10 +5,16 @@ verdocs-envelopes-list {
5
5
  flex-wrap: nowrap;
6
6
  border-radius: 6px;
7
7
  color: #33364b;
8
- align-items: center;
9
8
  flex-direction: column;
10
9
  font-family: "Inter", "Barlow", sans-serif;
11
10
  }
11
+ verdocs-envelopes-list .envelope-placeholder {
12
+ height: 48px;
13
+ flex: 0 0 48px;
14
+ margin: 5px 0;
15
+ border-radius: 5px;
16
+ background: #f5f5fa;
17
+ }
12
18
  verdocs-envelopes-list .header {
13
19
  width: 100%;
14
20
  row-gap: 4px;
@@ -20,7 +26,7 @@ verdocs-envelopes-list .header {
20
26
  flex-direction: row;
21
27
  }
22
28
  verdocs-envelopes-list .header .filter {
23
- width: 150px;
29
+ width: 300px;
24
30
  }
25
31
  verdocs-envelopes-list .header verdocs-text-input {
26
32
  margin: 0;
@@ -1,7 +1,8 @@
1
1
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
2
2
  import { Envelopes } from '@verdocs/js-sdk/Envelopes';
3
- import { Host, h } from '@stencil/core';
3
+ import { integerSequence } from '@verdocs/js-sdk/Utils/Primitives';
4
4
  import { cancelEnvelope } from '@verdocs/js-sdk/Envelopes/Envelopes';
5
+ import { Host, h } from '@stencil/core';
5
6
  import { getRecipientsWithActions, userCanAct, userCanCancelEnvelope } from '@verdocs/js-sdk/Envelopes/Permissions';
6
7
  import { saveEnvelopesAsZip } from '../../../utils/utils';
7
8
  import { VerdocsToast } from '../../../utils/Toast';
@@ -38,11 +39,13 @@ export class VerdocsEnvelopesList {
38
39
  this.endpoint = VerdocsEndpoint.getDefault();
39
40
  this.view = undefined;
40
41
  this.status = 'all';
41
- this.sort = 'updated_at';
42
- this.name = '';
43
- this.containing = '';
42
+ this.sort = 'created_at';
43
+ this.match = '';
44
+ this.showPagination = true;
45
+ this.rowsPerPage = 10;
44
46
  this.selectedPage = 0;
45
47
  this.count = 0;
48
+ this.initiallyLoaded = false;
46
49
  this.loading = true;
47
50
  this.selectedEnvelopes = [];
48
51
  this.envelopes = [];
@@ -56,12 +59,13 @@ export class VerdocsEnvelopesList {
56
59
  handleSortUpdated() {
57
60
  return this.queryEnvelopes();
58
61
  }
59
- handleNameUpdated() {
60
- return this.queryEnvelopes();
61
- }
62
- handleContainingUpdated() {
62
+ handleMatchUpdated() {
63
63
  return this.queryEnvelopes();
64
64
  }
65
+ // @Watch('containing')
66
+ // handleContainingUpdated() {
67
+ // return this.queryEnvelopes();
68
+ // }
65
69
  handlePageUpdated() {
66
70
  return this.queryEnvelopes();
67
71
  }
@@ -71,30 +75,34 @@ export class VerdocsEnvelopesList {
71
75
  console.log('[ENVELOPES] Must be authenticated');
72
76
  return;
73
77
  }
74
- return this.queryEnvelopes();
78
+ }
79
+ async componentDidLoad() {
80
+ await this.queryEnvelopes();
81
+ this.initiallyLoaded = true;
75
82
  }
76
83
  async queryEnvelopes() {
77
84
  var _a, _b, _c;
78
85
  try {
79
86
  this.loading = true;
80
87
  let queryParams = {
81
- page: this.selectedPage + 1,
82
- limit: 10,
88
+ page: this.selectedPage,
89
+ sort: this.sort,
90
+ rows: this.rowsPerPage,
83
91
  };
84
92
  switch (this.view) {
85
93
  case 'all':
86
94
  queryParams = {
87
95
  ...queryParams,
88
- sort_by: this.sort,
89
- ascending: this.sort === 'envelope_name',
90
- envelope_status: (this.status === 'all' ? ['pending', 'in progress', 'complete', 'declined', 'canceled'] : [this.status]),
96
+ sort: this.sort,
97
+ direction: this.sort === 'name' ? 'asc' : 'desc',
98
+ status: (this.status === 'all' ? ['pending', 'in progress', 'complete', 'declined', 'canceled'] : [this.status]),
91
99
  };
92
100
  break;
93
101
  case 'inbox':
94
102
  queryParams = {
95
103
  ...queryParams,
96
104
  is_recipient: true,
97
- sort_by: 'updated_at',
105
+ sort: 'updated_at',
98
106
  recipient_status: ['invited', 'declined', 'opened', 'signed', 'submitted', 'canceled'],
99
107
  };
100
108
  break;
@@ -102,15 +110,15 @@ export class VerdocsEnvelopesList {
102
110
  queryParams = {
103
111
  ...queryParams,
104
112
  is_owner: true,
105
- sort_by: 'updated_at',
113
+ sort: 'updated_at',
106
114
  };
107
115
  break;
108
116
  case 'action':
109
117
  queryParams = {
110
118
  ...queryParams,
111
- sort_by: 'updated_at',
119
+ sort: 'updated_at',
112
120
  is_recipient: true,
113
- envelope_status: ['pending', 'in progress'],
121
+ status: ['pending', 'in progress'],
114
122
  recipient_status: ['invited', 'opened', 'signed'],
115
123
  };
116
124
  break;
@@ -118,25 +126,25 @@ export class VerdocsEnvelopesList {
118
126
  queryParams = {
119
127
  ...queryParams,
120
128
  is_owner: true,
121
- sort_by: 'updated_at',
122
- ascending: false,
123
- envelope_status: ['pending', 'in progress'],
129
+ sort: 'updated_at',
130
+ direction: 'desc',
131
+ status: ['pending', 'in progress'],
124
132
  };
125
133
  break;
126
134
  case 'completed':
127
135
  queryParams = {
128
136
  ...queryParams,
129
- sort_by: 'updated_at',
130
- ascending: false,
131
- envelope_status: ['complete'],
137
+ sort: 'updated_at',
138
+ direction: 'desc',
139
+ status: ['complete'],
132
140
  };
133
141
  break;
134
142
  default:
135
143
  queryParams = {
136
144
  ...queryParams,
137
- sort_by: 'updated_at',
138
- ascending: false,
139
- envelope_status: (this.status === 'all' ? ['pending', 'in progress', 'complete', 'declined', 'canceled'] : [this.status]),
145
+ sort: 'updated_at',
146
+ direction: 'desc',
147
+ status: (this.status === 'all' ? ['pending', 'in progress', 'complete', 'declined', 'canceled'] : [this.status]),
140
148
  };
141
149
  }
142
150
  // These filters should only be applied in "View All" mode. Otherwise the user could have set them to something
@@ -144,27 +152,27 @@ export class VerdocsEnvelopesList {
144
152
  // would never return anything).
145
153
  if (this.view === 'all') {
146
154
  if (this.status !== 'all') {
147
- queryParams.envelope_status = [this.status];
155
+ queryParams.status = [this.status];
148
156
  }
149
157
  }
150
158
  if (this.sort !== 'updated_at') {
151
- queryParams.sort_by = this.sort;
152
- queryParams.ascending = this.sort === 'envelope_name';
159
+ queryParams.sort = this.sort;
160
+ queryParams.direction = this.sort === 'name' ? 'asc' : 'desc';
153
161
  }
154
- if (this.name.trim()) {
155
- queryParams.name = this.name.trim();
162
+ if (this.match.trim()) {
163
+ queryParams.match = this.match.trim();
156
164
  }
157
- if (this.containing.trim()) {
158
- queryParams.text_field_value = this.containing.trim();
159
- }
160
- const response = await Envelopes.searchEnvelopes(this.endpoint, queryParams);
161
- this.envelopes = response.result;
165
+ // if (this.containing.trim()) {
166
+ // queryParams.field_value = this.containing.trim();
167
+ // }
168
+ const response = await Envelopes.listEnvelopes(this.endpoint, queryParams);
169
+ this.envelopes = response.records;
162
170
  this.count = response.total;
163
171
  this.loading = false;
164
172
  }
165
173
  catch (e) {
166
- console.log('[ENVELOPES] Error with preview session', e);
167
- this.loading = true;
174
+ this.loading = false;
175
+ console.log('[ENVELOPES] Error listing envelopes', e);
168
176
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
169
177
  }
170
178
  }
@@ -185,22 +193,18 @@ export class VerdocsEnvelopesList {
185
193
  });
186
194
  }
187
195
  render() {
188
- return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.name, autocomplete: "off", placeholder: "Filter by Name...", onFocusout: (e) => {
189
- this.name = e.target.value;
190
- return this.queryEnvelopes();
196
+ return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.match, clearable: true, autocomplete: "off", placeholder: "Filter by Name, Recipient, or Field...", onFocusout: (e) => {
197
+ var _a;
198
+ // We don't locally filter envelopes because there are too many fields to match against efficiently.
199
+ this.match = e.target.value.trim();
200
+ (_a = this.changeMatch) === null || _a === void 0 ? void 0 : _a.emit(this.match);
191
201
  } })), h("verdocs-quick-filter", { label: "View", value: this.view, options: ViewFilters, onOptionSelected: e => {
192
202
  this.view = e.detail.value;
193
- return this.queryEnvelopes();
194
203
  } }), this.view === 'all' && (h("verdocs-quick-filter", { label: "Status", value: this.status, options: StatusFilters, onOptionSelected: e => {
195
204
  this.status = e.detail.value;
196
- return this.queryEnvelopes();
197
205
  } })), this.view === 'all' && (h("verdocs-quick-filter", { label: "Sort By", value: this.sort, options: SortFilters, onOptionSelected: e => {
198
206
  this.sort = e.detail.value;
199
- return this.queryEnvelopes();
200
- } })), h("div", { class: "containing" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-containing", value: this.containing, autocomplete: "off", placeholder: "Fields Containing...", onInput: (e) => {
201
- this.containing = e.target.value;
202
- return this.queryEnvelopes();
203
- } }))), this.loading && h("verdocs-spinner", { mode: "dark", size: 24 }), h("div", { style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
207
+ } })), this.loading && h("verdocs-spinner", { mode: "dark", size: 24 }), h("div", { style: { display: 'flex', flex: '1' } }), this.selectedEnvelopes.length > 0 && h("verdocs-button", { label: `Download (${this.selectedEnvelopes.length})`, onClick: () => this.handleDownload() })), this.envelopes.map(envelope => {
204
208
  var _a;
205
209
  const recipientsWithActions = getRecipientsWithActions(envelope);
206
210
  const userCanCancel = userCanCancelEnvelope(this.endpoint.session, envelope);
@@ -240,10 +244,9 @@ export class VerdocsEnvelopesList {
240
244
  break;
241
245
  }
242
246
  } }))));
243
- }), !this.loading && !this.envelopes.length ? (h("div", { class: "empty-text" }, "No matching envelopes found. Please adjust your filters and try again.")) : (h("div", { style: { marginTop: '10px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: 10, itemCount: this.count, onSelectPage: e => {
247
+ }), !this.initiallyLoaded && (h("div", { style: { width: '100%' } }, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "envelope-placeholder" }))))), this.initiallyLoaded && !this.envelopes.length && h("div", { 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 => {
244
248
  this.selectedPage = e.detail.selectedPage;
245
- return this.queryEnvelopes();
246
- } })))));
249
+ } }))) : (h("div", null))));
247
250
  }
248
251
  static get is() { return "verdocs-envelopes-list"; }
249
252
  static get originalStyleUrls() {
@@ -324,8 +327,8 @@ export class VerdocsEnvelopesList {
324
327
  "type": "string",
325
328
  "mutable": true,
326
329
  "complexType": {
327
- "original": "'created_at' | 'updated_at' | 'envelope_name' | 'canceled_at' | 'envelope_status'",
328
- "resolved": "\"canceled_at\" | \"created_at\" | \"envelope_name\" | \"envelope_status\" | \"updated_at\"",
330
+ "original": "'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status'",
331
+ "resolved": "\"canceled_at\" | \"created_at\" | \"name\" | \"status\" | \"updated_at\"",
329
332
  "references": {}
330
333
  },
331
334
  "required": false,
@@ -336,9 +339,9 @@ export class VerdocsEnvelopesList {
336
339
  },
337
340
  "attribute": "sort",
338
341
  "reflect": true,
339
- "defaultValue": "'updated_at'"
342
+ "defaultValue": "'created_at'"
340
343
  },
341
- "name": {
344
+ "match": {
342
345
  "type": "string",
343
346
  "mutable": true,
344
347
  "complexType": {
@@ -350,33 +353,51 @@ export class VerdocsEnvelopesList {
350
353
  "optional": false,
351
354
  "docs": {
352
355
  "tags": [],
353
- "text": "If set, filter envelopes by the specified name."
356
+ "text": "If set, filter envelopes by the specified string."
354
357
  },
355
- "attribute": "name",
358
+ "attribute": "match",
356
359
  "reflect": true,
357
360
  "defaultValue": "''"
358
361
  },
359
- "containing": {
360
- "type": "string",
361
- "mutable": true,
362
+ "showPagination": {
363
+ "type": "boolean",
364
+ "mutable": false,
362
365
  "complexType": {
363
- "original": "string",
364
- "resolved": "string",
366
+ "original": "boolean",
367
+ "resolved": "boolean",
365
368
  "references": {}
366
369
  },
367
370
  "required": false,
368
371
  "optional": false,
369
372
  "docs": {
370
373
  "tags": [],
371
- "text": "If set, filter envelopes by the specified \"containing\" value."
374
+ "text": "Whether or not pagination should be enabled."
372
375
  },
373
- "attribute": "containing",
374
- "reflect": true,
375
- "defaultValue": "''"
376
+ "attribute": "show-pagination",
377
+ "reflect": false,
378
+ "defaultValue": "true"
379
+ },
380
+ "rowsPerPage": {
381
+ "type": "number",
382
+ "mutable": false,
383
+ "complexType": {
384
+ "original": "number",
385
+ "resolved": "number",
386
+ "references": {}
387
+ },
388
+ "required": false,
389
+ "optional": false,
390
+ "docs": {
391
+ "tags": [],
392
+ "text": "The number of rows to display per page."
393
+ },
394
+ "attribute": "rows-per-page",
395
+ "reflect": false,
396
+ "defaultValue": "10"
376
397
  },
377
398
  "selectedPage": {
378
399
  "type": "number",
379
- "mutable": true,
400
+ "mutable": false,
380
401
  "complexType": {
381
402
  "original": "number",
382
403
  "resolved": "number",
@@ -389,7 +410,7 @@ export class VerdocsEnvelopesList {
389
410
  "text": "The initial page number to select. Pagination is internally controlled but may be overriden by the\nhost applicaiton."
390
411
  },
391
412
  "attribute": "selected-page",
392
- "reflect": true,
413
+ "reflect": false,
393
414
  "defaultValue": "0"
394
415
  }
395
416
  };
@@ -397,6 +418,7 @@ export class VerdocsEnvelopesList {
397
418
  static get states() {
398
419
  return {
399
420
  "count": {},
421
+ "initiallyLoaded": {},
400
422
  "loading": {},
401
423
  "selectedEnvelopes": {},
402
424
  "envelopes": {}
@@ -404,6 +426,71 @@ export class VerdocsEnvelopesList {
404
426
  }
405
427
  static get events() {
406
428
  return [{
429
+ "method": "changeView",
430
+ "name": "changeView",
431
+ "bubbles": true,
432
+ "cancelable": true,
433
+ "composed": true,
434
+ "docs": {
435
+ "tags": [],
436
+ "text": "Event fired when the user changes their view. Host applications can use this to save the user's preferences."
437
+ },
438
+ "complexType": {
439
+ "original": "'all' | 'inbox' | 'sent' | 'completed' | 'action' | 'waiting'",
440
+ "resolved": "\"action\" | \"all\" | \"completed\" | \"inbox\" | \"sent\" | \"waiting\"",
441
+ "references": {}
442
+ }
443
+ }, {
444
+ "method": "changeStatus",
445
+ "name": "changeStatus",
446
+ "bubbles": true,
447
+ "cancelable": true,
448
+ "composed": true,
449
+ "docs": {
450
+ "tags": [],
451
+ "text": "Event fired when the user changes their status filter. Host applications can use this to save the user's preferences."
452
+ },
453
+ "complexType": {
454
+ "original": "TEnvelopeStatus | 'all'",
455
+ "resolved": "\"all\" | \"canceled\" | \"complete\" | \"declined\" | \"in progress\" | \"pending\"",
456
+ "references": {
457
+ "TEnvelopeStatus": {
458
+ "location": "import",
459
+ "path": "@verdocs/js-sdk/Envelopes/Types"
460
+ }
461
+ }
462
+ }
463
+ }, {
464
+ "method": "changeSort",
465
+ "name": "changeSort",
466
+ "bubbles": true,
467
+ "cancelable": true,
468
+ "composed": true,
469
+ "docs": {
470
+ "tags": [],
471
+ "text": "Event fired when the user changes their sort order. Host applications can use this to save the user's preferences."
472
+ },
473
+ "complexType": {
474
+ "original": "'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status'",
475
+ "resolved": "\"canceled_at\" | \"created_at\" | \"name\" | \"status\" | \"updated_at\"",
476
+ "references": {}
477
+ }
478
+ }, {
479
+ "method": "changeMatch",
480
+ "name": "changeMatch",
481
+ "bubbles": true,
482
+ "cancelable": true,
483
+ "composed": true,
484
+ "docs": {
485
+ "tags": [],
486
+ "text": "Event fired when the user changes the match filter. This is fired for every inputChange event (every character\ntyped). This event is provided for balance with the other events, but host applications should generally not\nsave this value. Users might appreciate applications remembering their sorting or filtering preferences, but\nprobably not their search terms."
487
+ },
488
+ "complexType": {
489
+ "original": "string",
490
+ "resolved": "string",
491
+ "references": {}
492
+ }
493
+ }, {
407
494
  "method": "sdkError",
408
495
  "name": "sdkError",
409
496
  "bubbles": true,
@@ -434,14 +521,14 @@ export class VerdocsEnvelopesList {
434
521
  "text": "Event fired when the user clicks an activity entry. Typically the host application will use this to navigate\nto the envelope detail view."
435
522
  },
436
523
  "complexType": {
437
- "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelope}",
438
- "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelope; }",
524
+ "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary}",
525
+ "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary; }",
439
526
  "references": {
440
527
  "VerdocsEndpoint": {
441
528
  "location": "import",
442
529
  "path": "@verdocs/js-sdk"
443
530
  },
444
- "IEnvelope": {
531
+ "IEnvelopeSummary": {
445
532
  "location": "import",
446
533
  "path": "@verdocs/js-sdk/Envelopes/Types"
447
534
  }
@@ -458,14 +545,14 @@ export class VerdocsEnvelopesList {
458
545
  "text": "Event fired when the user clicks to finish signing later. Typically the host application should redirect\nthe user to another page."
459
546
  },
460
547
  "complexType": {
461
- "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelope}",
462
- "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelope; }",
548
+ "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary}",
549
+ "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary; }",
463
550
  "references": {
464
551
  "VerdocsEndpoint": {
465
552
  "location": "import",
466
553
  "path": "@verdocs/js-sdk"
467
554
  },
468
- "IEnvelope": {
555
+ "IEnvelopeSummary": {
469
556
  "location": "import",
470
557
  "path": "@verdocs/js-sdk/Envelopes/Types"
471
558
  }
@@ -484,11 +571,8 @@ export class VerdocsEnvelopesList {
484
571
  "propName": "sort",
485
572
  "methodName": "handleSortUpdated"
486
573
  }, {
487
- "propName": "name",
488
- "methodName": "handleNameUpdated"
489
- }, {
490
- "propName": "containing",
491
- "methodName": "handleContainingUpdated"
574
+ "propName": "match",
575
+ "methodName": "handleMatchUpdated"
492
576
  }, {
493
577
  "propName": "selectedPage",
494
578
  "methodName": "handlePageUpdated"
@@ -323,12 +323,16 @@ export class VerdocsStatusIndicator {
323
323
  "type": "unknown",
324
324
  "mutable": false,
325
325
  "complexType": {
326
- "original": "IEnvelope",
327
- "resolved": "IEnvelope",
326
+ "original": "IEnvelope | IEnvelopeSummary",
327
+ "resolved": "IEnvelope | IEnvelopeSummary",
328
328
  "references": {
329
329
  "IEnvelope": {
330
330
  "location": "import",
331
331
  "path": "@verdocs/js-sdk/Envelopes/Types"
332
+ },
333
+ "IEnvelopeSummary": {
334
+ "location": "import",
335
+ "path": "@verdocs/js-sdk/Envelopes/Types"
332
336
  }
333
337
  }
334
338
  },
@@ -2,8 +2,8 @@ import { format } from 'date-fns';
2
2
  import { VerdocsEndpoint } from '@verdocs/js-sdk';
3
3
  import { Templates } from '@verdocs/js-sdk/Templates';
4
4
  import { integerSequence } from '@verdocs/js-sdk/Utils/Primitives';
5
- import { TemplateActions } from '@verdocs/js-sdk/Templates/Types';
6
5
  import { h, Host } from '@stencil/core';
6
+ import { TemplateActions } from '@verdocs/js-sdk/Templates/Types';
7
7
  import { SDKError } from '../../../utils/errors';
8
8
  const GlobeAltIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>`;
9
9
  const LockClosedIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>`;
@@ -72,6 +72,7 @@ export class VerdocsTemplatesList {
72
72
  this.loading = true;
73
73
  this.confirmDelete = null;
74
74
  this.templates = [];
75
+ this.localNameFilter = '';
75
76
  }
76
77
  handleSharingUpdated() {
77
78
  return this.queryTemplates();
@@ -85,6 +86,9 @@ export class VerdocsTemplatesList {
85
86
  handleNameUpdated() {
86
87
  return this.queryTemplates();
87
88
  }
89
+ handlePageUpdated() {
90
+ return this.queryTemplates();
91
+ }
88
92
  componentWillLoad() {
89
93
  this.endpoint.loadSession();
90
94
  if (!this.endpoint.session) {
@@ -118,7 +122,8 @@ export class VerdocsTemplatesList {
118
122
  this.loading = false;
119
123
  }
120
124
  catch (e) {
121
- console.log('[TEMPLATES] Error with preview session', e);
125
+ this.loading = false;
126
+ console.log('[TEMPLATES] Error listing templates', e);
122
127
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
123
128
  }
124
129
  }
@@ -138,9 +143,13 @@ export class VerdocsTemplatesList {
138
143
  });
139
144
  }
140
145
  render() {
141
- return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.name, autocomplete: "off", placeholder: "Filter by Name...", onFocusout: (e) => {
146
+ // In addition to the server query we also filter locally. This provides a faster UI update
147
+ // while the onBlur re-queries the server for any new records that now qualify by the filter.
148
+ const locallyFilteredTemplates = !this.localNameFilter ? this.templates : this.templates.filter(t => t.name.toLowerCase().includes(this.localNameFilter.toLowerCase()));
149
+ return (h(Host, null, h("div", { class: "header" }, h("div", { class: "filter" }, h("verdocs-text-input", { id: "verdocs-filter-name", value: this.name, clearable: true, autocomplete: "off", placeholder: "Filter by Name...", onInput: (e) => (this.localNameFilter = e.target.value.trim()), onFocusout: (e) => {
142
150
  var _a;
143
- this.name = e.target.value;
151
+ this.name = e.target.value.trim();
152
+ this.localNameFilter = e.target.value.trim();
144
153
  (_a = this.changeName) === null || _a === void 0 ? void 0 : _a.emit(this.name);
145
154
  } })), h("verdocs-quick-filter", { label: "Sharing", value: this.sharing, options: SharingFilters, onOptionSelected: e => {
146
155
  var _a;
@@ -154,7 +163,7 @@ export class VerdocsTemplatesList {
154
163
  var _a;
155
164
  this.sort = e.detail.value;
156
165
  (_a = this.changeSort) === null || _a === void 0 ? void 0 : _a.emit(this.sort);
157
- } }), this.loading && h("verdocs-spinner", { mode: "dark", size: 24 }), h("div", { style: { display: 'flex', flex: '1' } })), this.templates.map(template => {
166
+ } }), this.loading && h("verdocs-spinner", { mode: "dark", size: 24 }), h("div", { style: { display: 'flex', flex: '1' } })), locallyFilteredTemplates.map(template => {
158
167
  const dateToShow = this.sort === 'created_at' ? 'created_at' : this.sort === 'updated_at' ? 'updated_at' : 'last_used_at';
159
168
  const date = template[dateToShow];
160
169
  const MENU_OPTIONS = [];
@@ -192,7 +201,6 @@ export class VerdocsTemplatesList {
192
201
  } }, h("div", { class: "inner" }, h("verdocs-template-star", { template: template, endpoint: this.endpoint }), h("div", { class: "spacer icon-spacer" }), h("div", { class: "name" }, template.name), h("div", { class: "spacer usage-spacer" }), h("div", { class: "usage" }, h("span", { innerHTML: EnvelopeIcon, title: "Usage Counter" }), template.counter || '--'), h("div", { class: "spacer last-used-spacer" }), h("div", { class: "last-used" }, dateToShow === 'created_at' && h("span", { innerHTML: CreatedIcon, title: "Created" }), dateToShow === 'updated_at' && h("span", { innerHTML: UpdatedIcon, title: "Last Updated" }), dateToShow === 'last_used_at' && h("span", { innerHTML: LastUsedIcon, title: "Last Used" }), date ? format(new Date(date), 'P') : 'Never'), h("div", { class: "spacer ownership-spacer" }), template.is_public && (h("div", { class: "ownership" }, h("span", { innerHTML: GlobeAltIcon }), " Public")), !template.is_public && !template.is_personal && (h("div", { class: "ownership" }, h("span", { innerHTML: LockClosedIcon }), " Private")), !template.is_public && template.is_personal && (h("div", { class: "ownership" }, h("span", { innerHTML: BuildingOfficeIcon }), " Shared")), h("verdocs-dropdown", { options: MENU_OPTIONS, onOptionSelected: e => this.handleOptionSelected(e.detail.id, template) }))));
193
202
  }), !this.initiallyLoaded && (h("div", null, integerSequence(0, this.rowsPerPage).map(() => (h("div", { class: "template-placeholder" }))))), this.initiallyLoaded && !this.templates.length && h("div", { class: "empty-text" }, "No matching templates found. Please adjust your filters and try again."), this.initiallyLoaded && this.templates.length && this.showPagination ? (h("div", { style: { marginTop: '20px' } }, h("verdocs-pagination", { selectedPage: this.selectedPage, perPage: this.rowsPerPage, itemCount: this.count, onSelectPage: e => {
194
203
  this.selectedPage = e.detail.selectedPage;
195
- return this.queryTemplates();
196
204
  } }))) : (h("div", null)), this.confirmDelete && (h("verdocs-ok-dialog", { heading: "Delete this Template?", message: "This operation cannot be undone.", onNext: () => this.deleteTemplate(this.confirmDelete), onExit: () => (this.confirmDelete = null), showCancel: true }))));
197
205
  }
198
206
  static get is() { return "verdocs-templates-list"; }
@@ -388,7 +396,8 @@ export class VerdocsTemplatesList {
388
396
  "initiallyLoaded": {},
389
397
  "loading": {},
390
398
  "confirmDelete": {},
391
- "templates": {}
399
+ "templates": {},
400
+ "localNameFilter": {}
392
401
  };
393
402
  }
394
403
  static get events() {
@@ -612,6 +621,9 @@ export class VerdocsTemplatesList {
612
621
  }, {
613
622
  "propName": "name",
614
623
  "methodName": "handleNameUpdated"
624
+ }, {
625
+ "propName": "selectedPage",
626
+ "methodName": "handlePageUpdated"
615
627
  }];
616
628
  }
617
629
  }