@vandenberghinc/volt 1.2.5 → 1.2.6

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 (489) hide show
  1. package/frontend/assets/admin/admin.png +0 -0
  2. package/frontend/assets/admin/password.webp +0 -0
  3. package/frontend/assets/icons/arrow.v1.webp +0 -0
  4. package/frontend/assets/icons/copy.webp +0 -0
  5. package/frontend/assets/payments/arrow.long.webp +0 -0
  6. package/frontend/assets/payments/arrow.long2.webp +0 -0
  7. package/frontend/assets/payments/cancelled.webp +0 -0
  8. package/frontend/assets/payments/check.sign.webp +0 -0
  9. package/frontend/assets/payments/check.webp +0 -0
  10. package/frontend/assets/payments/close.webp +0 -0
  11. package/frontend/assets/payments/error.webp +0 -0
  12. package/frontend/assets/payments/exclamation.webp +0 -0
  13. package/frontend/assets/payments/minus.webp +0 -0
  14. package/frontend/assets/payments/party.webp +0 -0
  15. package/frontend/assets/payments/plus.webp +0 -0
  16. package/frontend/assets/payments/shopping_cart.webp +0 -0
  17. package/frontend/assets/payments/trash.webp +0 -0
  18. package/package.json +5 -1
  19. package/.libris/config.json +0 -82
  20. package/backend/dist/cjs/backend/src/blacklist.d.ts +0 -12
  21. package/backend/dist/cjs/backend/src/blacklist.js +0 -78
  22. package/backend/dist/cjs/backend/src/cli.d.ts +0 -2
  23. package/backend/dist/cjs/backend/src/cli.js +0 -198
  24. package/backend/dist/cjs/backend/src/database/collection.d.ts +0 -1765
  25. package/backend/dist/cjs/backend/src/database/collection.js +0 -3301
  26. package/backend/dist/cjs/backend/src/database/database.d.ts +0 -92
  27. package/backend/dist/cjs/backend/src/database/database.js +0 -170
  28. package/backend/dist/cjs/backend/src/database/document.d.ts +0 -1
  29. package/backend/dist/cjs/backend/src/database/document.js +0 -15
  30. package/backend/dist/cjs/backend/src/database/filters/filters.d.ts +0 -6
  31. package/backend/dist/cjs/backend/src/database/filters/filters.js +0 -15
  32. package/backend/dist/cjs/backend/src/database/filters/strict_filter.d.ts +0 -223
  33. package/backend/dist/cjs/backend/src/database/filters/strict_filter.js +0 -15
  34. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.d.ts +0 -1
  35. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test.js +0 -443
  36. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
  37. package/backend/dist/cjs/backend/src/database/filters/strict_filter_test_v0.js +0 -15
  38. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
  39. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v0.js +0 -15
  40. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
  41. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v1.js +0 -15
  42. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
  43. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v2.js +0 -15
  44. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
  45. package/backend/dist/cjs/backend/src/database/filters/strict_filter_v3.js +0 -15
  46. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  47. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter.js +0 -15
  48. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
  49. package/backend/dist/cjs/backend/src/database/filters/strict_update_filter_test.js +0 -355
  50. package/backend/dist/cjs/backend/src/database/flatten.d.ts +0 -78
  51. package/backend/dist/cjs/backend/src/database/flatten.js +0 -53
  52. package/backend/dist/cjs/backend/src/database/flatten_test.d.ts +0 -1
  53. package/backend/dist/cjs/backend/src/database/flatten_test.js +0 -175
  54. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.d.ts +0 -533
  55. package/backend/dist/cjs/backend/src/database/quota/quoata_v2.js +0 -1046
  56. package/backend/dist/cjs/backend/src/database/quota/quota.d.ts +0 -551
  57. package/backend/dist/cjs/backend/src/database/quota/quota.js +0 -1108
  58. package/backend/dist/cjs/backend/src/database/quota/quota_v1.d.ts +0 -534
  59. package/backend/dist/cjs/backend/src/database/quota/quota_v1.js +0 -1087
  60. package/backend/dist/cjs/backend/src/database/quota/safe_int.d.ts +0 -412
  61. package/backend/dist/cjs/backend/src/database/quota/safe_int.js +0 -745
  62. package/backend/dist/cjs/backend/src/endpoint.d.ts +0 -346
  63. package/backend/dist/cjs/backend/src/endpoint.js +0 -468
  64. package/backend/dist/cjs/backend/src/errors/index.d.ts +0 -7
  65. package/backend/dist/cjs/backend/src/errors/index.js +0 -25
  66. package/backend/dist/cjs/backend/src/errors/internal_external.d.ts +0 -52
  67. package/backend/dist/cjs/backend/src/errors/internal_external.js +0 -95
  68. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.d.ts +0 -41
  69. package/backend/dist/cjs/backend/src/errors/invalid_usage_error.js +0 -47
  70. package/backend/dist/cjs/backend/src/errors/system_error.d.ts +0 -261
  71. package/backend/dist/cjs/backend/src/errors/system_error.js +0 -436
  72. package/backend/dist/cjs/backend/src/events.d.ts +0 -97
  73. package/backend/dist/cjs/backend/src/events.js +0 -15
  74. package/backend/dist/cjs/backend/src/frontend.d.ts +0 -11
  75. package/backend/dist/cjs/backend/src/frontend.js +0 -37
  76. package/backend/dist/cjs/backend/src/image_endpoint.d.ts +0 -44
  77. package/backend/dist/cjs/backend/src/image_endpoint.js +0 -185
  78. package/backend/dist/cjs/backend/src/index.d.ts +0 -23
  79. package/backend/dist/cjs/backend/src/index.js +0 -70
  80. package/backend/dist/cjs/backend/src/logger.d.ts +0 -5
  81. package/backend/dist/cjs/backend/src/logger.js +0 -15
  82. package/backend/dist/cjs/backend/src/meta.d.ts +0 -112
  83. package/backend/dist/cjs/backend/src/meta.js +0 -181
  84. package/backend/dist/cjs/backend/src/payments/paddle.d.ts +0 -329
  85. package/backend/dist/cjs/backend/src/payments/paddle.js +0 -1996
  86. package/backend/dist/cjs/backend/src/payments/stripe/checkout.d.ts +0 -113
  87. package/backend/dist/cjs/backend/src/payments/stripe/checkout.js +0 -295
  88. package/backend/dist/cjs/backend/src/payments/stripe/customers.d.ts +0 -17
  89. package/backend/dist/cjs/backend/src/payments/stripe/customers.js +0 -164
  90. package/backend/dist/cjs/backend/src/payments/stripe/error.d.ts +0 -74
  91. package/backend/dist/cjs/backend/src/payments/stripe/error.js +0 -64
  92. package/backend/dist/cjs/backend/src/payments/stripe/events.d.ts +0 -155
  93. package/backend/dist/cjs/backend/src/payments/stripe/events.js +0 -15
  94. package/backend/dist/cjs/backend/src/payments/stripe/meters.d.ts +0 -105
  95. package/backend/dist/cjs/backend/src/payments/stripe/meters.js +0 -230
  96. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  97. package/backend/dist/cjs/backend/src/payments/stripe/payment_methods.js +0 -109
  98. package/backend/dist/cjs/backend/src/payments/stripe/products.d.ts +0 -519
  99. package/backend/dist/cjs/backend/src/payments/stripe/products.js +0 -650
  100. package/backend/dist/cjs/backend/src/payments/stripe/stripe.d.ts +0 -215
  101. package/backend/dist/cjs/backend/src/payments/stripe/stripe.js +0 -468
  102. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  103. package/backend/dist/cjs/backend/src/payments/stripe/subscriptions.js +0 -557
  104. package/backend/dist/cjs/backend/src/payments/stripe/utils.d.ts +0 -63
  105. package/backend/dist/cjs/backend/src/payments/stripe/utils.js +0 -118
  106. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.d.ts +0 -105
  107. package/backend/dist/cjs/backend/src/payments/stripe/webhooks.js +0 -627
  108. package/backend/dist/cjs/backend/src/plugins/browser.d.ts +0 -1
  109. package/backend/dist/cjs/backend/src/plugins/browser.js +0 -15
  110. package/backend/dist/cjs/backend/src/plugins/communication.d.ts +0 -70
  111. package/backend/dist/cjs/backend/src/plugins/communication.js +0 -196
  112. package/backend/dist/cjs/backend/src/plugins/mail/mail.d.ts +0 -255
  113. package/backend/dist/cjs/backend/src/plugins/mail/mail.js +0 -381
  114. package/backend/dist/cjs/backend/src/plugins/mail/ui.d.ts +0 -297
  115. package/backend/dist/cjs/backend/src/plugins/mail/ui.js +0 -1370
  116. package/backend/dist/cjs/backend/src/plugins/pdf.d.ts +0 -1
  117. package/backend/dist/cjs/backend/src/plugins/pdf.js +0 -1456
  118. package/backend/dist/cjs/backend/src/plugins/thread_monitor.d.ts +0 -18
  119. package/backend/dist/cjs/backend/src/plugins/thread_monitor.js +0 -116
  120. package/backend/dist/cjs/backend/src/rate_limit.d.ts +0 -148
  121. package/backend/dist/cjs/backend/src/rate_limit.js +0 -543
  122. package/backend/dist/cjs/backend/src/route.d.ts +0 -39
  123. package/backend/dist/cjs/backend/src/route.js +0 -172
  124. package/backend/dist/cjs/backend/src/server.d.ts +0 -502
  125. package/backend/dist/cjs/backend/src/server.js +0 -1713
  126. package/backend/dist/cjs/backend/src/server.old.d.ts +0 -594
  127. package/backend/dist/cjs/backend/src/server.old.js +0 -2058
  128. package/backend/dist/cjs/backend/src/splash_screen.d.ts +0 -93
  129. package/backend/dist/cjs/backend/src/splash_screen.js +0 -119
  130. package/backend/dist/cjs/backend/src/status.d.ts +0 -89
  131. package/backend/dist/cjs/backend/src/status.js +0 -211
  132. package/backend/dist/cjs/backend/src/stream.d.ts +0 -494
  133. package/backend/dist/cjs/backend/src/stream.js +0 -1370
  134. package/backend/dist/cjs/backend/src/users.d.ts +0 -926
  135. package/backend/dist/cjs/backend/src/users.js +0 -2223
  136. package/backend/dist/cjs/backend/src/utils.d.ts +0 -22
  137. package/backend/dist/cjs/backend/src/utils.js +0 -626
  138. package/backend/dist/cjs/backend/src/view.d.ts +0 -115
  139. package/backend/dist/cjs/backend/src/view.js +0 -519
  140. package/backend/dist/cjs/backend/src/vinc.d.ts +0 -6
  141. package/backend/dist/cjs/backend/src/vinc.js +0 -40
  142. package/backend/dist/cjs/backend/src/volt.d.ts +0 -24
  143. package/backend/dist/cjs/backend/src/volt.js +0 -72
  144. package/backend/dist/cjs/frontend/src/modules/request.d.ts +0 -70
  145. package/backend/dist/cjs/frontend/src/modules/request.js +0 -99
  146. package/backend/dist/cjs/package.json +0 -1
  147. package/backend/dist/esm/backend/src/blacklist.d.ts +0 -12
  148. package/backend/dist/esm/backend/src/blacklist.js +0 -52
  149. package/backend/dist/esm/backend/src/cli.d.ts +0 -2
  150. package/backend/dist/esm/backend/src/cli.js +0 -211
  151. package/backend/dist/esm/backend/src/database/collection.d.ts +0 -1765
  152. package/backend/dist/esm/backend/src/database/collection.js +0 -3779
  153. package/backend/dist/esm/backend/src/database/database.d.ts +0 -92
  154. package/backend/dist/esm/backend/src/database/database.js +0 -214
  155. package/backend/dist/esm/backend/src/database/document.d.ts +0 -1
  156. package/backend/dist/esm/backend/src/database/document.js +0 -558
  157. package/backend/dist/esm/backend/src/database/filters/filters.d.ts +0 -6
  158. package/backend/dist/esm/backend/src/database/filters/filters.js +0 -1
  159. package/backend/dist/esm/backend/src/database/filters/strict_filter.d.ts +0 -223
  160. package/backend/dist/esm/backend/src/database/filters/strict_filter.js +0 -3
  161. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.d.ts +0 -1
  162. package/backend/dist/esm/backend/src/database/filters/strict_filter_test.js +0 -505
  163. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.d.ts +0 -1
  164. package/backend/dist/esm/backend/src/database/filters/strict_filter_test_v0.js +0 -712
  165. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.d.ts +0 -50
  166. package/backend/dist/esm/backend/src/database/filters/strict_filter_v0.js +0 -5
  167. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.d.ts +0 -76
  168. package/backend/dist/esm/backend/src/database/filters/strict_filter_v1.js +0 -44
  169. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.d.ts +0 -75
  170. package/backend/dist/esm/backend/src/database/filters/strict_filter_v2.js +0 -5
  171. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.d.ts +0 -219
  172. package/backend/dist/esm/backend/src/database/filters/strict_filter_v3.js +0 -1
  173. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  174. package/backend/dist/esm/backend/src/database/filters/strict_update_filter.js +0 -5
  175. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.d.ts +0 -5
  176. package/backend/dist/esm/backend/src/database/filters/strict_update_filter_test.js +0 -415
  177. package/backend/dist/esm/backend/src/database/flatten.d.ts +0 -78
  178. package/backend/dist/esm/backend/src/database/flatten.js +0 -22
  179. package/backend/dist/esm/backend/src/database/flatten_test.d.ts +0 -1
  180. package/backend/dist/esm/backend/src/database/flatten_test.js +0 -174
  181. package/backend/dist/esm/backend/src/database/quota/quoata_v2.d.ts +0 -533
  182. package/backend/dist/esm/backend/src/database/quota/quoata_v2.js +0 -1155
  183. package/backend/dist/esm/backend/src/database/quota/quota.d.ts +0 -551
  184. package/backend/dist/esm/backend/src/database/quota/quota.js +0 -1219
  185. package/backend/dist/esm/backend/src/database/quota/quota_v1.d.ts +0 -534
  186. package/backend/dist/esm/backend/src/database/quota/quota_v1.js +0 -1242
  187. package/backend/dist/esm/backend/src/database/quota/safe_int.d.ts +0 -412
  188. package/backend/dist/esm/backend/src/database/quota/safe_int.js +0 -810
  189. package/backend/dist/esm/backend/src/endpoint.d.ts +0 -346
  190. package/backend/dist/esm/backend/src/endpoint.js +0 -479
  191. package/backend/dist/esm/backend/src/errors/index.d.ts +0 -7
  192. package/backend/dist/esm/backend/src/errors/index.js +0 -7
  193. package/backend/dist/esm/backend/src/errors/internal_external.d.ts +0 -52
  194. package/backend/dist/esm/backend/src/errors/internal_external.js +0 -86
  195. package/backend/dist/esm/backend/src/errors/invalid_usage_error.d.ts +0 -41
  196. package/backend/dist/esm/backend/src/errors/invalid_usage_error.js +0 -33
  197. package/backend/dist/esm/backend/src/errors/system_error.d.ts +0 -261
  198. package/backend/dist/esm/backend/src/errors/system_error.js +0 -444
  199. package/backend/dist/esm/backend/src/events.d.ts +0 -97
  200. package/backend/dist/esm/backend/src/events.js +0 -5
  201. package/backend/dist/esm/backend/src/frontend.d.ts +0 -11
  202. package/backend/dist/esm/backend/src/frontend.js +0 -12
  203. package/backend/dist/esm/backend/src/image_endpoint.d.ts +0 -44
  204. package/backend/dist/esm/backend/src/image_endpoint.js +0 -196
  205. package/backend/dist/esm/backend/src/index.d.ts +0 -23
  206. package/backend/dist/esm/backend/src/index.js +0 -26
  207. package/backend/dist/esm/backend/src/logger.d.ts +0 -5
  208. package/backend/dist/esm/backend/src/logger.js +0 -8
  209. package/backend/dist/esm/backend/src/meta.d.ts +0 -112
  210. package/backend/dist/esm/backend/src/meta.js +0 -152
  211. package/backend/dist/esm/backend/src/payments/paddle.d.ts +0 -329
  212. package/backend/dist/esm/backend/src/payments/paddle.js +0 -2276
  213. package/backend/dist/esm/backend/src/payments/stripe/checkout.d.ts +0 -113
  214. package/backend/dist/esm/backend/src/payments/stripe/checkout.js +0 -356
  215. package/backend/dist/esm/backend/src/payments/stripe/customers.d.ts +0 -17
  216. package/backend/dist/esm/backend/src/payments/stripe/customers.js +0 -193
  217. package/backend/dist/esm/backend/src/payments/stripe/error.d.ts +0 -74
  218. package/backend/dist/esm/backend/src/payments/stripe/error.js +0 -51
  219. package/backend/dist/esm/backend/src/payments/stripe/events.d.ts +0 -155
  220. package/backend/dist/esm/backend/src/payments/stripe/events.js +0 -5
  221. package/backend/dist/esm/backend/src/payments/stripe/meters.d.ts +0 -105
  222. package/backend/dist/esm/backend/src/payments/stripe/meters.js +0 -318
  223. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  224. package/backend/dist/esm/backend/src/payments/stripe/payment_methods.js +0 -135
  225. package/backend/dist/esm/backend/src/payments/stripe/products.d.ts +0 -519
  226. package/backend/dist/esm/backend/src/payments/stripe/products.js +0 -896
  227. package/backend/dist/esm/backend/src/payments/stripe/stripe.d.ts +0 -215
  228. package/backend/dist/esm/backend/src/payments/stripe/stripe.js +0 -464
  229. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  230. package/backend/dist/esm/backend/src/payments/stripe/subscriptions.js +0 -754
  231. package/backend/dist/esm/backend/src/payments/stripe/utils.d.ts +0 -63
  232. package/backend/dist/esm/backend/src/payments/stripe/utils.js +0 -131
  233. package/backend/dist/esm/backend/src/payments/stripe/webhooks.d.ts +0 -105
  234. package/backend/dist/esm/backend/src/payments/stripe/webhooks.js +0 -752
  235. package/backend/dist/esm/backend/src/plugins/browser.d.ts +0 -1
  236. package/backend/dist/esm/backend/src/plugins/browser.js +0 -170
  237. package/backend/dist/esm/backend/src/plugins/communication.d.ts +0 -70
  238. package/backend/dist/esm/backend/src/plugins/communication.js +0 -169
  239. package/backend/dist/esm/backend/src/plugins/mail/mail.d.ts +0 -255
  240. package/backend/dist/esm/backend/src/plugins/mail/mail.js +0 -396
  241. package/backend/dist/esm/backend/src/plugins/mail/ui.d.ts +0 -297
  242. package/backend/dist/esm/backend/src/plugins/mail/ui.js +0 -1400
  243. package/backend/dist/esm/backend/src/plugins/pdf.d.ts +0 -1
  244. package/backend/dist/esm/backend/src/plugins/pdf.js +0 -1694
  245. package/backend/dist/esm/backend/src/plugins/thread_monitor.d.ts +0 -18
  246. package/backend/dist/esm/backend/src/plugins/thread_monitor.js +0 -120
  247. package/backend/dist/esm/backend/src/rate_limit.d.ts +0 -148
  248. package/backend/dist/esm/backend/src/rate_limit.js +0 -667
  249. package/backend/dist/esm/backend/src/route.d.ts +0 -39
  250. package/backend/dist/esm/backend/src/route.js +0 -222
  251. package/backend/dist/esm/backend/src/server.d.ts +0 -502
  252. package/backend/dist/esm/backend/src/server.js +0 -2034
  253. package/backend/dist/esm/backend/src/server.old.d.ts +0 -594
  254. package/backend/dist/esm/backend/src/server.old.js +0 -2630
  255. package/backend/dist/esm/backend/src/splash_screen.d.ts +0 -93
  256. package/backend/dist/esm/backend/src/splash_screen.js +0 -156
  257. package/backend/dist/esm/backend/src/status.d.ts +0 -89
  258. package/backend/dist/esm/backend/src/status.js +0 -213
  259. package/backend/dist/esm/backend/src/stream.d.ts +0 -494
  260. package/backend/dist/esm/backend/src/stream.js +0 -1611
  261. package/backend/dist/esm/backend/src/users.d.ts +0 -926
  262. package/backend/dist/esm/backend/src/users.js +0 -2423
  263. package/backend/dist/esm/backend/src/utils.d.ts +0 -22
  264. package/backend/dist/esm/backend/src/utils.js +0 -463
  265. package/backend/dist/esm/backend/src/view.d.ts +0 -115
  266. package/backend/dist/esm/backend/src/view.js +0 -584
  267. package/backend/dist/esm/backend/src/vinc.d.ts +0 -6
  268. package/backend/dist/esm/backend/src/vinc.js +0 -6
  269. package/backend/dist/esm/backend/src/volt.d.ts +0 -24
  270. package/backend/dist/esm/backend/src/volt.js +0 -27
  271. package/backend/dist/esm/frontend/src/modules/request.d.ts +0 -70
  272. package/backend/dist/esm/frontend/src/modules/request.js +0 -117
  273. package/backend/old/file_watcher.ts +0 -359
  274. package/backend/old/request.deprc.js +0 -626
  275. package/backend/old/response.deprc.js +0 -354
  276. package/frontend/dist/backend/src/database/collection.d.ts +0 -1765
  277. package/frontend/dist/backend/src/database/collection.js +0 -3779
  278. package/frontend/dist/backend/src/database/database.d.ts +0 -92
  279. package/frontend/dist/backend/src/database/database.js +0 -214
  280. package/frontend/dist/backend/src/database/filters/filters.d.ts +0 -6
  281. package/frontend/dist/backend/src/database/filters/filters.js +0 -1
  282. package/frontend/dist/backend/src/database/filters/strict_filter.d.ts +0 -223
  283. package/frontend/dist/backend/src/database/filters/strict_filter.js +0 -3
  284. package/frontend/dist/backend/src/database/filters/strict_update_filter.d.ts +0 -165
  285. package/frontend/dist/backend/src/database/filters/strict_update_filter.js +0 -5
  286. package/frontend/dist/backend/src/database/flatten.d.ts +0 -78
  287. package/frontend/dist/backend/src/database/flatten.js +0 -22
  288. package/frontend/dist/backend/src/endpoint.d.ts +0 -346
  289. package/frontend/dist/backend/src/endpoint.js +0 -479
  290. package/frontend/dist/backend/src/errors/index.d.ts +0 -7
  291. package/frontend/dist/backend/src/errors/index.js +0 -7
  292. package/frontend/dist/backend/src/errors/internal_external.d.ts +0 -52
  293. package/frontend/dist/backend/src/errors/internal_external.js +0 -86
  294. package/frontend/dist/backend/src/errors/invalid_usage_error.d.ts +0 -41
  295. package/frontend/dist/backend/src/errors/invalid_usage_error.js +0 -33
  296. package/frontend/dist/backend/src/errors/system_error.d.ts +0 -261
  297. package/frontend/dist/backend/src/errors/system_error.js +0 -444
  298. package/frontend/dist/backend/src/events.d.ts +0 -97
  299. package/frontend/dist/backend/src/events.js +0 -5
  300. package/frontend/dist/backend/src/frontend.d.ts +0 -11
  301. package/frontend/dist/backend/src/frontend.js +0 -12
  302. package/frontend/dist/backend/src/image_endpoint.d.ts +0 -44
  303. package/frontend/dist/backend/src/image_endpoint.js +0 -196
  304. package/frontend/dist/backend/src/meta.d.ts +0 -112
  305. package/frontend/dist/backend/src/meta.js +0 -152
  306. package/frontend/dist/backend/src/payments/paddle.d.ts +0 -329
  307. package/frontend/dist/backend/src/payments/paddle.js +0 -2276
  308. package/frontend/dist/backend/src/payments/stripe/checkout.d.ts +0 -113
  309. package/frontend/dist/backend/src/payments/stripe/checkout.js +0 -356
  310. package/frontend/dist/backend/src/payments/stripe/customers.d.ts +0 -17
  311. package/frontend/dist/backend/src/payments/stripe/customers.js +0 -193
  312. package/frontend/dist/backend/src/payments/stripe/error.d.ts +0 -74
  313. package/frontend/dist/backend/src/payments/stripe/error.js +0 -51
  314. package/frontend/dist/backend/src/payments/stripe/events.d.ts +0 -155
  315. package/frontend/dist/backend/src/payments/stripe/events.js +0 -5
  316. package/frontend/dist/backend/src/payments/stripe/meters.d.ts +0 -105
  317. package/frontend/dist/backend/src/payments/stripe/meters.js +0 -318
  318. package/frontend/dist/backend/src/payments/stripe/payment_methods.d.ts +0 -58
  319. package/frontend/dist/backend/src/payments/stripe/payment_methods.js +0 -135
  320. package/frontend/dist/backend/src/payments/stripe/products.d.ts +0 -519
  321. package/frontend/dist/backend/src/payments/stripe/products.js +0 -896
  322. package/frontend/dist/backend/src/payments/stripe/stripe.d.ts +0 -215
  323. package/frontend/dist/backend/src/payments/stripe/stripe.js +0 -464
  324. package/frontend/dist/backend/src/payments/stripe/subscriptions.d.ts +0 -172
  325. package/frontend/dist/backend/src/payments/stripe/subscriptions.js +0 -754
  326. package/frontend/dist/backend/src/payments/stripe/utils.d.ts +0 -63
  327. package/frontend/dist/backend/src/payments/stripe/utils.js +0 -131
  328. package/frontend/dist/backend/src/payments/stripe/webhooks.d.ts +0 -105
  329. package/frontend/dist/backend/src/payments/stripe/webhooks.js +0 -752
  330. package/frontend/dist/backend/src/plugins/mail/mail.d.ts +0 -255
  331. package/frontend/dist/backend/src/plugins/mail/mail.js +0 -396
  332. package/frontend/dist/backend/src/plugins/mail/ui.d.ts +0 -297
  333. package/frontend/dist/backend/src/plugins/mail/ui.js +0 -1400
  334. package/frontend/dist/backend/src/rate_limit.d.ts +0 -148
  335. package/frontend/dist/backend/src/rate_limit.js +0 -667
  336. package/frontend/dist/backend/src/route.d.ts +0 -39
  337. package/frontend/dist/backend/src/route.js +0 -222
  338. package/frontend/dist/backend/src/server.d.ts +0 -502
  339. package/frontend/dist/backend/src/server.js +0 -2034
  340. package/frontend/dist/backend/src/splash_screen.d.ts +0 -93
  341. package/frontend/dist/backend/src/splash_screen.js +0 -156
  342. package/frontend/dist/backend/src/status.d.ts +0 -89
  343. package/frontend/dist/backend/src/status.js +0 -213
  344. package/frontend/dist/backend/src/stream.d.ts +0 -494
  345. package/frontend/dist/backend/src/stream.js +0 -1611
  346. package/frontend/dist/backend/src/users.d.ts +0 -926
  347. package/frontend/dist/backend/src/users.js +0 -2423
  348. package/frontend/dist/backend/src/utils.d.ts +0 -22
  349. package/frontend/dist/backend/src/utils.js +0 -463
  350. package/frontend/dist/backend/src/view.d.ts +0 -115
  351. package/frontend/dist/backend/src/view.js +0 -584
  352. package/frontend/dist/frontend/src/elements/base.d.ts +0 -3743
  353. package/frontend/dist/frontend/src/elements/base.js +0 -12151
  354. package/frontend/dist/frontend/src/elements/module.d.ts +0 -95
  355. package/frontend/dist/frontend/src/elements/module.js +0 -216
  356. package/frontend/dist/frontend/src/elements/register_element.d.ts +0 -3
  357. package/frontend/dist/frontend/src/elements/register_element.js +0 -22
  358. package/frontend/dist/frontend/src/elements/resize_query_manager.d.ts +0 -0
  359. package/frontend/dist/frontend/src/elements/resize_query_manager.js +0 -150
  360. package/frontend/dist/frontend/src/elements/types.d.ts +0 -52
  361. package/frontend/dist/frontend/src/elements/types.js +0 -5
  362. package/frontend/dist/frontend/src/index.d.ts +0 -21
  363. package/frontend/dist/frontend/src/index.js +0 -29
  364. package/frontend/dist/frontend/src/modules/attachment.d.ts +0 -126
  365. package/frontend/dist/frontend/src/modules/attachment.js +0 -306
  366. package/frontend/dist/frontend/src/modules/auth.d.ts +0 -44
  367. package/frontend/dist/frontend/src/modules/auth.js +0 -80
  368. package/frontend/dist/frontend/src/modules/color.d.ts +0 -160
  369. package/frontend/dist/frontend/src/modules/color.js +0 -316
  370. package/frontend/dist/frontend/src/modules/compression.d.ts +0 -39
  371. package/frontend/dist/frontend/src/modules/compression.js +0 -102
  372. package/frontend/dist/frontend/src/modules/cookies.d.ts +0 -44
  373. package/frontend/dist/frontend/src/modules/cookies.js +0 -143
  374. package/frontend/dist/frontend/src/modules/events.d.ts +0 -31
  375. package/frontend/dist/frontend/src/modules/events.js +0 -79
  376. package/frontend/dist/frontend/src/modules/google.d.ts +0 -23
  377. package/frontend/dist/frontend/src/modules/google.js +0 -52
  378. package/frontend/dist/frontend/src/modules/meta.d.ts +0 -14
  379. package/frontend/dist/frontend/src/modules/meta.js +0 -48
  380. package/frontend/dist/frontend/src/modules/paddle.d.ts +0 -1207
  381. package/frontend/dist/frontend/src/modules/paddle.js +0 -2594
  382. package/frontend/dist/frontend/src/modules/request.d.ts +0 -70
  383. package/frontend/dist/frontend/src/modules/request.js +0 -117
  384. package/frontend/dist/frontend/src/modules/settings.d.ts +0 -3
  385. package/frontend/dist/frontend/src/modules/settings.js +0 -5
  386. package/frontend/dist/frontend/src/modules/statics.d.ts +0 -21
  387. package/frontend/dist/frontend/src/modules/statics.js +0 -43
  388. package/frontend/dist/frontend/src/modules/stripe/cart.d.ts +0 -112
  389. package/frontend/dist/frontend/src/modules/stripe/cart.js +0 -321
  390. package/frontend/dist/frontend/src/modules/stripe/checkout.d.ts +0 -7
  391. package/frontend/dist/frontend/src/modules/stripe/checkout.js +0 -37
  392. package/frontend/dist/frontend/src/modules/stripe/index.m.d.ts +0 -6
  393. package/frontend/dist/frontend/src/modules/stripe/index.m.js +0 -6
  394. package/frontend/dist/frontend/src/modules/stripe/payments.d.ts +0 -58
  395. package/frontend/dist/frontend/src/modules/stripe/payments.js +0 -92
  396. package/frontend/dist/frontend/src/modules/support.d.ts +0 -30
  397. package/frontend/dist/frontend/src/modules/support.js +0 -53
  398. package/frontend/dist/frontend/src/modules/theme.d.ts +0 -133
  399. package/frontend/dist/frontend/src/modules/theme.js +0 -406
  400. package/frontend/dist/frontend/src/modules/themes.d.ts +0 -12
  401. package/frontend/dist/frontend/src/modules/themes.js +0 -22
  402. package/frontend/dist/frontend/src/modules/user.d.ts +0 -164
  403. package/frontend/dist/frontend/src/modules/user.js +0 -270
  404. package/frontend/dist/frontend/src/modules/utils.d.ts +0 -176
  405. package/frontend/dist/frontend/src/modules/utils.js +0 -569
  406. package/frontend/dist/frontend/src/types/gradient.d.ts +0 -29
  407. package/frontend/dist/frontend/src/types/gradient.js +0 -79
  408. package/frontend/dist/frontend/src/ui/border_button.d.ts +0 -94
  409. package/frontend/dist/frontend/src/ui/border_button.js +0 -228
  410. package/frontend/dist/frontend/src/ui/button.d.ts +0 -241
  411. package/frontend/dist/frontend/src/ui/button.js +0 -682
  412. package/frontend/dist/frontend/src/ui/canvas.d.ts +0 -138
  413. package/frontend/dist/frontend/src/ui/canvas.js +0 -444
  414. package/frontend/dist/frontend/src/ui/checkbox.d.ts +0 -74
  415. package/frontend/dist/frontend/src/ui/checkbox.js +0 -321
  416. package/frontend/dist/frontend/src/ui/code.d.ts +0 -235
  417. package/frontend/dist/frontend/src/ui/code.js +0 -1007
  418. package/frontend/dist/frontend/src/ui/context_menu.d.ts +0 -36
  419. package/frontend/dist/frontend/src/ui/context_menu.js +0 -205
  420. package/frontend/dist/frontend/src/ui/css.d.ts +0 -16
  421. package/frontend/dist/frontend/src/ui/css.js +0 -48
  422. package/frontend/dist/frontend/src/ui/divider.d.ts +0 -15
  423. package/frontend/dist/frontend/src/ui/divider.js +0 -78
  424. package/frontend/dist/frontend/src/ui/dropdown.d.ts +0 -176
  425. package/frontend/dist/frontend/src/ui/dropdown.js +0 -481
  426. package/frontend/dist/frontend/src/ui/for_each.d.ts +0 -37
  427. package/frontend/dist/frontend/src/ui/for_each.js +0 -92
  428. package/frontend/dist/frontend/src/ui/form.d.ts +0 -34
  429. package/frontend/dist/frontend/src/ui/form.js +0 -233
  430. package/frontend/dist/frontend/src/ui/frame_modes.d.ts +0 -37
  431. package/frontend/dist/frontend/src/ui/frame_modes.js +0 -108
  432. package/frontend/dist/frontend/src/ui/google_map.d.ts +0 -24
  433. package/frontend/dist/frontend/src/ui/google_map.js +0 -106
  434. package/frontend/dist/frontend/src/ui/gradient.d.ts +0 -25
  435. package/frontend/dist/frontend/src/ui/gradient.js +0 -131
  436. package/frontend/dist/frontend/src/ui/image.d.ts +0 -111
  437. package/frontend/dist/frontend/src/ui/image.js +0 -576
  438. package/frontend/dist/frontend/src/ui/input.d.ts +0 -392
  439. package/frontend/dist/frontend/src/ui/input.js +0 -1201
  440. package/frontend/dist/frontend/src/ui/link.d.ts +0 -25
  441. package/frontend/dist/frontend/src/ui/link.js +0 -140
  442. package/frontend/dist/frontend/src/ui/list.d.ts +0 -37
  443. package/frontend/dist/frontend/src/ui/list.js +0 -170
  444. package/frontend/dist/frontend/src/ui/loader_button.d.ts +0 -80
  445. package/frontend/dist/frontend/src/ui/loader_button.js +0 -193
  446. package/frontend/dist/frontend/src/ui/loaders.d.ts +0 -57
  447. package/frontend/dist/frontend/src/ui/loaders.js +0 -157
  448. package/frontend/dist/frontend/src/ui/popup.d.ts +0 -94
  449. package/frontend/dist/frontend/src/ui/popup.js +0 -510
  450. package/frontend/dist/frontend/src/ui/pseudo.d.ts +0 -44
  451. package/frontend/dist/frontend/src/ui/pseudo.js +0 -154
  452. package/frontend/dist/frontend/src/ui/scroller.d.ts +0 -105
  453. package/frontend/dist/frontend/src/ui/scroller.js +0 -1253
  454. package/frontend/dist/frontend/src/ui/slider.d.ts +0 -45
  455. package/frontend/dist/frontend/src/ui/slider.js +0 -217
  456. package/frontend/dist/frontend/src/ui/spacer.d.ts +0 -15
  457. package/frontend/dist/frontend/src/ui/spacer.js +0 -78
  458. package/frontend/dist/frontend/src/ui/span.d.ts +0 -15
  459. package/frontend/dist/frontend/src/ui/span.js +0 -73
  460. package/frontend/dist/frontend/src/ui/stack.d.ts +0 -66
  461. package/frontend/dist/frontend/src/ui/stack.js +0 -335
  462. package/frontend/dist/frontend/src/ui/steps.d.ts +0 -131
  463. package/frontend/dist/frontend/src/ui/steps.js +0 -308
  464. package/frontend/dist/frontend/src/ui/style.d.ts +0 -17
  465. package/frontend/dist/frontend/src/ui/style.js +0 -73
  466. package/frontend/dist/frontend/src/ui/switch.d.ts +0 -69
  467. package/frontend/dist/frontend/src/ui/switch.js +0 -357
  468. package/frontend/dist/frontend/src/ui/table.d.ts +0 -100
  469. package/frontend/dist/frontend/src/ui/table.js +0 -405
  470. package/frontend/dist/frontend/src/ui/tabs.d.ts +0 -111
  471. package/frontend/dist/frontend/src/ui/tabs.js +0 -424
  472. package/frontend/dist/frontend/src/ui/text.d.ts +0 -15
  473. package/frontend/dist/frontend/src/ui/text.js +0 -83
  474. package/frontend/dist/frontend/src/ui/title.d.ts +0 -91
  475. package/frontend/dist/frontend/src/ui/title.js +0 -272
  476. package/frontend/dist/frontend/src/ui/ui.d.ts +0 -35
  477. package/frontend/dist/frontend/src/ui/ui.js +0 -38
  478. package/frontend/dist/frontend/src/ui/view.d.ts +0 -15
  479. package/frontend/dist/frontend/src/ui/view.js +0 -88
  480. package/frontend/dist/frontend/src/volt.d.ts +0 -20
  481. package/frontend/dist/frontend/src/volt.js +0 -27
  482. package/frontend/examples/theme/theme.ts +0 -58
  483. package/frontend/tools/bundle_d_ts.js +0 -71
  484. package/frontend/tools/convert_to_jsdoc_input.txt +0 -9452
  485. package/frontend/tools/convert_to_jsdoc_output.txt +0 -7626
  486. package/frontend/tools/convert_to_jsdoc_tmp.js +0 -345
  487. package/frontend/tools/scan_mixed_imports.js +0 -69
  488. /package/frontend/{dist/frontend/src/css → css}/adyen.css +0 -0
  489. /package/frontend/{dist/frontend/src/css → css}/volt.css +0 -0
