@verdocs/web-sdk 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/dist/cjs/Auth-0ba9a04b.js +68 -0
  2. package/dist/cjs/{Transport-68c8b1f4.js → Token-1ea6d834.js} +81 -19
  3. package/dist/cjs/{index-6fc067b7.js → index-01e27102.js} +5 -357
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/verdocs-auth.cjs.entry.js +9 -70
  6. package/dist/cjs/verdocs-button_2.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-document-status.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-loader.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-organization-card.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +31 -0
  14. package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +210 -0
  15. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +20 -0
  16. package/dist/cjs/verdocs-search.cjs.entry.js +2 -2
  17. package/dist/cjs/verdocs-sign.cjs.entry.js +11 -12
  18. package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +1 -1
  19. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  22. package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +1 -1
  23. package/dist/cjs/verdocs-web-sdk.cjs.js +2 -2
  24. package/dist/collection/collection-manifest.json +4 -6
  25. package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/document-icon.svg +0 -0
  26. package/dist/collection/components/elements/{search-quick-functions → verdocs-quick-functions}/template-icon.svg +0 -0
  27. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.css → verdocs-quick-functions/verdocs-quick-functions.css} +5 -5
  28. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.js → verdocs-quick-functions/verdocs-quick-functions.js} +9 -10
  29. package/dist/collection/components/elements/{search-quick-functions/search-quick-functions.stories.js → verdocs-quick-functions/verdocs-quick-functions.stories.js} +2 -2
  30. package/dist/collection/components/elements/{search-starred → verdocs-search-activity}/document-icon.svg +0 -0
  31. package/dist/collection/components/elements/{search-starred/search-starred.css → verdocs-search-activity/verdocs-search-activity.css} +12 -12
  32. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.js +168 -0
  33. package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.stories.js +14 -0
  34. package/dist/collection/components/elements/{search-box → verdocs-search-box}/close.svg +0 -0
  35. package/dist/collection/components/elements/{search-box → verdocs-search-box}/search.svg +0 -0
  36. package/dist/collection/components/elements/{search-box/search-box.css → verdocs-search-box/verdocs-search-box.css} +9 -9
  37. package/dist/collection/components/elements/{search-box/search-box.js → verdocs-search-box/verdocs-search-box.js} +14 -15
  38. package/dist/collection/components/elements/{search-box/search-box.stories.js → verdocs-search-box/verdocs-search-box.stories.js} +2 -2
  39. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.css +3 -0
  40. package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +19 -0
  41. package/dist/collection/components/elements/{search-tabs/search-tabs.stories.js → verdocs-search-tabs/verdocs-search-tabs.stories.js} +2 -2
  42. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +2 -2
  43. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +4 -4
  44. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -1
  45. package/dist/custom-elements/index.d.ts +24 -36
  46. package/dist/custom-elements/index.js +271 -331
  47. package/dist/docs.json +254 -344
  48. package/dist/esm/Auth-16761ea6.js +64 -0
  49. package/dist/esm/{Transport-797d3c59.js → Token-b82a8ea3.js} +81 -20
  50. package/dist/esm/{index-80d1b936.js → index-ade0ef1e.js} +5 -357
  51. package/dist/esm/loader.js +2 -2
  52. package/dist/esm/verdocs-auth.entry.js +4 -65
  53. package/dist/esm/verdocs-button_2.entry.js +1 -1
  54. package/dist/esm/verdocs-document-status.entry.js +1 -1
  55. package/dist/esm/verdocs-dropdown_12.entry.js +1 -1
  56. package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
  57. package/dist/esm/verdocs-loader.entry.js +1 -1
  58. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  59. package/dist/esm/verdocs-organization-card.entry.js +1 -1
  60. package/dist/esm/verdocs-quick-functions.entry.js +27 -0
  61. package/dist/esm/verdocs-search-activity_2.entry.js +205 -0
  62. package/dist/esm/verdocs-search-tabs.entry.js +16 -0
  63. package/dist/esm/verdocs-search.entry.js +2 -2
  64. package/dist/esm/verdocs-sign.entry.js +3 -4
  65. package/dist/esm/verdocs-signature-dialog.entry.js +1 -1
  66. package/dist/esm/verdocs-template-card.entry.js +1 -1
  67. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  68. package/dist/esm/verdocs-toggle.entry.js +1 -1
  69. package/dist/esm/verdocs-upload-dialog.entry.js +1 -1
  70. package/dist/esm/verdocs-web-sdk.js +2 -2
  71. package/dist/esm-es5/Auth-16761ea6.js +1 -0
  72. package/dist/esm-es5/{Transport-797d3c59.js → Token-b82a8ea3.js} +1 -1
  73. package/dist/esm-es5/index-ade0ef1e.js +1 -0
  74. package/dist/esm-es5/loader.js +1 -1
  75. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-button_2.entry.js +1 -1
  77. package/dist/esm-es5/verdocs-document-status.entry.js +1 -1
  78. package/dist/esm-es5/verdocs-dropdown_12.entry.js +1 -1
  79. package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
  80. package/dist/esm-es5/verdocs-loader.entry.js +1 -1
  81. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  82. package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
  83. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -0
  84. package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -0
  85. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -0
  86. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  87. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  88. package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
  89. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  90. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  91. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  92. package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
  93. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  94. package/dist/types/components/elements/{search-quick-functions/search-quick-functions.d.ts → verdocs-quick-functions/verdocs-quick-functions.d.ts} +1 -1
  95. package/dist/types/components/elements/{search-quick-functions/search-quick-functions.stories.d.ts → verdocs-quick-functions/verdocs-quick-functions.stories.d.ts} +0 -0
  96. package/dist/types/components/elements/{search-starred/search-starred.d.ts → verdocs-search-activity/verdocs-search-activity.d.ts} +10 -3
  97. package/dist/types/components/elements/{search-starred/search-starred.stories.d.ts → verdocs-search-activity/verdocs-search-activity.stories.d.ts} +2 -2
  98. package/dist/types/components/elements/{search-box/search-box.d.ts → verdocs-search-box/verdocs-search-box.d.ts} +1 -1
  99. package/dist/types/components/elements/{search-box/search-box.stories.d.ts → verdocs-search-box/verdocs-search-box.stories.d.ts} +0 -0
  100. package/dist/types/components/elements/{search-tabs/search-tabs.d.ts → verdocs-search-tabs/verdocs-search-tabs.d.ts} +1 -1
  101. package/dist/types/components/elements/{search-tabs/search-tabs.stories.d.ts → verdocs-search-tabs/verdocs-search-tabs.stories.d.ts} +0 -0
  102. package/dist/types/components.d.ts +106 -154
  103. package/dist/verdocs-web-sdk/{p-b07ae79f.entry.js → p-063c4c71.entry.js} +1 -1
  104. package/dist/verdocs-web-sdk/{p-94d6f88f.system.entry.js → p-10e7c953.system.entry.js} +1 -1
  105. package/dist/verdocs-web-sdk/{p-5a6041c0.entry.js → p-183c7338.entry.js} +1 -1
  106. package/dist/verdocs-web-sdk/{p-d03d748c.entry.js → p-25a138c4.entry.js} +1 -1
  107. package/dist/verdocs-web-sdk/{p-2ded0974.entry.js → p-28b3017f.entry.js} +1 -1
  108. package/dist/verdocs-web-sdk/p-2ec1d8d8.entry.js +1 -0
  109. package/dist/verdocs-web-sdk/p-3ced6e3a.system.js +1 -0
  110. package/dist/verdocs-web-sdk/{p-a415926b.system.entry.js → p-41383ebc.system.entry.js} +1 -1
  111. package/dist/verdocs-web-sdk/p-44b75396.system.js +1 -0
  112. package/dist/verdocs-web-sdk/p-48b73707.system.entry.js +1 -0
  113. package/dist/verdocs-web-sdk/p-4bfe13e6.system.entry.js +1 -0
  114. package/dist/verdocs-web-sdk/p-556f577f.system.js +1 -0
  115. package/dist/verdocs-web-sdk/p-6e95da9d.js +1 -0
  116. package/dist/verdocs-web-sdk/p-6ef8ca10.system.entry.js +1 -0
  117. package/dist/verdocs-web-sdk/p-72ebb6e3.system.entry.js +1 -0
  118. package/dist/verdocs-web-sdk/{p-cdae8dba.entry.js → p-817302a8.entry.js} +1 -1
  119. package/dist/verdocs-web-sdk/p-8a1b9ad0.entry.js +1 -0
  120. package/dist/verdocs-web-sdk/{p-ba8a7e2d.system.entry.js → p-91f87fa8.system.entry.js} +1 -1
  121. package/dist/verdocs-web-sdk/p-95880bac.entry.js +1 -0
  122. package/dist/verdocs-web-sdk/p-9e0a07a7.js +1 -0
  123. package/dist/verdocs-web-sdk/{p-d299cd16.system.entry.js → p-a0fcbe6e.system.entry.js} +1 -1
  124. package/dist/verdocs-web-sdk/{p-3a102b59.entry.js → p-ae37b970.entry.js} +1 -1
  125. package/dist/verdocs-web-sdk/p-b3c30059.system.js +1 -0
  126. package/dist/verdocs-web-sdk/{p-b13ee3be.entry.js → p-b567001f.entry.js} +1 -1
  127. package/dist/verdocs-web-sdk/{p-fae1351f.system.entry.js → p-b8f5af91.system.entry.js} +1 -1
  128. package/dist/verdocs-web-sdk/{p-f4786f62.entry.js → p-bc61d0ce.entry.js} +1 -1
  129. package/dist/verdocs-web-sdk/p-c4add613.entry.js +1 -0
  130. package/dist/verdocs-web-sdk/{p-80c7bc0c.system.entry.js → p-ccad2089.system.entry.js} +1 -1
  131. package/dist/verdocs-web-sdk/{p-993a0a23.system.entry.js → p-cfb1cad1.system.entry.js} +1 -1
  132. package/dist/verdocs-web-sdk/{p-82f4cb67.system.entry.js → p-d3a4e22e.system.entry.js} +1 -1
  133. package/dist/verdocs-web-sdk/p-d3ae5318.system.entry.js +1 -0
  134. package/dist/verdocs-web-sdk/p-dc1f3572.entry.js +1 -0
  135. package/dist/verdocs-web-sdk/{p-bdfa7db9.system.entry.js → p-dcf25d2c.system.entry.js} +1 -1
  136. package/dist/verdocs-web-sdk/{p-89f5fc2b.entry.js → p-df4ae522.entry.js} +1 -1
  137. package/dist/verdocs-web-sdk/{p-3b2cd409.system.entry.js → p-e0091c19.system.entry.js} +1 -1
  138. package/dist/verdocs-web-sdk/{p-0956a3bc.system.entry.js → p-e1887a75.system.entry.js} +1 -1
  139. package/dist/verdocs-web-sdk/p-e9f5d6a6.js +1 -0
  140. package/dist/verdocs-web-sdk/{p-853e30f2.system.entry.js → p-efffddab.system.entry.js} +1 -1
  141. package/dist/verdocs-web-sdk/{p-6327fd83.entry.js → p-f0d20c75.entry.js} +1 -1
  142. package/dist/verdocs-web-sdk/{p-fcfe34db.entry.js → p-f35c796c.entry.js} +1 -1
  143. package/dist/verdocs-web-sdk/{p-24236b87.entry.js → p-f5109d69.entry.js} +1 -1
  144. package/dist/verdocs-web-sdk/{p-7f9a96d5.system.entry.js → p-f6938563.system.entry.js} +1 -1
  145. package/dist/verdocs-web-sdk/p-fa8ae849.entry.js +1 -0
  146. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  147. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  148. package/package.json +10 -13
  149. package/dist/cjs/Token-65a1dc17.js +0 -71
  150. package/dist/cjs/search-box_5.cjs.entry.js +0 -283
  151. package/dist/cjs/search-tabs.cjs.entry.js +0 -20
  152. package/dist/collection/components/elements/search-recent/search-icon.svg +0 -1
  153. package/dist/collection/components/elements/search-recent/search-recent.css +0 -65
  154. package/dist/collection/components/elements/search-recent/search-recent.js +0 -98
  155. package/dist/collection/components/elements/search-recent/search-recent.stories.js +0 -12
  156. package/dist/collection/components/elements/search-saved/search-icon.svg +0 -1
  157. package/dist/collection/components/elements/search-saved/search-saved.css +0 -56
  158. package/dist/collection/components/elements/search-saved/search-saved.js +0 -98
  159. package/dist/collection/components/elements/search-saved/search-saved.stories.js +0 -12
  160. package/dist/collection/components/elements/search-starred/search-starred.js +0 -114
  161. package/dist/collection/components/elements/search-starred/search-starred.stories.js +0 -35
  162. package/dist/collection/components/elements/search-tabs/search-tabs.css +0 -3
  163. package/dist/collection/components/elements/search-tabs/search-tabs.js +0 -20
  164. package/dist/custom-elements.json +0 -727
  165. package/dist/esm/Token-a058076d.js +0 -69
  166. package/dist/esm/search-box_5.entry.js +0 -275
  167. package/dist/esm/search-tabs.entry.js +0 -16
  168. package/dist/esm-es5/Token-a058076d.js +0 -1
  169. package/dist/esm-es5/index-80d1b936.js +0 -1
  170. package/dist/esm-es5/search-box_5.entry.js +0 -1
  171. package/dist/esm-es5/search-tabs.entry.js +0 -1
  172. package/dist/types/components/elements/search-recent/search-recent.d.ts +0 -25
  173. package/dist/types/components/elements/search-recent/search-recent.stories.d.ts +0 -7
  174. package/dist/types/components/elements/search-saved/search-saved.d.ts +0 -25
  175. package/dist/types/components/elements/search-saved/search-saved.stories.d.ts +0 -7
  176. package/dist/verdocs-web-sdk/p-30d908ea.entry.js +0 -1
  177. package/dist/verdocs-web-sdk/p-37b07203.system.js +0 -1
  178. package/dist/verdocs-web-sdk/p-3c70c740.system.js +0 -1
  179. package/dist/verdocs-web-sdk/p-403cb7cf.js +0 -1
  180. package/dist/verdocs-web-sdk/p-4a538cbc.js +0 -1
  181. package/dist/verdocs-web-sdk/p-62ec194f.js +0 -1
  182. package/dist/verdocs-web-sdk/p-81b15287.system.entry.js +0 -1
  183. package/dist/verdocs-web-sdk/p-83dbc583.entry.js +0 -1
  184. package/dist/verdocs-web-sdk/p-8739595c.system.js +0 -1
  185. package/dist/verdocs-web-sdk/p-9a896baf.system.entry.js +0 -1
  186. package/dist/verdocs-web-sdk/p-a4fc6ad9.entry.js +0 -1
  187. package/dist/verdocs-web-sdk/p-a73a1ff8.system.entry.js +0 -1
  188. package/dist/verdocs-web-sdk/p-aec93cc9.entry.js +0 -1
  189. package/dist/verdocs-web-sdk/p-d82dc646.system.entry.js +0 -1
  190. package/dist/verdocs-web-sdk/p-eaffa4b1.entry.js +0 -1
  191. package/dist/verdocs-web-sdk/p-fc3d921f.system.js +0 -1
