@verdocs/web-sdk 1.9.20 → 1.9.21

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 (362) hide show
  1. package/dist/cjs/Envelopes-2277461f.js +65 -0
  2. package/dist/cjs/Envelopes-2277461f.js.map +1 -0
  3. package/dist/cjs/{Templates-c983e2a7.js → Templates-3404a881.js} +2 -2
  4. package/dist/cjs/{Templates-c983e2a7.js.map → Templates-3404a881.js.map} +1 -1
  5. package/dist/cjs/Token-576f0e8a.js +73 -0
  6. package/dist/cjs/Token-576f0e8a.js.map +1 -0
  7. package/dist/cjs/{VerdocsEndpoint-8c408e5b.js → VerdocsEndpoint-a9bf9d59.js} +3 -70
  8. package/dist/cjs/VerdocsEndpoint-a9bf9d59.js.map +1 -0
  9. package/dist/cjs/{templateStore-4caa4863.js → templateStore-3c43f83c.js} +2 -2
  10. package/dist/cjs/{templateStore-4caa4863.js.map → templateStore-3c43f83c.js.map} +1 -1
  11. package/dist/cjs/{utils-eb1aab04.js → utils-9b27a65b.js} +138 -2
  12. package/dist/cjs/utils-9b27a65b.js.map +1 -0
  13. package/dist/cjs/verdocs-auth.cjs.entry.js +2 -1
  14. package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
  15. package/dist/cjs/verdocs-build.cjs.entry.js +5 -4
  16. package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
  17. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +2 -1
  18. package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
  19. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -1
  20. package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -1
  21. package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -1
  22. package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
  23. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -1
  24. package/dist/cjs/verdocs-field-dropdown.cjs.entry.js.map +1 -1
  25. package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -1
  26. package/dist/cjs/verdocs-field-initial.cjs.entry.js.map +1 -1
  27. package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -1
  28. package/dist/cjs/verdocs-field-payment.cjs.entry.js.map +1 -1
  29. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -1
  30. package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -1
  31. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +2 -1
  32. package/dist/cjs/verdocs-field-signature_3.cjs.entry.js.map +1 -1
  33. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +2 -1
  34. package/dist/cjs/verdocs-field-textarea.cjs.entry.js.map +1 -1
  35. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -2
  36. package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
  37. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -1
  38. package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
  39. package/dist/cjs/verdocs-preview.cjs.entry.js +5 -4
  40. package/dist/cjs/verdocs-preview.cjs.entry.js.map +1 -1
  41. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +2 -1
  42. package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js.map +1 -1
  43. package/dist/cjs/verdocs-search.cjs.entry.js +2 -1
  44. package/dist/cjs/verdocs-search.cjs.entry.js.map +1 -1
  45. package/dist/cjs/verdocs-send.cjs.entry.js +3 -2
  46. package/dist/cjs/verdocs-send.cjs.entry.js.map +1 -1
  47. package/dist/cjs/verdocs-sign.cjs.entry.js +10 -28
  48. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  49. package/dist/cjs/verdocs-template-create_4.cjs.entry.js +5 -4
  50. package/dist/cjs/verdocs-template-create_4.cjs.entry.js.map +1 -1
  51. package/dist/cjs/verdocs-view.cjs.entry.js +26 -63
  52. package/dist/cjs/verdocs-view.cjs.entry.js.map +1 -1
  53. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -22
  54. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  55. package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +60 -3
  56. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +22 -61
  57. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
  58. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js +1 -1
  59. package/dist/collection/components/embeds/verdocs-view/verdocs-view.stories.js.map +1 -1
  60. package/dist/collection/utils/utils.js +20 -1
  61. package/dist/collection/utils/utils.js.map +1 -1
  62. package/dist/components/Envelopes.js +2 -112
  63. package/dist/components/Envelopes.js.map +1 -1
  64. package/dist/components/Token.js +71 -0
  65. package/dist/components/Token.js.map +1 -0
  66. package/dist/components/VerdocsEndpoint.js +2 -68
  67. package/dist/components/VerdocsEndpoint.js.map +1 -1
  68. package/dist/components/utils.js +132 -2
  69. package/dist/components/utils.js.map +1 -1
  70. package/dist/components/verdocs-sign.js +4 -23
  71. package/dist/components/verdocs-sign.js.map +1 -1
  72. package/dist/components/verdocs-template-fields2.js +1 -1
  73. package/dist/components/verdocs-view.js +24 -62
  74. package/dist/components/verdocs-view.js.map +1 -1
  75. package/dist/docs.json +1 -1
  76. package/dist/esm/Envelopes-c80609e5.js +62 -0
  77. package/dist/esm/Envelopes-c80609e5.js.map +1 -0
  78. package/dist/esm/{Templates-bfa45a12.js → Templates-7ae1294e.js} +2 -2
  79. package/dist/esm/{Templates-bfa45a12.js.map → Templates-7ae1294e.js.map} +1 -1
  80. package/dist/esm/Token-54690789.js +71 -0
  81. package/dist/esm/Token-54690789.js.map +1 -0
  82. package/dist/esm/{VerdocsEndpoint-dac04424.js → VerdocsEndpoint-76dbf9b9.js} +3 -69
  83. package/dist/esm/VerdocsEndpoint-76dbf9b9.js.map +1 -0
  84. package/dist/esm/{templateStore-d9856192.js → templateStore-a6dfb726.js} +2 -2
  85. package/dist/esm/{templateStore-d9856192.js.map → templateStore-a6dfb726.js.map} +1 -1
  86. package/dist/esm/utils-53001d87.js +336 -0
  87. package/dist/esm/utils-53001d87.js.map +1 -0
  88. package/dist/esm/verdocs-auth.entry.js +2 -1
  89. package/dist/esm/verdocs-auth.entry.js.map +1 -1
  90. package/dist/esm/verdocs-build.entry.js +5 -4
  91. package/dist/esm/verdocs-build.entry.js.map +1 -1
  92. package/dist/esm/verdocs-contact-picker.entry.js +2 -1
  93. package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
  94. package/dist/esm/verdocs-field-checkbox.entry.js +2 -1
  95. package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -1
  96. package/dist/esm/verdocs-field-date.entry.js +2 -1
  97. package/dist/esm/verdocs-field-date.entry.js.map +1 -1
  98. package/dist/esm/verdocs-field-dropdown.entry.js +2 -1
  99. package/dist/esm/verdocs-field-dropdown.entry.js.map +1 -1
  100. package/dist/esm/verdocs-field-initial.entry.js +2 -1
  101. package/dist/esm/verdocs-field-initial.entry.js.map +1 -1
  102. package/dist/esm/verdocs-field-payment.entry.js +2 -1
  103. package/dist/esm/verdocs-field-payment.entry.js.map +1 -1
  104. package/dist/esm/verdocs-field-radio-button.entry.js +2 -1
  105. package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -1
  106. package/dist/esm/verdocs-field-signature_3.entry.js +2 -1
  107. package/dist/esm/verdocs-field-signature_3.entry.js.map +1 -1
  108. package/dist/esm/verdocs-field-textarea.entry.js +2 -1
  109. package/dist/esm/verdocs-field-textarea.entry.js.map +1 -1
  110. package/dist/esm/verdocs-field-textbox.entry.js +3 -2
  111. package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
  112. package/dist/esm/verdocs-field-timestamp.entry.js +2 -1
  113. package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
  114. package/dist/esm/verdocs-preview.entry.js +5 -4
  115. package/dist/esm/verdocs-preview.entry.js.map +1 -1
  116. package/dist/esm/verdocs-quick-functions_3.entry.js +2 -1
  117. package/dist/esm/verdocs-quick-functions_3.entry.js.map +1 -1
  118. package/dist/esm/verdocs-search.entry.js +2 -1
  119. package/dist/esm/verdocs-search.entry.js.map +1 -1
  120. package/dist/esm/verdocs-send.entry.js +3 -2
  121. package/dist/esm/verdocs-send.entry.js.map +1 -1
  122. package/dist/esm/verdocs-sign.entry.js +6 -24
  123. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  124. package/dist/esm/verdocs-template-create_4.entry.js +5 -4
  125. package/dist/esm/verdocs-template-create_4.entry.js.map +1 -1
  126. package/dist/esm/verdocs-view.entry.js +26 -63
  127. package/dist/esm/verdocs-view.entry.js.map +1 -1
  128. package/dist/esm-es5/Envelopes-c80609e5.js +2 -0
  129. package/dist/esm-es5/Envelopes-c80609e5.js.map +1 -0
  130. package/dist/esm-es5/{Templates-bfa45a12.js → Templates-7ae1294e.js} +2 -2
  131. package/dist/esm-es5/{Templates-bfa45a12.js.map → Templates-7ae1294e.js.map} +0 -0
  132. package/dist/esm-es5/Token-54690789.js +2 -0
  133. package/dist/esm-es5/Token-54690789.js.map +1 -0
  134. package/dist/esm-es5/VerdocsEndpoint-76dbf9b9.js +2 -0
  135. package/dist/esm-es5/VerdocsEndpoint-76dbf9b9.js.map +1 -0
  136. package/dist/esm-es5/{templateStore-d9856192.js → templateStore-a6dfb726.js} +2 -2
  137. package/dist/esm-es5/{templateStore-d9856192.js.map → templateStore-a6dfb726.js.map} +0 -0
  138. package/dist/esm-es5/utils-53001d87.js +2 -0
  139. package/dist/esm-es5/utils-53001d87.js.map +1 -0
  140. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  141. package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
  142. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  143. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  144. package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
  145. package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
  146. package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
  147. package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -1
  148. package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
  149. package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
  150. package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
  151. package/dist/esm-es5/verdocs-field-dropdown.entry.js.map +1 -1
  152. package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
  153. package/dist/esm-es5/verdocs-field-initial.entry.js.map +1 -1
  154. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  155. package/dist/esm-es5/verdocs-field-payment.entry.js.map +1 -1
  156. package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
  157. package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -1
  158. package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
  159. package/dist/esm-es5/verdocs-field-signature_3.entry.js.map +1 -1
  160. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  161. package/dist/esm-es5/verdocs-field-textarea.entry.js.map +1 -1
  162. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  163. package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
  164. package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
  165. package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
  166. package/dist/esm-es5/verdocs-preview.entry.js +1 -1
  167. package/dist/esm-es5/verdocs-preview.entry.js.map +1 -1
  168. package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
  169. package/dist/esm-es5/verdocs-quick-functions_3.entry.js.map +1 -1
  170. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  171. package/dist/esm-es5/verdocs-search.entry.js.map +1 -1
  172. package/dist/esm-es5/verdocs-send.entry.js +1 -1
  173. package/dist/esm-es5/verdocs-send.entry.js.map +1 -1
  174. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  175. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  176. package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
  177. package/dist/esm-es5/verdocs-template-create_4.entry.js.map +1 -1
  178. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  179. package/dist/esm-es5/verdocs-view.entry.js.map +1 -1
  180. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +0 -1
  181. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +1 -2
  182. package/dist/types/utils/utils.d.ts +3 -1
  183. package/dist/verdocs-web-sdk/p-00cc11c3.entry.js +2 -0
  184. package/dist/verdocs-web-sdk/{p-d2cea7fb.entry.js.map → p-00cc11c3.entry.js.map} +1 -1
  185. package/dist/verdocs-web-sdk/p-0e7a7666.entry.js +2 -0
  186. package/dist/verdocs-web-sdk/{p-24fc5cec.entry.js.map → p-0e7a7666.entry.js.map} +1 -1
  187. package/dist/verdocs-web-sdk/p-0eee7f43.system.js +2 -0
  188. package/dist/verdocs-web-sdk/p-0eee7f43.system.js.map +1 -0
  189. package/dist/verdocs-web-sdk/p-1f1127dd.js +2 -0
  190. package/dist/verdocs-web-sdk/p-1f1127dd.js.map +1 -0
  191. package/dist/verdocs-web-sdk/p-208a3320.js +2 -0
  192. package/dist/verdocs-web-sdk/p-208a3320.js.map +1 -0
  193. package/dist/verdocs-web-sdk/p-21603661.js +2 -0
  194. package/dist/verdocs-web-sdk/p-21603661.js.map +1 -0
  195. package/dist/verdocs-web-sdk/p-27f3e394.entry.js +2 -0
  196. package/dist/verdocs-web-sdk/{p-751e0c80.entry.js.map → p-27f3e394.entry.js.map} +1 -1
  197. package/dist/verdocs-web-sdk/p-2b7f196e.system.entry.js +2 -0
  198. package/dist/verdocs-web-sdk/p-2b7f196e.system.entry.js.map +1 -0
  199. package/dist/verdocs-web-sdk/p-2c0f9340.system.js +2 -0
  200. package/dist/verdocs-web-sdk/p-2c0f9340.system.js.map +1 -0
  201. package/dist/verdocs-web-sdk/p-3175c6f2.system.entry.js +2 -0
  202. package/dist/verdocs-web-sdk/{p-abb55e0c.system.entry.js.map → p-3175c6f2.system.entry.js.map} +1 -1
  203. package/dist/verdocs-web-sdk/p-35333c3b.entry.js +2 -0
  204. package/dist/verdocs-web-sdk/{p-b73576e6.entry.js.map → p-35333c3b.entry.js.map} +1 -1
  205. package/dist/verdocs-web-sdk/p-359129d0.entry.js +2 -0
  206. package/dist/verdocs-web-sdk/{p-55de5397.entry.js.map → p-359129d0.entry.js.map} +1 -1
  207. package/dist/verdocs-web-sdk/{p-8ebd80e3.system.js → p-4437603c.system.js} +2 -2
  208. package/dist/verdocs-web-sdk/{p-8ebd80e3.system.js.map → p-4437603c.system.js.map} +0 -0
  209. package/dist/verdocs-web-sdk/p-48285c26.entry.js +2 -0
  210. package/dist/verdocs-web-sdk/{p-45715eaf.entry.js.map → p-48285c26.entry.js.map} +1 -1
  211. package/dist/verdocs-web-sdk/p-4943d790.system.entry.js +2 -0
  212. package/dist/verdocs-web-sdk/{p-0189d628.system.entry.js.map → p-4943d790.system.entry.js.map} +1 -1
  213. package/dist/verdocs-web-sdk/p-4ef84b54.js +2 -0
  214. package/dist/verdocs-web-sdk/{p-19418b30.js.map → p-4ef84b54.js.map} +0 -0
  215. package/dist/verdocs-web-sdk/p-4f321d05.entry.js +2 -0
  216. package/dist/verdocs-web-sdk/{p-84cb5d2e.entry.js.map → p-4f321d05.entry.js.map} +1 -1
  217. package/dist/verdocs-web-sdk/p-5bbbf36a.entry.js +2 -0
  218. package/dist/verdocs-web-sdk/{p-9cf35b81.entry.js.map → p-5bbbf36a.entry.js.map} +1 -1
  219. package/dist/verdocs-web-sdk/p-5c3fce00.entry.js +2 -0
  220. package/dist/verdocs-web-sdk/{p-f3d4f320.entry.js.map → p-5c3fce00.entry.js.map} +1 -1
  221. package/dist/verdocs-web-sdk/p-64cad758.system.entry.js +2 -0
  222. package/dist/verdocs-web-sdk/p-64cad758.system.entry.js.map +1 -0
  223. package/dist/verdocs-web-sdk/p-66eacdf0.system.entry.js +2 -0
  224. package/dist/verdocs-web-sdk/{p-84df823c.system.entry.js.map → p-66eacdf0.system.entry.js.map} +1 -1
  225. package/dist/verdocs-web-sdk/p-6c2273ee.system.entry.js +2 -0
  226. package/dist/verdocs-web-sdk/{p-84389de2.system.entry.js.map → p-6c2273ee.system.entry.js.map} +1 -1
  227. package/dist/verdocs-web-sdk/p-71de4718.entry.js +2 -0
  228. package/dist/verdocs-web-sdk/{p-fac05414.entry.js.map → p-71de4718.entry.js.map} +1 -1
  229. package/dist/verdocs-web-sdk/p-77a77df6.entry.js +2 -0
  230. package/dist/verdocs-web-sdk/{p-fe0c8a20.entry.js.map → p-77a77df6.entry.js.map} +1 -1
  231. package/dist/verdocs-web-sdk/p-8251b9eb.entry.js +2 -0
  232. package/dist/verdocs-web-sdk/{p-2fe5b678.entry.js.map → p-8251b9eb.entry.js.map} +1 -1
  233. package/dist/verdocs-web-sdk/p-888cf244.system.entry.js +2 -0
  234. package/dist/verdocs-web-sdk/{p-bd439481.system.entry.js.map → p-888cf244.system.entry.js.map} +1 -1
  235. package/dist/verdocs-web-sdk/p-90fe342a.entry.js +2 -0
  236. package/dist/verdocs-web-sdk/{p-38d63937.entry.js.map → p-90fe342a.entry.js.map} +1 -1
  237. package/dist/verdocs-web-sdk/p-93ada77f.system.entry.js +2 -0
  238. package/dist/verdocs-web-sdk/{p-3629c585.system.entry.js.map → p-93ada77f.system.entry.js.map} +1 -1
  239. package/dist/verdocs-web-sdk/p-99144a0a.system.entry.js +2 -0
  240. package/dist/verdocs-web-sdk/{p-6a8ac53e.system.entry.js.map → p-99144a0a.system.entry.js.map} +1 -1
  241. package/dist/verdocs-web-sdk/p-9a763c04.entry.js +2 -0
  242. package/dist/verdocs-web-sdk/{p-a59f1f82.entry.js.map → p-9a763c04.entry.js.map} +1 -1
  243. package/dist/verdocs-web-sdk/p-a580d69a.system.entry.js +2 -0
  244. package/dist/verdocs-web-sdk/{p-1cc7d51c.system.entry.js.map → p-a580d69a.system.entry.js.map} +1 -1
  245. package/dist/verdocs-web-sdk/p-a9429014.system.entry.js +2 -0
  246. package/dist/verdocs-web-sdk/{p-1fab9df7.system.entry.js.map → p-a9429014.system.entry.js.map} +1 -1
  247. package/dist/verdocs-web-sdk/p-a9d20e4b.system.entry.js +2 -0
  248. package/dist/verdocs-web-sdk/{p-7a7d791e.system.entry.js.map → p-a9d20e4b.system.entry.js.map} +1 -1
  249. package/dist/verdocs-web-sdk/p-ace31857.system.entry.js +2 -0
  250. package/dist/verdocs-web-sdk/{p-8d354dfc.system.entry.js.map → p-ace31857.system.entry.js.map} +1 -1
  251. package/dist/verdocs-web-sdk/p-af2c2f79.system.js +2 -0
  252. package/dist/verdocs-web-sdk/p-af2c2f79.system.js.map +1 -0
  253. package/dist/verdocs-web-sdk/p-ba8727f3.system.entry.js +2 -0
  254. package/dist/verdocs-web-sdk/{p-4e934f5b.system.entry.js.map → p-ba8727f3.system.entry.js.map} +1 -1
  255. package/dist/verdocs-web-sdk/p-bdff66f3.js +2 -0
  256. package/dist/verdocs-web-sdk/p-bdff66f3.js.map +1 -0
  257. package/dist/verdocs-web-sdk/p-c0804682.entry.js +2 -0
  258. package/dist/verdocs-web-sdk/{p-7b019b31.entry.js.map → p-c0804682.entry.js.map} +1 -1
  259. package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
  260. package/dist/verdocs-web-sdk/p-c475a969.system.entry.js +2 -0
  261. package/dist/verdocs-web-sdk/{p-a389d9c0.system.entry.js.map → p-c475a969.system.entry.js.map} +1 -1
  262. package/dist/verdocs-web-sdk/p-cf1ed6b8.system.js +2 -0
  263. package/dist/verdocs-web-sdk/p-cf1ed6b8.system.js.map +1 -0
  264. package/dist/verdocs-web-sdk/p-d0a360d6.entry.js +2 -0
  265. package/dist/verdocs-web-sdk/p-d0a360d6.entry.js.map +1 -0
  266. package/dist/verdocs-web-sdk/p-d2c1dcf9.system.entry.js +2 -0
  267. package/dist/verdocs-web-sdk/{p-b5882803.system.entry.js.map → p-d2c1dcf9.system.entry.js.map} +1 -1
  268. package/dist/verdocs-web-sdk/p-d65f5bf7.system.entry.js +2 -0
  269. package/dist/verdocs-web-sdk/{p-3b4d20a3.system.entry.js.map → p-d65f5bf7.system.entry.js.map} +1 -1
  270. package/dist/verdocs-web-sdk/p-d9b9a354.system.entry.js +2 -0
  271. package/dist/verdocs-web-sdk/{p-78ec7db1.system.entry.js.map → p-d9b9a354.system.entry.js.map} +1 -1
  272. package/dist/verdocs-web-sdk/p-dadccc57.js +2 -0
  273. package/dist/verdocs-web-sdk/{p-89d6f165.js.map → p-dadccc57.js.map} +0 -0
  274. package/dist/verdocs-web-sdk/p-e014f9a6.system.entry.js +2 -0
  275. package/dist/verdocs-web-sdk/{p-9c1e77fe.system.entry.js.map → p-e014f9a6.system.entry.js.map} +1 -1
  276. package/dist/verdocs-web-sdk/p-ecdd15bf.entry.js +2 -0
  277. package/dist/verdocs-web-sdk/{p-f22a201f.entry.js.map → p-ecdd15bf.entry.js.map} +1 -1
  278. package/dist/verdocs-web-sdk/p-f05afb1f.system.entry.js +2 -0
  279. package/dist/verdocs-web-sdk/{p-ae794996.system.entry.js.map → p-f05afb1f.system.entry.js.map} +1 -1
  280. package/dist/verdocs-web-sdk/{p-2c0e91da.system.js → p-f2137361.system.js} +2 -2
  281. package/dist/verdocs-web-sdk/{p-2c0e91da.system.js.map → p-f2137361.system.js.map} +0 -0
  282. package/dist/verdocs-web-sdk/p-f2f60dc9.entry.js +2 -0
  283. package/dist/verdocs-web-sdk/p-f2f60dc9.entry.js.map +1 -0
  284. package/dist/verdocs-web-sdk/p-f632dbd8.entry.js +2 -0
  285. package/dist/verdocs-web-sdk/{p-00e0da47.entry.js.map → p-f632dbd8.entry.js.map} +1 -1
  286. package/dist/verdocs-web-sdk/p-fa722164.entry.js +2 -0
  287. package/dist/verdocs-web-sdk/{p-b6b81230.entry.js.map → p-fa722164.entry.js.map} +1 -1
  288. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  289. package/package.json +1 -1
  290. package/dist/cjs/Envelopes-eb5c1ea9.js +0 -180
  291. package/dist/cjs/Envelopes-eb5c1ea9.js.map +0 -1
  292. package/dist/cjs/VerdocsEndpoint-8c408e5b.js.map +0 -1
  293. package/dist/cjs/utils-eb1aab04.js.map +0 -1
  294. package/dist/esm/Envelopes-979ad8c2.js +0 -172
  295. package/dist/esm/Envelopes-979ad8c2.js.map +0 -1
  296. package/dist/esm/VerdocsEndpoint-dac04424.js.map +0 -1
  297. package/dist/esm/utils-2dbb5f63.js +0 -206
  298. package/dist/esm/utils-2dbb5f63.js.map +0 -1
  299. package/dist/esm-es5/Envelopes-979ad8c2.js +0 -2
  300. package/dist/esm-es5/Envelopes-979ad8c2.js.map +0 -1
  301. package/dist/esm-es5/VerdocsEndpoint-dac04424.js +0 -2
  302. package/dist/esm-es5/VerdocsEndpoint-dac04424.js.map +0 -1
  303. package/dist/esm-es5/utils-2dbb5f63.js +0 -2
  304. package/dist/esm-es5/utils-2dbb5f63.js.map +0 -1
  305. package/dist/verdocs-web-sdk/p-00e0da47.entry.js +0 -2
  306. package/dist/verdocs-web-sdk/p-0189d628.system.entry.js +0 -2
  307. package/dist/verdocs-web-sdk/p-08d09277.system.entry.js +0 -2
  308. package/dist/verdocs-web-sdk/p-08d09277.system.entry.js.map +0 -1
  309. package/dist/verdocs-web-sdk/p-19418b30.js +0 -2
  310. package/dist/verdocs-web-sdk/p-1cc7d51c.system.entry.js +0 -2
  311. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js +0 -2
  312. package/dist/verdocs-web-sdk/p-1cd2f7dc.system.js.map +0 -1
  313. package/dist/verdocs-web-sdk/p-1fab9df7.system.entry.js +0 -2
  314. package/dist/verdocs-web-sdk/p-24fc5cec.entry.js +0 -2
  315. package/dist/verdocs-web-sdk/p-2fe5b678.entry.js +0 -2
  316. package/dist/verdocs-web-sdk/p-3629c585.system.entry.js +0 -2
  317. package/dist/verdocs-web-sdk/p-38d63937.entry.js +0 -2
  318. package/dist/verdocs-web-sdk/p-3b4d20a3.system.entry.js +0 -2
  319. package/dist/verdocs-web-sdk/p-45715eaf.entry.js +0 -2
  320. package/dist/verdocs-web-sdk/p-4e934f5b.system.entry.js +0 -2
  321. package/dist/verdocs-web-sdk/p-55de5397.entry.js +0 -2
  322. package/dist/verdocs-web-sdk/p-5742ce8f.system.js +0 -2
  323. package/dist/verdocs-web-sdk/p-5742ce8f.system.js.map +0 -1
  324. package/dist/verdocs-web-sdk/p-6a8ac53e.system.entry.js +0 -2
  325. package/dist/verdocs-web-sdk/p-751e0c80.entry.js +0 -2
  326. package/dist/verdocs-web-sdk/p-78ec7db1.system.entry.js +0 -2
  327. package/dist/verdocs-web-sdk/p-7a7d791e.system.entry.js +0 -2
  328. package/dist/verdocs-web-sdk/p-7b019b31.entry.js +0 -2
  329. package/dist/verdocs-web-sdk/p-7d8bc1c8.entry.js +0 -2
  330. package/dist/verdocs-web-sdk/p-7d8bc1c8.entry.js.map +0 -1
  331. package/dist/verdocs-web-sdk/p-84389de2.system.entry.js +0 -2
  332. package/dist/verdocs-web-sdk/p-84cb5d2e.entry.js +0 -2
  333. package/dist/verdocs-web-sdk/p-84df823c.system.entry.js +0 -2
  334. package/dist/verdocs-web-sdk/p-89d6f165.js +0 -2
  335. package/dist/verdocs-web-sdk/p-8b34ee67.js +0 -2
  336. package/dist/verdocs-web-sdk/p-8b34ee67.js.map +0 -1
  337. package/dist/verdocs-web-sdk/p-8d354dfc.system.entry.js +0 -2
  338. package/dist/verdocs-web-sdk/p-9c1e77fe.system.entry.js +0 -2
  339. package/dist/verdocs-web-sdk/p-9cf35b81.entry.js +0 -2
  340. package/dist/verdocs-web-sdk/p-a227f663.system.entry.js +0 -2
  341. package/dist/verdocs-web-sdk/p-a227f663.system.entry.js.map +0 -1
  342. package/dist/verdocs-web-sdk/p-a389d9c0.system.entry.js +0 -2
  343. package/dist/verdocs-web-sdk/p-a59f1f82.entry.js +0 -2
  344. package/dist/verdocs-web-sdk/p-abb55e0c.system.entry.js +0 -2
  345. package/dist/verdocs-web-sdk/p-ae794996.system.entry.js +0 -2
  346. package/dist/verdocs-web-sdk/p-b5882803.system.entry.js +0 -2
  347. package/dist/verdocs-web-sdk/p-b6b81230.entry.js +0 -2
  348. package/dist/verdocs-web-sdk/p-b73576e6.entry.js +0 -2
  349. package/dist/verdocs-web-sdk/p-bd439481.system.entry.js +0 -2
  350. package/dist/verdocs-web-sdk/p-becd8d7e.js +0 -2
  351. package/dist/verdocs-web-sdk/p-becd8d7e.js.map +0 -1
  352. package/dist/verdocs-web-sdk/p-d2cea7fb.entry.js +0 -2
  353. package/dist/verdocs-web-sdk/p-d7f0c475.entry.js +0 -2
  354. package/dist/verdocs-web-sdk/p-d7f0c475.entry.js.map +0 -1
  355. package/dist/verdocs-web-sdk/p-de241d16.js +0 -2
  356. package/dist/verdocs-web-sdk/p-de241d16.js.map +0 -1
  357. package/dist/verdocs-web-sdk/p-e1f005fc.system.js +0 -2
  358. package/dist/verdocs-web-sdk/p-e1f005fc.system.js.map +0 -1
  359. package/dist/verdocs-web-sdk/p-f22a201f.entry.js +0 -2
  360. package/dist/verdocs-web-sdk/p-f3d4f320.entry.js +0 -2
  361. package/dist/verdocs-web-sdk/p-fac05414.entry.js +0 -2
  362. package/dist/verdocs-web-sdk/p-fe0c8a20.entry.js +0 -2
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function l(e){try{a(i.next(e))}catch(e){r(e)}}function s(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?o(e.value):n(e.value).then(l,s)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=l[0]&2?n["return"]:l[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;if(n=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;n=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){o.label=l[1];break}if(l[0]===6&&o.label<r[1]){o.label=r[1];r=l;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(l);break}if(r[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];n=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import{g as getRGBA}from"./Colors-1b298092.js";import{s as state}from"./templateStore-d9856192.js";import{g as getFieldSettings}from"./utils-2dbb5f63.js";import"./index-fd7b8a34.js";var verdocsFieldTextboxCss='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{width:100%;height:100%;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox input:focus{outline:none}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}';var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var VerdocsFieldTextbox=function(){function e(e){registerInstance(this,e);this.recipientChanged=createEvent(this,"recipientChanged",7);this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.handleChangeRecipient=function(e){var t;(t=this.recipientChanged)===null||t===void 0?void 0:t.emit(e.detail)};e.prototype.render=function(){var e=this;var t,o,i,n;var r=getFieldSettings(this.field);var l=(o=(t=this.disabled)!==null&&t!==void 0?t:r.disabled)!==null&&o!==void 0?o:false;var s=this.field["rgba"]||getRGBA(this.roleindex);var a=(r===null||r===void 0?void 0:r.result)||"";if(this.done){return h(Host,{class:{done:this.done}},a)}return h(Host,{class:{required:(i=this.field)===null||i===void 0?void 0:i.required,disabled:l,done:this.done},style:{backgroundColor:s}},h("input",{type:"text",placeholder:r===null||r===void 0?void 0:r.placeholder,tabIndex:r===null||r===void 0?void 0:r.order,value:a,disabled:l,required:(n=this.field)===null||n===void 0?void 0:n.required,ref:function(t){return e.el=t}}),this.editable&&h("verdocs-button-panel",{icon:settingsIcon},h("h6",null,"Field Settings"),h("form",null,h("verdocs-select-input",{label:"Recipient",value:state.roleNames[this.roleindex],options:state.roleNames.map((function(e){return{label:e,value:e}})),onChange:function(t){return e.handleChangeRecipient(t)}}),h("verdocs-text-input",{label:"Field Name",value:"",placeholder:"Stored field name...",onInput:function(e){e.stopPropagation();console.log("ipt",e)}}),h("verdocs-text-input",{label:"Placeholder",value:"",placeholder:"Placeholder text...",onInput:function(e){e.stopPropagation();console.log("ipt",e)}}))))};return e}();VerdocsFieldTextbox.style=verdocsFieldTextboxCss;export{VerdocsFieldTextbox as verdocs_field_textbox};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function l(e){try{a(i.next(e))}catch(e){r(e)}}function s(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?o(e.value):n(e.value).then(l,s)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=l[0]&2?n["return"]:l[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;if(n=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:o.label++;return{value:l[1],done:false};case 5:o.label++;n=l[1];l=[0];continue;case 7:l=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){o=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){o.label=l[1];break}if(l[0]===6&&o.label<r[1]){o.label=r[1];r=l;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(l);break}if(r[2])o.ops.pop();o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e];n=0}finally{i=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import{g as getRGBA}from"./Colors-1b298092.js";import{s as state}from"./templateStore-a6dfb726.js";import{g as getFieldSettings}from"./utils-53001d87.js";import"./index-fd7b8a34.js";import"./Token-54690789.js";var verdocsFieldTextboxCss='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{width:100%;height:100%;font-size:11px;background:none;font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox input:focus{outline:none}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}';var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var VerdocsFieldTextbox=function(){function e(e){registerInstance(this,e);this.recipientChanged=createEvent(this,"recipientChanged",7);this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.handleChangeRecipient=function(e){var t;(t=this.recipientChanged)===null||t===void 0?void 0:t.emit(e.detail)};e.prototype.render=function(){var e=this;var t,o,i,n;var r=getFieldSettings(this.field);var l=(o=(t=this.disabled)!==null&&t!==void 0?t:r.disabled)!==null&&o!==void 0?o:false;var s=this.field["rgba"]||getRGBA(this.roleindex);var a=(r===null||r===void 0?void 0:r.result)||"";if(this.done){return h(Host,{class:{done:this.done}},a)}return h(Host,{class:{required:(i=this.field)===null||i===void 0?void 0:i.required,disabled:l,done:this.done},style:{backgroundColor:s}},h("input",{type:"text",placeholder:r===null||r===void 0?void 0:r.placeholder,tabIndex:r===null||r===void 0?void 0:r.order,value:a,disabled:l,required:(n=this.field)===null||n===void 0?void 0:n.required,ref:function(t){return e.el=t}}),this.editable&&h("verdocs-button-panel",{icon:settingsIcon},h("h6",null,"Field Settings"),h("form",null,h("verdocs-select-input",{label:"Recipient",value:state.roleNames[this.roleindex],options:state.roleNames.map((function(e){return{label:e,value:e}})),onChange:function(t){return e.handleChangeRecipient(t)}}),h("verdocs-text-input",{label:"Field Name",value:"",placeholder:"Stored field name...",onInput:function(e){e.stopPropagation();console.log("ipt",e)}}),h("verdocs-text-input",{label:"Placeholder",value:"",placeholder:"Placeholder text...",onInput:function(e){e.stopPropagation();console.log("ipt",e)}}))))};return e}();VerdocsFieldTextbox.style=verdocsFieldTextboxCss;export{VerdocsFieldTextbox as verdocs_field_textbox};
2
2
  //# sourceMappingURL=verdocs-field-textbox.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/elements/verdocs-field-textbox/verdocs-field-textbox.scss?tag=verdocs-field-textbox","src/components/elements/verdocs-field-textbox/verdocs-field-textbox.tsx"],"names":["verdocsFieldTextboxCss","settingsIcon","VerdocsFieldTextbox","class_1","prototype","focusField","this","el","focus","handleChangeRecipient","e","_a","recipientChanged","emit","detail","render","_this","settings","getFieldSettings","field","disabled","_b","backgroundColor","getRGBA","roleindex","value","result","done","h","Host","class","required","_c","style","type","placeholder","tabIndex","order","_d","ref","editable","icon","label","TemplateStore","roleNames","options","map","role","onChange","onInput","stopPropagation","console","log"],"mappings":"msDAAA,IAAMA,uBAAyB,6zCCO/B,IAAMC,aACJ,6rCAUWC,oBAAmB,0HAM0B,mBAK3B,oBAMA,oBAKA,gBAKJ,qBAKI,EAObC,EAAAC,UAAAC,WAAN,gGACRC,KAAKC,GAAGC,yBAGVL,EAAAC,UAAAK,sBAAA,SAAsBC,UACpBC,EAAAL,KAAKM,oBAAgB,MAAAD,SAAA,OAAA,EAAAA,EAAEE,KAAKH,EAAEI,SAGhCX,EAAAC,UAAAW,OAAA,WAAA,IAAAC,EAAAV,iBACE,IAAMW,EAAWC,iBAAiBZ,KAAKa,OACvC,IAAIC,GAAWC,GAAAV,EAAAL,KAAKc,YAAQ,MAAAT,SAAA,EAAAA,EAAIM,EAASG,YAAQ,MAAAC,SAAA,EAAAA,EAAI,MACrD,IAAMC,EAAkBhB,KAAKa,MAAM,SAAWI,QAAQjB,KAAKkB,WAC3D,IAAMC,GAAQR,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUS,SAAU,GAElC,GAAIpB,KAAKqB,KAAM,CACb,OAAOC,EAACC,KAAI,CAACC,MAAO,CAACH,KAAMrB,KAAKqB,OAAQF,GAG1C,OACEG,EAACC,KAAI,CAACC,MAAO,CAACC,UAAUC,EAAA1B,KAAKa,SAAK,MAAAa,SAAA,OAAA,EAAAA,EAAED,SAAUX,SAAQA,EAAEO,KAAMrB,KAAKqB,MAAOM,MAAO,CAACX,gBAAeA,IAC/FM,EAAA,QAAA,CACEM,KAAK,OACLC,YAAalB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUkB,YACvBC,SAAUnB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUoB,MACpBZ,MAAOA,EACPL,SAAUA,EACVW,UAAUO,EAAAhC,KAAKa,SAAK,MAAAmB,SAAA,OAAA,EAAAA,EAAEP,SACtBQ,IAAK,SAAAhC,GAAE,OAAKS,EAAKT,GAAKA,KAEvBD,KAAKkC,UACJZ,EAAA,uBAAA,CAAsBa,KAAMxC,cAC1B2B,EAAA,KAAA,KAAA,kBACAA,EAAA,OAAA,KACEA,EAAA,uBAAA,CACEc,MAAM,YACNjB,MAAOkB,MAAcC,UAAUtC,KAAKkB,WACpCqB,QAASF,MAAcC,UAAUE,KAAI,SAAAC,GAAI,MAAA,CAAML,MAAOK,EAAMtB,MAAOsB,MACnEC,SAAU,SAAAtC,GAAK,OAAAM,EAAKP,sBAAsBC,MAG5CkB,EAAA,qBAAA,CACEc,MAAM,aACNjB,MAAM,GACNU,YAAY,uBACZc,QAAS,SAAAvC,GACPA,EAAEwC,kBACFC,QAAQC,IAAI,MAAO1C,MAGvBkB,EAAA,qBAAA,CACEc,MAAM,cACNjB,MAAM,GACNU,YAAY,sBACZc,QAAS,SAAAvC,GACPA,EAAEwC,kBACFC,QAAQC,IAAI,MAAO1C,mBA9FL","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-textbox {\n font-family: $verdocs-primary-font;\n width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n background-color: transparent;\n transform-origin: bottom left;\n\n &.disabled {\n opacity: 0.5;\n }\n\n input {\n width: 100%;\n height: 100%;\n font-size: 11px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &:focus {\n outline: none;\n }\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.75s 2;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n // @see https://community.logmein.com/t5/LastPass-Support-Discussions/placeholder-text-overrides-data-lpignore-quot-true-quot/td-p/295135\n // LastPass is ignoring the data-lpignore attribute in some cases\n [data-lastpass-icon-root] {\n display: none !important;\n }\n}\n","import {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField} from '@verdocs/js-sdk/Envelopes/Types';\nimport {Component, h, Host, Prop, Event, EventEmitter, Method} from '@stencil/core';\nimport TemplateStore from '../../../utils/templateStore';\nimport {getFieldSettings} from '../../../utils/utils';\n\nconst settingsIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" width=\"20\"><path d=\"m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z\"/></svg>';\n\n/**\n * Display a text input field.\n */\n@Component({\n tag: 'verdocs-field-textbox',\n styleUrl: 'verdocs-field-textbox.scss',\n shadow: false,\n})\nexport class VerdocsFieldTextbox {\n private el: HTMLInputElement;\n\n /**\n * The document or template field to display.\n */\n @Prop() field: IDocumentField | ITemplateField | null = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop() editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop() moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop() done?: boolean = false;\n\n /**\n * If set, the field will be colored using this index value to select the background color.\n */\n @Prop() roleindex?: number = 0;\n\n /**\n * Event fired if the field is configurable when the recipient has changed.\n */\n @Event({composed: true}) recipientChanged: EventEmitter<string>;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n handleChangeRecipient(e: any) {\n this.recipientChanged?.emit(e.detail);\n }\n\n render() {\n const settings = getFieldSettings(this.field);\n let disabled = this.disabled ?? settings.disabled ?? false;\n const backgroundColor = this.field['rgba'] || getRGBA(this.roleindex);\n const value = settings?.result || '';\n\n if (this.done) {\n return <Host class={{done: this.done}}>{value}</Host>;\n }\n\n return (\n <Host class={{required: this.field?.required, disabled, done: this.done}} style={{backgroundColor}}>\n <input\n type=\"text\"\n placeholder={settings?.placeholder}\n tabIndex={settings?.order}\n value={value}\n disabled={disabled}\n required={this.field?.required}\n ref={el => (this.el = el)}\n />\n {this.editable && (\n <verdocs-button-panel icon={settingsIcon}>\n <h6>Field Settings</h6>\n <form>\n <verdocs-select-input\n label=\"Recipient\"\n value={TemplateStore.roleNames[this.roleindex]}\n options={TemplateStore.roleNames.map(role => ({label: role, value: role}))}\n onChange={e => this.handleChangeRecipient(e)}\n />\n\n <verdocs-text-input\n label=\"Field Name\"\n value=\"\"\n placeholder=\"Stored field name...\"\n onInput={e => {\n e.stopPropagation();\n console.log('ipt', e);\n }}\n />\n <verdocs-text-input\n label=\"Placeholder\"\n value=\"\"\n placeholder=\"Placeholder text...\"\n onInput={e => {\n e.stopPropagation();\n console.log('ipt', e);\n }}\n />\n </form>\n </verdocs-button-panel>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/elements/verdocs-field-textbox/verdocs-field-textbox.scss?tag=verdocs-field-textbox","src/components/elements/verdocs-field-textbox/verdocs-field-textbox.tsx"],"names":["verdocsFieldTextboxCss","settingsIcon","VerdocsFieldTextbox","class_1","prototype","focusField","this","el","focus","handleChangeRecipient","e","_a","recipientChanged","emit","detail","render","_this","settings","getFieldSettings","field","disabled","_b","backgroundColor","getRGBA","roleindex","value","result","done","h","Host","class","required","_c","style","type","placeholder","tabIndex","order","_d","ref","editable","icon","label","TemplateStore","roleNames","options","map","role","onChange","onInput","stopPropagation","console","log"],"mappings":"+tDAAA,IAAMA,uBAAyB,6zCCO/B,IAAMC,aACJ,6rCAUWC,oBAAmB,0HAM0B,mBAK3B,oBAMA,oBAKA,gBAKJ,qBAKI,EAObC,EAAAC,UAAAC,WAAN,gGACRC,KAAKC,GAAGC,yBAGVL,EAAAC,UAAAK,sBAAA,SAAsBC,UACpBC,EAAAL,KAAKM,oBAAgB,MAAAD,SAAA,OAAA,EAAAA,EAAEE,KAAKH,EAAEI,SAGhCX,EAAAC,UAAAW,OAAA,WAAA,IAAAC,EAAAV,iBACE,IAAMW,EAAWC,iBAAiBZ,KAAKa,OACvC,IAAIC,GAAWC,GAAAV,EAAAL,KAAKc,YAAQ,MAAAT,SAAA,EAAAA,EAAIM,EAASG,YAAQ,MAAAC,SAAA,EAAAA,EAAI,MACrD,IAAMC,EAAkBhB,KAAKa,MAAM,SAAWI,QAAQjB,KAAKkB,WAC3D,IAAMC,GAAQR,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUS,SAAU,GAElC,GAAIpB,KAAKqB,KAAM,CACb,OAAOC,EAACC,KAAI,CAACC,MAAO,CAACH,KAAMrB,KAAKqB,OAAQF,GAG1C,OACEG,EAACC,KAAI,CAACC,MAAO,CAACC,UAAUC,EAAA1B,KAAKa,SAAK,MAAAa,SAAA,OAAA,EAAAA,EAAED,SAAUX,SAAQA,EAAEO,KAAMrB,KAAKqB,MAAOM,MAAO,CAACX,gBAAeA,IAC/FM,EAAA,QAAA,CACEM,KAAK,OACLC,YAAalB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUkB,YACvBC,SAAUnB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUoB,MACpBZ,MAAOA,EACPL,SAAUA,EACVW,UAAUO,EAAAhC,KAAKa,SAAK,MAAAmB,SAAA,OAAA,EAAAA,EAAEP,SACtBQ,IAAK,SAAAhC,GAAE,OAAKS,EAAKT,GAAKA,KAEvBD,KAAKkC,UACJZ,EAAA,uBAAA,CAAsBa,KAAMxC,cAC1B2B,EAAA,KAAA,KAAA,kBACAA,EAAA,OAAA,KACEA,EAAA,uBAAA,CACEc,MAAM,YACNjB,MAAOkB,MAAcC,UAAUtC,KAAKkB,WACpCqB,QAASF,MAAcC,UAAUE,KAAI,SAAAC,GAAI,MAAA,CAAML,MAAOK,EAAMtB,MAAOsB,MACnEC,SAAU,SAAAtC,GAAK,OAAAM,EAAKP,sBAAsBC,MAG5CkB,EAAA,qBAAA,CACEc,MAAM,aACNjB,MAAM,GACNU,YAAY,uBACZc,QAAS,SAAAvC,GACPA,EAAEwC,kBACFC,QAAQC,IAAI,MAAO1C,MAGvBkB,EAAA,qBAAA,CACEc,MAAM,cACNjB,MAAM,GACNU,YAAY,sBACZc,QAAS,SAAAvC,GACPA,EAAEwC,kBACFC,QAAQC,IAAI,MAAO1C,mBA9FL","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-textbox {\n font-family: $verdocs-primary-font;\n width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n background-color: transparent;\n transform-origin: bottom left;\n\n &.disabled {\n opacity: 0.5;\n }\n\n input {\n width: 100%;\n height: 100%;\n font-size: 11px;\n background: none;\n font-weight: 500;\n transform-origin: 0 0;\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &:focus {\n outline: none;\n }\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.75s 2;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n\n // @see https://community.logmein.com/t5/LastPass-Support-Discussions/placeholder-text-overrides-data-lpignore-quot-true-quot/td-p/295135\n // LastPass is ignoring the data-lpignore attribute in some cases\n [data-lastpass-icon-root] {\n display: none !important;\n }\n}\n","import {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField} from '@verdocs/js-sdk/Envelopes/Types';\nimport {Component, h, Host, Prop, Event, EventEmitter, Method} from '@stencil/core';\nimport TemplateStore from '../../../utils/templateStore';\nimport {getFieldSettings} from '../../../utils/utils';\n\nconst settingsIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" width=\"20\"><path d=\"m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z\"/></svg>';\n\n/**\n * Display a text input field.\n */\n@Component({\n tag: 'verdocs-field-textbox',\n styleUrl: 'verdocs-field-textbox.scss',\n shadow: false,\n})\nexport class VerdocsFieldTextbox {\n private el: HTMLInputElement;\n\n /**\n * The document or template field to display.\n */\n @Prop() field: IDocumentField | ITemplateField | null = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop() editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop() moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop() done?: boolean = false;\n\n /**\n * If set, the field will be colored using this index value to select the background color.\n */\n @Prop() roleindex?: number = 0;\n\n /**\n * Event fired if the field is configurable when the recipient has changed.\n */\n @Event({composed: true}) recipientChanged: EventEmitter<string>;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n handleChangeRecipient(e: any) {\n this.recipientChanged?.emit(e.detail);\n }\n\n render() {\n const settings = getFieldSettings(this.field);\n let disabled = this.disabled ?? settings.disabled ?? false;\n const backgroundColor = this.field['rgba'] || getRGBA(this.roleindex);\n const value = settings?.result || '';\n\n if (this.done) {\n return <Host class={{done: this.done}}>{value}</Host>;\n }\n\n return (\n <Host class={{required: this.field?.required, disabled, done: this.done}} style={{backgroundColor}}>\n <input\n type=\"text\"\n placeholder={settings?.placeholder}\n tabIndex={settings?.order}\n value={value}\n disabled={disabled}\n required={this.field?.required}\n ref={el => (this.el = el)}\n />\n {this.editable && (\n <verdocs-button-panel icon={settingsIcon}>\n <h6>Field Settings</h6>\n <form>\n <verdocs-select-input\n label=\"Recipient\"\n value={TemplateStore.roleNames[this.roleindex]}\n options={TemplateStore.roleNames.map(role => ({label: role, value: role}))}\n onChange={e => this.handleChangeRecipient(e)}\n />\n\n <verdocs-text-input\n label=\"Field Name\"\n value=\"\"\n placeholder=\"Stored field name...\"\n onInput={e => {\n e.stopPropagation();\n console.log('ipt', e);\n }}\n />\n <verdocs-text-input\n label=\"Placeholder\"\n value=\"\"\n placeholder=\"Placeholder text...\"\n onInput={e => {\n e.stopPropagation();\n console.log('ipt', e);\n }}\n />\n </form>\n </verdocs-button-panel>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function l(e){try{a(o.next(e))}catch(e){n(e)}}function s(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):r(e.value).then(l,s)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,r,n,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,r&&(n=l[0]&2?r["return"]:l[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,l[1])).done)return n;if(r=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){i.label=l[1];break}if(l[0]===6&&i.label<n[1]){i.label=n[1];n=l;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(l);break}if(n[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];r=0}finally{o=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-f78d163d.js";import{g as getRGBA}from"./Colors-1b298092.js";import{g as getFieldSettings}from"./utils-2dbb5f63.js";import{f as format}from"./index-d264c496.js";var verdocsFieldTimestampCss='verdocs-field-timestamp{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0.5}verdocs-field-timestamp.done{opacity:1}verdocs-field-timestamp input{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:10px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-timestamp input.hide{display:none}verdocs-field-timestamp.required{border:1px solid #cc0000}verdocs-field-timestamp.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-timestamp verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-timestamp verdocs-button-panel[data-active],verdocs-field-timestamp verdocs-button-panel:hover{opacity:1}verdocs-field-timestamp verdocs-button-panel .icon svg{fill:#333333}verdocs-field-timestamp verdocs-button-panel .icon:hover svg{fill:#000000}';var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var VerdocsFieldTimestamp=function(){function e(e){registerInstance(this,e);this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.render=function(){var e=this;var t,i,o;var r=getFieldSettings(this.field);var n=(i=(t=this.disabled)!==null&&t!==void 0?t:r.disabled)!==null&&i!==void 0?i:false;var l=this.field["rgba"]||getRGBA(this.roleindex);var s=r.value||(new Date).toISOString();var a=new Date(s);var d=format(a,"MMM d, y");if(this.done){return h(Host,{class:{done:this.done}},d)}return h(Host,{class:{required:(o=this.field)===null||o===void 0?void 0:o.required,disabled:n},style:{backgroundColor:l}},h("input",{type:"text",placeholder:r===null||r===void 0?void 0:r.placeholder,tabIndex:r===null||r===void 0?void 0:r.order,value:d,disabled:true,ref:function(t){return e.el=t}}),this.editable&&h("verdocs-button-panel",{icon:settingsIcon},h("h6",null,"Field Settings"),h("form",null,h("verdocs-select-input",{label:"Recipient",options:[{label:"Buyer",value:"Buyer"},{label:"Seller",value:"Seller"}]}),h("verdocs-text-input",{label:"Field Name",value:"",placeholder:"Stored field name...",onInput:function(e){return console.log("ipt",e)}}),h("verdocs-text-input",{label:"Placeholder",value:"",placeholder:"Placeholder text...",onInput:function(e){return console.log("ipt",e)}}))))};return e}();VerdocsFieldTimestamp.style=verdocsFieldTimestampCss;export{VerdocsFieldTimestamp as verdocs_field_timestamp};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function l(e){try{a(o.next(e))}catch(e){n(e)}}function s(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):r(e.value).then(l,s)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,r,n,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,r&&(n=l[0]&2?r["return"]:l[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,l[1])).done)return n;if(r=0,n)l=[l[0]&2,n.value];switch(l[0]){case 0:case 1:n=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;r=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){i.label=l[1];break}if(l[0]===6&&i.label<n[1]){i.label=n[1];n=l;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(l);break}if(n[2])i.ops.pop();i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e];r=0}finally{o=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-f78d163d.js";import{g as getRGBA}from"./Colors-1b298092.js";import{g as getFieldSettings}from"./utils-53001d87.js";import{f as format}from"./index-d264c496.js";import"./Token-54690789.js";var verdocsFieldTimestampCss='verdocs-field-timestamp{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0.5}verdocs-field-timestamp.done{opacity:1}verdocs-field-timestamp input{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:10px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-timestamp input.hide{display:none}verdocs-field-timestamp.required{border:1px solid #cc0000}verdocs-field-timestamp.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-timestamp verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-timestamp verdocs-button-panel[data-active],verdocs-field-timestamp verdocs-button-panel:hover{opacity:1}verdocs-field-timestamp verdocs-button-panel .icon svg{fill:#333333}verdocs-field-timestamp verdocs-button-panel .icon:hover svg{fill:#000000}';var settingsIcon='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>';var VerdocsFieldTimestamp=function(){function e(e){registerInstance(this,e);this.field=null;this.disabled=false;this.editable=false;this.moveable=false;this.done=false;this.roleindex=0}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.el.focus();return[2]}))}))};e.prototype.render=function(){var e=this;var t,i,o;var r=getFieldSettings(this.field);var n=(i=(t=this.disabled)!==null&&t!==void 0?t:r.disabled)!==null&&i!==void 0?i:false;var l=this.field["rgba"]||getRGBA(this.roleindex);var s=r.value||(new Date).toISOString();var a=new Date(s);var d=format(a,"MMM d, y");if(this.done){return h(Host,{class:{done:this.done}},d)}return h(Host,{class:{required:(o=this.field)===null||o===void 0?void 0:o.required,disabled:n},style:{backgroundColor:l}},h("input",{type:"text",placeholder:r===null||r===void 0?void 0:r.placeholder,tabIndex:r===null||r===void 0?void 0:r.order,value:d,disabled:true,ref:function(t){return e.el=t}}),this.editable&&h("verdocs-button-panel",{icon:settingsIcon},h("h6",null,"Field Settings"),h("form",null,h("verdocs-select-input",{label:"Recipient",options:[{label:"Buyer",value:"Buyer"},{label:"Seller",value:"Seller"}]}),h("verdocs-text-input",{label:"Field Name",value:"",placeholder:"Stored field name...",onInput:function(e){return console.log("ipt",e)}}),h("verdocs-text-input",{label:"Placeholder",value:"",placeholder:"Placeholder text...",onInput:function(e){return console.log("ipt",e)}}))))};return e}();VerdocsFieldTimestamp.style=verdocsFieldTimestampCss;export{VerdocsFieldTimestamp as verdocs_field_timestamp};
2
2
  //# sourceMappingURL=verdocs-field-timestamp.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"names":["verdocsFieldTimestampCss","settingsIcon","VerdocsFieldTimestamp","class_1","prototype","focusField","this","el","focus","render","_this","settings","getFieldSettings","field","disabled","_b","_a","backgroundColor","getRGBA","roleindex","value","Date","toISOString","dt","formatted","format","done","h","Host","class","required","_c","style","type","placeholder","tabIndex","order","ref","editable","icon","label","options","onInput","e","console","log"],"mappings":"+oDAAA,IAAMA,yBAA2B,kuCCOjC,IAAMC,aACJ,6rCAUWC,sBAAqB,6DAMwB,mBAK3B,oBAMA,oBAKA,gBAKJ,qBAKI,EAEbC,EAAAC,UAAAC,WAAN,gGACRC,KAAKC,GAAGC,yBAGVL,EAAAC,UAAAK,OAAA,WAAA,IAAAC,EAAAJ,eACE,IAAMK,EAAWC,iBAAiBN,KAAKO,OACvC,IAAMC,GAAWC,GAAAC,EAAAV,KAAKQ,YAAQ,MAAAE,SAAA,EAAAA,EAAIL,EAASG,YAAQ,MAAAC,SAAA,EAAAA,EAAI,MACvD,IAAME,EAAkBX,KAAKO,MAAM,SAAWK,QAAQZ,KAAKa,WAC3D,IAAMC,EAAQT,EAASS,QAAS,IAAIC,MAAOC,cAE3C,IAAMC,EAAK,IAAIF,KAAKD,GACpB,IAAMI,EAAYC,OAAOF,EAAI,YAE7B,GAAIjB,KAAKoB,KAAM,CACb,OAAOC,EAACC,KAAI,CAACC,MAAO,CAACH,KAAMpB,KAAKoB,OAAQF,GAG1C,OACEG,EAACC,KAAI,CAACC,MAAO,CAACC,UAAUC,EAAAzB,KAAKO,SAAK,MAAAkB,SAAA,OAAA,EAAAA,EAAED,SAAUhB,SAAQA,GAAGkB,MAAO,CAACf,gBAAeA,IAC9EU,EAAA,QAAA,CACEM,KAAK,OACLC,YAAavB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUuB,YACvBC,SAAUxB,IAAQ,MAARA,SAAQ,OAAA,EAARA,EAAUyB,MAGpBhB,MAAOI,EACPV,SAAU,KACVuB,IAAK,SAAA9B,GAAE,OAAKG,EAAKH,GAAKA,KAGvBD,KAAKgC,UACJX,EAAA,uBAAA,CAAsBY,KAAMtC,cAC1B0B,EAAA,KAAA,KAAA,kBACAA,EAAA,OAAA,KACEA,EAAA,uBAAA,CACEa,MAAM,YACNC,QAAS,CACP,CAACD,MAAO,QAASpB,MAAO,SACxB,CAACoB,MAAO,SAAUpB,MAAO,aAI7BO,EAAA,qBAAA,CAAoBa,MAAM,aAAapB,MAAM,GAAGc,YAAY,uBAAuBQ,QAAS,SAAAC,GAAK,OAAAC,QAAQC,IAAI,MAAOF,MACpHhB,EAAA,qBAAA,CAAoBa,MAAM,cAAcpB,MAAM,GAAGc,YAAY,sBAAsBQ,QAAS,SAAAC,GAAK,OAAAC,QAAQC,IAAI,MAAOF,mBA7EhG","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-field-timestamp {\n font-family: $verdocs-primary-font;\n width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n background-color: transparent;\n transform-origin: bottom left;\n opacity: 0.5;\n\n &.done {\n opacity: 1;\n }\n\n input {\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n background: none;\n font-size: 10px;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.75s 2;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n}\n","import {format} from 'date-fns';\nimport {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField} from '@verdocs/js-sdk/Envelopes/Types';\nimport {Component, h, Host, Prop, Method} from '@stencil/core';\nimport {getFieldSettings} from '../../../utils/utils';\n\nconst settingsIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" width=\"20\"><path d=\"m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z\"/></svg>';\n\n/**\n * Display a timestamp field.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * The document or template field to display.\n */\n @Prop() field: IDocumentField | ITemplateField | null = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop() editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop() moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop() done?: boolean = false;\n\n /**\n * If set, the field will be colored using this index value to select the background color.\n */\n @Prop() roleindex?: number = 0;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n render() {\n const settings = getFieldSettings(this.field);\n const disabled = this.disabled ?? settings.disabled ?? false;\n const backgroundColor = this.field['rgba'] || getRGBA(this.roleindex);\n const value = settings.value || new Date().toISOString();\n\n const dt = new Date(value);\n const formatted = format(dt, 'MMM d, y');\n\n if (this.done) {\n return <Host class={{done: this.done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required: this.field?.required, disabled}} style={{backgroundColor}}>\n <input\n type=\"text\"\n placeholder={settings?.placeholder}\n tabIndex={settings?.order}\n // TODO: It would really make more sense to show the date and time but the default width of 64px for this field\n // is encoded in a ton of existing entries in the database and is hard to change.\n value={formatted}\n disabled={true}\n ref={el => (this.el = el)}\n />\n\n {this.editable && (\n <verdocs-button-panel icon={settingsIcon}>\n <h6>Field Settings</h6>\n <form>\n <verdocs-select-input\n label=\"Recipient\"\n options={[\n {label: 'Buyer', value: 'Buyer'},\n {label: 'Seller', value: 'Seller'},\n ]}\n />\n\n <verdocs-text-input label=\"Field Name\" value=\"\" placeholder=\"Stored field name...\" onInput={e => console.log('ipt', e)} />\n <verdocs-text-input label=\"Placeholder\" value=\"\" placeholder=\"Placeholder text...\" onInput={e => console.log('ipt', e)} />\n </form>\n </verdocs-button-panel>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.scss?tag=verdocs-field-timestamp","src/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.tsx"],"names":["verdocsFieldTimestampCss","settingsIcon","VerdocsFieldTimestamp","class_1","prototype","focusField","this","el","focus","render","_this","settings","getFieldSettings","field","disabled","_b","_a","backgroundColor","getRGBA","roleindex","value","Date","toISOString","dt","formatted","format","done","h","Host","class","required","_c","style","type","placeholder","tabIndex","order","ref","editable","icon","label","options","onInput","e","console","log"],"mappings":"2qDAAA,IAAMA,yBAA2B,kuCCOjC,IAAMC,aACJ,6rCAUWC,sBAAqB,6DAMwB,mBAK3B,oBAMA,oBAKA,gBAKJ,qBAKI,EAEbC,EAAAC,UAAAC,WAAN,gGACRC,KAAKC,GAAGC,yBAGVL,EAAAC,UAAAK,OAAA,WAAA,IAAAC,EAAAJ,eACE,IAAMK,EAAWC,iBAAiBN,KAAKO,OACvC,IAAMC,GAAWC,GAAAC,EAAAV,KAAKQ,YAAQ,M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width: 150px;\n height: 15px;\n display: block;\n font-size: 11px;\n position: relative;\n background-color: transparent;\n transform-origin: bottom left;\n opacity: 0.5;\n\n &.done {\n opacity: 1;\n }\n\n input {\n box-sizing: border-box;\n color: rgba(0, 0, 0, 0.87);\n font-weight: 500;\n transform-origin: 0 0;\n height: 100%;\n width: 100%;\n background: none;\n font-size: 10px;\n border: 1px solid rgba(0, 0, 0, 0.2);\n\n &.hide {\n display: none;\n }\n }\n\n &.required {\n border: 1px solid rgb(204, 0, 0);\n }\n\n &.focused {\n animation: verdocs-field-pulse 0.75s 2;\n }\n\n verdocs-button-panel {\n top: -3px;\n left: -2px;\n opacity: 0.5;\n z-index: 1000;\n cursor: pointer;\n position: absolute;\n transform: scale(0.6);\n\n &[data-active],\n &:hover {\n opacity: 1;\n }\n\n .icon {\n svg {\n fill: #333333;\n }\n\n &:hover {\n svg {\n fill: #000000;\n }\n }\n }\n }\n}\n","import {format} from 'date-fns';\nimport {getRGBA} from '@verdocs/js-sdk/Utils/Colors';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField} from '@verdocs/js-sdk/Envelopes/Types';\nimport {Component, h, Host, Prop, Method} from '@stencil/core';\nimport {getFieldSettings} from '../../../utils/utils';\n\nconst settingsIcon =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" width=\"20\"><path d=\"m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z\"/></svg>';\n\n/**\n * Display a timestamp field.\n */\n@Component({\n tag: 'verdocs-field-timestamp',\n styleUrl: 'verdocs-field-timestamp.scss',\n shadow: false,\n})\nexport class VerdocsFieldTimestamp {\n private el: HTMLInputElement;\n\n /**\n * The document or template field to display.\n */\n @Prop() field: IDocumentField | ITemplateField | null = null;\n\n /**\n * If set, overrides the field's settings object. Primarily used to support \"preview\" modes where all fields are disabled.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * If set, a settings icon will be displayed on hover. The settings shown allow the field's recipient and other settings to be\n * changed, so it should typically only be enabled in the Builder.\n */\n @Prop() editable?: boolean = false;\n\n /**\n * If set, the field may be dragged to a new location. This should only be enabled in the Builder, or for self-placed fields.\n */\n @Prop() moveable?: boolean = false;\n\n /**\n * If set, the field is considered \"done\" and is drawn in a display-final-value state.\n */\n @Prop() done?: boolean = false;\n\n /**\n * If set, the field will be colored using this index value to select the background color.\n */\n @Prop() roleindex?: number = 0;\n\n @Method() async focusField() {\n this.el.focus();\n }\n\n render() {\n const settings = getFieldSettings(this.field);\n const disabled = this.disabled ?? settings.disabled ?? false;\n const backgroundColor = this.field['rgba'] || getRGBA(this.roleindex);\n const value = settings.value || new Date().toISOString();\n\n const dt = new Date(value);\n const formatted = format(dt, 'MMM d, y');\n\n if (this.done) {\n return <Host class={{done: this.done}}>{formatted}</Host>;\n }\n\n return (\n <Host class={{required: this.field?.required, disabled}} style={{backgroundColor}}>\n <input\n type=\"text\"\n placeholder={settings?.placeholder}\n tabIndex={settings?.order}\n // TODO: It would really make more sense to show the date and time but the default width of 64px for this field\n // is encoded in a ton of existing entries in the database and is hard to change.\n value={formatted}\n disabled={true}\n ref={el => (this.el = el)}\n />\n\n {this.editable && (\n <verdocs-button-panel icon={settingsIcon}>\n <h6>Field Settings</h6>\n <form>\n <verdocs-select-input\n label=\"Recipient\"\n options={[\n {label: 'Buyer', value: 'Buyer'},\n {label: 'Seller', value: 'Seller'},\n ]}\n />\n\n <verdocs-text-input label=\"Field Name\" value=\"\" placeholder=\"Stored field name...\" onInput={e => console.log('ipt', e)} />\n <verdocs-text-input label=\"Placeholder\" value=\"\" placeholder=\"Placeholder text...\" onInput={e => console.log('ipt', e)} />\n </form>\n </verdocs-button-panel>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n["throw"](e))}catch(e){a(e)}}function l(e){e.done?r(e.value):o(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];o=0}finally{n=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-dac04424.js";import{r as renderDocumentField,a as getRoleIndex}from"./utils-2dbb5f63.js";import{s as state}from"./templateStore-d9856192.js";import{l as loadTemplate}from"./Templates-bfa45a12.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-fd7b8a34.js";import"./Templates-0638b1e4.js";var verdocsPreviewCss='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null}e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(o){switch(o.label){case 0:this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}o.label=1;case 1:o.trys.push([1,3,,4]);console.log("[PREVIEW] Loading template ".concat(this.templateId));return[4,loadTemplate(this.endpoint,this.templateId)];case 2:o.sent();return[3,4];case 3:n=o.sent();console.log("[PREVIEW] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handleFieldChange=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){console.log("[PREVIEW] handleFieldChange",e,t,r);return[2]}))}))};e.prototype.handlePageRendered=function(e){var t=e.detail;console.log("[PREVIEW] Page rendered",t);var r=state.fields.filter((function(e){return e.page_sequence===t.pageNumber}));console.log("[PREVIEW] Fields on page",r);r.forEach((function(e){return renderDocumentField(e,t,getRoleIndex(state.roleNames,e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;if(state.loading||!state.template){return h(Host,null,h("verdocs-loader",null))}var t=__spreadArray([],state.template.pages,true);t.sort((function(e,t){return e.sequence-t.sequence}));return h(Host,null,t.map((function(t){console.log("rendering page",t);return h("verdocs-document-page",{pageImageUri:t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}();VerdocsPreview.style=verdocsPreviewCss;export{VerdocsPreview as verdocs_preview};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,r,n){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,a){function i(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n["throw"](e))}catch(e){a(e)}}function l(e){e.done?r(e.value):o(e.value).then(i,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return l([e,t])}}function l(i){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,o&&(a=i[0]&2?o["return"]:i[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,i[1])).done)return a;if(o=0,a)i=[i[0]&2,a.value];switch(i[0]){case 0:case 1:a=i;break;case 4:r.label++;return{value:i[1],done:false};case 5:r.label++;o=i[1];i=[0];continue;case 7:i=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1];a=i;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(i);break}if(a[2])r.ops.pop();r.trys.pop();continue}i=t.call(e,r)}catch(e){i=[6,e];o=0}finally{n=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-76dbf9b9.js";import{r as renderDocumentField,a as getRoleIndex}from"./utils-53001d87.js";import{s as state}from"./templateStore-a6dfb726.js";import{l as loadTemplate}from"./Templates-7ae1294e.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./Token-54690789.js";import"./index-fd7b8a34.js";import"./Templates-0638b1e4.js";var verdocsPreviewCss='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var VerdocsPreview=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null}e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(o){switch(o.label){case 0:this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}o.label=1;case 1:o.trys.push([1,3,,4]);console.log("[PREVIEW] Loading template ".concat(this.templateId));return[4,loadTemplate(this.endpoint,this.templateId)];case 2:o.sent();return[3,4];case 3:n=o.sent();console.log("[PREVIEW] Error loading template",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(r=n.response)===null||r===void 0?void 0:r.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handleFieldChange=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){console.log("[PREVIEW] handleFieldChange",e,t,r);return[2]}))}))};e.prototype.handlePageRendered=function(e){var t=e.detail;console.log("[PREVIEW] Page rendered",t);var r=state.fields.filter((function(e){return e.page_sequence===t.pageNumber}));console.log("[PREVIEW] Fields on page",r);r.forEach((function(e){return renderDocumentField(e,t,getRoleIndex(state.roleNames,e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;if(state.loading||!state.template){return h(Host,null,h("verdocs-loader",null))}var t=__spreadArray([],state.template.pages,true);t.sort((function(e,t){return e.sequence-t.sequence}));return h(Host,null,t.map((function(t){console.log("rendering page",t);return h("verdocs-document-page",{pageImageUri:t.display_uri,virtualWidth:612,virtualHeight:792,pageNumber:t.sequence,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}();VerdocsPreview.style=verdocsPreviewCss;export{VerdocsPreview as verdocs_preview};
2
2
  //# sourceMappingURL=verdocs-preview.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":["verdocsPreviewCss","VerdocsPreview","VerdocsEndpoint","getDefault","class_1","prototype","componentDidLoad","this","endpoint","loadSession","templateId","console","log","concat","loadTemplate","_d","sent","e_1","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","handleFieldChange","field","e","optionId","handlePageRendered","pageInfo","detail","fields","TemplateStore","filter","page_sequence","pageNumber","forEach","renderDocumentField","getRoleIndex","roleNames","role_name","disabled","editable","draggable","render","_this","loading","template","h","Host","pages","__spreadArray","sort","a","b","sequence","map","page","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","layers","name","type"],"mappings":"8nEAAA,IAAMA,kBAAoB,wbCoBbC,eAAc,6GAIWC,gBAAgBC,6BAKhB,KAS9BC,EAAAC,UAAAC,iBAAN,mIACEC,KAAKC,SAASC,cAEd,IAAKF,KAAKG,WAAY,CACpBC,QAAQC,IAAI,0CAAAC,OAA0CN,KAAKG,aAC3D,MAAA,CAAA,0CAIAC,QAAQC,IAAI,8BAAAC,OAA8BN,KAAKG,aAC/C,MAAA,CAAA,EAAMI,aAAaP,KAAKC,SAAUD,KAAKG,oBAAvCK,EAAAC,qCAEAL,QAAQC,IAAI,mCAAoCK,IAChDC,EAAAX,KAAKY,YAAQ,MAAAD,SAAA,OAAA,EAAAA,EAAEE,KAAK,IAA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ocs-primary-font;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h} from '@stencil/core';\nimport {Event, EventEmitter, Host} from '@stencil/core';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {getRoleIndex, renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport TemplateStore from '../../../utils/templateStore';\nimport {loadTemplate} from '../../../utils/Templates';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n // TODO: Move to state store so we can load this one time\n async componentDidLoad() {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n try {\n console.log(`[PREVIEW] Loading template ${this.templateId}`);\n await loadTemplate(this.endpoint, this.templateId);\n } catch (e) {\n console.log('[PREVIEW] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async handleFieldChange(field: ITemplateField, e: any, optionId?: string) {\n console.log('[PREVIEW] handleFieldChange', field, e, optionId);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[PREVIEW] Page rendered', pageInfo);\n\n const fields = TemplateStore.fields.filter(field => field.page_sequence === pageInfo.pageNumber);\n console.log('[PREVIEW] Fields on page', fields);\n fields.forEach(field => renderDocumentField(field, pageInfo, getRoleIndex(TemplateStore.roleNames, field.role_name), {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n // TODO: Render a better error\n if (TemplateStore.loading || !TemplateStore.template) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const pages = [...TemplateStore.template.pages];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Host>\n {pages.map(page => {\n console.log('rendering page', page);\n return (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/embeds/verdocs-preview/verdocs-preview.scss?tag=verdocs-preview","src/components/embeds/verdocs-preview/verdocs-preview.tsx"],"names":["verdocsPreviewCss","VerdocsPreview","VerdocsEndpoint","getDefault","class_1","prototype","componentDidLoad","this","endpoint","loadSession","templateId","console","log","concat","loadTemplate","_d","sent","e_1","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","handleFieldChange","field","e","optionId","handlePageRendered","pageInfo","detail","fields","TemplateStore","filter","page_sequence","pageNumber","forEach","renderDocumentField","getRoleIndex","roleNames","role_name","disabled","editable","draggable","render","_this","loading","template","h","Host","pages","__spreadArray","sort","a","b","sequence","map","page","pageImageUri","display_uri","virtualWidth","virtualHeight","onPageRendered","layers","name","type"],"mappings":"0pEAAA,IAAMA,kBAAoB,wbCoBbC,eAAc,6GAIWC,gBAAgBC,6BAKhB,KAS9BC,EAAAC,UAAAC,iBAAN,mIACEC,KAAKC,SAASC,cA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QAAQC,IAAI,iBAAkBiD,GAC9B,OACET,EAAA,wBAAA,CACEU,aAAcD,EAAKE,YACnBC,aAAc,IACdC,cAAe,IACf1B,WAAYsB,EAAKF,SACjBO,eAAgB,SAAApC,GAAK,OAAAmB,EAAKjB,mBAAmBF,IAC7CqC,OAAQ,CACN,CAACC,KAAM,OAAQC,KAAM,UACrB,CAACD,KAAM,WAAYC,KAAM,wBA1Ed","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-preview {\n font-family: $verdocs-primary-font;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n min-height: 200px;\n position: relative;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n\n div,\n canvas {\n box-sizing: border-box;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h} from '@stencil/core';\nimport {Event, EventEmitter, Host} from '@stencil/core';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {getRoleIndex, renderDocumentField} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport TemplateStore from '../../../utils/templateStore';\nimport {loadTemplate} from '../../../utils/Templates';\nimport {SDKError} from '../../../utils/errors';\n\n/**\n * Display a template preview experience. This will display the template's attached\n * documents with signing fields overlaid on each page. Fields will be color-coded\n * by recipient, and will be read-only (cannot be filled, moved, or altered).\n */\n@Component({\n tag: 'verdocs-preview',\n styleUrl: 'verdocs-preview.scss',\n shadow: false,\n})\nexport class VerdocsPreview {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop() templateId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n // TODO: Move to state store so we can load this one time\n async componentDidLoad() {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);\n return;\n }\n\n try {\n console.log(`[PREVIEW] Loading template ${this.templateId}`);\n await loadTemplate(this.endpoint, this.templateId);\n } catch (e) {\n console.log('[PREVIEW] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async handleFieldChange(field: ITemplateField, e: any, optionId?: string) {\n console.log('[PREVIEW] handleFieldChange', field, e, optionId);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[PREVIEW] Page rendered', pageInfo);\n\n const fields = TemplateStore.fields.filter(field => field.page_sequence === pageInfo.pageNumber);\n console.log('[PREVIEW] Fields on page', fields);\n fields.forEach(field => renderDocumentField(field, pageInfo, getRoleIndex(TemplateStore.roleNames, field.role_name), {disabled: true, editable: false, draggable: false}));\n }\n\n render() {\n // TODO: Render a better error\n if (TemplateStore.loading || !TemplateStore.template) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const pages = [...TemplateStore.template.pages];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Host>\n {pages.map(page => {\n console.log('rendering page', page);\n return (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Host>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-dac04424.js";import{a as getTemplates}from"./Templates-0638b1e4.js";var __awaiter=undefined&&undefined.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var getSearchHistory=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e.api.get("/search/history").then((function(e){return e.data}))]}))}))};var TemplateIcon='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var DocumentIcon$1='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var verdocsQuickFunctionsCss='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';var VerdocsQuickFunctions=function(){function e(e){registerInstance(this,e);this.createTemplate=createEvent(this,"createTemplate",7);this.createDocument=createEvent(this,"createDocument",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return h("div",{class:"container"},h("p",{class:"title"},"Quick Create"),h("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:TemplateIcon},"Template"),h("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:DocumentIcon$1},"Document"))};return e}();VerdocsQuickFunctions.style=verdocsQuickFunctionsCss;var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var verdocsSearchActivityCss='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:#1e2031}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#cccccc}';var VerdocsSearchActivity=function(){function e(e){registerInstance(this,e);this.entrySelected=createEvent(this,"entrySelected",7);this.endpoint=VerdocsEndpoint.getDefault();this.type="recent";this.options=undefined;this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();var t=function(t){var n;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((n=t===null||t===void 0?void 0:t.response)===null||n===void 0?void 0:n.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";getSearchHistory(this.endpoint).then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";getSearchHistory(this.endpoint).then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";getTemplates(this.endpoint,{is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return h("div",{class:"container"},h("p",{class:"title"},this.title),h("div",{class:"items"},this.recent.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"},"Test")))})),this.saved.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"})))})),t&&h("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}();VerdocsSearchActivity.style=verdocsSearchActivityCss;var SearchIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n';var CloseIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n';var verdocsSearchBoxCss='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:#707ae5}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#55bc81;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var VerdocsSearchBox=function(){function e(e){registerInstance(this,e);this.searchClicked=createEvent(this,"searchClicked",7);this.typeChanged=createEvent(this,"typeChanged",7);this.queryChanged=createEvent(this,"queryChanged",7);this.endpoint=VerdocsEndpoint.getDefault();this.placeholder="search documents, templates, people...";this.type="all";this.query="";this.grabsFocus=false}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.inputEl.focus();return[2]}))}))};e.prototype.componentDidRender=function(){if(this.grabsFocus){this.inputEl.focus()}};e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return h("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&h("span",{class:"type"},this.type,"s ",h("button",{class:"remove",innerHTML:CloseIcon,onClick:function(){return e.handleClearFilter()}})),h("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)},ref:function(t){return e.inputEl=t}}),h("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},h("span",{innerHTML:SearchIcon}),"Search"))};return e}();VerdocsSearchBox.style=verdocsSearchBoxCss;export{VerdocsQuickFunctions as verdocs_quick_functions,VerdocsSearchActivity as verdocs_search_activity,VerdocsSearchBox as verdocs_search_box};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-76dbf9b9.js";import{a as getTemplates}from"./Templates-0638b1e4.js";import"./Token-54690789.js";var __awaiter=undefined&&undefined.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?n(e.value):i(e.value).then(s,c)}a((r=r.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var getSearchHistory=function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e.api.get("/search/history").then((function(e){return e.data}))]}))}))};var TemplateIcon='<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>';var DocumentIcon$1='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var verdocsQuickFunctionsCss='verdocs-quick-functions{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}';var VerdocsQuickFunctions=function(){function e(e){registerInstance(this,e);this.createTemplate=createEvent(this,"createTemplate",7);this.createDocument=createEvent(this,"createDocument",7);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.handleCreateTemplate=function(){this.createTemplate.emit()};e.prototype.handleCreateDocument=function(){this.createDocument.emit()};e.prototype.render=function(){var e=this;return h("div",{class:"container"},h("p",{class:"title"},"Quick Create"),h("button",{onClick:function(){return e.handleCreateTemplate()},innerHTML:TemplateIcon},"Template"),h("button",{onClick:function(){return e.handleCreateDocument()},innerHTML:DocumentIcon$1},"Document"))};return e}();VerdocsQuickFunctions.style=verdocsQuickFunctionsCss;var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z"/></svg>';var verdocsSearchActivityCss='verdocs-search-activity{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-activity .container{display:-ms-flexbox;display:flex;width:240px;color:#ffffff;-ms-flex-direction:column;flex-direction:column;text-transform:uppercase;padding:10px 10px 20px 10px;background-color:#1e2031}verdocs-search-activity .title{font-size:22px;font-weight:700;line-height:30px}verdocs-search-activity .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}verdocs-search-activity .item:hover{cursor:pointer}verdocs-search-activity .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}verdocs-search-activity .icon svg{fill:#707ae5;width:22px;height:22px}verdocs-search-activity .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}verdocs-search-activity .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-search-activity .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}verdocs-search-activity .empty{text-transform:none;line-height:22px;color:#cccccc}';var VerdocsSearchActivity=function(){function e(e){registerInstance(this,e);this.entrySelected=createEvent(this,"entrySelected",7);this.endpoint=VerdocsEndpoint.getDefault();this.type="recent";this.options=undefined;this.emptyMessage="You do not have any starred searches.";this.authFailure=false;this.title="Recent Searches";this.recent=[];this.saved=[];this.starred=[]}e.prototype.componentWillLoad=function(){var e=this;this.endpoint.loadSession();var t=function(t){var n;console.warn("[Verdocs/search-activity] Error getting search data",t);if(((n=t===null||t===void 0?void 0:t.response)===null||n===void 0?void 0:n.status)===401){e.authFailure=true}};switch(this.type){case"recent":this.title="Recent Searches";this.emptyMessage="You do not have any recent searches.";getSearchHistory(this.endpoint).then((function(t){return e.recent=t.recent})).catch(t);break;case"saved":this.title="Saved Searches";this.emptyMessage="You do not have any saved searches.";getSearchHistory(this.endpoint).then((function(t){return e.saved=t.saved})).catch(t);break;case"starred":this.title="My Starred items";this.emptyMessage="You do not have any starred templates.";getTemplates(this.endpoint,{is_starred:true}).then((function(t){return e.starred=t})).catch(t);break}};e.prototype.handleSelectEntry=function(e){this.entrySelected.emit(e)};e.prototype.computePagesText=function(e){if(e<2){return"".concat(e," Page")}else{return"".concat(e," Pages")}};e.prototype.computeRecipientsText=function(e){if(typeof e==="object"){return e.join(", ")}else if(e>1){return"".concat(e," Recipients")}else{return"".concat(e," Recipient")}};e.prototype.render=function(){var e=this;var t=this.recent.length<1&&this.saved.length<1&&this.starred.length<1;return h("div",{class:"container"},h("p",{class:"title"},this.title),h("div",{class:"items"},this.recent.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"},"Test")))})),this.saved.map((function(t){return h("button",{class:"item",onClick:function(){return e.handleSelectEntry(t)}},h("div",{class:"icon",innerHTML:DocumentIcon}),h("div",{class:"details"},h("div",{class:"item-title"},t.params.q),h("div",{class:"info"})))})),t&&h("div",{class:"empty"},this.authFailure?"Authentication required":this.emptyMessage)))};return e}();VerdocsSearchActivity.style=verdocsSearchActivityCss;var SearchIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M23.4809 20.7176L17.9111 15.2536C19.0961 13.6368 19.727 11.6926 19.7128 9.70131C19.7201 7.53345 18.9846 5.42606 17.6244 3.71753C16.2642 2.009 14.3581 0.798456 12.2123 0.280282C10.0665 -0.237892 7.80552 -0.0336342 5.79227 0.86026C3.77902 1.75415 2.13038 3.28582 1.1111 5.20931C0.0918114 7.1328 -0.238985 9.33652 0.171813 11.4666C0.582612 13.5967 1.71117 15.5296 3.37628 16.9548C5.0414 18.3801 7.14646 19.2151 9.35344 19.3257C11.5604 19.4364 13.7413 18.8162 15.5458 17.5649L21.1372 23.05L21.1563 23.0663C21.4841 23.3487 21.9039 23.507 22.3401 23.5128C22.7823 23.5125 23.2063 23.3402 23.5191 23.0337V23.0337C23.6749 22.8812 23.7979 22.6995 23.8804 22.4993C23.963 22.2991 24.0036 22.0847 23.9997 21.8688C23.9959 21.6529 23.9477 21.44 23.858 21.2428C23.7683 21.0456 23.639 20.8682 23.4778 20.7212L23.4809 20.7176ZM14.5167 14.1975C13.4564 15.2349 12.0623 15.8797 10.5719 16.022C9.08145 16.1644 7.58681 15.7955 6.34249 14.9781C5.09816 14.1608 4.18109 12.9456 3.74751 11.5395C3.31393 10.1334 3.39064 8.6233 3.96455 7.26643C4.53846 5.90955 5.57409 4.7898 6.89507 4.09787C8.21606 3.40594 9.74071 3.18461 11.2093 3.4716C12.678 3.75858 13.9998 4.53612 14.9497 5.6718C15.8996 6.80748 16.4188 8.23105 16.4189 9.7001C16.4196 10.5357 16.2519 11.3632 15.9254 12.135C15.599 12.9069 15.1202 13.6078 14.5167 14.1975V14.1975Z" fill="white"/>\n</svg>\n';var CloseIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.0739 11.7565L19.7127 6.23228C20.0875 5.85692 20.0875 5.25309 19.7127 4.87773L19.0213 4.20046C18.6382 3.82511 18.0219 3.82511 17.6387 4.20046L12 9.72472L6.36127 4.20046C5.97814 3.82511 5.36179 3.82511 4.97866 4.20046L4.28735 4.87773C3.90422 5.25309 3.90422 5.85692 4.28735 6.23228L9.92608 11.7565L4.28735 17.2808C3.90422 17.6561 3.90422 18.26 4.28735 18.6353L4.97866 19.3126C5.36179 19.688 5.97814 19.688 6.36127 19.3126L12 13.7883L17.6387 19.3126C18.0219 19.688 18.6382 19.688 19.0213 19.3126L19.7127 18.6353C20.0958 18.26 20.0958 17.6561 19.7127 17.2808L14.0739 11.7565Z" fill="white"/>\n</svg>\n';var verdocsSearchBoxCss='verdocs-search-box{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-search-box form{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:45px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0 0;border-radius:5px;-ms-flex-align:center;align-items:center;background-color:#fff;padding:0 8px;border-width:1px;border-style:solid;border-color:#707ae5}verdocs-search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}verdocs-search-box form input:focus{outline:none}verdocs-search-box form button.search{cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border:none;width:100px;height:28px;font-weight:700;font-size:10px;letter-spacing:1px;background-color:#55bc81;text-transform:uppercase;color:#fff}verdocs-search-box form .type{background-color:#707ae5;height:30px;display:-ms-inline-flexbox;display:inline-flex;padding:1px 0 2px 10px;font-size:13px;line-height:16px;border-radius:4px;-ms-flex-pack:center;justify-content:center;text-transform:uppercase;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#fff;margin-right:10px}verdocs-search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}verdocs-search-box form svg{width:12px;height:12px;margin-right:6px}verdocs-search-box ::-webkit-input-placeholder{color:#aeb4bf}verdocs-search-box ::-moz-placeholder{color:#aeb4bf}verdocs-search-box :-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::-ms-input-placeholder{color:#aeb4bf}verdocs-search-box ::placeholder{color:#aeb4bf}';var VerdocsSearchBox=function(){function e(e){registerInstance(this,e);this.searchClicked=createEvent(this,"searchClicked",7);this.typeChanged=createEvent(this,"typeChanged",7);this.queryChanged=createEvent(this,"queryChanged",7);this.endpoint=VerdocsEndpoint.getDefault();this.placeholder="search documents, templates, people...";this.type="all";this.query="";this.grabsFocus=false}e.prototype.focusField=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.inputEl.focus();return[2]}))}))};e.prototype.componentDidRender=function(){if(this.grabsFocus){this.inputEl.focus()}};e.prototype.handleSearch=function(e){this.searchClicked.emit({type:this.type,query:this.query});e.preventDefault();return false};e.prototype.handleChange=function(e){this.queryChanged.emit(e.target.value)};e.prototype.handleClearFilter=function(){this.typeChanged.emit("all")};e.prototype.handleKeyUp=function(e){if(e.key==="Enter"){this.searchClicked.emit({type:this.type,query:this.query})}};e.prototype.render=function(){var e=this;return h("form",{onSubmit:function(t){return e.handleSearch(t)}},this.type!==undefined&&this.type!=="all"&&h("span",{class:"type"},this.type,"s ",h("button",{class:"remove",innerHTML:CloseIcon,onClick:function(){return e.handleClearFilter()}})),h("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.handleChange(t)},onKeyUp:function(t){return e.handleKeyUp(t)},ref:function(t){return e.inputEl=t}}),h("button",{onClick:function(t){return e.handleSearch(t)},class:"search"},h("span",{innerHTML:SearchIcon}),"Search"))};return e}();VerdocsSearchBox.style=verdocsSearchBoxCss;export{VerdocsQuickFunctions as verdocs_quick_functions,VerdocsSearchActivity as verdocs_search_activity,VerdocsSearchBox as verdocs_search_box};
2
2
  //# sourceMappingURL=verdocs-quick-functions_3.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["node_modules/@verdocs/js-sdk/Search/Content.js","src/components/elements/verdocs-quick-functions/verdocs-quick-functions.scss?tag=verdocs-quick-functions","src/components/elements/verdocs-quick-functions/verdocs-quick-functions.tsx","src/components/elements/verdocs-search-activity/verdocs-search-activity.scss?tag=verdocs-search-activity","src/components/elements/verdocs-search-activity/verdocs-search-activity.tsx","src/components/elements/verdocs-search-box/verdocs-search-box.scss?tag=verdocs-search-box","src/components/elements/verdocs-search-box/verdocs-search-box.tsx"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","getSearchHistory","endpoint","_a","api","get","r","data","verdocsQuickFunctionsCss","VerdocsQuickFunctions","VerdocsEndpoint","getDefault","prototype","handleCreateTemplate","createTemplate","emit","handleCreateDocument","createDocument","render","_this","h","class","onClick","innerHTML","TemplateIcon","DocumentIcon","verdocsSearchActivityCss","VerdocsSearchActivity","componentWillLoad","loadSession","errorHandler","console","warn","response","status","authFailure","type","title","emptyMessage","recent","catch","saved","getTemplates","is_starred","starred","handleSelectEntry","entry","entrySelected","computePagesText","pages","concat","computeRecipientsText","recipients","join","showEmpty","map","params","q","option","verdocsSearchBoxCss","VerdocsSearchBox","class_1","focusField","inputEl","focus","componentDidRender","grabsFocus","handleSearch","searchClicked","query","preventDefault","handleChange","queryChanged","target","handleClearFilter","typeChanged","handleKeyUp","key","onSubmit","undefined","CloseIcon","placeholder","onInput","onKeyUp","ref","el","SearchIcon"],"mappings":"spDAOA,IAAIA,UAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAKH,IAAMA,EAAIK,WAAU,SAAUD,EAASE,GAC/C,SAASC,EAAUJ,GAAS,IAAMK,EAAKP,EAAUQ,KAAKN,IAAW,MAAOO,GAAKJ,EAAOI,IACpF,SAASC,EAASR,GAAS,IAAMK,EAAKP,EAAU,SAASE,IAAW,MAAOO,GAAKJ,EAAOI,IACvF,SAASF,EAAKI,GAAUA,EAAOC,KAAOT,EAAQQ,EAAOT,OAASD,EAAMU,EAAOT,OAAOW,KAAKP,EAAWI,GAClGH,GAAMP,EAAYA,EAAUc,MAAMjB,EAASC,GAAc,KAAKU,YAGtE,IAAIO,YAAenB,WAAQA,UAAKmB,aAAgB,SAAUlB,EAASmB,GAC/D,IAAIC,EAAI,CAAEC,MAAO,EAAGC,KAAM,WAAa,GAAIC,EAAE,GAAK,EAAG,MAAMA,EAAE,GAAI,OAAOA,EAAE,IAAOC,KAAM,GAAIC,IAAK,IAAMC,EAAGC,EAAGJ,EAAGK,EAC/G,OAAOA,EAAI,CAAEjB,KAAMkB,EAAK,GAAIC,MAASD,EAAK,GAAIE,OAAUF,EAAK,WAAaG,SAAW,aAAeJ,EAAEI,OAAOC,UAAY,WAAa,OAAO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KAAK5C,EAAEsG,OAAO7G,QAGlCiG,EAAAjD,UAAA8D,kBAAA,WACEpH,KAAKqH,YAAY5D,KAAK,QAGxB8C,EAAAjD,UAAAgE,YAAA,SAAYzG,GACV,GAAIA,EAAE0G,MAAQ,QAAS,CACrBvH,KAAK8G,cAAcrD,KAAK,CAACqB,KAAM9E,KAAK8E,KAAMiC,MAAO/G,KAAK+G,UAI1DR,EAAAjD,UAAAM,OAAA,WAAA,IAAAC,EAAA7D,KACE,OACE8D,EAAA,OAAA,CAAM0D,SAAU,SAAA3G,GAAK,OAAAgD,EAAKgD,aAAahG,KACpCb,KAAK8E,OAAS2C,WAAazH,KAAK8E,OAAS,OACxChB,EAAA,OAAA,CAAMC,MAAM,QACT/D,KAAK8E,KAAI,KAAGhB,EAAA,SAAA,CAAQC,MAAM,SAASE,UAAWyD,UAAW1D,QAAS,WAAM,OAAAH,EAAKuD,wBAGlFtD,EAAA,QAAA,CACEgB,KAAK,OACLxE,MAAON,KAAK+G,MACZY,YAAa3H,KAAK2H,YAClBC,QAAS,SAAA/G,GAAK,OAAAgD,EAAKoD,aAAapG,IAChCgH,QAAS,SAAAhH,GAAK,OAAAgD,EAAKyD,YAAYzG,IAC/BiH,IAAK,SAAAC,GAAE,OAAKlE,EAAK4C,QAAUsB,KAE7BjE,EAAA,SAAA,CAAQE,QAAS,SAAAnD,GAAK,OAAAgD,EAAKgD,aAAahG,IAAIkD,MAAM,UAChDD,EAAA,OAAA,CAAMG,UAAW+D,aAAc,qBA1FZ","sourcesContent":["/**\n * Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended\n * to locate items across all content types. More specific retrievals may be performed using the various \"list\" endpoints within\n * each collection (e.g. {@link Envelopes.Envelopes.searchEnvelopes} or {@link Templates.Templates.searchTemplates}).\n *\n * @module\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each\n * type but this may be expanded in the future. Client UI's should self-limit display counts as needed.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const {recent, saved} = await Content.getSearchHistory();\n * ```\n */\nexport var getSearchHistory = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get('/search/history')\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});\n * ```\n */\nexport var saveSearch = function (endpoint, name, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/search/saved', { name: name, params: params })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for documents matching various criteria.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const {result, page, total} = await Documents.search({ ... });\n * ```\n */\nexport var searchContent = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/search/content', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n","@import '../../../theme.scss';\n\nverdocs-quick-functions {\n font-family: $verdocs-primary-font;\n\n .container {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n width: 240px;\n background-color: $verdocs-bg-5;\n text-transform: uppercase;\n padding: 10px 10px 20px 10px;\n font-family: sans-serif;\n color: #ffffff;\n }\n\n .title {\n font-size: 22px;\n font-weight: 700;\n line-height: 30px;\n margin: 1em 0 40px 0;\n }\n\n button {\n width: 140px;\n height: 40px;\n border: none;\n display: flex;\n color: $verdocs-grey-4;\n cursor: pointer;\n font-size: 14px;\n font-weight: 700;\n line-height: 25px;\n align-items: center;\n margin-bottom: 20px;\n border-radius: 5px;\n text-transform: uppercase;\n justify-content: space-evenly;\n background-color: $verdocs-green;\n }\n\n button svg {\n fill: $verdocs-grey-4;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop} from '@stencil/core';\nimport TemplateIcon from './template-icon.svg';\nimport DocumentIcon from './document-icon.svg';\n\n/**\n * Display quick-function buttons for creating templates and documents.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-quick-functions',\n styleUrl: 'verdocs-quick-functions.scss',\n})\nexport class VerdocsQuickFunctions {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) createTemplate: EventEmitter;\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) createDocument: EventEmitter;\n\n handleCreateTemplate() {\n this.createTemplate.emit();\n }\n\n handleCreateDocument() {\n this.createDocument.emit();\n }\n\n render() {\n return (\n <div class=\"container\">\n <p class=\"title\">Quick Create</p>\n <button onClick={() => this.handleCreateTemplate()} innerHTML={TemplateIcon}>\n Template\n </button>\n <button onClick={() => this.handleCreateDocument()} innerHTML={DocumentIcon}>\n Document\n </button>\n </div>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-search-activity {\n font-family: $verdocs-primary-font;\n\n .container {\n display: flex;\n width: 240px;\n color: $verdocs-grey-4;\n flex-direction: column;\n text-transform: uppercase;\n padding: 10px 10px 20px 10px;\n background-color: $verdocs-bg-5;\n }\n\n .title {\n font-size: 22px;\n font-weight: 700;\n line-height: 30px;\n }\n\n .items {\n display: flex;\n margin-top: 20px;\n flex-direction: column;\n }\n\n .item {\n border: none;\n display: flex;\n text-align: left;\n margin-bottom: 20px;\n flex-direction: row;\n background: transparent;\n }\n\n .item:hover {\n cursor: pointer;\n }\n\n .icon {\n flex: 0 0 22px;\n margin-right: 14px;\n }\n\n .icon svg {\n fill: $verdocs-light-blue;\n width: 22px;\n height: 22px;\n }\n\n .details {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n }\n\n .item-title {\n font-size: 16px;\n font-weight: 400;\n color: $verdocs-grey-4;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .info {\n font-size: 14px;\n font-weight: 500;\n line-height: 23px;\n color: $verdocs-grey-2;\n }\n\n .empty {\n text-transform: none;\n line-height: 22px;\n color: $verdocs-bg-1;\n }\n}\n","import {ITemplate} from '@verdocs/js-sdk/Templates/Types';\nimport {getSearchHistory} from '@verdocs/js-sdk/Search/Content';\nimport {getTemplates} from '@verdocs/js-sdk/Templates/Templates';\nimport {IRecentSearch, ISavedSearch} from '@verdocs/js-sdk/Search/Types';\nimport {Component, h, Prop, Event, EventEmitter, State} from '@stencil/core';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport DocumentIcon from './document-icon.svg';\n\n/**\n * Display a list of starred items.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-search-activity',\n styleUrl: 'verdocs-search-activity.scss',\n shadow: false,\n})\nexport class VerdocsSearchActivity {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n @Prop() type: 'recent' | 'saved' | 'starred' = 'recent';\n\n @Prop() options: any;\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) entrySelected: EventEmitter<IRecentSearch>;\n\n @State() emptyMessage = 'You do not have any starred searches.';\n\n @State() authFailure = false;\n\n @State() title = 'Recent Searches';\n\n @State() recent: IRecentSearch[] = [];\n\n @State() saved: ISavedSearch[] = [];\n\n @State() starred: ITemplate[] = [];\n\n componentWillLoad() {\n this.endpoint.loadSession();\n\n const errorHandler = e => {\n console.warn('[Verdocs/search-activity] Error getting search data', e);\n if (e?.response?.status === 401) {\n this.authFailure = true;\n }\n };\n\n switch (this.type) {\n case 'recent':\n this.title = 'Recent Searches';\n this.emptyMessage = 'You do not have any recent searches.';\n getSearchHistory(this.endpoint)\n .then(r => (this.recent = r.recent))\n .catch(errorHandler);\n break;\n\n case 'saved':\n this.title = 'Saved Searches';\n this.emptyMessage = 'You do not have any saved searches.';\n getSearchHistory(this.endpoint)\n .then(r => (this.saved = r.saved))\n .catch(errorHandler);\n break;\n\n case 'starred':\n this.title = 'My Starred items';\n this.emptyMessage = 'You do not have any starred templates.';\n getTemplates(this.endpoint, {is_starred: true})\n .then(r => (this.starred = r))\n .catch(errorHandler);\n break;\n }\n }\n\n handleSelectEntry(entry: any) {\n this.entrySelected.emit(entry);\n }\n\n computePagesText(pages) {\n if (pages < 2) {\n return `${pages} Page`;\n } else {\n return `${pages} Pages`;\n }\n }\n\n computeRecipientsText(recipients) {\n if (typeof recipients === 'object') {\n return recipients.join(', ');\n } else if (recipients > 1) {\n return `${recipients} Recipients`;\n } else {\n return `${recipients} Recipient`;\n }\n }\n\n render() {\n const showEmpty = this.recent.length < 1 && this.saved.length < 1 && this.starred.length < 1;\n\n return (\n <div class=\"container\">\n <p class=\"title\">{this.title}</p>\n\n <div class=\"items\">\n {this.recent.map(recent => (\n <button class=\"item\" onClick={() => this.handleSelectEntry(recent)}>\n <div class=\"icon\" innerHTML={DocumentIcon} />\n <div class=\"details\">\n <div class=\"item-title\">{recent.params.q}</div>\n <div class=\"info\">Test</div>\n </div>\n </button>\n ))}\n\n {this.saved.map(option => (\n <button class=\"item\" onClick={() => this.handleSelectEntry(option)}>\n <div class=\"icon\" innerHTML={DocumentIcon} />\n <div class=\"details\">\n <div class=\"item-title\">{option.params.q}</div>\n <div class=\"info\">\n {/*{option.pages ? `${this.computePagesText(option.pages)} ` : ''}*/}\n {/*{option.recipients ? this.computeRecipientsText(option.recipients) : ''}*/}\n </div>\n </div>\n </button>\n ))}\n\n {showEmpty && <div class=\"empty\">{this.authFailure ? 'Authentication required' : this.emptyMessage}</div>}\n </div>\n </div>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-search-box {\n font-family: $verdocs-primary-font;\n\n form {\n display: flex;\n flex-direction: row;\n height: 45px;\n box-sizing: border-box;\n margin: 5px 0 0;\n border-radius: 5px;\n align-items: center;\n background-color: #fff;\n padding: 0 8px;\n border-width: 1px;\n border-style: solid;\n border-color: $verdocs-light-blue;\n\n input {\n box-sizing: border-box;\n height: 43px;\n width: 100%;\n font-size: 18px;\n border: none;\n\n &:focus {\n outline: none;\n }\n }\n\n button.search {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n border-radius: 4px;\n border: none;\n width: 100px;\n height: 28px;\n font-weight: 700;\n font-size: 10px;\n letter-spacing: 1px;\n background-color: $verdocs-green;\n text-transform: uppercase;\n color: #fff;\n }\n\n .type {\n background-color: $verdocs-light-blue;\n height: 30px;\n display: inline-flex;\n padding: 1px 0 2px 10px;\n font-size: 13px;\n line-height: 16px;\n border-radius: 4px;\n justify-content: center;\n text-transform: uppercase;\n align-items: center;\n flex-direction: row;\n color: #fff;\n margin-right: 10px;\n\n button {\n border: none;\n color: #fff;\n margin: 5px 0 0 8px;\n background: transparent;\n }\n }\n\n svg {\n width: 12px;\n height: 12px;\n margin-right: 6px;\n }\n }\n\n ::placeholder {\n color: $verdocs-grey-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop, Method} from '@stencil/core';\nimport SearchIcon from './search.svg';\nimport CloseIcon from './close.svg';\n\nexport type TContentType = 'all' | 'document' | 'template' | 'organization';\n\nexport interface ISearchEvent {\n query: string;\n type: TContentType;\n}\n\n/**\n * Displays a customizable input box for search queries.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-search-box',\n styleUrl: 'verdocs-search-box.scss',\n shadow: false,\n})\nexport class VerdocsSearchBox {\n private inputEl: HTMLInputElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The placeholder to display in the input field.\n */\n @Prop() placeholder = 'search documents, templates, people...';\n\n /**\n * If set to a value other than 'all', a removeable filter indicator will be displayed.\n */\n @Prop() type: TContentType = 'all';\n\n /**\n * The text search string entered by the user.\n */\n @Prop() query = '';\n\n /**\n * If set, the input field will attempt to \"grab\" focus after being rendered.\n */\n @Prop() grabsFocus = false;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) searchClicked: EventEmitter<ISearchEvent>;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) typeChanged: EventEmitter<TContentType>;\n\n /**\n * Event fired when the user changes the query string.\n */\n @Event({composed: true}) queryChanged: EventEmitter<string>;\n\n @Method() async focusField() {\n this.inputEl.focus();\n }\n\n componentDidRender() {\n if (this.grabsFocus) {\n this.inputEl.focus();\n }\n }\n\n handleSearch(e) {\n this.searchClicked.emit({type: this.type, query: this.query});\n e.preventDefault();\n return false;\n }\n\n handleChange(e) {\n this.queryChanged.emit(e.target.value);\n }\n\n handleClearFilter() {\n this.typeChanged.emit('all');\n }\n\n handleKeyUp(e) {\n if (e.key === 'Enter') {\n this.searchClicked.emit({type: this.type, query: this.query});\n }\n }\n\n render() {\n return (\n <form onSubmit={e => this.handleSearch(e)}>\n {this.type !== undefined && this.type !== 'all' && (\n <span class=\"type\">\n {this.type}s <button class=\"remove\" innerHTML={CloseIcon} onClick={() => this.handleClearFilter()} />\n </span>\n )}\n <input\n type=\"text\"\n value={this.query}\n placeholder={this.placeholder}\n onInput={e => this.handleChange(e)}\n onKeyUp={e => this.handleKeyUp(e)}\n ref={el => (this.inputEl = el)}\n />\n <button onClick={e => this.handleSearch(e)} class=\"search\">\n <span innerHTML={SearchIcon} />\n Search\n </button>\n </form>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["node_modules/@verdocs/js-sdk/Search/Content.js","src/components/elements/verdocs-quick-functions/verdocs-quick-functions.scss?tag=verdocs-quick-functions","src/components/elements/verdocs-quick-functions/verdocs-quick-functions.tsx","src/components/elements/verdocs-search-activity/verdocs-search-activity.scss?tag=verdocs-search-activity","src/components/elements/verdocs-search-activity/verdocs-search-activity.tsx","src/components/elements/verdocs-search-box/verdocs-search-box.scss?tag=verdocs-search-box","src/components/elements/verdocs-search-box/verdocs-search-box.tsx"],"names":["__awaiter","this","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","__generator","body","_","label","sent","t","trys","ops","f","y","g","verb","throw","return","Symbol","iterator","n","v","op","TypeError","call","pop","length","push","getSearchHistory","endpoint","_a","api","get","r","data","verdocsQuickFunctionsCss","VerdocsQuickFunctions","VerdocsEndpoint","getDefault","prototype","handleCreateTemplate","createTemplate","emit","handleCreateDocument","createDocument","render","_this","h","class","onClick","innerHTML","TemplateIcon","DocumentIcon","verdocsSearchActivityCss","VerdocsSearchActivity","componentWillLoad","loadSession","errorHandler","console","warn","response","status","authFailure","type","title","emptyMessage","recent","catch","saved","getTemplates","is_starred","starred","handleSelectEntry","entry","entrySelected","computePagesText","pages","concat","computeRecipientsText","recipients","join","showEmpty","map","params","q","option","verdocsSearchBoxCss","VerdocsSearchBox","class_1","focusField","inputEl","focus","componentDidRender","grabsFocus","handleSearch","searchClicked","query","preventDefault","handleChange","queryChanged","target","handleClearFilter","typeChanged","handleKeyUp","key","onSubmit","undefined","CloseIcon","placeholder","onInput","onKeyUp","ref","el","SearchIcon"],"mappings":"krDAOA,IAAIA,UAAaC,WAAQA,UAAKD,WAAc,SAAUE,EAASC,EAAYC,EAAGC,GAC1E,SAASC,EAAMC,GAAS,OAAOA,aAAiBH,EAAIG,EAAQ,IAAIH,GAAE,SAAUI,GAAWA,EAAQD,MAC/F,OAAO,IAAK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,UAAWyD,UAAW1D,QAAS,WAAM,OAAAH,EAAKuD,wBAGlFtD,EAAA,QAAA,CACEgB,KAAK,OACLxE,MAAON,KAAK+G,MACZY,YAAa3H,KAAK2H,YAClBC,QAAS,SAAA/G,GAAK,OAAAgD,EAAKoD,aAAapG,IAChCgH,QAAS,SAAAhH,GAAK,OAAAgD,EAAKyD,YAAYzG,IAC/BiH,IAAK,SAAAC,GAAE,OAAKlE,EAAK4C,QAAUsB,KAE7BjE,EAAA,SAAA,CAAQE,QAAS,SAAAnD,GAAK,OAAAgD,EAAKgD,aAAahG,IAAIkD,MAAM,UAChDD,EAAA,OAAA,CAAMG,UAAW+D,aAAc,qBA1FZ","sourcesContent":["/**\n * Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended\n * to locate items across all content types. More specific retrievals may be performed using the various \"list\" endpoints within\n * each collection (e.g. {@link Envelopes.Envelopes.searchEnvelopes} or {@link Templates.Templates.searchTemplates}).\n *\n * @module\n */\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n/**\n * Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each\n * type but this may be expanded in the future. Client UI's should self-limit display counts as needed.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const {recent, saved} = await Content.getSearchHistory();\n * ```\n */\nexport var getSearchHistory = function (endpoint) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get('/search/history')\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Save a search. If a name is re-used, that saved search will be overwritten with the new parameters.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const entry = await Documents.saveSearch('W9 Forms', {q: 'w9', type: 'template});\n * ```\n */\nexport var saveSearch = function (endpoint, name, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/search/saved', { name: name, params: params })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for documents matching various criteria.\n *\n * ```typescript\n * import {Content} from '@verdocs/js-sdk/Search';\n *\n * const {result, page, total} = await Documents.search({ ... });\n * ```\n */\nexport var searchContent = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/search/content', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n","@import '../../../theme.scss';\n\nverdocs-quick-functions {\n font-family: $verdocs-primary-font;\n\n .container {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n width: 240px;\n background-color: $verdocs-bg-5;\n text-transform: uppercase;\n padding: 10px 10px 20px 10px;\n font-family: sans-serif;\n color: #ffffff;\n }\n\n .title {\n font-size: 22px;\n font-weight: 700;\n line-height: 30px;\n margin: 1em 0 40px 0;\n }\n\n button {\n width: 140px;\n height: 40px;\n border: none;\n display: flex;\n color: $verdocs-grey-4;\n cursor: pointer;\n font-size: 14px;\n font-weight: 700;\n line-height: 25px;\n align-items: center;\n margin-bottom: 20px;\n border-radius: 5px;\n text-transform: uppercase;\n justify-content: space-evenly;\n background-color: $verdocs-green;\n }\n\n button svg {\n fill: $verdocs-grey-4;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop} from '@stencil/core';\nimport TemplateIcon from './template-icon.svg';\nimport DocumentIcon from './document-icon.svg';\n\n/**\n * Display quick-function buttons for creating templates and documents.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-quick-functions',\n styleUrl: 'verdocs-quick-functions.scss',\n})\nexport class VerdocsQuickFunctions {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) createTemplate: EventEmitter;\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) createDocument: EventEmitter;\n\n handleCreateTemplate() {\n this.createTemplate.emit();\n }\n\n handleCreateDocument() {\n this.createDocument.emit();\n }\n\n render() {\n return (\n <div class=\"container\">\n <p class=\"title\">Quick Create</p>\n <button onClick={() => this.handleCreateTemplate()} innerHTML={TemplateIcon}>\n Template\n </button>\n <button onClick={() => this.handleCreateDocument()} innerHTML={DocumentIcon}>\n Document\n </button>\n </div>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-search-activity {\n font-family: $verdocs-primary-font;\n\n .container {\n display: flex;\n width: 240px;\n color: $verdocs-grey-4;\n flex-direction: column;\n text-transform: uppercase;\n padding: 10px 10px 20px 10px;\n background-color: $verdocs-bg-5;\n }\n\n .title {\n font-size: 22px;\n font-weight: 700;\n line-height: 30px;\n }\n\n .items {\n display: flex;\n margin-top: 20px;\n flex-direction: column;\n }\n\n .item {\n border: none;\n display: flex;\n text-align: left;\n margin-bottom: 20px;\n flex-direction: row;\n background: transparent;\n }\n\n .item:hover {\n cursor: pointer;\n }\n\n .icon {\n flex: 0 0 22px;\n margin-right: 14px;\n }\n\n .icon svg {\n fill: $verdocs-light-blue;\n width: 22px;\n height: 22px;\n }\n\n .details {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n }\n\n .item-title {\n font-size: 16px;\n font-weight: 400;\n color: $verdocs-grey-4;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .info {\n font-size: 14px;\n font-weight: 500;\n line-height: 23px;\n color: $verdocs-grey-2;\n }\n\n .empty {\n text-transform: none;\n line-height: 22px;\n color: $verdocs-bg-1;\n }\n}\n","import {ITemplate} from '@verdocs/js-sdk/Templates/Types';\nimport {getSearchHistory} from '@verdocs/js-sdk/Search/Content';\nimport {getTemplates} from '@verdocs/js-sdk/Templates/Templates';\nimport {IRecentSearch, ISavedSearch} from '@verdocs/js-sdk/Search/Types';\nimport {Component, h, Prop, Event, EventEmitter, State} from '@stencil/core';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport DocumentIcon from './document-icon.svg';\n\n/**\n * Display a list of starred items.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-search-activity',\n styleUrl: 'verdocs-search-activity.scss',\n shadow: false,\n})\nexport class VerdocsSearchActivity {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n @Prop() type: 'recent' | 'saved' | 'starred' = 'recent';\n\n @Prop() options: any;\n\n /**\n * Event fired when an entry is clicked.\n */\n @Event({composed: true}) entrySelected: EventEmitter<IRecentSearch>;\n\n @State() emptyMessage = 'You do not have any starred searches.';\n\n @State() authFailure = false;\n\n @State() title = 'Recent Searches';\n\n @State() recent: IRecentSearch[] = [];\n\n @State() saved: ISavedSearch[] = [];\n\n @State() starred: ITemplate[] = [];\n\n componentWillLoad() {\n this.endpoint.loadSession();\n\n const errorHandler = e => {\n console.warn('[Verdocs/search-activity] Error getting search data', e);\n if (e?.response?.status === 401) {\n this.authFailure = true;\n }\n };\n\n switch (this.type) {\n case 'recent':\n this.title = 'Recent Searches';\n this.emptyMessage = 'You do not have any recent searches.';\n getSearchHistory(this.endpoint)\n .then(r => (this.recent = r.recent))\n .catch(errorHandler);\n break;\n\n case 'saved':\n this.title = 'Saved Searches';\n this.emptyMessage = 'You do not have any saved searches.';\n getSearchHistory(this.endpoint)\n .then(r => (this.saved = r.saved))\n .catch(errorHandler);\n break;\n\n case 'starred':\n this.title = 'My Starred items';\n this.emptyMessage = 'You do not have any starred templates.';\n getTemplates(this.endpoint, {is_starred: true})\n .then(r => (this.starred = r))\n .catch(errorHandler);\n break;\n }\n }\n\n handleSelectEntry(entry: any) {\n this.entrySelected.emit(entry);\n }\n\n computePagesText(pages) {\n if (pages < 2) {\n return `${pages} Page`;\n } else {\n return `${pages} Pages`;\n }\n }\n\n computeRecipientsText(recipients) {\n if (typeof recipients === 'object') {\n return recipients.join(', ');\n } else if (recipients > 1) {\n return `${recipients} Recipients`;\n } else {\n return `${recipients} Recipient`;\n }\n }\n\n render() {\n const showEmpty = this.recent.length < 1 && this.saved.length < 1 && this.starred.length < 1;\n\n return (\n <div class=\"container\">\n <p class=\"title\">{this.title}</p>\n\n <div class=\"items\">\n {this.recent.map(recent => (\n <button class=\"item\" onClick={() => this.handleSelectEntry(recent)}>\n <div class=\"icon\" innerHTML={DocumentIcon} />\n <div class=\"details\">\n <div class=\"item-title\">{recent.params.q}</div>\n <div class=\"info\">Test</div>\n </div>\n </button>\n ))}\n\n {this.saved.map(option => (\n <button class=\"item\" onClick={() => this.handleSelectEntry(option)}>\n <div class=\"icon\" innerHTML={DocumentIcon} />\n <div class=\"details\">\n <div class=\"item-title\">{option.params.q}</div>\n <div class=\"info\">\n {/*{option.pages ? `${this.computePagesText(option.pages)} ` : ''}*/}\n {/*{option.recipients ? this.computeRecipientsText(option.recipients) : ''}*/}\n </div>\n </div>\n </button>\n ))}\n\n {showEmpty && <div class=\"empty\">{this.authFailure ? 'Authentication required' : this.emptyMessage}</div>}\n </div>\n </div>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-search-box {\n font-family: $verdocs-primary-font;\n\n form {\n display: flex;\n flex-direction: row;\n height: 45px;\n box-sizing: border-box;\n margin: 5px 0 0;\n border-radius: 5px;\n align-items: center;\n background-color: #fff;\n padding: 0 8px;\n border-width: 1px;\n border-style: solid;\n border-color: $verdocs-light-blue;\n\n input {\n box-sizing: border-box;\n height: 43px;\n width: 100%;\n font-size: 18px;\n border: none;\n\n &:focus {\n outline: none;\n }\n }\n\n button.search {\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n border-radius: 4px;\n border: none;\n width: 100px;\n height: 28px;\n font-weight: 700;\n font-size: 10px;\n letter-spacing: 1px;\n background-color: $verdocs-green;\n text-transform: uppercase;\n color: #fff;\n }\n\n .type {\n background-color: $verdocs-light-blue;\n height: 30px;\n display: inline-flex;\n padding: 1px 0 2px 10px;\n font-size: 13px;\n line-height: 16px;\n border-radius: 4px;\n justify-content: center;\n text-transform: uppercase;\n align-items: center;\n flex-direction: row;\n color: #fff;\n margin-right: 10px;\n\n button {\n border: none;\n color: #fff;\n margin: 5px 0 0 8px;\n background: transparent;\n }\n }\n\n svg {\n width: 12px;\n height: 12px;\n margin-right: 6px;\n }\n }\n\n ::placeholder {\n color: $verdocs-grey-2;\n }\n}\n","import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Event, EventEmitter, Prop, Method} from '@stencil/core';\nimport SearchIcon from './search.svg';\nimport CloseIcon from './close.svg';\n\nexport type TContentType = 'all' | 'document' | 'template' | 'organization';\n\nexport interface ISearchEvent {\n query: string;\n type: TContentType;\n}\n\n/**\n * Displays a customizable input box for search queries.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n */\n@Component({\n tag: 'verdocs-search-box',\n styleUrl: 'verdocs-search-box.scss',\n shadow: false,\n})\nexport class VerdocsSearchBox {\n private inputEl: HTMLInputElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The placeholder to display in the input field.\n */\n @Prop() placeholder = 'search documents, templates, people...';\n\n /**\n * If set to a value other than 'all', a removeable filter indicator will be displayed.\n */\n @Prop() type: TContentType = 'all';\n\n /**\n * The text search string entered by the user.\n */\n @Prop() query = '';\n\n /**\n * If set, the input field will attempt to \"grab\" focus after being rendered.\n */\n @Prop() grabsFocus = false;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) searchClicked: EventEmitter<ISearchEvent>;\n\n /**\n * Event fired when the user changes the type.\n */\n @Event({composed: true}) typeChanged: EventEmitter<TContentType>;\n\n /**\n * Event fired when the user changes the query string.\n */\n @Event({composed: true}) queryChanged: EventEmitter<string>;\n\n @Method() async focusField() {\n this.inputEl.focus();\n }\n\n componentDidRender() {\n if (this.grabsFocus) {\n this.inputEl.focus();\n }\n }\n\n handleSearch(e) {\n this.searchClicked.emit({type: this.type, query: this.query});\n e.preventDefault();\n return false;\n }\n\n handleChange(e) {\n this.queryChanged.emit(e.target.value);\n }\n\n handleClearFilter() {\n this.typeChanged.emit('all');\n }\n\n handleKeyUp(e) {\n if (e.key === 'Enter') {\n this.searchClicked.emit({type: this.type, query: this.query});\n }\n }\n\n render() {\n return (\n <form onSubmit={e => this.handleSearch(e)}>\n {this.type !== undefined && this.type !== 'all' && (\n <span class=\"type\">\n {this.type}s <button class=\"remove\" innerHTML={CloseIcon} onClick={() => this.handleClearFilter()} />\n </span>\n )}\n <input\n type=\"text\"\n value={this.query}\n placeholder={this.placeholder}\n onInput={e => this.handleChange(e)}\n onKeyUp={e => this.handleKeyUp(e)}\n ref={el => (this.inputEl = el)}\n />\n <button onClick={e => this.handleSearch(e)} class=\"search\">\n <span innerHTML={SearchIcon} />\n Search\n </button>\n </form>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import{r as registerInstance,h}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-dac04424.js";var verdocsSearchCss='verdocs-search{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}';var VerdocsSearch=function(){function e(e){registerInstance(this,e);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.render=function(){return h("div",{class:"container"},h("verdocs-search-box",{endpoint:this.endpoint}),h("div",{class:"boxes"},h("verdocs-search-activity",{type:"recent",endpoint:this.endpoint}),h("verdocs-search-activity",{type:"saved",endpoint:this.endpoint}),h("verdocs-search-activity",{type:"starred",endpoint:this.endpoint}),h("verdocs-quick-functions",{endpoint:this.endpoint})))};return e}();VerdocsSearch.style=verdocsSearchCss;export{VerdocsSearch as verdocs_search};
1
+ import{r as registerInstance,h}from"./index-f78d163d.js";import"./Types-ab9f6af8.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-76dbf9b9.js";import"./Token-54690789.js";var verdocsSearchCss='verdocs-search{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}';var VerdocsSearch=function(){function e(e){registerInstance(this,e);this.endpoint=VerdocsEndpoint.getDefault()}e.prototype.render=function(){return h("div",{class:"container"},h("verdocs-search-box",{endpoint:this.endpoint}),h("div",{class:"boxes"},h("verdocs-search-activity",{type:"recent",endpoint:this.endpoint}),h("verdocs-search-activity",{type:"saved",endpoint:this.endpoint}),h("verdocs-search-activity",{type:"starred",endpoint:this.endpoint}),h("verdocs-quick-functions",{endpoint:this.endpoint})))};return e}();VerdocsSearch.style=verdocsSearchCss;export{VerdocsSearch as verdocs_search};
2
2
  //# sourceMappingURL=verdocs-search.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["src/components/embeds/verdocs-search/verdocs-search.scss?tag=verdocs-search","src/components/embeds/verdocs-search/verdocs-search.tsx"],"names":["verdocsSearchCss","VerdocsSearch","VerdocsEndpoint","getDefault","prototype","render","h","class","endpoint","this","type"],"mappings":"qJAAA,IAAMA,iBAAmB,umBCQZC,cAAa,gEAIYC,gBAAgBC,aAEpDF,EAAAG,UAAAC,OAAA,WACE,OACEC,EAAA,MAAA,CAAKC,MAAM,aACTD,EAAA,qBAAA,CAAoBE,SAAUC,KAAKD,WAEnCF,EAAA,MAAA,CAAKC,MAAM,SACTD,EAAA,0BAAA,CAAyBI,KAAK,SAASF,SAAUC,KAAKD,WACtDF,EAAA,0BAAA,CAAyBI,KAAK,QAAQF,SAAUC,KAAKD,WACrDF,EAAA,0BAAA,CAAyBI,KAAK,UAAUF,SAAUC,KAAKD,WACvDF,EAAA,0BAAA,CAAyBE,SAAUC,KAAKD,uBAfxB","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-search {\n font-family: $verdocs-primary-font;\n display: flex;\n background-color: $dark-bg;\n\n search-box {\n display: flex;\n flex-direction: column;\n margin: 20px 10px;\n }\n\n .boxes {\n flex-wrap: wrap;\n display: flex;\n flex-direction: row;\n margin: 20px 0;\n }\n\n search-recent,\n search-saved,\n search-quick-functions,\n search-starred {\n display: flex;\n margin: 0 20px 20px 0;\n }\n}\n","import {Component, h, Prop} from '@stencil/core';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\n\n@Component({\n tag: 'verdocs-search',\n styleUrl: 'verdocs-search.scss',\n shadow: false,\n})\nexport class VerdocsSearch {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n render() {\n return (\n <div class=\"container\">\n <verdocs-search-box endpoint={this.endpoint} />\n\n <div class=\"boxes\">\n <verdocs-search-activity type=\"recent\" endpoint={this.endpoint} />\n <verdocs-search-activity type=\"saved\" endpoint={this.endpoint} />\n <verdocs-search-activity type=\"starred\" endpoint={this.endpoint} />\n <verdocs-quick-functions endpoint={this.endpoint} />\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"sources":["src/components/embeds/verdocs-search/verdocs-search.scss?tag=verdocs-search","src/components/embeds/verdocs-search/verdocs-search.tsx"],"names":["verdocsSearchCss","VerdocsSearch","VerdocsEndpoint","getDefault","prototype","render","h","class","endpoint","this","type"],"mappings":"iLAAA,IAAMA,iBAAmB,umBCQZC,cAAa,gEAIYC,gBAAgBC,aAEpDF,EAAAG,UAAAC,OAAA,WACE,OACEC,EAAA,MAAA,CAAKC,MAAM,aACTD,EAAA,qBAAA,CAAoBE,SAAUC,KAAKD,WAEnCF,EAAA,MAAA,CAAKC,MAAM,SACTD,EAAA,0BAAA,CAAyBI,KAAK,SAASF,SAAUC,KAAKD,WACtDF,EAAA,0BAAA,CAAyBI,KAAK,QAAQF,SAAUC,KAAKD,WACrDF,EAAA,0BAAA,CAAyBI,KAAK,UAAUF,SAAUC,KAAKD,WACvDF,EAAA,0BAAA,CAAyBE,SAAUC,KAAKD,uBAfxB","sourcesContent":["@import '../../../theme.scss';\n\nverdocs-search {\n font-family: $verdocs-primary-font;\n display: flex;\n background-color: $dark-bg;\n\n search-box {\n display: flex;\n flex-direction: column;\n margin: 20px 10px;\n }\n\n .boxes {\n flex-wrap: wrap;\n display: flex;\n flex-direction: row;\n margin: 20px 0;\n }\n\n search-recent,\n search-saved,\n search-quick-functions,\n search-starred {\n display: flex;\n margin: 0 20px 20px 0;\n }\n}\n","import {Component, h, Prop} from '@stencil/core';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\n\n@Component({\n tag: 'verdocs-search',\n styleUrl: 'verdocs-search.scss',\n shadow: false,\n})\nexport class VerdocsSearch {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n render() {\n return (\n <div class=\"container\">\n <verdocs-search-box endpoint={this.endpoint} />\n\n <div class=\"boxes\">\n <verdocs-search-activity type=\"recent\" endpoint={this.endpoint} />\n <verdocs-search-activity type=\"saved\" endpoint={this.endpoint} />\n <verdocs-search-activity type=\"starred\" endpoint={this.endpoint} />\n <verdocs-quick-functions endpoint={this.endpoint} />\n </div>\n </div>\n );\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function l(e){try{a(i.next(e))}catch(e){s(e)}}function r(e){try{a(i["throw"](e))}catch(e){s(e)}}function a(e){e.done?n(e.value):o(e.value).then(l,r)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,o,s,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(e){return function(t){return a([e,t])}}function a(l){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(s=l[0]&2?o["return"]:l[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;if(o=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1];s=l;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(l);break}if(s[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];o=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import{g as getTemplate}from"./Templates-0638b1e4.js";import"./Types-ab9f6af8.js";import{i as isValidEmail,a as isValidPhone}from"./Validators-f110bae2.js";import{g as getRGBA}from"./Colors-1b298092.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-dac04424.js";import{a as getRoleIndex}from"./utils-2dbb5f63.js";var verdocsSendCss='verdocs-send{display:-ms-flexbox;display:flex;padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var editIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var stepIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var doneIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var VerdocsSend=function(){function e(e){registerInstance(this,e);this.send=createEvent(this,"send",7);this.cancel=createEvent(this,"cancel",7);this.sdkError=createEvent(this,"sdkError",7);this.levels=[];this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.template=null;this.pdfUrl=null;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.recipientsAssigned={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:this.sessionContacts=[];i.label=1;case 1:i.trys.push([1,3,,4]);return[4,this.endpoint.loadSession()];case 2:t=i.sent();if((e=t.session)===null||e===void 0?void 0:e.profile){this.sessionContacts.push({id:t.session.profile.id,name:"".concat(t.session.profile.first_name," ").concat(t.session.profile.last_name),email:t.session.profile.email,phone:t.session.profile.phone})}return[3,4];case 3:n=i.sent();console.log("Error loading session",n);return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:console.log("[SEND] Showing template",this.templateId);i.label=1;case 1:i.trys.push([1,3,,4]);console.log("[SEND] Loading template ".concat(this.templateId));return[4,getTemplate(this.endpoint,this.templateId)];case 2:e=i.sent();console.log("[SEND] Got template",e);this.template=e;if(e===null||e===void 0?void 0:e.roles){t={};e.roles.forEach((function(e){var n=e.sequence-1;t[n]||(t[n]=[]);var i="r-".concat(n,"-").concat(t[n].length);t[n].push(__assign(__assign({},e),{id:i}))}));this.rolesAtLevel=t;this.levels=Object.keys(t).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}return[3,4];case 3:n=i.sent();console.log("[SEND] Error getting template",n);return[3,4];case 4:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e>=this.levels.length){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.recipientsAssigned[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t;e.stopPropagation();(t=this.send)===null||t===void 0?void 0:t.emit({recipientsAssigned:Object.values(this.recipientsAssigned)})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,n,i;var o=((n=(t=this.template)===null||t===void 0?void 0:t.roles)===null||n===void 0?void 0:n.map((function(e){return e.name})))||[];var s=Object.values(this.recipientsAssigned).filter((function(e){console.log("valid email",isValidEmail(e.email),e.email);console.log("valid phone",isValidPhone(e.phone),e.phone);return isValidEmail(e.email)||isValidPhone(e.phone)})).length>=((i=this.template)===null||i===void 0?void 0:i.roles.length);console.log("assigned",s);return h(Host,{class:{}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon(-1),h("div",{class:"complete"},"Send Document")),this.levels.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var n,i,s;return h("div",{class:"recipient",style:{backgroundColor:getRGBA(getRoleIndex(o,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(i=(n=e.recipientsAssigned[t.id])===null||n===void 0?void 0:n.full_name)!==null&&i!==void 0?i:t.name,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-contact-picker",{onCancel:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.recipientsAssigned[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(e){return console.log("Search",e.detail)}}))})))})),h("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),h("div",{class:"complete"},"Document Complete"))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"Send",size:"small",disabled:!s,onClick:function(t){return e.handleSend(t)}})))};return e}();VerdocsSend.style=verdocsSendCss;export{VerdocsSend as verdocs_send};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function l(e){try{a(o.next(e))}catch(e){s(e)}}function r(e){try{a(o["throw"](e))}catch(e){s(e)}}function a(e){e.done?n(e.value):i(e.value).then(l,r)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,i,s,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(e){return function(t){return a([e,t])}}function a(l){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(s=l[0]&2?i["return"]:l[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;if(i=0,s)l=[l[0]&2,s.value];switch(l[0]){case 0:case 1:s=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;i=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1];s=l;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(l);break}if(s[2])n.ops.pop();n.trys.pop();continue}l=t.call(e,n)}catch(e){l=[6,e];i=0}finally{o=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-f78d163d.js";import{g as getTemplate}from"./Templates-0638b1e4.js";import"./Types-ab9f6af8.js";import{i as isValidEmail,a as isValidPhone}from"./Validators-f110bae2.js";import{g as getRGBA}from"./Colors-1b298092.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-76dbf9b9.js";import{a as getRoleIndex}from"./utils-53001d87.js";import"./Token-54690789.js";var verdocsSendCss='verdocs-send{display:-ms-flexbox;display:flex;padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var editIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var startIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var stepIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var doneIcon='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var VerdocsSend=function(){function e(e){registerInstance(this,e);this.send=createEvent(this,"send",7);this.cancel=createEvent(this,"cancel",7);this.sdkError=createEvent(this,"sdkError",7);this.levels=[];this.endpoint=VerdocsEndpoint.getDefault();this.templateId=null;this.template=null;this.pdfUrl=null;this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.recipientsAssigned={}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){switch(o.label){case 0:this.sessionContacts=[];o.label=1;case 1:o.trys.push([1,3,,4]);return[4,this.endpoint.loadSession()];case 2:t=o.sent();if((e=t.session)===null||e===void 0?void 0:e.profile){this.sessionContacts.push({id:t.session.profile.id,name:"".concat(t.session.profile.first_name," ").concat(t.session.profile.last_name),email:t.session.profile.email,phone:t.session.profile.phone})}return[3,4];case 3:n=o.sent();console.log("Error loading session",n);return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SEND] Showing template",this.templateId);o.label=1;case 1:o.trys.push([1,3,,4]);console.log("[SEND] Loading template ".concat(this.templateId));return[4,getTemplate(this.endpoint,this.templateId)];case 2:e=o.sent();console.log("[SEND] Got template",e);this.template=e;if(e===null||e===void 0?void 0:e.roles){t={};e.roles.forEach((function(e){var n=e.sequence-1;t[n]||(t[n]=[]);var o="r-".concat(n,"-").concat(t[n].length);t[n].push(__assign(__assign({},e),{id:o}))}));this.rolesAtLevel=t;this.levels=Object.keys(t).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}return[3,4];case 3:n=o.sent();console.log("[SEND] Error getting template",n);return[3,4];case 4:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return h("div",{class:"level-icon",innerHTML:startIcon})}else if(e>=this.levels.length){return h("div",{class:"level-icon",innerHTML:doneIcon})}else{return h("div",{class:"level-icon",innerHTML:stepIcon})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.recipientsAssigned[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t;e.stopPropagation();(t=this.send)===null||t===void 0?void 0:t.emit({recipientsAssigned:Object.values(this.recipientsAssigned)})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.cancel)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,n,o;var i=((n=(t=this.template)===null||t===void 0?void 0:t.roles)===null||n===void 0?void 0:n.map((function(e){return e.name})))||[];var s=Object.values(this.recipientsAssigned).filter((function(e){console.log("valid email",isValidEmail(e.email),e.email);console.log("valid phone",isValidPhone(e.phone),e.phone);return isValidEmail(e.email)||isValidPhone(e.phone)})).length>=((o=this.template)===null||o===void 0?void 0:o.roles.length);console.log("assigned",s);return h(Host,{class:{}},h("div",{class:"recipients"},h("div",{class:"left-line"}),h("div",{class:"level level-start"},this.getLevelIcon(-1),h("div",{class:"complete"},"Send Document")),this.levels.map((function(t){return h("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var n,o,s;return h("div",{class:"recipient",style:{backgroundColor:getRGBA(getRoleIndex(i,t.name))},onClick:function(n){return e.handleClickRole(n,t)}},(o=(n=e.recipientsAssigned[t.id])===null||n===void 0?void 0:n.full_name)!==null&&o!==void 0?o:t.name,h("div",{class:"icon",innerHTML:editIcon}),e.showPickerForId===t.id&&h("verdocs-contact-picker",{onCancel:function(){return e.showPickerForId=""},onNext:function(n){return e.handleSelectContact(n,t)},contactSuggestions:e.sessionContacts,templateRole:(s=e.recipientsAssigned[t.id])!==null&&s!==void 0?s:t,onSearchContacts:function(e){return console.log("Search",e.detail)}}))})))})),h("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),h("div",{class:"complete"},"Document Complete"))),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{label:"Send",size:"small",disabled:!s,onClick:function(t){return e.handleSend(t)}})))};return e}();VerdocsSend.style=verdocsSendCss;export{VerdocsSend as verdocs_send};
2
2
  //# sourceMappingURL=verdocs-send.entry.js.map