@verdocs/web-sdk 2.0.23 → 2.0.26

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 (191) 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 +66 -59
  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 +2 -2
  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/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.css +8 -2
  38. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +169 -84
  39. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +6 -2
  40. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +19 -7
  41. package/dist/components/Envelopes.js +15 -17
  42. package/dist/components/Permissions.js +3 -1
  43. package/dist/components/verdocs-envelopes-list.js +69 -60
  44. package/dist/components/verdocs-pagination2.js +4 -5
  45. package/dist/components/verdocs-templates-list.js +17 -7
  46. package/dist/components/verdocs-text-input2.js +21 -3
  47. package/dist/custom-elements.json +14 -6
  48. package/dist/docs.json +107 -34
  49. package/dist/esm/{EnvelopeStore-26315437.js → EnvelopeStore-ca60f0ab.js} +1 -1
  50. package/dist/esm/{Envelopes-9ccae245.js → Envelopes-5e32159f.js} +15 -17
  51. package/dist/esm/{Permissions-391258bd.js → Permissions-f2eb0421.js} +3 -1
  52. package/dist/esm/loader.js +1 -1
  53. package/dist/esm/{utils-a3504472.js → utils-51d998e2.js} +1 -1
  54. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  55. package/dist/esm/verdocs-checkbox_5.entry.js +20 -3
  56. package/dist/esm/verdocs-contact-picker.entry.js +2 -2
  57. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  58. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +3 -3
  59. package/dist/esm/verdocs-envelope-sidebar.entry.js +3 -3
  60. package/dist/esm/verdocs-envelopes-list.entry.js +66 -59
  61. package/dist/esm/verdocs-field-attachment.entry.js +2 -2
  62. package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
  63. package/dist/esm/verdocs-field-date.entry.js +2 -2
  64. package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
  65. package/dist/esm/verdocs-field-initial.entry.js +2 -2
  66. package/dist/esm/verdocs-field-payment.entry.js +2 -2
  67. package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
  68. package/dist/esm/verdocs-field-signature.entry.js +2 -2
  69. package/dist/esm/verdocs-field-textarea.entry.js +2 -2
  70. package/dist/esm/verdocs-field-textbox.entry.js +2 -2
  71. package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
  72. package/dist/esm/verdocs-pagination_3.entry.js +6 -7
  73. package/dist/esm/verdocs-preview.entry.js +2 -2
  74. package/dist/esm/verdocs-send.entry.js +2 -2
  75. package/dist/esm/verdocs-sign.entry.js +2 -2
  76. package/dist/esm/verdocs-template-document-page_2.entry.js +2 -2
  77. package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
  78. package/dist/esm/verdocs-templates-list.entry.js +15 -6
  79. package/dist/esm/verdocs-view.entry.js +3 -3
  80. package/dist/esm/verdocs-web-sdk.js +1 -1
  81. package/dist/esm-es5/{EnvelopeStore-26315437.js → EnvelopeStore-ca60f0ab.js} +1 -1
  82. package/dist/esm-es5/Envelopes-5e32159f.js +1 -0
  83. package/dist/esm-es5/loader.js +1 -1
  84. package/dist/esm-es5/{utils-a3504472.js → utils-51d998e2.js} +1 -1
  85. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  86. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-field-attachment.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  94. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  95. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  96. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  97. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  98. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  99. package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
  100. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  101. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  102. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  103. package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
  104. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  105. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  106. package/dist/esm-es5/verdocs-sign.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-fields_4.entry.js +1 -1
  109. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  110. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  111. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  112. package/dist/types/components/controls/verdocs-text-input/verdocs-text-input.d.ts +6 -0
  113. package/dist/types/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.d.ts +42 -16
  114. package/dist/types/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.d.ts +2 -2
  115. package/dist/types/components/templates/verdocs-templates-list/verdocs-templates-list.d.ts +3 -1
  116. package/dist/types/components.d.ts +52 -20
  117. package/dist/types/utils/utils.d.ts +2 -2
  118. package/dist/verdocs-web-sdk/{p-10a58bc0.system.entry.js → p-01ec9d6d.system.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/{p-761cd04f.entry.js → p-0331a582.entry.js} +1 -1
  120. package/dist/verdocs-web-sdk/{p-13da9776.system.entry.js → p-043eab3f.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/{p-3ff21704.system.entry.js → p-06e445b1.system.entry.js} +1 -1
  122. package/dist/verdocs-web-sdk/{p-6ce6c81f.entry.js → p-0d590026.entry.js} +1 -1
  123. package/dist/verdocs-web-sdk/{p-d339db07.system.entry.js → p-0e08012c.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/p-11e34f77.system.js +1 -0
  125. package/dist/verdocs-web-sdk/{p-d1020e11.system.js → p-169fa979.system.js} +1 -1
  126. package/dist/verdocs-web-sdk/{p-32d173cf.system.entry.js → p-19860fa1.system.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-5e3559ff.entry.js → p-1d7846c9.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-7d9d22d9.system.entry.js → p-205b6235.system.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/p-28b22c54.system.entry.js +1 -0
  130. package/dist/verdocs-web-sdk/{p-c98dc1dc.entry.js → p-2ea70113.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-54dc2f71.entry.js → p-31211dfc.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-02bda176.system.js → p-353d7e71.system.js} +1 -1
  133. package/dist/verdocs-web-sdk/{p-67a4588a.system.entry.js → p-37c09dd4.system.entry.js} +1 -1
  134. package/dist/verdocs-web-sdk/p-38d827d3.js +1 -0
  135. package/dist/verdocs-web-sdk/{p-e23b9c03.entry.js → p-3a7d47ba.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-aa637390.js → p-3dac1048.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-bd287aad.entry.js → p-42efc13c.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-86433cb0.js → p-449f38bb.js} +1 -1
  139. package/dist/verdocs-web-sdk/{p-e36f0402.entry.js → p-4911d1f9.entry.js} +1 -1
  140. package/dist/verdocs-web-sdk/{p-a5239b05.entry.js → p-4b0a633d.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/p-4c9d9cd6.entry.js +1 -0
  142. package/dist/verdocs-web-sdk/{p-3b1bef0f.system.entry.js → p-4f0c253e.system.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-53447ca3.system.entry.js → p-5314386f.system.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-543d12af.system.entry.js → p-54e215c5.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/{p-0ec94d1b.system.entry.js → p-5cb78c1b.system.entry.js} +1 -1
  146. package/dist/verdocs-web-sdk/{p-08c75409.system.entry.js → p-5d6c7546.system.entry.js} +1 -1
  147. package/dist/verdocs-web-sdk/{p-43d78f20.entry.js → p-607a2dfe.entry.js} +1 -1
  148. package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
  149. package/dist/verdocs-web-sdk/{p-e6616a5e.entry.js → p-675c95e8.entry.js} +1 -1
  150. package/dist/verdocs-web-sdk/p-68487ce7.system.entry.js +1 -0
  151. package/dist/verdocs-web-sdk/p-690a485e.system.entry.js +1 -0
  152. package/dist/verdocs-web-sdk/{p-466ae9b3.system.entry.js → p-6cd5db91.system.entry.js} +1 -1
  153. package/dist/verdocs-web-sdk/{p-5464c8f3.system.entry.js → p-750b37cd.system.entry.js} +1 -1
  154. package/dist/verdocs-web-sdk/{p-0100e5cd.entry.js → p-752fe35b.entry.js} +1 -1
  155. package/dist/verdocs-web-sdk/{p-4e60b427.entry.js → p-7d6c3d5b.entry.js} +1 -1
  156. package/dist/verdocs-web-sdk/{p-71cce1d5.entry.js → p-8e83ea1e.entry.js} +1 -1
  157. package/dist/verdocs-web-sdk/{p-bbdb47e7.entry.js → p-a00ea81e.entry.js} +1 -1
  158. package/dist/verdocs-web-sdk/{p-e749e4b8.entry.js → p-aac295bd.entry.js} +1 -1
  159. package/dist/verdocs-web-sdk/{p-e16eedbd.entry.js → p-b48a2f14.entry.js} +1 -1
  160. package/dist/verdocs-web-sdk/p-b4ac7a21.entry.js +1 -0
  161. package/dist/verdocs-web-sdk/{p-249d4dbf.system.entry.js → p-b4aefba1.system.entry.js} +1 -1
  162. package/dist/verdocs-web-sdk/{p-890cd7fd.system.entry.js → p-b650d3c1.system.entry.js} +1 -1
  163. package/dist/verdocs-web-sdk/{p-f26a6d84.system.entry.js → p-bf8bded0.system.entry.js} +1 -1
  164. package/dist/verdocs-web-sdk/{p-704b515e.system.entry.js → p-c125f51e.system.entry.js} +1 -1
  165. package/dist/verdocs-web-sdk/{p-00b90b95.system.entry.js → p-c2e3d476.system.entry.js} +1 -1
  166. package/dist/verdocs-web-sdk/p-c391fa41.entry.js +1 -0
  167. package/dist/verdocs-web-sdk/{p-8dbb3599.system.entry.js → p-c69b5a99.system.entry.js} +1 -1
  168. package/dist/verdocs-web-sdk/{p-cbefbfda.entry.js → p-cd92a456.entry.js} +1 -1
  169. package/dist/verdocs-web-sdk/{p-369ea745.entry.js → p-cef5dd3e.entry.js} +1 -1
  170. package/dist/verdocs-web-sdk/p-dd5460ea.entry.js +1 -0
  171. package/dist/verdocs-web-sdk/{p-5567acac.entry.js → p-e2d0d0cc.entry.js} +1 -1
  172. package/dist/verdocs-web-sdk/{p-94f811f6.system.entry.js → p-f05e18ba.system.entry.js} +1 -1
  173. package/dist/verdocs-web-sdk/{p-b8ba7838.entry.js → p-f8a2988e.entry.js} +1 -1
  174. package/dist/verdocs-web-sdk/{p-6785d5ea.system.entry.js → p-fb9b8d32.system.entry.js} +1 -1
  175. package/dist/verdocs-web-sdk/{p-d08dde38.entry.js → p-fd059523.entry.js} +1 -1
  176. package/dist/verdocs-web-sdk/{p-00229e30.system.entry.js → p-ff2d4284.system.entry.js} +1 -1
  177. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  178. package/package.json +2 -2
  179. package/dist/esm-es5/Envelopes-9ccae245.js +0 -1
  180. package/dist/verdocs-web-sdk/p-0b0a2fbd.system.js +0 -1
  181. package/dist/verdocs-web-sdk/p-1708f25d.entry.js +0 -1
  182. package/dist/verdocs-web-sdk/p-3a0ba0b8.entry.js +0 -1
  183. package/dist/verdocs-web-sdk/p-657dacc4.system.entry.js +0 -1
  184. package/dist/verdocs-web-sdk/p-70ca15f7.system.entry.js +0 -1
  185. package/dist/verdocs-web-sdk/p-b288f867.system.entry.js +0 -1
  186. package/dist/verdocs-web-sdk/p-b5591ddc.js +0 -1
  187. package/dist/verdocs-web-sdk/p-d6941876.entry.js +0 -1
  188. package/dist/verdocs-web-sdk/p-e2ef1a46.entry.js +0 -1
  189. /package/dist/esm-es5/{Permissions-391258bd.js → Permissions-f2eb0421.js} +0 -0
  190. /package/dist/verdocs-web-sdk/{p-65e7b32a.system.js → p-1d60151a.system.js} +0 -0
  191. /package/dist/verdocs-web-sdk/{p-beb02ef7.js → p-29f64c27.js} +0 -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);
@@ -226,7 +230,7 @@ export class VerdocsEnvelopesList {
226
230
  (_a = this.viewEnvelope) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, envelope });
227
231
  break;
228
232
  case 'finish':
229
- (_b = this.finishLater) === null || _b === void 0 ? void 0 : _b.emit({ endpoint: this.endpoint, envelope });
233
+ (_b = this.finishEnvelope) === null || _b === void 0 ? void 0 : _b.emit({ endpoint: this.endpoint, envelope });
230
234
  break;
231
235
  case 'download':
232
236
  this.downloadEnvelope(envelope);
@@ -236,14 +240,14 @@ export class VerdocsEnvelopesList {
236
240
  cancelEnvelope(this.endpoint, envelope.id)
237
241
  .then(() => VerdocsToast('Envelope canceled'))
238
242
  .catch(e => VerdocsToast('Unable to cancel envelope: ' + e.messabge, { style: 'error' }));
243
+ this.queryEnvelopes().catch(() => { });
239
244
  }
240
245
  break;
241
246
  }
242
247
  } }))));
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 => {
248
+ }), !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
249
  this.selectedPage = e.detail.selectedPage;