@@ -1,283 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-6fc067b7.js');
6
- const Transport = require('./Transport-68c8b1f4.js');
7
- require('./index-4bf5cc66.js');
8
-
9
- const SearchIcon$2 = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
10
- <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"/>
11
- </svg>
12
- `;
13
-
14
- const CloseIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
15
- <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"/>
16
- </svg>
17
- `;
18
-
19
- const searchBoxCss = "search-box{font-family:sans-serif;font-family:var(--verdocs-font)}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:var(--verdocs-container-border-color)}search-box form input{-webkit-box-sizing:border-box;box-sizing:border-box;height:43px;width:100%;font-size:18px;border:none}search-box form input:focus{outline:none}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:#50be80;text-transform:uppercase;color:#fff}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}search-box form .type button{border:none;color:#fff;margin:5px 0 0 8px;background:transparent}search-box form svg{width:12px;height:12px;margin-right:6px}search-box ::-webkit-input-placeholder{color:#aeb4bf}search-box ::-moz-placeholder{color:#aeb4bf}search-box :-ms-input-placeholder{color:#aeb4bf}search-box ::-ms-input-placeholder{color:#aeb4bf}search-box ::placeholder{color:#aeb4bf}";
20
-
21
- let SearchBox = class {
22
- constructor(hostRef) {
23
- index.registerInstance(this, hostRef);
24
- this.searchClicked = index.createEvent(this, "searchClicked", 7);
25
- this.typeChanged = index.createEvent(this, "typeChanged", 7);
26
- this.queryChanged = index.createEvent(this, "queryChanged", 7);
27
- /**
28
- * The placeholder to display in the input field.
29
- */
30
- this.placeholder = 'search documents, templates, people...';
31
- /**
32
- * If set to a value other than 'all', a removeable filter indicator will be displayed.
33
- */
34
- this.type = 'all';
35
- /**
36
- * The text search string entered by the user.
37
- */
38
- this.query = '';
39
- }
40
- handleSearch(e) {
41
- this.searchClicked.emit({ type: this.type, query: this.query });
42
- e.preventDefault();
43
- return false;
44
- }
45
- handleChange(e) {
46
- this.queryChanged.emit(e.target.value);
47
- }
48
- handleClearFilter() {
49
- this.typeChanged.emit('all');
50
- }
51
- handleKeyUp(e) {
52
- if (e.key === 'Enter') {
53
- this.searchClicked.emit({ type: this.type, query: this.query });
54
- }
55
- }
56
- render() {
57
- return (index.h(index.Host, null, index.h("form", { onSubmit: e => this.handleSearch(e) }, this.type !== undefined && this.type !== 'all' && (index.h("span", { class: "type" }, this.type, "s ", index.h("button", { class: "remove", innerHTML: CloseIcon, onClick: () => this.handleClearFilter() }))), index.h("input", { type: "text", placeholder: this.placeholder, value: this.query, onInput: e => this.handleChange(e), onKeyUp: e => this.handleKeyUp(e) }), index.h("button", { onClick: e => this.handleSearch(e), class: "search" }, index.h("span", { innerHTML: SearchIcon$2 }), "Search"))));
58
- }
59
- };
60
- SearchBox.style = searchBoxCss;
61
-
62
- const 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>`;
63
-
64
- const 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>`;
65
-
66
- const searchQuickFunctionsCss = "search-quick-functions{font-family:sans-serif;font-family:var(--verdocs-font)}search-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:var(--verdocs-background-dark);text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}search-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}search-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:#50be50}search-quick-functions button svg{fill:#ffffff}";
67
-
68
- let SearchQuickFunctions = class {
69
- constructor(hostRef) {
70
- index.registerInstance(this, hostRef);
71
- this.createTemplate = index.createEvent(this, "createTemplate", 7);
72
- this.createDocument = index.createEvent(this, "createDocument", 7);
73
- }
74
- handleCreateTemplate() {
75
- this.createTemplate.emit();
76
- }
77
- handleCreateDocument() {
78
- this.createDocument.emit();
79
- }
80
- render() {
81
- return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("p", { class: "title" }, "Quick Create"), index.h("button", { onClick: () => this.handleCreateTemplate(), innerHTML: TemplateIcon }, "Template"), index.h("button", { onClick: () => this.handleCreateDocument(), innerHTML: DocumentIcon$1 }, "Document"))));
82
- }
83
- };
84
- SearchQuickFunctions.style = searchQuickFunctionsCss;
85
-
86
- /**
87
- * Verdocs provides a range of search functions to help find and retrieve content. This module provides generic functions intended
88
- * to locate items across all content types. More specific retrievals may be performed using the various "list" endpoints within
89
- * each collection (e.g. {@link Documents.Documents.searchDocuments} or {@link Templates.Templates.searchTemplates}).
90
- *
91
- * @module
92
- */
93
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
94
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
95
- return new (P || (P = Promise))(function (resolve, reject) {
96
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
97
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
98
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
99
- step((generator = generator.apply(thisArg, _arguments || [])).next());
100
- });
101
- };
102
- var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
103
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
104
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
105
- function verb(n) { return function (v) { return step([n, v]); }; }
106
- function step(op) {
107
- if (f) throw new TypeError("Generator is already executing.");
108
- while (_) try {
109
- 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;
110
- if (y = 0, t) op = [op[0] & 2, t.value];
111
- switch (op[0]) {
112
- case 0: case 1: t = op; break;
113
- case 4: _.label++; return { value: op[1], done: false };
114
- case 5: _.label++; y = op[1]; op = [0]; continue;
115
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
116
- default:
117
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
118
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
119
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
120
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
121
- if (t[2]) _.ops.pop();
122
- _.trys.pop(); continue;
123
- }
124
- op = body.call(thisArg, _);
125
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
126
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
127
- }
128
- };
129
- /**
130
- * Retrieve recent and saved searches. Note that result counts will be limited to a maximum of 20 entries for each
131
- * type but this may be expanded in the future. Client UI's should self-limit display counts as needed.
132
- *
133
- * ```typescript
134
- * import {Content} from '@verdocs/js-sdk/Search';
135
- *
136
- * const {recent, saved} = await Content.getSearchHistory();
137
- * ```
138
- */
139
- var getSearchHistory = function () { return __awaiter(void 0, void 0, void 0, function () {
140
- return __generator(this, function (_a) {
141
- return [2 /*return*/, Transport.getEndpoint()
142
- .api.get('/search/history')
143
- .then(function (r) { return r.data; })];
144
- });
145
- }); };
146
-
147
- const SearchIcon$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="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>`;
148
-
149
- const searchRecentCss = "search-recent{font-family:sans-serif;font-family:var(--verdocs-font)}search-recent .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:var(--verdocs-background-dark);text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}search-recent .title{font-size:22px;font-weight:700;line-height:30px}search-recent .items{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:start;align-items:flex-start;margin-top:20px}search-recent .button{background:transparent;border:none;height:20px;font-size:16px;font-family:sans-serif;color:#ffffff;line-height:26px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}search-recent .button:hover{cursor:pointer}search-recent .button:not(:last-child){margin-bottom:36px}search-recent .button svg{fill:#707ae5;width:28px;height:28px;margin-right:26px}search-recent .pill{font-size:14px;display:-ms-inline-flexbox;display:inline-flex;padding:3px 8px;border-radius:6px;margin-right:8px;background-color:#999999;color:#333}search-recent .empty{text-transform:none;line-height:22px;color:#ccc}";
150
-
151
- let SearchRecent = class {
152
- constructor(hostRef) {
153
- index.registerInstance(this, hostRef);
154
- this.entrySelected = index.createEvent(this, "entrySelected", 7);
155
- /**
156
- * If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries
157
- * that cannot currently be increased (only reduced).
158
- */
159
- this.limit = 10;
160
- this.recent = [];
161
- this.emptyMessage = 'You do not have any recent searches.';
162
- }
163
- componentDidLoad() {
164
- getSearchHistory()
165
- .then(r => {
166
- this.recent = r.recent;
167
- this.emptyMessage = 'You do not have any recent searches.';
168
- })
169
- .catch(e => {
170
- var _a;
171
- console.warn('[Verdocs/search-recent] Error getting reent searches', e);
172
- if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
173
- this.emptyMessage = 'Authenticated required.';
174
- }
175
- });
176
- }
177
- handleSelectEntry(entry) {
178
- this.entrySelected.emit(entry);
179
- }
180
- render() {
181
- return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("p", { class: "title" }, "Recent Searches"), index.h("div", { class: "items" }, this.recent.slice(0, this.limit).map(entry => (index.h("button", { class: "button", innerHTML: SearchIcon$1, onClick: () => this.handleSelectEntry(entry) }, entry.params.q))), this.recent.length < 1 && index.h("div", { class: "empty" }, this.emptyMessage)))));
182
- }
183
- };
184
- SearchRecent.style = searchRecentCss;
185
-
186
- const SearchIcon = `<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="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>`;
187
-
188
- const searchSavedCss = "search-saved{font-family:sans-serif;font-family:var(--verdocs-font)}search-saved .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:var(--verdocs-background-dark);text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}search-saved .title{font-size:22px;font-weight:700;line-height:30px}search-saved .items{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:start;align-items:flex-start;margin-top:20px}search-saved .button{background:transparent;border:none;height:20px;font-size:16px;font-family:sans-serif;color:#ffffff;line-height:26px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}search-saved .button:hover{cursor:pointer}search-saved .button:not(:last-child){margin-bottom:36px}search-saved .button svg{fill:#707ae5;width:28px;height:28px;margin-right:26px}search-saved .empty{text-transform:none;line-height:22px;color:#ccc}";
189
-
190
- let SearchSaved = class {
191
- constructor(hostRef) {
192
- index.registerInstance(this, hostRef);
193
- this.entrySelected = index.createEvent(this, "entrySelected", 7);
194
- /**
195
- * If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries
196
- * that cannot currently be increased (only reduced).
197
- */
198
- this.limit = 10;
199
- this.saved = [];
200
- this.emptyMessage = 'You do not have any saved searches.';
201
- }
202
- componentDidLoad() {
203
- getSearchHistory()
204
- .then(r => {
205
- this.saved = r.saved;
206
- this.emptyMessage = 'You do not have any saved searches.';
207
- })
208
- .catch(e => {
209
- var _a;
210
- console.warn('[Verdocs/search-recent] Error getting saved searches', e);
211
- if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
212
- this.emptyMessage = 'Authenticated required.';
213
- }
214
- });
215
- }
216
- handleSelectEntry(entry) {
217
- this.entrySelected.emit(entry);
218
- }
219
- render() {
220
- return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("p", { class: "title" }, "Saved Searches"), index.h("div", { class: "items" }, this.saved.slice(0, this.limit).map(entry => (index.h("button", { class: "button", innerHTML: SearchIcon, onClick: () => this.handleSelectEntry(entry) }, entry.name))), this.saved.length < 1 && index.h("div", { class: "empty" }, this.emptyMessage)))));
221
- }
222
- };
223
- SearchSaved.style = searchSavedCss;
224
-
225
- const 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>`;
226
-
227
- const searchStarredCss = "search-starred{font-family:sans-serif;font-family:var(--verdocs-font)}search-starred .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:var(--verdocs-background-dark)}search-starred .title{font-size:22px;font-weight:700;line-height:30px}search-starred .items{display:-ms-flexbox;display:flex;margin-top:20px;-ms-flex-direction:column;flex-direction:column}search-starred .item{border:none;display:-ms-flexbox;display:flex;text-align:left;margin-bottom:20px;-ms-flex-direction:row;flex-direction:row;background:transparent}search-starred .item:hover{cursor:pointer}search-starred .icon{-ms-flex:0 0 22px;flex:0 0 22px;margin-right:14px}search-starred .icon svg{fill:#707ae5;width:22px;height:22px}search-starred .details{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column}search-starred .item-title{font-size:16px;font-weight:400;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}search-starred .info{font-size:14px;font-weight:500;line-height:23px;color:#aeb4bf}search-starred .empty{text-transform:none;line-height:22px;color:#ccc}";
228
-
229
- let SearchStarred = class {
230
- constructor(hostRef) {
231
- index.registerInstance(this, hostRef);
232
- this.entrySelected = index.createEvent(this, "entrySelected", 7);
233
- this.emptyMessage = 'You do not have any starred searches.';
234
- }
235
- componentDidLoad() {
236
- // TODO
237
- // getStarred()
238
- // .then(r => {
239
- // this.saved = r.saved;
240
- // this.emptyMessage = 'You do not have any saved searches.';
241
- // })
242
- // .catch(e => {
243
- // console.warn('[Verdocs/search-recent] Error getting saved searches', e);
244
- // if (e?.response?.status === 401) {
245
- // this.emptyMessage = 'Authenticated required.';
246
- // }
247
- // });
248
- }
249
- handleSelectEntry(entry) {
250
- this.entrySelected.emit(entry);
251
- }
252
- computePagesText(pages) {
253
- if (pages < 2) {
254
- return `${pages} Page`;
255
- }
256
- else {
257
- return `${pages} Pages`;
258
- }
259
- }
260
- computeRecipientsText(recipients) {
261
- if (typeof recipients === 'object') {
262
- return recipients.join(', ');
263
- }
264
- else if (recipients > 1) {
265
- return `${recipients} Recipients`;
266
- }
267
- else {
268
- return `${recipients} Recipient`;
269
- }
270
- }
271
- render() {
272
- var _a, _b;
273
- return (index.h(index.Host, null, index.h("div", { class: "container" }, index.h("p", { class: "title" }, "My Starred Items"), index.h("div", { class: "items" }, (_a = this.options) === null || _a === void 0 ? void 0 :
274
- _a.map(option => (index.h("button", { class: "item", onClick: () => this.handleSelectEntry(option) }, index.h("div", { class: "icon", innerHTML: DocumentIcon }), index.h("div", { class: "details" }, index.h("div", { class: "item-title" }, option.params.q), index.h("div", { class: "info" }, option.pages ? `${this.computePagesText(option.pages)} ` : '', option.recipients ? this.computeRecipientsText(option.recipients) : ''))))), (((_b = this.options) === null || _b === void 0 ? void 0 : _b.length) || []) < 1 && index.h("div", { class: "empty" }, this.emptyMessage)))));
275
- }
276
- };
277
- SearchStarred.style = searchStarredCss;
278
-
279
- exports.search_box = SearchBox;
280
- exports.search_quick_functions = SearchQuickFunctions;
281
- exports.search_recent = SearchRecent;
282
- exports.search_saved = SearchSaved;
283
- exports.search_starred = SearchStarred;
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-6fc067b7.js');
6
-
7
- const searchTabsCss = ":host{display:block}";
8
-
9
- let SearchTabs = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.selected = 'all';
13
- }
14
- render() {
15
- return (index.h(index.Host, null, index.h("slot", null)));
16
- }
17
- };
18
- SearchTabs.style = searchTabsCss;
19
-
20
- exports.search_tabs = SearchTabs;
@@ -1 +0,0 @@
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="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>
@@ -1,65 +0,0 @@
1
- search-recent {
2
- /* Fallback font for old browsers */
3
- font-family: sans-serif;
4
- font-family: var(--verdocs-font);
5
- }
6
- search-recent .container {
7
- display: flex;
8
- flex-direction: column;
9
- flex-wrap: nowrap;
10
- width: 240px;
11
- background-color: var(--verdocs-background-dark);
12
- text-transform: uppercase;
13
- padding: 10px 10px 20px 10px;
14
- font-family: sans-serif;
15
- color: #ffffff;
16
- }
17
- search-recent .title {
18
- font-size: 22px;
19
- font-weight: 700;
20
- line-height: 30px;
21
- }
22
- search-recent .items {
23
- display: flex;
24
- flex-direction: column;
25
- flex-wrap: nowrap;
26
- align-items: flex-start;
27
- margin-top: 20px;
28
- }
29
- search-recent .button {
30
- background: transparent;
31
- border: none;
32
- height: 20px;
33
- font-size: 16px;
34
- font-family: sans-serif;
35
- color: #ffffff;
36
- line-height: 26px;
37
- display: flex;
38
- align-items: center;
39
- }
40
- search-recent .button:hover {
41
- cursor: pointer;
42
- }
43
- search-recent .button:not(:last-child) {
44
- margin-bottom: 36px;
45
- }
46
- search-recent .button svg {
47
- fill: #707ae5;
48
- width: 28px;
49
- height: 28px;
50
- margin-right: 26px;
51
- }
52
- search-recent .pill {
53
- font-size: 14px;
54
- display: inline-flex;
55
- padding: 3px 8px;
56
- border-radius: 6px;
57
- margin-right: 8px;
58
- background-color: #999999;
59
- color: #333;
60
- }
61
- search-recent .empty {
62
- text-transform: none;
63
- line-height: 22px;
64
- color: #ccc;
65
- }
@@ -1,98 +0,0 @@
1
- import { getSearchHistory } from '@verdocs/js-sdk/Search/Content';
2
- import { Component, Host, h, Prop, State, Event } from '@stencil/core';
3
- import SearchIcon from './search-icon.svg';
4
- /**
5
- * Display a list of recent searches. Note that only some types of searches are automatically saved in the
6
- * user's history (those that contain a unique `q` query string from the next-most-recent search.
7
- *
8
- * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth
9
- * embed. This Element will reuse the same session produced by logging in via that Embed.
10
- */
11
- export class SearchRecent {
12
- constructor() {
13
- /**
14
- * If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries
15
- * that cannot currently be increased (only reduced).
16
- */
17
- this.limit = 10;
18
- this.recent = [];
19
- this.emptyMessage = 'You do not have any recent searches.';
20
- }
21
- componentDidLoad() {
22
- getSearchHistory()
23
- .then(r => {
24
- this.recent = r.recent;
25
- this.emptyMessage = 'You do not have any recent searches.';
26
- })
27
- .catch(e => {
28
- var _a;
29
- console.warn('[Verdocs/search-recent] Error getting reent searches', e);
30
- if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
31
- this.emptyMessage = 'Authenticated required.';
32
- }
33
- });
34
- }
35
- handleSelectEntry(entry) {
36
- this.entrySelected.emit(entry);
37
- }
38
- render() {
39
- return (h(Host, null,
40
- h("div", { class: "container" },
41
- h("p", { class: "title" }, "Recent Searches"),
42
- h("div", { class: "items" },
43
- this.recent.slice(0, this.limit).map(entry => (h("button", { class: "button", innerHTML: SearchIcon, onClick: () => this.handleSelectEntry(entry) }, entry.params.q))),
44
- this.recent.length < 1 && h("div", { class: "empty" }, this.emptyMessage)))));
45
- }
46
- static get is() { return "search-recent"; }
47
- static get originalStyleUrls() { return {
48
- "$": ["search-recent.scss"]
49
- }; }
50
- static get styleUrls() { return {
51
- "$": ["search-recent.css"]
52
- }; }
53
- static get properties() { return {
54
- "limit": {
55
- "type": "number",
56
- "mutable": false,
57
- "complexType": {
58
- "original": "number",
59
- "resolved": "number",
60
- "references": {}
61
- },
62
- "required": false,
63
- "optional": false,
64
- "docs": {
65
- "tags": [],
66
- "text": "If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries\nthat cannot currently be increased (only reduced)."
67
- },
68
- "attribute": "limit",
69
- "reflect": false,
70
- "defaultValue": "10"
71
- }
72
- }; }
73
- static get states() { return {
74
- "recent": {},
75
- "emptyMessage": {}
76
- }; }
77
- static get events() { return [{
78
- "method": "entrySelected",
79
- "name": "entrySelected",
80
- "bubbles": true,
81
- "cancelable": true,
82
- "composed": true,
83
- "docs": {
84
- "tags": [],
85
- "text": "Event fired when an entry is clicked."
86
- },
87
- "complexType": {
88
- "original": "IRecentSearch",
89
- "resolved": "IRecentSearch",
90
- "references": {
91
- "IRecentSearch": {
92
- "location": "import",
93
- "path": "@verdocs/js-sdk/Search/Types"
94
- }
95
- }
96
- }
97
- }]; }
98
- }
@@ -1,12 +0,0 @@
1
- import { html } from 'lit-html';
2
- export default {
3
- title: 'Elements/Search/Recent Searches',
4
- component: 'search-recent',
5
- args: {
6
- limit: 10,
7
- },
8
- argTypes: {
9
- entrySelected: { action: 'entrySelected' },
10
- },
11
- };
12
- export const RecentSearches = ({ limit, entrySelected }) => html `<search-recent .limit=${limit} @entrySelected=${entrySelected} />`;
@@ -1 +0,0 @@
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="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>
@@ -1,56 +0,0 @@
1
- search-saved {
2
- /* Fallback font for old browsers */
3
- font-family: sans-serif;
4
- font-family: var(--verdocs-font);
5
- }
6
- search-saved .container {
7
- display: flex;
8
- flex-direction: column;
9
- flex-wrap: nowrap;
10
- width: 240px;
11
- background-color: var(--verdocs-background-dark);
12
- text-transform: uppercase;
13
- padding: 10px 10px 20px 10px;
14
- font-family: sans-serif;
15
- color: #ffffff;
16
- }
17
- search-saved .title {
18
- font-size: 22px;
19
- font-weight: 700;
20
- line-height: 30px;
21
- }
22
- search-saved .items {
23
- display: flex;
24
- flex-direction: column;
25
- flex-wrap: nowrap;
26
- align-items: flex-start;
27
- margin-top: 20px;
28
- }
29
- search-saved .button {
30
- background: transparent;
31
- border: none;
32
- height: 20px;
33
- font-size: 16px;
34
- font-family: sans-serif;
35
- color: #ffffff;
36
- line-height: 26px;
37
- display: flex;
38
- align-items: center;
39
- }
40
- search-saved .button:hover {
41
- cursor: pointer;
42
- }
43
- search-saved .button:not(:last-child) {
44
- margin-bottom: 36px;
45
- }
46
- search-saved .button svg {
47
- fill: #707ae5;
48
- width: 28px;
49
- height: 28px;
50
- margin-right: 26px;
51
- }
52
- search-saved .empty {
53
- text-transform: none;
54
- line-height: 22px;
55
- color: #ccc;
56
- }
@@ -1,98 +0,0 @@
1
- import { getSearchHistory } from '@verdocs/js-sdk/Search/Content';
2
- import { Component, Host, h, Prop, State, Event } from '@stencil/core';
3
- import SearchIcon from './search-icon.svg';
4
- /**
5
- * Display a list of saved searches. Note that only some types of searches are automatically saved in the
6
- * user's history (those that contain a unique `q` query string from the next-most-recent search.
7
- *
8
- * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth
9
- * embed. This Element will reuse the same session produced by logging in via that Embed.
10
- */
11
- export class SearchSaved {
12
- constructor() {
13
- /**
14
- * If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries
15
- * that cannot currently be increased (only reduced).
16
- */
17
- this.limit = 10;
18
- this.saved = [];
19
- this.emptyMessage = 'You do not have any saved searches.';
20
- }
21
- componentDidLoad() {
22
- getSearchHistory()
23
- .then(r => {
24
- this.saved = r.saved;
25
- this.emptyMessage = 'You do not have any saved searches.';
26
- })
27
- .catch(e => {
28
- var _a;
29
- console.warn('[Verdocs/search-recent] Error getting saved searches', e);
30
- if (((_a = e === null || e === void 0 ? void 0 : e.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
31
- this.emptyMessage = 'Authenticated required.';
32
- }
33
- });
34
- }
35
- handleSelectEntry(entry) {
36
- this.entrySelected.emit(entry);
37
- }
38
- render() {
39
- return (h(Host, null,
40
- h("div", { class: "container" },
41
- h("p", { class: "title" }, "Saved Searches"),
42
- h("div", { class: "items" },
43
- this.saved.slice(0, this.limit).map(entry => (h("button", { class: "button", innerHTML: SearchIcon, onClick: () => this.handleSelectEntry(entry) }, entry.name))),
44
- this.saved.length < 1 && h("div", { class: "empty" }, this.emptyMessage)))));
45
- }
46
- static get is() { return "search-saved"; }
47
- static get originalStyleUrls() { return {
48
- "$": ["search-saved.scss"]
49
- }; }
50
- static get styleUrls() { return {
51
- "$": ["search-saved.css"]
52
- }; }
53
- static get properties() { return {
54
- "limit": {
55
- "type": "number",
56
- "mutable": false,
57
- "complexType": {
58
- "original": "number",
59
- "resolved": "number",
60
- "references": {}
61
- },
62
- "required": false,
63
- "optional": false,
64
- "docs": {
65
- "tags": [],
66
- "text": "If set, limits the number of entries that will be shown. Note that there is a server-imposed limit of 20 entries\nthat cannot currently be increased (only reduced)."
67
- },
68
- "attribute": "limit",
69
- "reflect": false,
70
- "defaultValue": "10"
71
- }
72
- }; }
73
- static get states() { return {
74
- "saved": {},
75
- "emptyMessage": {}
76
- }; }
77
- static get events() { return [{
78
- "method": "entrySelected",
79
- "name": "entrySelected",
80
- "bubbles": true,
81
- "cancelable": true,
82
- "composed": true,
83
- "docs": {
84
- "tags": [],
85
- "text": "Event fired when an entry is clicked."
86
- },
87
- "complexType": {
88
- "original": "ISavedSearch",
89
- "resolved": "ISavedSearch",
90
- "references": {
91
- "ISavedSearch": {
92
- "location": "import",
93
- "path": "@verdocs/js-sdk/Search/Types"
94
- }
95
- }
96
- }
97
- }]; }
98
- }
@@ -1,12 +0,0 @@
1
- import { html } from 'lit-html';
2
- export default {
3
- title: 'Elements/Search/Saved Searches',
4
- component: 'search-saved',
5
- args: {
6
- limit: 10,
7
- },
8
- argTypes: {
9
- entrySelected: { action: 'entrySelected' },
10
- },
11
- };
12
- export const SavedSearches = ({ limit, entrySelected }) => html `<search-saved .limit=${limit} @entrySelected=${entrySelected} />`;