@@ -1,1201 +0,0 @@
1
- /**
2
- * @author Daan van den Bergh
3
- * @copyright © 2022 - 2025 Daan van den Bergh. All rights reserved
4
- */
5
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
6
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
7
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
8
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
9
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
10
- var _, done = false;
11
- for (var i = decorators.length - 1; i >= 0; i--) {
12
- var context = {};
13
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
14
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
15
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
16
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
17
- if (kind === "accessor") {
18
- if (result === void 0) continue;
19
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
20
- if (_ = accept(result.get)) descriptor.get = _;
21
- if (_ = accept(result.set)) descriptor.set = _;
22
- if (_ = accept(result.init)) initializers.unshift(_);
23
- }
24
- else if (_ = accept(result)) {
25
- if (kind === "field") initializers.unshift(_);
26
- else descriptor[key] = _;
27
- }
28
- }
29
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
30
- done = true;
31
- };
32
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
33
- var useValue = arguments.length > 2;
34
- for (var i = 0; i < initializers.length; i++) {
35
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
36
- }
37
- return useValue ? value : void 0;
38
- };
39
- // External imports.
40
- import * as vlib from "@vandenberghinc/vlib/frontend";
41
- // Imports.
42
- import { Elements, VElementTagMap } from "../elements/module.js";
43
- import { Utils } from "../modules/utils.js";
44
- import { HStack, VStack, VStackElement } from "./stack.js";
45
- import { Text } from "./text.js";
46
- import { ImageMask } from "./image.js";
47
- import { GradientBorder } from "./gradient.js";
48
- import { Scroller } from "./scroller.js";
49
- import { Divider } from "./divider.js";
50
- // Input.
51
- let InputElement = (() => {
52
- let _classDecorators = [Elements.create({
53
- name: "InputElement",
54
- default_style: {
55
- "margin": "0px 0px 0px 0px",
56
- "padding": "2.5px 5px 2.5px 5px",
57
- "font": "inherit",
58
- "color": "inherit",
59
- "background": "none",
60
- "outline": "none",
61
- "border": "none",
62
- "border-radius": "10px",
63
- "text-align": "start",
64
- "white-space": "nowrap",
65
- },
66
- default_attributes: {
67
- "spellcheck": "false",
68
- "autocorrect": "off",
69
- "autocapitalize": "none",
70
- },
71
- })];
72
- let _classDescriptor;
73
- let _classExtraInitializers = [];
74
- let _classThis;
75
- let _classSuper = VElementTagMap.input;
76
- var InputElement = class extends _classSuper {
77
- static { _classThis = this; }
78
- static {
79
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
80
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
81
- InputElement = _classThis = _classDescriptor.value;
82
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
83
- __runInitializers(_classThis, _classExtraInitializers);
84
- }
85
- // Attributes.
86
- _e;
87
- // Constructor.
88
- constructor(placeholder, type = "text", value) {
89
- // Initialize base class.
90
- super({
91
- derived: InputElement,
92
- });
93
- // Safari does not render images correctly for custom elements.
94
- if (Utils.is_safari) {
95
- this.attachShadow({ mode: 'open' });
96
- this._e = document.createElement("input");
97
- this._e.style.font = "inherit";
98
- this._e.style.color = "inherit";
99
- this._e.style.background = "none";
100
- this._e.style.border = "none";
101
- this._e.style.outline = "none";
102
- this._e.style.whiteSpace = "nowrap";
103
- this._e.style.width = "100%";
104
- this._e.style.padding = InputElement.default_style.padding;
105
- this.shadowRoot.appendChild(this._e);
106
- this.padding("0");
107
- }
108
- // Set src.
109
- this.placeholder(placeholder ?? "");
110
- this.type(type ?? "text");
111
- this.value(value ?? "");
112
- }
113
- value(val) {
114
- if (this._e === undefined) {
115
- return super.value(val);
116
- }
117
- if (val == null) {
118
- return this._e.value ?? "";
119
- }
120
- this._e.value = val.toString();
121
- // if (val == null) { return this._e.getAttribute("value") ?? ""; }
122
- // this._e.setAttribute("value", val.toString());
123
- return this;
124
- }
125
- required(val) { if (this._e === undefined) {
126
- return super.required(val);
127
- } if (val == null) {
128
- return this._e.getAttribute("required") === "true";
129
- } if (!val) {
130
- this._e.removeAttribute("required");
131
- }
132
- else {
133
- this._e.setAttribute("required", val);
134
- } return this; }
135
- type(val) { if (this._e === undefined) {
136
- return super.type(val);
137
- } if (val == null) {
138
- return this._e.getAttribute("type") ?? "";
139
- } this._e.setAttribute("type", val); return this; }
140
- placeholder(val) { if (this._e === undefined) {
141
- return super.placeholder(val);
142
- } if (val == null) {
143
- return this._e.getAttribute("placeholder") ?? "";
144
- } this._e.setAttribute("placeholder", val); return this; }
145
- resize(val) { if (this._e === undefined) {
146
- return super.resize(val);
147
- } if (val == null) {
148
- return this._e.getAttribute("resize") ?? "";
149
- } this._e.setAttribute("resize", val); return this; }
150
- padding(...values) {
151
- if (this._e === undefined) {
152
- return super.padding(...values);
153
- }
154
- if (values.length === 0) {
155
- return this._e.style.padding;
156
- }
157
- else if (values.length === 1) {
158
- this._e.style.padding = this.pad_numeric(values[0]);
159
- }
160
- else if (values.length === 2) {
161
- if (values[0] != null) {
162
- this._e.style.paddingTop = this.pad_numeric(values[0]);
163
- }
164
- if (values[1] != null) {
165
- this._e.style.paddingRight = this.pad_numeric(values[1]);
166
- }
167
- if (values[0] != null) {
168
- this._e.style.paddingBottom = this.pad_numeric(values[0]);
169
- }
170
- if (values[1] != null) {
171
- this._e.style.paddingLeft = this.pad_numeric(values[1]);
172
- }
173
- }
174
- else if (values.length === 4) {
175
- this._e.style.paddingTop = this.pad_numeric(values[0]);
176
- if (values[1] != null) {
177
- this._e.style.paddingRight = this.pad_numeric(values[1]);
178
- }
179
- if (values[2] != null) {
180
- this._e.style.paddingBottom = this.pad_numeric(values[2]);
181
- }
182
- if (values[3] != null) {
183
- this._e.style.paddingLeft = this.pad_numeric(values[3]);
184
- }
185
- }
186
- else {
187
- console.error("Invalid number of arguments for function \"padding()\".");
188
- }
189
- return this;
190
- }
191
- };
192
- return InputElement = _classThis;
193
- })();
194
- export { InputElement };
195
- export const Input = Elements.wrapper(InputElement);
196
- export const NullInput = Elements.create_null(InputElement);
197
- // InputBox.
198
- let InputBoxElement = (() => {
199
- let _classDecorators = [Elements.create({
200
- name: "InputBoxElement",
201
- default_style: {
202
- "margin": "0px 0px 0px 0px",
203
- "padding": "2.5px 5px 2.5px 5px",
204
- "height": "20px",
205
- "font": "inherit",
206
- "color": "inherit",
207
- "background": "none",
208
- "outline": "none",
209
- "border": "none",
210
- "border-radius": "10px",
211
- "text-align": "start",
212
- "white-space": "wrap",
213
- "resize": "none",
214
- },
215
- default_attributes: {
216
- "spellcheck": "false",
217
- "autocorrect": "off",
218
- "autocapitalize": "none",
219
- },
220
- })];
221
- let _classDescriptor;
222
- let _classExtraInitializers = [];
223
- let _classThis;
224
- let _classSuper = VElementTagMap.textarea;
225
- var InputBoxElement = class extends _classSuper {
226
- static { _classThis = this; }
227
- static {
228
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
229
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
230
- InputBoxElement = _classThis = _classDescriptor.value;
231
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
232
- __runInitializers(_classThis, _classExtraInitializers);
233
- }
234
- // Attributes.
235
- _e;
236
- // Constructor.
237
- constructor(placeholder) {
238
- // Initialize base class.
239
- super({
240
- derived: InputBoxElement,
241
- });
242
- // Safari does not render images correctly for custom elements.
243
- if (Utils.is_safari) {
244
- this.attachShadow({ mode: 'open' });
245
- this._e = document.createElement("textarea");
246
- this._e.style.font = "inherit";
247
- this._e.style.color = "inherit";
248
- this._e.style.background = "none";
249
- this._e.style.border = "none";
250
- this._e.style.outline = "none";
251
- this._e.style.width = "100%";
252
- this._e.style.height = "100%";
253
- this._e.style.margin = "0";
254
- this._e.style.padding = InputBoxElement.default_style.padding;
255
- this.shadowRoot.appendChild(this._e);
256
- this.padding("0");
257
- }
258
- // Set src.
259
- this.placeholder(placeholder ?? "");
260
- }
261
- value(val) { if (this._e === undefined) {
262
- return super.value(val);
263
- } if (val == null) {
264
- return this._e.getAttribute("value") ?? "";
265
- } this._e.setAttribute("value", val.toString()); return this; }
266
- required(val) { if (this._e === undefined) {
267
- return super.required(val);
268
- } if (val == null) {
269
- return this._e.getAttribute("required") === "true";
270
- } if (!val) {
271
- this._e.removeAttribute("required");
272
- }
273
- else {
274
- this._e.setAttribute("required", val);
275
- } return this; }
276
- type(val) { if (this._e === undefined) {
277
- return super.type(val);
278
- } if (val == null) {
279
- return this._e.getAttribute("type") ?? "";
280
- } this._e.setAttribute("type", val); return this; }
281
- placeholder(val) { if (this._e === undefined) {
282
- return super.placeholder(val);
283
- } if (val == null) {
284
- return this._e.getAttribute("placeholder") ?? "";
285
- } this._e.setAttribute("placeholder", val); return this; }
286
- resize(val) { if (this._e === undefined) {
287
- return super.resize(val);
288
- } if (val == null) {
289
- return this._e.getAttribute("resize") ?? "";
290
- } this._e.setAttribute("resize", val); return this; }
291
- padding(...values) {
292
- if (this._e === undefined) {
293
- return super.padding(...values);
294
- }
295
- if (values.length === 0) {
296
- return this._e.style.padding;
297
- }
298
- else if (values.length === 1) {
299
- this._e.style.padding = this.pad_numeric(values[0]);
300
- }
301
- else if (values.length === 2) {
302
- if (values[0] != null) {
303
- this._e.style.paddingTop = this.pad_numeric(values[0]);
304
- }
305
- if (values[1] != null) {
306
- this._e.style.paddingRight = this.pad_numeric(values[1]);
307
- }
308
- if (values[0] != null) {
309
- this._e.style.paddingBottom = this.pad_numeric(values[0]);
310
- }
311
- if (values[1] != null) {
312
- this._e.style.paddingLeft = this.pad_numeric(values[1]);
313
- }
314
- }
315
- else if (values.length === 4) {
316
- this._e.style.paddingTop = this.pad_numeric(values[0]);
317
- if (values[1] != null) {
318
- this._e.style.paddingRight = this.pad_numeric(values[1]);
319
- }
320
- if (values[2] != null) {
321
- this._e.style.paddingBottom = this.pad_numeric(values[2]);
322
- }
323
- if (values[3] != null) {
324
- this._e.style.paddingLeft = this.pad_numeric(values[3]);
325
- }
326
- }
327
- else {
328
- console.error("Invalid number of arguments for function \"padding()\".");
329
- }
330
- return this;
331
- }
332
- };
333
- return InputBoxElement = _classThis;
334
- })();
335
- export { InputBoxElement };
336
- export const InputBox = Elements.wrapper(InputBoxElement);
337
- export const NullInputBox = Elements.create_null(InputBoxElement);
338
- // Extended input.
339
- let ExtendedInputElement = (() => {
340
- let _classDecorators = [Elements.create({
341
- name: "ExtendedInputElement",
342
- default_style: {
343
- ...VStackElement.default_style,
344
- "color": "inherit",
345
- "font-size": "16px",
346
- },
347
- })];
348
- let _classDescriptor;
349
- let _classExtraInitializers = [];
350
- let _classThis;
351
- let _classSuper = VStackElement;
352
- var ExtendedInputElement = class extends _classSuper {
353
- static { _classThis = this; }
354
- static {
355
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
356
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
357
- ExtendedInputElement = _classThis = _classDescriptor.value;
358
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
359
- __runInitializers(_classThis, _classExtraInitializers);
360
- }
361
- copy_opts;
362
- input_opts;
363
- /** The label node, always defined even when `opts.label` is undefined, so the user can still style it. */
364
- // @ts-expect-error
365
- label;
366
- /** The left image element created by the `opts.image` field. */
367
- image;
368
- /** The clickable copy node created by the `opts.copy` field. */
369
- copyable;
370
- /** The input element created by the `opts.input` field. */
371
- input;
372
- /** The (gradient) border element used for the input field. */
373
- input_border;
374
- /** The container element for the input field. */
375
- container;
376
- /** The error text element shown when the input is marked as missing. */
377
- error_text;
378
- /** Has error state. */
379
- has_error = false;
380
- /** Is focused state. */
381
- is_focused = false;
382
- /** Validation options. */
383
- validation_entry;
384
- // Constructor.
385
- constructor({ label, image, placeholder = "Input", id, readonly = false, required = false, type = "text", value, copy, input, validate, }) {
386
- // Initialize super.
387
- super();
388
- this._init({
389
- derived: ExtendedInputElement,
390
- });
391
- // Cast image.
392
- if (typeof image === "string") {
393
- image = { url: image };
394
- }
395
- // Cast label.
396
- if (typeof label === "string") {
397
- label = { text: label };
398
- }
399
- // Direct attributes.
400
- this.validation_entry = validate;
401
- // Set id.
402
- if (id != null) {
403
- this.id(id);
404
- }
405
- // Set input options..
406
- this.input_opts = {
407
- ...(input ?? {}),
408
- border: {
409
- color: input?.border?.color ?? "gray",
410
- hover: input?.border?.hover ?? "gray",
411
- focused: input?.border?.focused ?? "#8EB8EB",
412
- missing: input?.border?.missing ?? "#E8454E",
413
- width: input?.border?.width ?? "1px",
414
- radius: input?.border?.radius ?? "5px",
415
- type: input?.border?.type ?? "full",
416
- },
417
- };
418
- // Set copy options.
419
- this.copy_opts = copy;
420
- // Set default styling.
421
- this.styles(ExtendedInputElement.default_style);
422
- // Title element.
423
- this.label = Text(label?.text)
424
- .parent(this)
425
- .font_size(label?.font_size ?? "inherit")
426
- .margin(0, 0, label?.spacing ?? (input?.border?.type === "bottom" ? 12.5 : 7.5), 0)
427
- .color(label?.color ?? "inherit");
428
- if (!label) {
429
- // always keep label present so uses can still style it with single-line code when needed.
430
- this.label.hide();
431
- }
432
- else {
433
- if (label.wrap) {
434
- this.label
435
- .width("fit-content")
436
- .overflow_wrap("break-word") // or "anywhere" for more aggressive breaking
437
- .hyphens("auto")
438
- .display("inline-block") // so width constraints apply
439
- .max_width(label.max_width ?? "100%"); // ensure there’s something to wrap to
440
- }
441
- else {
442
- this.label.ellipsis_overflow(true)
443
- .width("fit-content")
444
- .max_width(label.max_width ?? "100%"); // ensure there’s something to wrap to
445
- }
446
- }
447
- // Input left image.
448
- this.image = !image ? undefined : ImageMask(image.url)
449
- .parent(this)
450
- .mask_color(image.color ?? "#000")
451
- .square(image.size ?? 20)
452
- .margin(0, 10, 0, 5)
453
- .alt(image?.alt ?? "Volt");
454
- // Copyable right image.
455
- this.copyable = !this.copy_opts ? undefined : ImageMask(this.copy_opts.url)
456
- .parent(this)
457
- .mask_color(this.copy_opts?.color ?? image?.color ?? "#000")
458
- .square(this.copy_opts.size ?? 20)
459
- .margin(0, 5, 0, 10)
460
- .alt(this.copy_opts?.alt ?? "Copy")
461
- .on_click(() => {
462
- if (this.copy_opts?.on_click) {
463
- this.copy_opts.on_click(this.input.value());
464
- }
465
- })
466
- .transition_mask("background 200ms ease-in-out")
467
- .on_mouse_over_out(e => e.mask_color(this.copy_opts?.hover ?? image?.color ?? "#000"), e => e.mask_color(this.copy_opts?.color ?? image?.color ?? "#000"));
468
- // Input element.
469
- if (type === "box" || type === "area") {
470
- this.input = InputBox(placeholder);
471
- }
472
- else {
473
- this.input = Input(placeholder, type);
474
- }
475
- this.input
476
- .parent(this)
477
- .color("inherit")
478
- .readonly(readonly)
479
- .font_size("inherit")
480
- .font_weight("normal")
481
- .margin(0)
482
- .width("100%")
483
- .stretch(true)
484
- // .padding(0, 5)
485
- .padding(0)
486
- .line_height("1.6em")
487
- .box_shadow("none")
488
- .border("none")
489
- .outline("none")
490
- .z_index(1)
491
- .border_radius(0) // is required.
492
- .on_focus(() => {
493
- if (!this.has_error) {
494
- this.is_focused = true;
495
- this._set_border_color(this.input_opts.border.focused, true);
496
- }
497
- })
498
- .on_blur(() => {
499
- if (!this.has_error) {
500
- this.is_focused = false;
501
- this._set_border_color(this.input_opts.border.color);
502
- }
503
- });
504
- // Set input height.
505
- if (input?.height != null) {
506
- console.log("Setting fixed height to", input.height);
507
- this.input.fixed_height(input.height);
508
- }
509
- // The input border to support gradients.
510
- this.input_border = GradientBorder()
511
- .z_index(0)
512
- .position(0, 0, 0, 0)
513
- .border_width(this.input_opts.border.width)
514
- .border_radius(this.input_opts.border.radius)
515
- .border_color(this.input_opts.border.color)
516
- .box_shadow(`0 0 0 0px transparent`)
517
- .transition("background 200ms ease-in-out")
518
- .pointer_events("none")
519
- .parent(this);
520
- if (this.input_opts.border.type === "bottom") {
521
- this.input_border.hide();
522
- }
523
- // The hstack container.
524
- this.container = HStack(!this.image ? undefined : VStack(this.image) // wrap in container for height.
525
- .width("fit-content")
526
- .height("1.6em")
527
- .center_vertical(), this.input, !this.copyable ? undefined : VStack(this.copyable) // wrap in container for height.
528
- .width("fit-content")
529
- .height("1.6em")
530
- .center_vertical(), this.input_border)
531
- .parent(this)
532
- .position("relative")
533
- .background(input?.background ?? "transparent")
534
- .padding((input?.padding ?? "12px 6px"))
535
- .border_radius(this.input_opts.border.radius) // for outline when focused or missing etc.
536
- .transition("box-shadow 0.2s ease-in-out")
537
- .outline("0px solid transparent")
538
- .box_shadow(`0 0 0 0px transparent`)
539
- .width("100%")
540
- .on_mouse_over_out((e) => {
541
- if (!this.has_error && !this.is_focused) {
542
- this._set_border_color(this.input_opts.border.hover);
543
- }
544
- }, (e) => {
545
- if (!this.has_error && !this.is_focused) {
546
- this._set_border_color(this.input_opts.border.color);
547
- }
548
- });
549
- if (this.input_opts.border.type === "bottom") {
550
- this._set_border_color(this.input_opts.border.color);
551
- this.container.padding_left(0).padding_right(0);
552
- }
553
- // The error message.
554
- this.error_text = Text("Incomplete field")
555
- .color(this.input_opts.border.missing)
556
- .font_size("0.8em")
557
- .margin(7.5, 0, 0, 2.5)
558
- .padding(0)
559
- .leading()
560
- .hide();
561
- // Set id.
562
- if (id != null) {
563
- this.id(id);
564
- }
565
- // Set required.
566
- this.required(required);
567
- // Append.
568
- this.append(this.label, this.container, this.error_text);
569
- // Set value.
570
- if (value) {
571
- this.value(value);
572
- }
573
- }
574
- /** Helper to set the border color. */
575
- _set_border_color(color, set_outline = false) {
576
- if (this.input_opts.border.type === "full") {
577
- this.input_border.border_color(color);
578
- if (set_outline) {
579
- this.container.box_shadow(`0 0 0 3px ${color}80`);
580
- }
581
- else {
582
- this.container.box_shadow(`0 0 0 0px transparent`);
583
- }
584
- }
585
- else {
586
- this.container.border_bottom(this.input_opts.border.width, color);
587
- }
588
- }
589
- // Set the focus color.
590
- focus_color(val) {
591
- if (val == null) {
592
- return (this.input_opts.border.focused ?? "");
593
- }
594
- this.input_opts.border.focused = val;
595
- return this;
596
- }
597
- // Set default since it inherits an element.
598
- set_default() {
599
- return super.set_default(ExtendedInputElement);
600
- }
601
- /**
602
- * Set the error state and message.
603
- * Providing a truthy value will enable the error state and return the current instance for chaining.
604
- * Providing a falsy value will disable the error state and return the current instance for chaining.
605
- * Providing no value will return the current error message or `undefined` when no error is set.
606
- */
607
- error(err) {
608
- if (err == null) {
609
- return (this.has_error ? this.error_text.text() : undefined);
610
- }
611
- else if (err) {
612
- this.has_error = true;
613
- this._set_border_color(this.input_opts.border.missing, true);
614
- // this.image.mask_color(this._border_opts.missing)
615
- this.error_text.show();
616
- this.error_text.text(err);
617
- }
618
- else {
619
- this.has_error = false;
620
- this._set_border_color(this.input_opts.border.color);
621
- this.error_text.hide();
622
- }
623
- return this;
624
- }
625
- /** Remove the error state and mark as valid. */
626
- valid() {
627
- return this.error(false);
628
- }
629
- /** Submit the item, throws an error when the item is not defined. */
630
- submit() {
631
- // Get value.
632
- const value = this.value();
633
- if (value == null || value === "") {
634
- this.error("Incomplete field");
635
- throw Error("Fill in all the required fields.");
636
- }
637
- // Validate.
638
- if (this.validation_entry) {
639
- const res = vlib.Schema.validate_entry(value, this.validation_entry, { throw: false, field_type: "field" });
640
- if (res.error) {
641
- // use raw error for showing.
642
- this.error(res.raw_error ?? "Invalid value");
643
- // use full error for throwing.
644
- throw Error(res.error);
645
- }
646
- }
647
- // Success.
648
- this.valid();
649
- return value;
650
- }
651
- readonly(val) { if (val == null) {
652
- return this.input.readonly();
653
- } this.input.readonly(val); return this; }
654
- text(val) { if (val == null) {
655
- return this.label?.text() ?? "";
656
- } this.label?.text(val); return this; }
657
- value(val) {
658
- if (val == null) {
659
- return this.input.value();
660
- }
661
- this.input.value(val);
662
- return this;
663
- }
664
- required(val) { if (val == null) {
665
- return this.input.required();
666
- } this.input.required(val); return this; }
667
- on_enter(val) {
668
- if (val == null) {
669
- return this.input.on_enter();
670
- }
671
- this.input.on_enter((x, y) => val(this, y));
672
- return this;
673
- }
674
- on_input(val) {
675
- if (val == null) {
676
- return this.input.on_input();
677
- }
678
- this.input.on_input((x, y) => val(this, y));
679
- return this;
680
- }
681
- background(val) { if (val == null) {
682
- return this.container.background();
683
- } this.container.background(val); return this; }
684
- padding(...values) {
685
- if (values.length === 0 || (values.length === 1 && values[0] == null)) {
686
- return this.container.padding();
687
- }
688
- this.container.padding(...values);
689
- return this;
690
- }
691
- };
692
- return ExtendedInputElement = _classThis;
693
- })();
694
- export { ExtendedInputElement };
695
- export const ExtendedInput = Elements.wrapper(ExtendedInputElement);
696
- export const NullExtendedInput = Elements.create_null(ExtendedInputElement);
697
- // Extended input.
698
- let ExtendedSelectElement = (() => {
699
- let _classDecorators = [Elements.create({
700
- name: "ExtendedSelectElement",
701
- default_style: {
702
- ...VStackElement.default_style,
703
- "color": "inherit",
704
- "font-size": "16px",
705
- "background": "#FFFFFF",
706
- }
707
- })];
708
- let _classDescriptor;
709
- let _classExtraInitializers = [];
710
- let _classThis;
711
- let _classSuper = VStackElement;
712
- var ExtendedSelectElement = class extends _classSuper {
713
- static { _classThis = this; }
714
- static {
715
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
716
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
717
- ExtendedSelectElement = _classThis = _classDescriptor.value;
718
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
719
- __runInitializers(_classThis, _classExtraInitializers);
720
- }
721
- /** The selectable items. */
722
- items;
723
- /** The label node. */
724
- // @ts-expect-error
725
- label;
726
- /** The image node. */
727
- image;
728
- /** The input node (readonly) with the selected value. */
729
- input;
730
- /** The container node. */
731
- container;
732
- /** The error text node. */
733
- error_text;
734
- /** The dropdown scroller element. */
735
- dropdown;
736
- /** Has error state. */
737
- has_error = false;
738
- /** Is focused state. */
739
- is_focused = false;
740
- // Internal attributes.
741
- input_opts;
742
- image_opts;
743
- _dropdown_item_hover;
744
- _on_change_callback;
745
- _on_dropdown_close;
746
- _dropdown_height;
747
- _value;
748
- // Constructor.
749
- constructor({ label = undefined, image = undefined, placeholder = "Placeholder", id = undefined, required = false, items = [{ id: "option", text: "Option", image: undefined }], // may also be an array with strings which will be used as the item's id and text.
750
- dropdown, input, }) {
751
- // Initialize super.
752
- super();
753
- this._init({
754
- derived: ExtendedSelectElement,
755
- });
756
- // Cast image.
757
- if (typeof image === "string") {
758
- image = { url: image };
759
- }
760
- this.image_opts = image;
761
- // Set input options..
762
- this.input_opts = {
763
- ...(input ?? {}),
764
- border: {
765
- color: input?.border?.color ?? "gray",
766
- hover: input?.border?.hover ?? "gray",
767
- focused: input?.border?.focused ?? "#8EB8EB",
768
- missing: input?.border?.missing ?? "#E8454E",
769
- width: input?.border?.width ?? "1px",
770
- radius: input?.border?.radius ?? "5px",
771
- type: input?.border?.type ?? "full",
772
- },
773
- };
774
- // Arguments.
775
- if (Array.isArray(items)) {
776
- this.items = [];
777
- for (const item of items) {
778
- if (typeof item === "string") {
779
- this.items.append({
780
- id: item,
781
- text: item,
782
- });
783
- }
784
- else {
785
- if (item.text == null) {
786
- item.text = item.id;
787
- }
788
- this.items.append(item);
789
- }
790
- }
791
- }
792
- else if (typeof items === "object" && items != null) {
793
- this.items = [];
794
- for (const key of Object.keys(items)) {
795
- if (typeof items[key] === "string") {
796
- this.items.append({
797
- id: key,
798
- text: items[key],
799
- });
800
- }
801
- else {
802
- this.items.append({
803
- ...items[key],
804
- id: key,
805
- });
806
- }
807
- }
808
- }
809
- else {
810
- throw Error(`Parameter "items" should be a defined value of type "array" or "object".`);
811
- }
812
- // Attributes.
813
- this._dropdown_item_hover = dropdown?.hover ?? "#00000007";
814
- // Set default styling.
815
- this.styles(ExtendedSelectElement.default_style);
816
- // Title element.
817
- this.label = Text(label)
818
- .parent(this)
819
- .font_size("inherit")
820
- .margin(0, 0, 7.5, 0)
821
- .color("inherit")
822
- .width("fit-content")
823
- .ellipsis_overflow(true);
824
- if (label == null) {
825
- this.label.hide();
826
- }
827
- // Title element.
828
- this.image = !image ? undefined : ImageMask(image.url)
829
- .parent(this)
830
- .mask_color(image?.color ?? "#000")
831
- .square(image?.size ?? 20)
832
- .margin(0, 10, 0, 5)
833
- .alt(image?.alt ?? "Volt");
834
- // Input element.
835
- this.input = Input(placeholder)
836
- .parent(this)
837
- .color("inherit")
838
- .readonly(true)
839
- .font_size("inherit")
840
- .margin(0)
841
- .width("100%")
842
- .stretch(true)
843
- .outline("none")
844
- .padding(0, 5)
845
- .line_height("1.6em")
846
- .box_shadow("none")
847
- .cursor("pointer")
848
- .border_radius(0); // is required
849
- // The hstack container.
850
- this.container = HStack(!this.image ? undefined : VStack(this.image)
851
- .width("fit-content")
852
- .height("1.6em")
853
- .center_vertical(), this.input)
854
- .parent(this)
855
- .background(input?.background ?? "transparent")
856
- .padding((input?.padding ?? "12px 6px"))
857
- .border_radius(this.input_opts.border.radius)
858
- .border_width(this.input_opts.border.width)
859
- .border_style("solid")
860
- .transition("border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out")
861
- .box_shadow(`0 0 0 0px transparent`)
862
- .width("100%")
863
- .on_mouse_over_out((e) => {
864
- if (!this.has_error && !this.is_focused) {
865
- this._set_border_color(this.input_opts.border.hover);
866
- }
867
- }, (e) => {
868
- if (!this.has_error && !this.is_focused) {
869
- this._set_border_color(this.input_opts.border.color);
870
- }
871
- })
872
- .on_click(() => {
873
- if (this.dropdown.is_hidden()) {
874
- this.expand();
875
- }
876
- });
877
- this._set_border_color(this.input_opts.border.color);
878
- if (this.input_opts.border.type === "bottom") {
879
- this.container.padding_left(0).padding_right(0);
880
- }
881
- // The error message.
882
- this.error_text = Text("Incomplete field")
883
- .color(this.input_opts.border.missing)
884
- .font_size("0.8em")
885
- .margin(7.5, 0, 0, 2.5)
886
- .padding(0)
887
- .leading()
888
- .hide();
889
- // The dropdown menu.
890
- this.dropdown = Scroller()
891
- .parent(this)
892
- .position(0, null, null, null)
893
- .background(ExtendedSelectElement.default_style["background"])
894
- .border_radius(this.input_opts.border.radius)
895
- .border_width(this.input_opts.border.width)
896
- .border_style("solid")
897
- .border_color(this.input_opts.border.color)
898
- .box_shadow("0px 0px 5px #00000050")
899
- .frame("100%", "100%")
900
- .z_index(10)
901
- .hide();
902
- // Append.
903
- this.append(this.label, this.container, this.error_text, this.dropdown);
904
- // Styling.
905
- this.position("relative");
906
- this.overflow("visible");
907
- super.background("none");
908
- // Set id.
909
- if (id != null) {
910
- this.id(id);
911
- }
912
- // Set required.
913
- if (required) {
914
- this.required(required);
915
- }
916
- // On dropdown close event by mouse down.
917
- this._on_dropdown_close = (event) => {
918
- let parent = event.target.parentElement;
919
- let stop = true;
920
- for (let i = 0; i < 4; i++) {
921
- if (parent == null) {
922
- break;
923
- }
924
- else if (parent === this.dropdown) {
925
- stop = false;
926
- break;
927
- }
928
- parent = parent.parentElement;
929
- }
930
- if (stop) {
931
- this.dropdown.hide();
932
- window.removeEventListener("mousedown", this._on_dropdown_close);
933
- // Unfocus.
934
- if (!this.has_error) {
935
- this.is_focused = false;
936
- this._set_border_color(this.input_opts.border.color);
937
- }
938
- }
939
- };
940
- }
941
- /** Helper to set the border color. */
942
- _set_border_color(color, set_outline = false) {
943
- if (this.input_opts.border.type === "full") {
944
- this.container.border_color(color);
945
- if (set_outline) {
946
- this.container.box_shadow(`0 0 0 3px ${color}80`);
947
- }
948
- else {
949
- this.container.box_shadow(`0 0 0 0px transparent`);
950
- }
951
- }
952
- else {
953
- this.container.border_bottom(this.input_opts.border.width, color);
954
- }
955
- }
956
- focus_color(val) {
957
- if (val == null) {
958
- return this.input_opts.border.focused ?? "";
959
- }
960
- this.input_opts.border.focused = val;
961
- return this;
962
- }
963
- error_color(val) {
964
- if (val == null) {
965
- return this.input_opts.border.missing ?? "";
966
- }
967
- this.input_opts.border.missing = val;
968
- this.error_text.color(this.input_opts.border.missing);
969
- return this;
970
- }
971
- dropdown_height(val) {
972
- if (val === undefined) {
973
- return this._dropdown_height;
974
- }
975
- this._dropdown_height = val;
976
- return this;
977
- }
978
- /** Set default since it inherits an element. */
979
- set_default() {
980
- return super.set_default(ExtendedSelectElement);
981
- }
982
- /**
983
- * Set the error state and message.
984
- * Providing a truthy value will enable the error state and return the current instance for chaining.
985
- * Providing a falsy value will disable the error state and return the current instance for chaining.
986
- * Providing no value will return the current error message or `undefined` when no error is set.
987
- */
988
- error(err) {
989
- if (err == null) {
990
- return (this.has_error ? this.error_text.text() : undefined);
991
- }
992
- else if (err) {
993
- this.has_error = true;
994
- this._set_border_color(this.input_opts.border.missing, true);
995
- this.image?.mask_color(this.input_opts.border.missing);
996
- this.error_text.show();
997
- if (err) {
998
- this.error_text.text(err);
999
- }
1000
- }
1001
- else {
1002
- this.has_error = false;
1003
- this._set_border_color(this.input_opts.border.color);
1004
- this.image?.mask_color(this.image_opts?.color ?? "#000");
1005
- this.error_text.hide();
1006
- }
1007
- return this;
1008
- }
1009
- /** Remove the error state and mark as valid. */
1010
- valid() {
1011
- return this.error(false);
1012
- }
1013
- /** Submit the item, throws an error when the item is not defined. */
1014
- submit() {
1015
- const value = this.value();
1016
- if (value == null || value === "") {
1017
- this.error("Incomplete field");
1018
- throw Error("Fill in all the required fields.");
1019
- }
1020
- this.valid();
1021
- return value;
1022
- }
1023
- /** Expand dropdown. */
1024
- expand() {
1025
- // Set focus.
1026
- if (!this.has_error) {
1027
- this.is_focused = true;
1028
- this._set_border_color(this.input_opts.border.focused, true);
1029
- }
1030
- // Add event listener.
1031
- window.addEventListener("mousedown", this._on_dropdown_close);
1032
- // Clear.
1033
- this.dropdown.remove_children();
1034
- // Set top.
1035
- // this.dropdown.top(this.label.clientHeight + this.container.clientHeight + (this.label.is_hidden() ? 0 : 5) + 5)
1036
- this.dropdown.top(this.label.clientHeight + (this.label.is_hidden() ? 0 : 5));
1037
- // Search bar.
1038
- const search = Input("Search")
1039
- .color("inherit")
1040
- .font_size("inherit")
1041
- .margin(10)
1042
- .padding(0)
1043
- .width("calc(100% - 20px)")
1044
- .outline("none")
1045
- .box_shadow("none")
1046
- .border_radius(0)
1047
- .on_input((e, event) => {
1048
- const query = e.value();
1049
- if (query.length === 0) {
1050
- content.inner_html("");
1051
- for (const item of this.items) {
1052
- content.append(item.stack);
1053
- }
1054
- }
1055
- else {
1056
- const results = vlib.fuzzy.search({
1057
- query,
1058
- targets: this.items,
1059
- limit: undefined,
1060
- case_match: false,
1061
- allow_exceeding_chars: true,
1062
- key: ["id", "text"],
1063
- });
1064
- content.inner_html("");
1065
- for (const item of results) {
1066
- content.append(item.stack);
1067
- }
1068
- }
1069
- });
1070
- // The content.
1071
- const content = VStack()
1072
- .frame("100%")
1073
- .padding(5, 0);
1074
- // Add children.
1075
- let i = 0;
1076
- let min_height;
1077
- // this.dropdown.items = [];
1078
- for (const item of this.items) {
1079
- // Image.
1080
- let img;
1081
- if (item.image != null) {
1082
- img = ImageMask(item.image)
1083
- .mask_color(this.image_opts?.color ?? "#000")
1084
- .square(this.image_opts?.size ?? 20)
1085
- .margin(0, 10, 0, 5)
1086
- .alt(this.image_opts?.alt ?? "Volt")
1087
- .pointer_events("none"); // so target element of mouse down is easier.
1088
- }
1089
- // Text.
1090
- const text = Text(item.text)
1091
- .color("inherit")
1092
- .font_size("inherit")
1093
- .white_space("pre")
1094
- .margin(0)
1095
- .width("100%")
1096
- .stretch(true)
1097
- .pointer_events("none"); // so target element of mouse down is easier.
1098
- // Stack.
1099
- const stack = HStack(img, text)
1100
- .width("100%")
1101
- .padding(5, 10)
1102
- .background("transparent")
1103
- .transition("background 0.2 ease-in-out")
1104
- .on_click(() => {
1105
- this.dropdown.hide();
1106
- this._value = item.id;
1107
- this.input.value(item.text ?? item.id);
1108
- if (this._on_change_callback != null) {
1109
- this._on_change_callback(this, item.id);
1110
- }
1111
- window.removeEventListener("mousedown", this._on_dropdown_close);
1112
- })
1113
- .on_mouse_over((e) => e.background(this._dropdown_item_hover))
1114
- .on_mouse_out((e) => e.background("transparent"));
1115
- // Update the item with the stack for searches.
1116
- item.stack = stack;
1117
- // Append.
1118
- content.append(stack);
1119
- // Increment.
1120
- ++i;
1121
- }
1122
- // Show search bar or just show everything.
1123
- if (this.items.length > 15) {
1124
- this.dropdown.append(search, Divider()
1125
- .margin(0)
1126
- .background(this.input_opts.border.color), content);
1127
- }
1128
- else {
1129
- this.dropdown.append(content);
1130
- }
1131
- // Show dropdown.
1132
- this.dropdown.show();
1133
- // Select
1134
- if (this.items.length > 15) {
1135
- search.select();
1136
- }
1137
- // Set min height.
1138
- if (this._dropdown_height !== undefined) {
1139
- this.dropdown.fixed_height(this._dropdown_height);
1140
- }
1141
- else if (this.items.length > 15) {
1142
- this.dropdown.fixed_height((this.dropdown.content.child(0).clientHeight) * Math.min(this.items.length, 10) + 10);
1143
- }
1144
- else {
1145
- this.dropdown.fixed_height((this.dropdown.content.child(0).child(0).clientHeight) * Math.min(this.items.length, 10) + 10);
1146
- }
1147
- // this.dropdown.min_height((this.dropdown.content.child(0).clientHeight + 10) * Math.min(this.items.length, 10) + 10) // old.
1148
- // Response.
1149
- return this;
1150
- }
1151
- value(val) {
1152
- if (val == null) {
1153
- return this._value ?? "";
1154
- }
1155
- for (const item of this.items) {
1156
- if (item.id === val) {
1157
- this._value = val;
1158
- this.input.value(item.text ?? item.id);
1159
- if (this._on_change_callback != null) {
1160
- this._on_change_callback(this, val);
1161
- }
1162
- }
1163
- }
1164
- return this;
1165
- }
1166
- background(val) {
1167
- if (val == null) {
1168
- return this.background();
1169
- }
1170
- this.container.background(val);
1171
- this.dropdown.background(val);
1172
- return this;
1173
- }
1174
- padding(...values) {
1175
- if (values.length === 0 || (values.length === 1 && values[0] == null)) {
1176
- return this.container.padding();
1177
- }
1178
- this.container.padding(...values);
1179
- this.dropdown.padding(...values);
1180
- return this;
1181
- }
1182
- // @ts-expect-error
1183
- on_change(callback) {
1184
- if (callback == null) {
1185
- return this._on_change_callback;
1186
- }
1187
- this._on_change_callback = callback;
1188
- return this;
1189
- }
1190
- text(val) { if (val == null) {
1191
- return this.label.text();
1192
- } this.label.text(val); return this; }
1193
- required(val) { if (val == null) {
1194
- return this.input.required();
1195
- } this.input.required(val); return this; }
1196
- };
1197
- return ExtendedSelectElement = _classThis;
1198
- })();
1199
- export { ExtendedSelectElement };
1200
- export const ExtendedSelect = Elements.wrapper(ExtendedSelectElement);
1201
- export const NullExtendedSelect = Elements.create_null(ExtendedSelectElement);