@vandenberghinc/volt 1.1.4 → 1.1.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 (290) hide show
  1. package/backend/dist/cjs/database.d.ts +41 -68
  2. package/backend/dist/cjs/database.js +136 -78
  3. package/backend/dist/cjs/endpoint.d.ts +23 -9
  4. package/backend/dist/cjs/endpoint.js +98 -21
  5. package/backend/dist/cjs/file_watcher.js +2 -2
  6. package/backend/dist/cjs/frontend.d.ts +0 -2
  7. package/backend/dist/cjs/frontend.js +9 -9
  8. package/backend/dist/cjs/image_endpoint.d.ts +3 -1
  9. package/backend/dist/cjs/image_endpoint.js +2 -1
  10. package/backend/dist/cjs/payments/paddle.js +10 -2
  11. package/backend/dist/cjs/plugins/css.d.ts +6 -5
  12. package/backend/dist/cjs/plugins/css.js +32 -7
  13. package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
  14. package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
  15. package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
  16. package/backend/dist/cjs/server.d.ts +7 -13
  17. package/backend/dist/cjs/server.js +184 -303
  18. package/backend/dist/cjs/status.d.ts +1 -0
  19. package/backend/dist/cjs/status.js +2 -1
  20. package/backend/dist/cjs/stream.d.ts +5 -3
  21. package/backend/dist/cjs/stream.js +13 -4
  22. package/backend/dist/cjs/users.d.ts +1 -1
  23. package/backend/dist/cjs/users.js +87 -72
  24. package/backend/dist/cjs/utils.d.ts +17 -9
  25. package/backend/dist/cjs/utils.js +22 -64
  26. package/backend/dist/cjs/view.d.ts +2 -2
  27. package/backend/dist/cjs/view.js +38 -40
  28. package/backend/dist/cjs/volt.d.ts +3 -2
  29. package/backend/dist/cjs/volt.js +2 -2
  30. package/backend/dist/css/volt.css +5 -0
  31. package/backend/dist/esm/database.d.ts +41 -68
  32. package/backend/dist/esm/database.js +137 -79
  33. package/backend/dist/esm/endpoint.d.ts +23 -9
  34. package/backend/dist/esm/endpoint.js +99 -22
  35. package/backend/dist/esm/file_watcher.js +2 -2
  36. package/backend/dist/esm/frontend.d.ts +0 -2
  37. package/backend/dist/esm/frontend.js +9 -9
  38. package/backend/dist/esm/image_endpoint.d.ts +3 -1
  39. package/backend/dist/esm/image_endpoint.js +2 -1
  40. package/backend/dist/esm/payments/paddle.js +11 -3
  41. package/backend/dist/esm/plugins/css.d.ts +6 -5
  42. package/backend/dist/esm/plugins/css.js +32 -6
  43. package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
  44. package/backend/dist/esm/plugins/ts/compiler.js +26 -2
  45. package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
  46. package/backend/dist/esm/server.d.ts +7 -13
  47. package/backend/dist/esm/server.js +182 -301
  48. package/backend/dist/esm/status.d.ts +1 -0
  49. package/backend/dist/esm/status.js +1 -0
  50. package/backend/dist/esm/stream.d.ts +5 -3
  51. package/backend/dist/esm/stream.js +13 -4
  52. package/backend/dist/esm/users.d.ts +1 -1
  53. package/backend/dist/esm/users.js +87 -72
  54. package/backend/dist/esm/utils.d.ts +17 -9
  55. package/backend/dist/esm/utils.js +21 -62
  56. package/backend/dist/esm/view.d.ts +2 -2
  57. package/backend/dist/esm/view.js +38 -40
  58. package/backend/dist/esm/volt.d.ts +3 -2
  59. package/backend/dist/esm/volt.js +2 -1
  60. package/backend/dist/esm-dev/blacklist.js +1 -1
  61. package/backend/dist/esm-dev/cli.js +2 -2
  62. package/backend/dist/esm-dev/database.d.ts +41 -68
  63. package/backend/dist/esm-dev/database.js +138 -80
  64. package/backend/dist/esm-dev/endpoint.d.ts +23 -9
  65. package/backend/dist/esm-dev/endpoint.js +100 -23
  66. package/backend/dist/esm-dev/file_watcher.js +3 -3
  67. package/backend/dist/esm-dev/frontend.d.ts +0 -2
  68. package/backend/dist/esm-dev/frontend.js +9 -9
  69. package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
  70. package/backend/dist/esm-dev/image_endpoint.js +2 -1
  71. package/backend/dist/esm-dev/logger.js +1 -1
  72. package/backend/dist/esm-dev/payments/paddle.js +12 -4
  73. package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
  74. package/backend/dist/esm-dev/plugins/css.js +33 -7
  75. package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
  76. package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
  77. package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
  78. package/backend/dist/esm-dev/rate_limit.js +1 -1
  79. package/backend/dist/esm-dev/server.d.ts +7 -13
  80. package/backend/dist/esm-dev/server.js +184 -303
  81. package/backend/dist/esm-dev/status.d.ts +1 -0
  82. package/backend/dist/esm-dev/status.js +1 -0
  83. package/backend/dist/esm-dev/stream.d.ts +5 -3
  84. package/backend/dist/esm-dev/stream.js +13 -4
  85. package/backend/dist/esm-dev/users.d.ts +1 -1
  86. package/backend/dist/esm-dev/users.js +88 -73
  87. package/backend/dist/esm-dev/utils.d.ts +17 -9
  88. package/backend/dist/esm-dev/utils.js +22 -63
  89. package/backend/dist/esm-dev/view.d.ts +2 -2
  90. package/backend/dist/esm-dev/view.js +39 -41
  91. package/backend/dist/esm-dev/volt.d.ts +3 -2
  92. package/backend/dist/esm-dev/volt.js +2 -1
  93. package/backend/src/database.ts +173 -155
  94. package/backend/src/endpoint.ts +123 -31
  95. package/backend/src/file_watcher.ts +2 -2
  96. package/backend/src/frontend.ts +9 -8
  97. package/backend/src/image_endpoint.ts +4 -0
  98. package/backend/src/payments/paddle.ts +11 -3
  99. package/backend/src/plugins/css.ts +36 -8
  100. package/backend/src/plugins/ts/compiler.ts +37 -1
  101. package/backend/src/plugins/ts/preprocessing.ts +5 -3
  102. package/backend/src/server.ts +167 -306
  103. package/backend/src/status.ts +1 -0
  104. package/backend/src/stream.ts +28 -8
  105. package/backend/src/users.ts +87 -72
  106. package/backend/src/utils.ts +58 -25
  107. package/backend/src/view.ts +30 -28
  108. package/backend/src/{volt.js → volt.ts} +2 -1
  109. package/backend/tsconfig.cjs.json +3 -3
  110. package/backend/tsconfig.esm.json +3 -3
  111. package/frontend/dist/elements/base.d.ts +414 -432
  112. package/frontend/dist/elements/base.js +566 -329
  113. package/frontend/dist/elements/module.d.ts +26 -12
  114. package/frontend/dist/elements/module.js +69 -32
  115. package/frontend/dist/elements/register_element.d.ts +3 -0
  116. package/frontend/dist/elements/register_element.js +22 -0
  117. package/frontend/dist/modules/auth.d.ts +1 -0
  118. package/frontend/dist/modules/auth.js +6 -5
  119. package/frontend/dist/modules/color.d.ts +159 -0
  120. package/frontend/dist/modules/color.js +315 -0
  121. package/frontend/dist/modules/colors.d.ts +1 -26
  122. package/frontend/dist/modules/colors.js +417 -340
  123. package/frontend/dist/modules/cookies.d.ts +1 -0
  124. package/frontend/dist/modules/cookies.js +1 -0
  125. package/frontend/dist/modules/events.d.ts +1 -0
  126. package/frontend/dist/modules/events.js +1 -0
  127. package/frontend/dist/modules/google.d.ts +1 -0
  128. package/frontend/dist/modules/google.js +1 -0
  129. package/frontend/dist/modules/meta.d.ts +1 -0
  130. package/frontend/dist/modules/meta.js +1 -0
  131. package/frontend/dist/modules/mutex.d.ts +1 -2
  132. package/frontend/dist/modules/mutex.js +3 -4
  133. package/frontend/dist/modules/paddle.d.ts +1 -0
  134. package/frontend/dist/modules/paddle.js +14 -13
  135. package/frontend/dist/modules/scheme.d.ts +1 -0
  136. package/frontend/dist/modules/scheme.js +5 -3
  137. package/frontend/dist/modules/statics.d.ts +1 -0
  138. package/frontend/dist/modules/statics.js +1 -0
  139. package/frontend/dist/modules/support.d.ts +1 -0
  140. package/frontend/dist/modules/support.js +3 -2
  141. package/frontend/dist/modules/theme.d.ts +56 -0
  142. package/frontend/dist/{ui → modules}/theme.js +186 -75
  143. package/frontend/dist/modules/themes.d.ts +1 -1
  144. package/frontend/dist/modules/themes.js +1 -0
  145. package/frontend/dist/modules/user.d.ts +1 -0
  146. package/frontend/dist/modules/user.js +11 -10
  147. package/frontend/dist/modules/utils.d.ts +23 -2
  148. package/frontend/dist/modules/utils.js +93 -1
  149. package/frontend/dist/types/gradient.js +4 -0
  150. package/frontend/dist/ui/border_button.d.ts +0 -25
  151. package/frontend/dist/ui/border_button.js +50 -51
  152. package/frontend/dist/ui/button.d.ts +0 -21
  153. package/frontend/dist/ui/button.js +41 -46
  154. package/frontend/dist/ui/canvas.js +15 -15
  155. package/frontend/dist/ui/checkbox.d.ts +3 -17
  156. package/frontend/dist/ui/checkbox.js +36 -30
  157. package/frontend/dist/ui/code.d.ts +15 -82
  158. package/frontend/dist/ui/code.js +150 -125
  159. package/frontend/dist/ui/color.d.ts +0 -1
  160. package/frontend/dist/ui/color.js +1 -1
  161. package/frontend/dist/ui/context_menu.d.ts +4 -2
  162. package/frontend/dist/ui/context_menu.js +16 -17
  163. package/frontend/dist/ui/css.js +2 -0
  164. package/frontend/dist/ui/divider.d.ts +0 -7
  165. package/frontend/dist/ui/divider.js +21 -25
  166. package/frontend/dist/ui/dropdown.d.ts +13 -7
  167. package/frontend/dist/ui/dropdown.js +65 -30
  168. package/frontend/dist/ui/for_each.d.ts +0 -5
  169. package/frontend/dist/ui/for_each.js +17 -22
  170. package/frontend/dist/ui/form.d.ts +17 -12
  171. package/frontend/dist/ui/form.js +21 -18
  172. package/frontend/dist/ui/frame_modes.d.ts +9 -12
  173. package/frontend/dist/ui/frame_modes.js +8 -10
  174. package/frontend/dist/ui/google_map.d.ts +0 -11
  175. package/frontend/dist/ui/google_map.js +23 -28
  176. package/frontend/dist/ui/gradient.d.ts +0 -5
  177. package/frontend/dist/ui/gradient.js +17 -22
  178. package/frontend/dist/ui/image.d.ts +27 -58
  179. package/frontend/dist/ui/image.js +99 -93
  180. package/frontend/dist/ui/input.d.ts +20 -97
  181. package/frontend/dist/ui/input.js +192 -170
  182. package/frontend/dist/ui/link.d.ts +0 -18
  183. package/frontend/dist/ui/link.js +42 -48
  184. package/frontend/dist/ui/list.js +36 -37
  185. package/frontend/dist/ui/loader_button.d.ts +4 -19
  186. package/frontend/dist/ui/loader_button.js +35 -37
  187. package/frontend/dist/ui/loaders.d.ts +0 -8
  188. package/frontend/dist/ui/loaders.js +20 -25
  189. package/frontend/dist/ui/popup.d.ts +11 -8
  190. package/frontend/dist/ui/popup.js +183 -24
  191. package/frontend/dist/ui/pseudo.d.ts +3 -3
  192. package/frontend/dist/ui/pseudo.js +14 -17
  193. package/frontend/dist/ui/scroller.d.ts +10 -48
  194. package/frontend/dist/ui/scroller.js +306 -300
  195. package/frontend/dist/ui/slider.d.ts +9 -3
  196. package/frontend/dist/ui/slider.js +31 -17
  197. package/frontend/dist/ui/spacer.d.ts +0 -9
  198. package/frontend/dist/ui/spacer.js +21 -26
  199. package/frontend/dist/ui/span.js +13 -15
  200. package/frontend/dist/ui/stack.d.ts +14 -75
  201. package/frontend/dist/ui/stack.js +166 -169
  202. package/frontend/dist/ui/steps.d.ts +10 -23
  203. package/frontend/dist/ui/steps.js +47 -34
  204. package/frontend/dist/ui/style.d.ts +4 -3
  205. package/frontend/dist/ui/style.js +13 -18
  206. package/frontend/dist/ui/switch.d.ts +10 -4
  207. package/frontend/dist/ui/switch.js +24 -16
  208. package/frontend/dist/ui/table.d.ts +0 -23
  209. package/frontend/dist/ui/table.js +113 -119
  210. package/frontend/dist/ui/tabs.d.ts +3 -19
  211. package/frontend/dist/ui/tabs.js +35 -29
  212. package/frontend/dist/ui/text.d.ts +0 -8
  213. package/frontend/dist/ui/text.js +20 -25
  214. package/frontend/dist/ui/title.d.ts +0 -15
  215. package/frontend/dist/ui/title.js +39 -45
  216. package/frontend/dist/ui/ui.d.ts +0 -2
  217. package/frontend/dist/ui/ui.js +0 -2
  218. package/frontend/dist/ui/view.d.ts +3 -17
  219. package/frontend/dist/ui/view.js +27 -32
  220. package/frontend/dist/volt.d.ts +2 -1
  221. package/frontend/dist/volt.js +3 -1
  222. package/frontend/examples/dashboard/dashboard.ts +774 -0
  223. package/frontend/examples/theme/theme.ts +58 -0
  224. package/frontend/src/css/volt.css +5 -0
  225. package/frontend/src/elements/base.ts +767 -545
  226. package/frontend/src/elements/module.ts +90 -29
  227. package/frontend/src/elements/register_element.ts +24 -0
  228. package/frontend/src/modules/auth.ts +7 -6
  229. package/frontend/src/modules/color.ts +348 -0
  230. package/frontend/src/modules/colors.ts +468 -449
  231. package/frontend/src/modules/cookies.ts +1 -0
  232. package/frontend/src/modules/events.ts +1 -0
  233. package/frontend/src/modules/google.ts +1 -0
  234. package/frontend/src/modules/meta.ts +2 -1
  235. package/frontend/src/modules/mutex.ts +2 -4
  236. package/frontend/src/modules/paddle.ts +21 -20
  237. package/frontend/src/modules/scheme.ts +5 -4
  238. package/frontend/src/modules/statics.ts +2 -1
  239. package/frontend/src/modules/support.ts +3 -2
  240. package/frontend/src/modules/theme.ts +413 -0
  241. package/frontend/src/modules/themes.ts +2 -1
  242. package/frontend/src/modules/user.ts +12 -11
  243. package/frontend/src/modules/utils.ts +125 -2
  244. package/frontend/src/ui/border_button.ts +41 -37
  245. package/frontend/src/ui/button.ts +33 -32
  246. package/frontend/src/ui/canvas.ts +5 -2
  247. package/frontend/src/ui/checkbox.ts +21 -22
  248. package/frontend/src/ui/code.ts +92 -86
  249. package/frontend/src/ui/context_menu.ts +7 -5
  250. package/frontend/src/ui/css.ts +1 -1
  251. package/frontend/src/ui/divider.ts +15 -10
  252. package/frontend/src/ui/dropdown.ts +38 -21
  253. package/frontend/src/ui/for_each.ts +9 -8
  254. package/frontend/src/ui/form.ts +26 -21
  255. package/frontend/src/ui/frame_modes.ts +13 -17
  256. package/frontend/src/ui/google_map.ts +15 -13
  257. package/frontend/src/ui/gradient.ts +9 -8
  258. package/frontend/src/ui/image.ts +108 -86
  259. package/frontend/src/ui/input.ts +145 -144
  260. package/frontend/src/ui/link.ts +25 -23
  261. package/frontend/src/ui/list.ts +12 -6
  262. package/frontend/src/ui/loader_button.ts +26 -25
  263. package/frontend/src/ui/loaders.ts +12 -11
  264. package/frontend/src/ui/popup.ts +168 -14
  265. package/frontend/src/ui/pseudo.ts +5 -3
  266. package/frontend/src/ui/scroller.ts +303 -294
  267. package/frontend/src/ui/slider.ts +15 -10
  268. package/frontend/src/ui/spacer.ts +14 -11
  269. package/frontend/src/ui/span.ts +6 -2
  270. package/frontend/src/ui/stack.ts +196 -183
  271. package/frontend/src/ui/steps.ts +38 -22
  272. package/frontend/src/ui/style.ts +7 -4
  273. package/frontend/src/ui/switch.ts +16 -11
  274. package/frontend/src/ui/table.ts +42 -34
  275. package/frontend/src/ui/tabs.ts +20 -19
  276. package/frontend/src/ui/text.ts +12 -11
  277. package/frontend/src/ui/title.ts +22 -20
  278. package/frontend/src/ui/ui.ts +0 -2
  279. package/frontend/src/ui/view.ts +20 -19
  280. package/frontend/src/volt.ts +3 -1
  281. package/frontend/{compile.js → tools/compile.old.js} +2 -2
  282. package/frontend/tools/embed_scripts.js +69 -0
  283. package/frontend/tsconfig.json +26 -0
  284. package/package.json +7 -6
  285. package/frontend/dist/ui/theme.d.ts +0 -25
  286. package/frontend/exports.json +0 -1340
  287. package/frontend/src/modules/date.js +0 -535
  288. package/frontend/src/ui/color.ts +0 -117
  289. package/frontend/src/ui/theme.ts +0 -279
  290. /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap, VInputElement, VTextAreaElement } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap, VInputElement, VTextAreaElement, ElementKeyboardEvent, ElementEvent } from "../elements/module.js"
