@vandenberghinc/volt 1.1.2

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