245
- return this.queryEnvelopes();
246
- } })))));
250
+ } }))) : (h("div", null))));
247
251
  }
248
252
  static get is() { return "verdocs-envelopes-list"; }
249
253
  static get originalStyleUrls() {
@@ -324,8 +328,8 @@ export class VerdocsEnvelopesList {
324
328
  "type": "string",
325
329
  "mutable": true,
326
330
  "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\"",
331
+ "original": "'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status'",
332
+ "resolved": "\"canceled_at\" | \"created_at\" | \"name\" | \"status\" | \"updated_at\"",
329
333
  "references": {}
330
334
  },
331
335
  "required": false,
@@ -336,9 +340,9 @@ export class VerdocsEnvelopesList {
336
340
  },
337
341
  "attribute": "sort",
338
342
  "reflect": true,
339
- "defaultValue": "'updated_at'"
343
+ "defaultValue": "'created_at'"
340
344
  },
341
- "name": {
345
+ "match": {
342
346
  "type": "string",
343
347
  "mutable": true,
344
348
  "complexType": {
@@ -350,33 +354,51 @@ export class VerdocsEnvelopesList {
350
354
  "optional": false,
351
355
  "docs": {
352
356
  "tags": [],
353
- "text": "If set, filter envelopes by the specified name."
357
+ "text": "If set, filter envelopes by the specified string."
354
358
  },
355
- "attribute": "name",
359
+ "attribute": "match",
356
360
  "reflect": true,
357
361
  "defaultValue": "''"
358
362
  },
359
- "containing": {
360
- "type": "string",
361
- "mutable": true,
363
+ "showPagination": {
364
+ "type": "boolean",
365
+ "mutable": false,
362
366
  "complexType": {
363
- "original": "string",
364
- "resolved": "string",
367
+ "original": "boolean",
368
+ "resolved": "boolean",
365
369
  "references": {}
366
370
  },
367
371
  "required": false,
368
372
  "optional": false,
369
373
  "docs": {
370
374
  "tags": [],
371
- "text": "If set, filter envelopes by the specified \"containing\" value."
375
+ "text": "Whether or not pagination should be enabled."
372
376
  },
373
- "attribute": "containing",
374
- "reflect": true,
375
- "defaultValue": "''"
377
+ "attribute": "show-pagination",
378
+ "reflect": false,
379
+ "defaultValue": "true"
380
+ },
381
+ "rowsPerPage": {
382
+ "type": "number",
383
+ "mutable": false,
384
+ "complexType": {
385
+ "original": "number",
386
+ "resolved": "number",
387
+ "references": {}
388
+ },
389
+ "required": false,
390
+ "optional": false,
391
+ "docs": {
392
+ "tags": [],
393
+ "text": "The number of rows to display per page."
394
+ },
395
+ "attribute": "rows-per-page",
396
+ "reflect": false,
397
+ "defaultValue": "10"
376
398
  },
377
399
  "selectedPage": {
378
400
  "type": "number",
379
- "mutable": true,
401
+ "mutable": false,
380
402
  "complexType": {
381
403
  "original": "number",
382
404
  "resolved": "number",
@@ -389,7 +411,7 @@ export class VerdocsEnvelopesList {
389
411
  "text": "The initial page number to select. Pagination is internally controlled but may be overriden by the\nhost applicaiton."
390
412
  },
391
413
  "attribute": "selected-page",
392
- "reflect": true,
414
+ "reflect": false,
393
415
  "defaultValue": "0"
394
416
  }
395
417
  };
@@ -397,6 +419,7 @@ export class VerdocsEnvelopesList {
397
419
  static get states() {
398
420
  return {
399
421
  "count": {},
422
+ "initiallyLoaded": {},
400
423
  "loading": {},
401
424
  "selectedEnvelopes": {},
402
425
  "envelopes": {}
@@ -404,6 +427,71 @@ export class VerdocsEnvelopesList {
404
427
  }
405
428
  static get events() {
406
429
  return [{
430
+ "method": "changeView",
431
+ "name": "changeView",
432
+ "bubbles": true,
433
+ "cancelable": true,
434
+ "composed": true,
435
+ "docs": {
436
+ "tags": [],
437
+ "text": "Event fired when the user changes their view. Host applications can use this to save the user's preferences."
438
+ },
439
+ "complexType": {
440
+ "original": "'all' | 'inbox' | 'sent' | 'completed' | 'action' | 'waiting'",
441
+ "resolved": "\"action\" | \"all\" | \"completed\" | \"inbox\" | \"sent\" | \"waiting\"",
442
+ "references": {}
443
+ }
444
+ }, {
445
+ "method": "changeStatus",
446
+ "name": "changeStatus",
447
+ "bubbles": true,
448
+ "cancelable": true,
449
+ "composed": true,
450
+ "docs": {
451
+ "tags": [],
452
+ "text": "Event fired when the user changes their status filter. Host applications can use this to save the user's preferences."
453
+ },
454
+ "complexType": {
455
+ "original": "TEnvelopeStatus | 'all'",
456
+ "resolved": "\"all\" | \"canceled\" | \"complete\" | \"declined\" | \"in progress\" | \"pending\"",
457
+ "references": {
458
+ "TEnvelopeStatus": {
459
+ "location": "import",
460
+ "path": "@verdocs/js-sdk/Envelopes/Types"
461
+ }
462
+ }
463
+ }
464
+ }, {
465
+ "method": "changeSort",
466
+ "name": "changeSort",
467
+ "bubbles": true,
468
+ "cancelable": true,
469
+ "composed": true,
470
+ "docs": {
471
+ "tags": [],
472
+ "text": "Event fired when the user changes their sort order. Host applications can use this to save the user's preferences."
473
+ },
474
+ "complexType": {
475
+ "original": "'name' | 'created_at' | 'updated_at' | 'canceled_at' | 'status'",
476
+ "resolved": "\"canceled_at\" | \"created_at\" | \"name\" | \"status\" | \"updated_at\"",
477
+ "references": {}
478
+ }
479
+ }, {
480
+ "method": "changeMatch",
481
+ "name": "changeMatch",
482
+ "bubbles": true,
483
+ "cancelable": true,
484
+ "composed": true,
485
+ "docs": {
486
+ "tags": [],
487
+ "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."
488
+ },
489
+ "complexType": {
490
+ "original": "string",
491
+ "resolved": "string",
492
+ "references": {}
493
+ }
494
+ }, {
407
495
  "method": "sdkError",
408
496
  "name": "sdkError",
409
497
  "bubbles": true,
@@ -434,38 +522,38 @@ export class VerdocsEnvelopesList {
434
522
  "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
523
  },
436
524
  "complexType": {
437
- "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelope}",
438
- "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelope; }",
525
+ "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary}",
526
+ "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary; }",
439
527
  "references": {
440
528
  "VerdocsEndpoint": {
441
529
  "location": "import",
442
530
  "path": "@verdocs/js-sdk"
443
531
  },
444
- "IEnvelope": {
532
+ "IEnvelopeSummary": {
445
533
  "location": "import",
446
534
  "path": "@verdocs/js-sdk/Envelopes/Types"
447
535
  }
448
536
  }
449
537
  }
450
538
  }, {
451
- "method": "finishLater",
452
- "name": "finishLater",
539
+ "method": "finishEnvelope",
540
+ "name": "finishEnvelope",
453
541
  "bubbles": true,
454
542
  "cancelable": true,
455
543
  "composed": true,
456
544
  "docs": {
457
545
  "tags": [],
458
- "text": "Event fired when the user clicks to finish signing later. Typically the host application should redirect\nthe user to another page."
546
+ "text": "Event fired when the user clicks to finish the envelope."
459
547
  },
460
548
  "complexType": {
461
- "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelope}",
462
- "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelope; }",
549
+ "original": "{endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary}",
550
+ "resolved": "{ endpoint: VerdocsEndpoint; envelope: IEnvelopeSummary; }",
463
551
  "references": {
464
552
  "VerdocsEndpoint": {
465
553
  "location": "import",
466
554
  "path": "@verdocs/js-sdk"
467
555
  },
468
- "IEnvelope": {
556
+ "IEnvelopeSummary": {
469
557
  "location": "import",
470
558
  "path": "@verdocs/js-sdk/Envelopes/Types"
471
559
  }
@@ -484,11 +572,8 @@ export class VerdocsEnvelopesList {
484
572
  "propName": "sort",
485
573
  "methodName": "handleSortUpdated"
486
574
  }, {
487
- "propName": "name",
488
- "methodName": "handleNameUpdated"
489
- }, {
490
- "propName": "containing",
491
- "methodName": "handleContainingUpdated"
575
+ "propName": "match",
576
+ "methodName": "handleMatchUpdated"
492
577
  }, {
493
578
  "propName": "selectedPage",
494
579
  "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
  }
@@ -52,22 +52,6 @@ var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, vo
52
52
  .then(function (r) { return r.data; })];
53
53
  });
54
54
  }); };
55
- /**
56
- * Search for envelopes matching various criteria.
57
- *
58
- * ```typescript
59
- * import {Envelopes} from '@verdocs/js-sdk/Envelopes';
60
- *
61
- * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });
62
- * ```
63
- */
64
- var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {
65
- return __generator(this, function (_a) {
66
- return [2 /*return*/, endpoint.api //
67
- .post('/envelopes/search', params)
68
- .then(function (r) { return r.data; })];
69
- });
70
- }); };
71
55
  /**
72
56
  * Get a signing session for an Envelope.
73
57
  */
@@ -214,5 +198,19 @@ var throttledGetEnvelope = function (endpoint, envelopeId) {
214
198
  return envelope;
215
199
  });
216
200
  };
201
+ /**
202
+ * Lists all templates accessible by the caller, with optional filters.
203
+ *
204
+ * ```typescript
205
+ * import {Envelopes} from '@verdocs/js-sdk/Templates';
206
+ *
207
+ * await Envelopes.listEnvelopes((VerdocsEndpoint.getDefault(), { name: 'test', sort: 'updated_at' });
208
+ * ```
209
+ */
210
+ var listEnvelopes = function (endpoint, params) {
211
+ return endpoint.api //
212
+ .post('/envelopes/list', params, { baseURL: endpoint.getBaseURLv2() })
213
+ .then(function (r) { return r.data; });
214
+ };
217
215
 
218
- export { getSigningSession as a, updateEnvelopeFieldSignature as b, cancelEnvelope as c, updateEnvelopeFieldInitials as d, uploadEnvelopeFieldAttachment as e, getEnvelopeDocumentPageDisplayUri as f, getSummary as g, getEnvelopeFile as h, getFieldAttachment as i, getEnvelope as j, searchEnvelopes as s, throttledGetEnvelope as t, updateEnvelopeField as u };
216
+ export { getSigningSession as a, updateEnvelopeFieldSignature as b, cancelEnvelope as c, updateEnvelopeFieldInitials as d, uploadEnvelopeFieldAttachment as e, getEnvelopeDocumentPageDisplayUri as f, getSummary as g, getEnvelopeFile as h, getFieldAttachment as i, getEnvelope as j, listEnvelopes as l, throttledGetEnvelope as t, updateEnvelopeField as u };
@@ -8,7 +8,9 @@ import { E as EnvelopeStates } from './Types.js';
8
8
  /**
9
9
  * Check to see if the user owns the envelope.
10
10
  */
11
- var userIsEnvelopeOwner = function (session, envelope) { return envelope.profile_id === (session === null || session === void 0 ? void 0 : session.profile_id); };
11
+ var userIsEnvelopeOwner = function (session, envelope) {
12
+ return envelope.profile_id === (session === null || session === void 0 ? void 0 : session.profile_id);
13
+ };
12
14
  /**
13
15
  * Check to see if the user owns the envelope.
14
16
  */