8
8
  import { Utils } from "../modules/utils.js"
9
9
  import { HStack, HStackElement, VStack, VStackElement } from "./stack"
10
10
  import { Text, TextElement } from "./text"
@@ -12,28 +12,30 @@ import { ImageMask, ImageMaskElement } from "./image"
12
12
  import { GradientBorder, GradientBorderElement } from "./gradient"
13
13
  import { Scroller, ScrollerElement } from "./scroller"
14
14
  import { Divider } from "./divider"
15
+ import { addSyntheticLeadingComment } from "typescript"
15
16
 
16
17
  // Input.
17
- @Elements.register
18
- export class InputElement extends VElementTagMap.input {
19
-
20
- static default_style = {
21
- "margin": "0px 0px 0px 0px",
22
- "padding": "2.5px 5px 2.5px 5px",
23
- "font": "inherit",
24
- "color": "inherit",
25
- "background": "none",
26
- "outline": "none",
27
- "border": "none",
28
- "border-radius": "10px",
29
- "text-align": "start",
30
- "white-space": "nowrap",
31
- };
32
- static default_attributes = {
18
+ @Elements.create({
19
+ name: "InputElement",
20
+ default_style: {
21
+ "margin": "0px 0px 0px 0px",
22
+ "padding": "2.5px 5px 2.5px 5px",
23
+ "font": "inherit",
24
+ "color": "inherit",
25
+ "background": "none",
26
+ "outline": "none",
27
+ "border": "none",
28
+ "border-radius": "10px",
29
+ "text-align": "start",
30
+ "white-space": "nowrap",
31
+ },
32
+ default_attributes: {
33
33
  "spellcheck": "false",
34
34
  "autocorrect": "off",
35
35
  "autocapitalize": "none",
36
- };
36
+ },
37
+ })
38
+ export class InputElement extends VElementTagMap.input {
37
39
 
38
40
  // Attributes.
39
41
  private _e!: HTMLInputElement;
@@ -129,28 +131,29 @@ export const NullInput = Elements.create_null(InputElement);
129
131
  declare module './any_element.d.ts' { interface AnyElementMap { InputElement: InputElement }}
130
132
 
131
133
  // InputBox.
132
- @Elements.register
133
- export class InputBoxElement extends VElementTagMap.textarea {
134
-
135
- static default_style = {
136
- "margin": "0px 0px 0px 0px",
137
- "padding": "2.5px 5px 2.5px 5px",
138
- "height": "20px",
139
- "font": "inherit",
140
- "color": "inherit",
141
- "background": "none",
142
- "outline": "none",
143
- "border": "none",
144
- "border-radius": "10px",
145
- "text-align": "start",
146
- "white-space": "wrap",
147
- "resize": "none",
148
- }
149
- static default_attributes = {
134
+ @Elements.create({
135
+ name: "InputBoxElement",
136
+ default_style: {
137
+ "margin": "0px 0px 0px 0px",
138
+ "padding": "2.5px 5px 2.5px 5px",
139
+ "height": "20px",
140
+ "font": "inherit",
141
+ "color": "inherit",
142
+ "background": "none",
143
+ "outline": "none",
144
+ "border": "none",
145
+ "border-radius": "10px",
146
+ "text-align": "start",
147
+ "white-space": "wrap",
148
+ "resize": "none",
149
+ },
150
+ default_attributes: {
150
151
  "spellcheck": "false",
151
152
  "autocorrect": "off",
152
153
  "autocapitalize": "none",
153
- }
154
+ },
155
+ })
156
+ export class InputBoxElement extends VElementTagMap.textarea {
154
157
 
155
158
  // Attributes.
156
159
  public _e?: HTMLTextAreaElement;
@@ -245,35 +248,34 @@ export const NullInputBox = Elements.create_null(InputBoxElement);
245
248
  declare module './any_element.d.ts' { interface AnyElementMap { InputBoxElement: InputBoxElement }}
246
249
 
247
250
  // Extended input.
248
- @Elements.register
249
- export class ExtendedInputElement extends VStackElement {
250
-
251
- static default_style = {
252
- ...VStackElement.default_style,
253
- "color": "inherit",
254
- "font-size": "16px",
255
- // Custom.
256
- "--input-padding": "12px 6px",
257
- "--input-border-radius": "5px",
258
- "--input-border-color": "gray",
259
- "--input-background": "transparent",
260
- "--image-mask-color": "#000",
261
- "--image-size": "20px",
262
- "--image-margin-right": "10px",
263
- "--image-margin-left": "5px",
264
- "--image-alt": "VWeb",
265
- "--focus-color": "#8EB8EB",
266
- "--missing-color": "#E8454E",
267
- }
268
-
269
- #macro ElementKeyboardEvent ((element: this, event: KeyboardEvent) => any)
270
- #macro ElementEvent ((element: this, event: Event) => any)
271
-
272
- public _focus_color: string;
273
- public _missing_color: string;
274
- public _mask_color: string;
275
- public _initial_border_color: string;
276
- public _missing: boolean;
251
+ @Elements.create({
252
+ name: "ExtendedInputElement",
253
+ default_style: {
254
+ ...VStackElement.default_style,
255
+ "color": "inherit",
256
+ "font-size": "16px",
257
+ // Custom.
258
+ "--input-padding": "12px 6px",
259
+ "--input-border-radius": "5px",
260
+ "--input-border-color": "gray",
261
+ "--input-hover-border-color": "gray",
262
+ "--input-background": "transparent",
263
+ "--image-mask-color": "#000",
264
+ "--image-size": "20px",
265
+ "--image-margin-right": "10px",
266
+ "--image-margin-left": "5px",
267
+ "--image-alt": "VWeb",
268
+ "--focus-color": "#8EB8EB",
269
+ "--missing-color": "#E8454E",
270
+ },
271
+ })
272
+ export class ExtendedInputElement extends (VStackElement as any as VElementBaseSignature) {
273
+
274
+ private _focus_color: string;
275
+ private _missing_color: string;
276
+ private _mask_color: string;
277
+ private _initial_border_color: string;
278
+ private _hover_border_color: string;
277
279
 
278
280
  // @ts-expect-error
279
281
  public label: TextElement;
@@ -282,6 +284,8 @@ export class ExtendedInputElement extends VStackElement {
282
284
  public input_border: GradientBorderElement;
283
285
  public container: HStackElement;
284
286
  public error: TextElement;
287
+ public is_missing = false;
288
+ public is_focused = false;
285
289
 
286
290
  // @todo add readonly func
287
291
 
@@ -310,7 +314,7 @@ export class ExtendedInputElement extends VStackElement {
310
314
 
311
315
  // Initialize super.
312
316
  super();
313
- this._init_derived({
317
+ this._init({
314
318
  derived: ExtendedInputElement,
315
319
  })
316
320
 
@@ -320,12 +324,11 @@ export class ExtendedInputElement extends VStackElement {
320
324
  }
321
325
 
322
326
  // Attributes.
323
- this.element_type = "ExtendedInput";
324
327
  this._focus_color = ExtendedInputElement.default_style["--focus-color"];
325
328
  this._missing_color = ExtendedInputElement.default_style["--missing-color"];
326
329
  this._mask_color = ExtendedInputElement.default_style["--image-mask-color"];
327
- this._initial_border_color = "black";
328
- this._missing = false;
330
+ this._initial_border_color = ExtendedInputElement.default_style["--input-border-color"];
331
+ this._hover_border_color = ExtendedInputElement.default_style["--input-hover-border-color"];
329
332
 
330
333
  // Set default styling.
331
334
  this.styles(ExtendedInputElement.default_style);
@@ -334,7 +337,7 @@ export class ExtendedInputElement extends VStackElement {
334
337
  this.label = Text(label)
335
338
  .parent(this)
336
339
  .font_size("inherit")
337
- .margin(0, 0, 5, 0)
340
+ .margin(0, 0, 7.5, 0)
338
341
  .color("inherit")
339
342
  .width("fit-content")
340
343
  .ellipsis_overflow(true)
@@ -377,26 +380,16 @@ export class ExtendedInputElement extends VStackElement {
377
380
  .outline("none")
378
381
  .z_index(1)
379
382
  .border_radius(0) // is required.
380
- // .on_focus(() => {
381
- // if (this._missing !== true) {
382
- // this.container.outline(`1px solid ${this._focus_color}`)
383
- // this.container.box_shadow(`0 0 0 3px ${this._focus_color}80`)
384
- // }
385
- // })
386
- // .on_blur(() => {
387
- // if (this._missing !== true) {
388
- // this.container.outline("0px solid transparent")
389
- // this.container.box_shadow(`0 0 0 0px transparent`)
390
- // }
391
- // })
392
383
  .on_focus(() => {
393
- if (this._missing !== true) {
384
+ if (!this.is_missing) {
385
+ this.is_focused = true;
394
386
  this.input_border.border_color(this._focus_color)
395
387
  this.container.box_shadow(`0 0 0 3px ${this._focus_color}80`)
396
388
  }
397
389
  })
398
390
  .on_blur(() => {
399
- if (this._missing !== true) {
391
+ if (!this.is_missing) {
392
+ this.is_focused = false;
400
393
  this.input_border.border_color(this._initial_border_color)
401
394
  this.container.box_shadow(`0 0 0 0px transparent`)
402
395
  }
@@ -418,6 +411,7 @@ export class ExtendedInputElement extends VStackElement {
418
411
  VStack(
419
412
  this.image,
420
413
  )
414
+ .width("fit-content")
421
415
  .height("1.6em")
422
416
  .center_vertical(),
423
417
  this.input_border,
@@ -430,7 +424,19 @@ export class ExtendedInputElement extends VStackElement {
430
424
  .transition("box-shadow 0.2s ease-in-out")
431
425
  .outline("0px solid transparent")
432
426
  .box_shadow(`0 0 0 0px transparent`)
433
- .width(100%)
427
+ .width("100%")
428
+ .on_mouse_over_out(
429
+ (e) => {
430
+ if (!this.is_missing && !this.is_focused) {
431
+ this.input_border.border_color(this._hover_border_color)
432
+ }
433
+ },
434
+ (e) => {
435
+ if (!this.is_missing && !this.is_focused) {
436
+ this.input_border.border_color(this._initial_border_color)
437
+ }
438
+ },
439
+ )
434
440
 
435
441
  // The error message.
436
442
  this.error = Text("Incomplete field")
@@ -471,6 +477,7 @@ export class ExtendedInputElement extends VStackElement {
471
477
  styles["--input-padding"] = this.container.padding();
472
478
  styles["--input-border-radius"] = this.container.border_radius();
473
479
  styles["--input-border-color"] = this.container.border_color();
480
+ styles["--input-hover-border-color"] = this._hover_border_color;
474
481
  styles["--image-mask-color"] = this._mask_color;
475
482
  styles["--image-size"] = this.image.width().toString();
476
483
  styles["--image-margin-right"] = this.image.margin_right().toString();
@@ -512,9 +519,9 @@ export class ExtendedInputElement extends VStackElement {
512
519
  missing(): boolean;
513
520
  missing(to: boolean, err?: string): this;
514
521
  missing(to?: boolean, err: string = "Incomplete field"): boolean | this {
515
- if (to == null) { return this._missing; }
522
+ if (to == null) { return this.is_missing; }
516
523
  else if (to === true) {
517
- this._missing = true;
524
+ this.is_missing = true;
518
525
  this.input_border.border_color(this._missing_color)
519
526
  // this.container.outline(`1px solid ${this._missing_color}`)
520
527
  this.container.box_shadow(`0 0 0 3px ${this._missing_color}80`)
@@ -524,7 +531,7 @@ export class ExtendedInputElement extends VStackElement {
524
531
  this.error.text(err);
525
532
  }
526
533
  } else {
527
- this._missing = false;
534
+ this.is_missing = false;
528
535
  this.input_border.border_color(this._initial_border_color)
529
536
  // this.container.outline("0px solid transparent")
530
537
  this.container.box_shadow(`0 0 0 0px transparent`)
@@ -586,18 +593,18 @@ export class ExtendedInputElement extends VStackElement {
586
593
  required(val: boolean): this;
587
594
  required(val?: boolean): boolean | this { if (val == null) { return this.input.required(); } this.input.required(val); return this; }
588
595
 
589
- on_enter(): undefined | ElementKeyboardEvent;
590
- on_enter(val: ElementKeyboardEvent): this;
591
- on_enter(val?: ElementKeyboardEvent): this | undefined | ElementKeyboardEvent {
592
- if (val == null) { return this.input.on_enter() as undefined | ElementKeyboardEvent; }
596
+ on_enter(): undefined | ElementKeyboardEvent<this>;
597
+ on_enter(val: ElementKeyboardEvent<this>): this;
598
+ on_enter(val?: ElementKeyboardEvent<this>): this | undefined | ElementKeyboardEvent<this> {
599
+ if (val == null) { return this.input.on_enter() as undefined | ElementKeyboardEvent<this>; }
593
600
  this.input.on_enter((x, y) => val(this, y));
594
601
  return this;
595
602
  }
596
603
 
597
- on_input(): undefined | ElementEvent;
598
- on_input(val: ElementEvent): this;
599
- on_input(val?: ElementEvent): undefined | ElementEvent | this {
600
- if (val == null) { return this.input.on_input() as undefined | ElementEvent; }
604
+ on_input(): undefined | ElementEvent<this>;
605
+ on_input(val: ElementEvent<this>): this;
606
+ on_input(val?: ElementEvent<this>): undefined | ElementEvent<this> | this {
607
+ if (val == null) { return this.input.on_input() as undefined | ElementEvent<this>; }
601
608
  this.input.on_input((x, y) => val(this, y));
602
609
  return this;
603
610
  }
@@ -616,6 +623,14 @@ export class ExtendedInputElement extends VStackElement {
616
623
  return this;
617
624
  }
618
625
 
626
+ hover_border_color(): string;
627
+ hover_border_color(val: string): this;
628
+ hover_border_color(val ?: string): string | this {
629
+ if (val == null) { return this._hover_border_color; }
630
+ this._hover_border_color = val;
631
+ return this;
632
+ }
633
+
619
634
  border_width(): string;
620
635
  border_width(val: string): this;
621
636
  border_width(val?: string): string | this { if (val == null) { return this.container.border_width(); } this.container.border_width(val); this.input_border.border_width(val); return this; }
@@ -661,34 +676,34 @@ interface ExtendedSelectItem {
661
676
  type ExtendedSelectOnChange = (element: ExtendedSelectElement, id: string) => any;
662
677
 
663
678
  // Extended input.
664
- @Elements.register
665
- export class ExtendedSelectElement extends VStackElement {
666
-
667
- static default_style = {
668
- ...VStackElement.default_style,
669
- "color": "inherit",
670
- "font-size": "16px",
671
- "background": "#FFFFFF",
672
- // Custom.
673
- "--input-padding": "12px 6px",
674
- "--input-border-radius": "5px",
675
- "--input-border-color": "gray",
676
- "--image-mask-color": "#000",
677
- "--image-size": "20px",
678
- "--image-margin-right": "10px",
679
- "--image-margin-left": "5px",
680
- "--image-alt": "VWeb",
681
- "--hover-bg": "#00000007",
682
- "--focus-color": "#8EB8EB",
683
- "--missing-color": "#E8454E",
684
- }
679
+ @Elements.create({
680
+ name: "ExtendedSelectElement",
681
+ default_style: {
682
+ ...VStackElement.default_style,
683
+ "color": "inherit",
684
+ "font-size": "16px",
685
+ "background": "#FFFFFF",
686
+ // Custom.
687
+ "--input-padding": "12px 6px",
688
+ "--input-border-radius": "5px",
689
+ "--input-border-color": "gray",
690
+ "--image-mask-color": "#000",
691
+ "--image-size": "20px",
692
+ "--image-margin-right": "10px",
693
+ "--image-margin-left": "5px",
694
+ "--image-alt": "VWeb",
695
+ "--hover-bg": "#00000007",
696
+ "--focus-color": "#8EB8EB",
697
+ "--missing-color": "#E8454E",
698
+ }
699
+ })
700
+ export class ExtendedSelectElement extends (VStackElement as any as VElementBaseSignature) {
685
701
 
686
702
  public _focus_color: string;
687
703
  public _missing_color: string;
688
704
  public _mask_color: string;
689
705
  public _border_color: string;
690
706
  public _hover_bg: string;
691
- public _missing: boolean;
692
707
 
693
708
  public items: ExtendedSelectItem[];
694
709
 
@@ -699,6 +714,7 @@ export class ExtendedSelectElement extends VStackElement {
699
714
  public container: HStackElement;
700
715
  public error: TextElement;
701
716
  public dropdown: ScrollerElement;
717
+ public is_missing = false;
702
718
 
703
719
  public _on_change_callback?: ExtendedSelectOnChange;
704
720
 
@@ -728,7 +744,7 @@ export class ExtendedSelectElement extends VStackElement {
728
744
 
729
745
  // Initialize super.
730
746
  super();
731
- this._init_derived({
747
+ this._init({
732
748
  derived: ExtendedSelectElement,
733
749
  })
734
750
 
@@ -767,16 +783,12 @@ export class ExtendedSelectElement extends VStackElement {
767
783
  throw Error(`Parameter "items" should be a defined value of type "array" or "object".`);
768
784
  }
769
785
 
770
- // Default attributes.
771
- this.element_type = "ExtendedSelect";
772
-
773
786
  // Attributes.
774
787
  this._focus_color = ExtendedSelectElement.default_style["--focus-color"];
775
788
  this._missing_color = ExtendedSelectElement.default_style["--missing-color"];
776
789
  this._mask_color = ExtendedSelectElement.default_style["--image-mask-color"];
777
790
  this._border_color = ExtendedSelectElement.default_style["--input-border-color"];
778
791
  this._hover_bg = ExtendedSelectElement.default_style["--hover-bg"]
779
- this._missing = false;
780
792
 
781
793
  // Set default styling.
782
794
  this.styles(ExtendedSelectElement.default_style);
@@ -785,7 +797,7 @@ export class ExtendedSelectElement extends VStackElement {
785
797
  this.label = Text(label)
786
798
  .parent(this)
787
799
  .font_size("inherit")
788
- .margin(0, 0, 5, 0)
800
+ .margin(0, 0, 7.5, 0)
789
801
  .color("inherit")
790
802
  .width("fit-content")
791
803
  .ellipsis_overflow(true)
@@ -821,24 +833,13 @@ export class ExtendedSelectElement extends VStackElement {
821
833
  .box_shadow("none")
822
834
  .cursor("pointer")
823
835
  .border_radius(0) // is required
824
- // .on_focus(() => {
825
- // if (this._missing !== true) {
826
- // this.container.outline(`1px solid ${this._focus_color}`)
827
- // this.container.box_shadow(`0 0 0 3px ${this._focus_color}80`)
828
- // }
829
- // })
830
- // .on_blur(() => {
831
- // if (this._missing !== true) {
832
- // this.container.outline("0px solid transparent")
833
- // this.container.box_shadow(`0 0 0 0px transparent`)
834
- // }
835
- // })
836
836
 
837
837
  // The hstack container.
838
838
  this.container = HStack(
839
839
  VStack(
840
840
  this.image,
841
841
  )
842
+ .width("fit-content")
842
843
  .height("1.6em")
843
844
  .center_vertical(),
844
845
  this.input,
@@ -853,7 +854,7 @@ export class ExtendedSelectElement extends VStackElement {
853
854
  .transition("outline 0.2s ease-in-out, box-shadow 0.2s ease-in-out")
854
855
  .outline("0px solid transparent")
855
856
  .box_shadow(`0 0 0 0px transparent`)
856
- .width(100%)
857
+ .width("100%")
857
858
  .on_click(() => {
858
859
  if (this.dropdown.is_hidden()) {
859
860
  this.expand();
@@ -879,7 +880,7 @@ export class ExtendedSelectElement extends VStackElement {
879
880
  .border_style("solid")
880
881
  .border_color(this._border_color)
881
882
  .box_shadow("0px 0px 5px #00000050")
882
- .frame(100%, 100%)
883
+ .frame("100%", "100%")
883
884
  .z_index(10)
884
885
  .hide()
885
886
 
@@ -981,9 +982,9 @@ export class ExtendedSelectElement extends VStackElement {
981
982
  missing(): boolean;
982
983
  missing(to: boolean, err?: string): this;
983
984
  missing(to?: boolean, err: string = "Incomplete field"): boolean | this {
984
- if (to == null) { return this._missing; }
985
+ if (to == null) { return this.is_missing; }
985
986
  else if (to === true) {
986
- this._missing = true;
987
+ this.is_missing = true;
987
988
  this.container.outline(`1px solid ${this._missing_color}`)
988
989
  this.container.box_shadow(`0 0 0 3px ${this._missing_color}80`)
989
990
  this.image.mask_color(this._missing_color)
@@ -992,7 +993,7 @@ export class ExtendedSelectElement extends VStackElement {
992
993
  this.error.text(err);
993
994
  }
994
995
  } else {
995
- this._missing = false;
996
+ this.is_missing = false;
996
997
  this.container.outline("0px solid transparent")
997
998
  this.container.box_shadow(`0 0 0 0px transparent`)
998
999
  this.image.mask_color(this._mask_color)
@@ -1063,7 +1064,7 @@ export class ExtendedSelectElement extends VStackElement {
1063
1064
 
1064
1065
  // The content.
1065
1066
  const content = VStack()
1066
- .frame(100%)
1067
+ .frame("100%")
1067
1068
  .padding(5, 0)
1068
1069
 
1069
1070
  // Add children.
@@ -1097,7 +1098,7 @@ export class ExtendedSelectElement extends VStackElement {
1097
1098
 
1098
1099
  // Stack.
1099
1100
  const stack = HStack(img, text)
1100
- .width(100%)
1101
+ .width("100%")
1101
1102
  .padding(5, 10)
1102
1103
  .background("transparent")
1103
1104
  .transition("background 0.2 ease-in-out")
@@ -4,22 +4,23 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap } from "../elements/module.js"
8
8
 
9
9
  // Link.
10
- @Elements.register
10
+ @Elements.create({
11
+ name: "AnchorElement",
12
+ default_style: {
13
+ "font-family": "inherit",
14
+ "font-size": "inherit",
15
+ "color": "inherit",
16
+ "text-decoration": "none",
17
+ "text-underline-position": "none",
18
+ "cursor": "pointer",
19
+ "outline": "none",
20
+ "border": "none",
21
+ },
22
+ })
11
23
  export class AnchorElement extends VElementTagMap.a {
12
-
13
- static default_style = {
14
- "font-family": "inherit",
15
- "font-size": "inherit",
16
- "color": "inherit",
17
- "text-decoration": "none",
18
- "text-underline-position": "none",
19
- "cursor": "pointer",
20
- "outline": "none",
21
- "border": "none",
22
- };
23
24
 
24
25
  // Constructor.
25
26
  constructor(text?: string, href?: string, alt?: string) {
@@ -44,17 +45,18 @@ export const NullAnchor = Elements.create_null(AnchorElement);
44
45
  declare module './any_element.d.ts' { interface AnyElementMap { AnchorElement: AnchorElement }}
45
46
 
46
47
  // Link.
47
- @Elements.register
48
+ @Elements.create({
49
+ name: "LinkElement",
50
+ default_style: {
51
+ "font-family": "inherit",
52
+ "font-size": "1em",
53
+ "color": "rgb(85, 108, 214)",
54
+ "text-decoration": "underline",
55
+ "text-underline-position": "auto",
56
+ "cursor": "pointer",
57
+ },
58
+ })
48
59
  export class LinkElement extends VElementTagMap.a {
49
-
50
- static default_style = {
51
- "font-family": "inherit",
52
- "font-size": "1em",
53
- "color": "rgb(85, 108, 214)",
54
- "text-decoration": "underline",
55
- "text-underline-position": "auto",
56
- "cursor": "pointer",
57
- };
58
60
 
59
61
  // Constructor.
60
62
  constructor(text?: string, href?: string) {
@@ -4,13 +4,15 @@
4
4
  */
5
5
 
6
6
  // Imports.
7
- import { Elements, VElementTagMap } from "../elements/module.js"
7
+ import { Elements, VElementBaseSignature, VElement, VElementTagMap } from "../elements/module.js"
8
8
  import { Scheme } from "../modules/scheme"
9
9
 
10
10
  // List item.
11
- @Elements.register
11
+ @Elements.create({
12
+ name: "ListItemElement",
13
+ })
12
14
  export class ListItemElement extends VElementTagMap.li {
13
-
15
+
14
16
  // Constructor.
15
17
  constructor(...content: any[]) {
16
18
 
@@ -26,7 +28,9 @@ export const NullListItem = Elements.create_null(ListItemElement);
26
28
  declare module './any_element.d.ts' { interface AnyElementMap { ListItemElement: ListItemElement }}
27
29
 
28
30
  // Unordered List.
29
- @Elements.register
31
+ @Elements.create({
32
+ name: "UnorderedListElement",
33
+ })
30
34
  export class UnorderedListElement extends VElementTagMap.ul {
31
35
 
32
36
  // Constructor.
@@ -57,9 +61,11 @@ export const NullUnorderedList = Elements.create_null(UnorderedListElement);
57
61
  declare module './any_element.d.ts' { interface AnyElementMap { UnorderedListElement: UnorderedListElement }}
58
62
 
59
63
  // Ordered List.
60
- @Elements.register
64
+ @Elements.create({
65
+ name: "OrderedListElement",
66
+ })
61
67
  export class OrderedListElement extends VElementTagMap.ol {
62
-
68
+
63
69
  // Constructor.
64
70
  constructor(items: (ListItemElement | any | any[])[] = []) {
65
71