@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.
- package/backend/dist/cjs/database.d.ts +41 -68
- package/backend/dist/cjs/database.js +136 -78
- package/backend/dist/cjs/endpoint.d.ts +23 -9
- package/backend/dist/cjs/endpoint.js +98 -21
- package/backend/dist/cjs/file_watcher.js +2 -2
- package/backend/dist/cjs/frontend.d.ts +0 -2
- package/backend/dist/cjs/frontend.js +9 -9
- package/backend/dist/cjs/image_endpoint.d.ts +3 -1
- package/backend/dist/cjs/image_endpoint.js +2 -1
- package/backend/dist/cjs/payments/paddle.js +10 -2
- package/backend/dist/cjs/plugins/css.d.ts +6 -5
- package/backend/dist/cjs/plugins/css.js +32 -7
- package/backend/dist/cjs/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/cjs/plugins/ts/compiler.js +26 -2
- package/backend/dist/cjs/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/cjs/server.d.ts +7 -13
- package/backend/dist/cjs/server.js +184 -303
- package/backend/dist/cjs/status.d.ts +1 -0
- package/backend/dist/cjs/status.js +2 -1
- package/backend/dist/cjs/stream.d.ts +5 -3
- package/backend/dist/cjs/stream.js +13 -4
- package/backend/dist/cjs/users.d.ts +1 -1
- package/backend/dist/cjs/users.js +87 -72
- package/backend/dist/cjs/utils.d.ts +17 -9
- package/backend/dist/cjs/utils.js +22 -64
- package/backend/dist/cjs/view.d.ts +2 -2
- package/backend/dist/cjs/view.js +38 -40
- package/backend/dist/cjs/volt.d.ts +3 -2
- package/backend/dist/cjs/volt.js +2 -2
- package/backend/dist/css/volt.css +5 -0
- package/backend/dist/esm/database.d.ts +41 -68
- package/backend/dist/esm/database.js +137 -79
- package/backend/dist/esm/endpoint.d.ts +23 -9
- package/backend/dist/esm/endpoint.js +99 -22
- package/backend/dist/esm/file_watcher.js +2 -2
- package/backend/dist/esm/frontend.d.ts +0 -2
- package/backend/dist/esm/frontend.js +9 -9
- package/backend/dist/esm/image_endpoint.d.ts +3 -1
- package/backend/dist/esm/image_endpoint.js +2 -1
- package/backend/dist/esm/payments/paddle.js +11 -3
- package/backend/dist/esm/plugins/css.d.ts +6 -5
- package/backend/dist/esm/plugins/css.js +32 -6
- package/backend/dist/esm/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm/plugins/ts/compiler.js +26 -2
- package/backend/dist/esm/plugins/ts/preprocessing.js +5 -3
- package/backend/dist/esm/server.d.ts +7 -13
- package/backend/dist/esm/server.js +182 -301
- package/backend/dist/esm/status.d.ts +1 -0
- package/backend/dist/esm/status.js +1 -0
- package/backend/dist/esm/stream.d.ts +5 -3
- package/backend/dist/esm/stream.js +13 -4
- package/backend/dist/esm/users.d.ts +1 -1
- package/backend/dist/esm/users.js +87 -72
- package/backend/dist/esm/utils.d.ts +17 -9
- package/backend/dist/esm/utils.js +21 -62
- package/backend/dist/esm/view.d.ts +2 -2
- package/backend/dist/esm/view.js +38 -40
- package/backend/dist/esm/volt.d.ts +3 -2
- package/backend/dist/esm/volt.js +2 -1
- package/backend/dist/esm-dev/blacklist.js +1 -1
- package/backend/dist/esm-dev/cli.js +2 -2
- package/backend/dist/esm-dev/database.d.ts +41 -68
- package/backend/dist/esm-dev/database.js +138 -80
- package/backend/dist/esm-dev/endpoint.d.ts +23 -9
- package/backend/dist/esm-dev/endpoint.js +100 -23
- package/backend/dist/esm-dev/file_watcher.js +3 -3
- package/backend/dist/esm-dev/frontend.d.ts +0 -2
- package/backend/dist/esm-dev/frontend.js +9 -9
- package/backend/dist/esm-dev/image_endpoint.d.ts +3 -1
- package/backend/dist/esm-dev/image_endpoint.js +2 -1
- package/backend/dist/esm-dev/logger.js +1 -1
- package/backend/dist/esm-dev/payments/paddle.js +12 -4
- package/backend/dist/esm-dev/plugins/css.d.ts +6 -5
- package/backend/dist/esm-dev/plugins/css.js +33 -7
- package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +6 -1
- package/backend/dist/esm-dev/plugins/ts/compiler.js +27 -3
- package/backend/dist/esm-dev/plugins/ts/preprocessing.js +7 -5
- package/backend/dist/esm-dev/rate_limit.js +1 -1
- package/backend/dist/esm-dev/server.d.ts +7 -13
- package/backend/dist/esm-dev/server.js +184 -303
- package/backend/dist/esm-dev/status.d.ts +1 -0
- package/backend/dist/esm-dev/status.js +1 -0
- package/backend/dist/esm-dev/stream.d.ts +5 -3
- package/backend/dist/esm-dev/stream.js +13 -4
- package/backend/dist/esm-dev/users.d.ts +1 -1
- package/backend/dist/esm-dev/users.js +88 -73
- package/backend/dist/esm-dev/utils.d.ts +17 -9
- package/backend/dist/esm-dev/utils.js +22 -63
- package/backend/dist/esm-dev/view.d.ts +2 -2
- package/backend/dist/esm-dev/view.js +39 -41
- package/backend/dist/esm-dev/volt.d.ts +3 -2
- package/backend/dist/esm-dev/volt.js +2 -1
- package/backend/src/database.ts +173 -155
- package/backend/src/endpoint.ts +123 -31
- package/backend/src/file_watcher.ts +2 -2
- package/backend/src/frontend.ts +9 -8
- package/backend/src/image_endpoint.ts +4 -0
- package/backend/src/payments/paddle.ts +11 -3
- package/backend/src/plugins/css.ts +36 -8
- package/backend/src/plugins/ts/compiler.ts +37 -1
- package/backend/src/plugins/ts/preprocessing.ts +5 -3
- package/backend/src/server.ts +167 -306
- package/backend/src/status.ts +1 -0
- package/backend/src/stream.ts +28 -8
- package/backend/src/users.ts +87 -72
- package/backend/src/utils.ts +58 -25
- package/backend/src/view.ts +30 -28
- package/backend/src/{volt.js → volt.ts} +2 -1
- package/backend/tsconfig.cjs.json +3 -3
- package/backend/tsconfig.esm.json +3 -3
- package/frontend/dist/elements/base.d.ts +414 -432
- package/frontend/dist/elements/base.js +566 -329
- package/frontend/dist/elements/module.d.ts +26 -12
- package/frontend/dist/elements/module.js +69 -32
- package/frontend/dist/elements/register_element.d.ts +3 -0
- package/frontend/dist/elements/register_element.js +22 -0
- package/frontend/dist/modules/auth.d.ts +1 -0
- package/frontend/dist/modules/auth.js +6 -5
- package/frontend/dist/modules/color.d.ts +159 -0
- package/frontend/dist/modules/color.js +315 -0
- package/frontend/dist/modules/colors.d.ts +1 -26
- package/frontend/dist/modules/colors.js +417 -340
- package/frontend/dist/modules/cookies.d.ts +1 -0
- package/frontend/dist/modules/cookies.js +1 -0
- package/frontend/dist/modules/events.d.ts +1 -0
- package/frontend/dist/modules/events.js +1 -0
- package/frontend/dist/modules/google.d.ts +1 -0
- package/frontend/dist/modules/google.js +1 -0
- package/frontend/dist/modules/meta.d.ts +1 -0
- package/frontend/dist/modules/meta.js +1 -0
- package/frontend/dist/modules/mutex.d.ts +1 -2
- package/frontend/dist/modules/mutex.js +3 -4
- package/frontend/dist/modules/paddle.d.ts +1 -0
- package/frontend/dist/modules/paddle.js +14 -13
- package/frontend/dist/modules/scheme.d.ts +1 -0
- package/frontend/dist/modules/scheme.js +5 -3
- package/frontend/dist/modules/statics.d.ts +1 -0
- package/frontend/dist/modules/statics.js +1 -0
- package/frontend/dist/modules/support.d.ts +1 -0
- package/frontend/dist/modules/support.js +3 -2
- package/frontend/dist/modules/theme.d.ts +56 -0
- package/frontend/dist/{ui → modules}/theme.js +186 -75
- package/frontend/dist/modules/themes.d.ts +1 -1
- package/frontend/dist/modules/themes.js +1 -0
- package/frontend/dist/modules/user.d.ts +1 -0
- package/frontend/dist/modules/user.js +11 -10
- package/frontend/dist/modules/utils.d.ts +23 -2
- package/frontend/dist/modules/utils.js +93 -1
- package/frontend/dist/types/gradient.js +4 -0
- package/frontend/dist/ui/border_button.d.ts +0 -25
- package/frontend/dist/ui/border_button.js +50 -51
- package/frontend/dist/ui/button.d.ts +0 -21
- package/frontend/dist/ui/button.js +41 -46
- package/frontend/dist/ui/canvas.js +15 -15
- package/frontend/dist/ui/checkbox.d.ts +3 -17
- package/frontend/dist/ui/checkbox.js +36 -30
- package/frontend/dist/ui/code.d.ts +15 -82
- package/frontend/dist/ui/code.js +150 -125
- package/frontend/dist/ui/color.d.ts +0 -1
- package/frontend/dist/ui/color.js +1 -1
- package/frontend/dist/ui/context_menu.d.ts +4 -2
- package/frontend/dist/ui/context_menu.js +16 -17
- package/frontend/dist/ui/css.js +2 -0
- package/frontend/dist/ui/divider.d.ts +0 -7
- package/frontend/dist/ui/divider.js +21 -25
- package/frontend/dist/ui/dropdown.d.ts +13 -7
- package/frontend/dist/ui/dropdown.js +65 -30
- package/frontend/dist/ui/for_each.d.ts +0 -5
- package/frontend/dist/ui/for_each.js +17 -22
- package/frontend/dist/ui/form.d.ts +17 -12
- package/frontend/dist/ui/form.js +21 -18
- package/frontend/dist/ui/frame_modes.d.ts +9 -12
- package/frontend/dist/ui/frame_modes.js +8 -10
- package/frontend/dist/ui/google_map.d.ts +0 -11
- package/frontend/dist/ui/google_map.js +23 -28
- package/frontend/dist/ui/gradient.d.ts +0 -5
- package/frontend/dist/ui/gradient.js +17 -22
- package/frontend/dist/ui/image.d.ts +27 -58
- package/frontend/dist/ui/image.js +99 -93
- package/frontend/dist/ui/input.d.ts +20 -97
- package/frontend/dist/ui/input.js +192 -170
- package/frontend/dist/ui/link.d.ts +0 -18
- package/frontend/dist/ui/link.js +42 -48
- package/frontend/dist/ui/list.js +36 -37
- package/frontend/dist/ui/loader_button.d.ts +4 -19
- package/frontend/dist/ui/loader_button.js +35 -37
- package/frontend/dist/ui/loaders.d.ts +0 -8
- package/frontend/dist/ui/loaders.js +20 -25
- package/frontend/dist/ui/popup.d.ts +11 -8
- package/frontend/dist/ui/popup.js +183 -24
- package/frontend/dist/ui/pseudo.d.ts +3 -3
- package/frontend/dist/ui/pseudo.js +14 -17
- package/frontend/dist/ui/scroller.d.ts +10 -48
- package/frontend/dist/ui/scroller.js +306 -300
- package/frontend/dist/ui/slider.d.ts +9 -3
- package/frontend/dist/ui/slider.js +31 -17
- package/frontend/dist/ui/spacer.d.ts +0 -9
- package/frontend/dist/ui/spacer.js +21 -26
- package/frontend/dist/ui/span.js +13 -15
- package/frontend/dist/ui/stack.d.ts +14 -75
- package/frontend/dist/ui/stack.js +166 -169
- package/frontend/dist/ui/steps.d.ts +10 -23
- package/frontend/dist/ui/steps.js +47 -34
- package/frontend/dist/ui/style.d.ts +4 -3
- package/frontend/dist/ui/style.js +13 -18
- package/frontend/dist/ui/switch.d.ts +10 -4
- package/frontend/dist/ui/switch.js +24 -16
- package/frontend/dist/ui/table.d.ts +0 -23
- package/frontend/dist/ui/table.js +113 -119
- package/frontend/dist/ui/tabs.d.ts +3 -19
- package/frontend/dist/ui/tabs.js +35 -29
- package/frontend/dist/ui/text.d.ts +0 -8
- package/frontend/dist/ui/text.js +20 -25
- package/frontend/dist/ui/title.d.ts +0 -15
- package/frontend/dist/ui/title.js +39 -45
- package/frontend/dist/ui/ui.d.ts +0 -2
- package/frontend/dist/ui/ui.js +0 -2
- package/frontend/dist/ui/view.d.ts +3 -17
- package/frontend/dist/ui/view.js +27 -32
- package/frontend/dist/volt.d.ts +2 -1
- package/frontend/dist/volt.js +3 -1
- package/frontend/examples/dashboard/dashboard.ts +774 -0
- package/frontend/examples/theme/theme.ts +58 -0
- package/frontend/src/css/volt.css +5 -0
- package/frontend/src/elements/base.ts +767 -545
- package/frontend/src/elements/module.ts +90 -29
- package/frontend/src/elements/register_element.ts +24 -0
- package/frontend/src/modules/auth.ts +7 -6
- package/frontend/src/modules/color.ts +348 -0
- package/frontend/src/modules/colors.ts +468 -449
- package/frontend/src/modules/cookies.ts +1 -0
- package/frontend/src/modules/events.ts +1 -0
- package/frontend/src/modules/google.ts +1 -0
- package/frontend/src/modules/meta.ts +2 -1
- package/frontend/src/modules/mutex.ts +2 -4
- package/frontend/src/modules/paddle.ts +21 -20
- package/frontend/src/modules/scheme.ts +5 -4
- package/frontend/src/modules/statics.ts +2 -1
- package/frontend/src/modules/support.ts +3 -2
- package/frontend/src/modules/theme.ts +413 -0
- package/frontend/src/modules/themes.ts +2 -1
- package/frontend/src/modules/user.ts +12 -11
- package/frontend/src/modules/utils.ts +125 -2
- package/frontend/src/ui/border_button.ts +41 -37
- package/frontend/src/ui/button.ts +33 -32
- package/frontend/src/ui/canvas.ts +5 -2
- package/frontend/src/ui/checkbox.ts +21 -22
- package/frontend/src/ui/code.ts +92 -86
- package/frontend/src/ui/context_menu.ts +7 -5
- package/frontend/src/ui/css.ts +1 -1
- package/frontend/src/ui/divider.ts +15 -10
- package/frontend/src/ui/dropdown.ts +38 -21
- package/frontend/src/ui/for_each.ts +9 -8
- package/frontend/src/ui/form.ts +26 -21
- package/frontend/src/ui/frame_modes.ts +13 -17
- package/frontend/src/ui/google_map.ts +15 -13
- package/frontend/src/ui/gradient.ts +9 -8
- package/frontend/src/ui/image.ts +108 -86
- package/frontend/src/ui/input.ts +145 -144
- package/frontend/src/ui/link.ts +25 -23
- package/frontend/src/ui/list.ts +12 -6
- package/frontend/src/ui/loader_button.ts +26 -25
- package/frontend/src/ui/loaders.ts +12 -11
- package/frontend/src/ui/popup.ts +168 -14
- package/frontend/src/ui/pseudo.ts +5 -3
- package/frontend/src/ui/scroller.ts +303 -294
- package/frontend/src/ui/slider.ts +15 -10
- package/frontend/src/ui/spacer.ts +14 -11
- package/frontend/src/ui/span.ts +6 -2
- package/frontend/src/ui/stack.ts +196 -183
- package/frontend/src/ui/steps.ts +38 -22
- package/frontend/src/ui/style.ts +7 -4
- package/frontend/src/ui/switch.ts +16 -11
- package/frontend/src/ui/table.ts +42 -34
- package/frontend/src/ui/tabs.ts +20 -19
- package/frontend/src/ui/text.ts +12 -11
- package/frontend/src/ui/title.ts +22 -20
- package/frontend/src/ui/ui.ts +0 -2
- package/frontend/src/ui/view.ts +20 -19
- package/frontend/src/volt.ts +3 -1
- package/frontend/{compile.js → tools/compile.old.js} +2 -2
- package/frontend/tools/embed_scripts.js +69 -0
- package/frontend/tsconfig.json +26 -0
- package/package.json +7 -6
- package/frontend/dist/ui/theme.d.ts +0 -25
- package/frontend/exports.json +0 -1340
- package/frontend/src/modules/date.js +0 -535
- package/frontend/src/ui/color.ts +0 -117
- package/frontend/src/ui/theme.ts +0 -279
- /package/backend/src/{vinc.dev.js → vinc.dev.ts} +0 -0
package/frontend/src/ui/steps.ts
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, isVElement } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, isVElement, VElementTagMap } from "../elements/module.js"
|
|
8
8
|
import { VStack, VStackElement, HStack, HStackElement } from "./stack"
|
|
9
9
|
import { Divider, DividerElement } from "./divider"
|
|
10
10
|
import { Span } from "./span"
|
|
11
11
|
import { ForEach } from "./for_each"
|
|
12
12
|
|
|
13
|
-
interface
|
|
13
|
+
export interface StepContentOptions {
|
|
14
14
|
content: any[];
|
|
15
15
|
title?: string;
|
|
16
16
|
hstack?: boolean;
|
|
@@ -50,24 +50,26 @@ interface ContentObject {
|
|
|
50
50
|
@type: string, number
|
|
51
51
|
@default: "1.25em"
|
|
52
52
|
*/
|
|
53
|
-
@Elements.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
@Elements.create({
|
|
54
|
+
name: "StepsElement",
|
|
55
|
+
default_style: {
|
|
56
|
+
...VStackElement.default_style,
|
|
57
|
+
"--steps-tint": "gray",
|
|
58
|
+
"--steps-tint-opac": 1,
|
|
59
|
+
"--steps-step-bg": "gray",
|
|
60
|
+
"--steps-step-border": "gray",
|
|
61
|
+
"--steps-step-border-radius": "50%",
|
|
62
|
+
"--steps-div-bg": "gray",
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
export class StepsElement extends (VStackElement as any as VElementBaseSignature) {
|
|
65
66
|
|
|
66
67
|
public _tint: string;
|
|
67
68
|
public _tint_opac: number;
|
|
68
69
|
public _step_bg: string;
|
|
69
70
|
public _step_border: string;
|
|
70
71
|
public _step_border_radius: string;
|
|
72
|
+
public _step_margin_right: string = "1em";
|
|
71
73
|
public _div_bg: string;
|
|
72
74
|
public _step_nr_nodes: (VStackElement & { bg: VStackElement }) [] = [];
|
|
73
75
|
public _step_nodes: HStackElement[] = [];
|
|
@@ -77,15 +79,13 @@ export class StepsElement extends VStackElement {
|
|
|
77
79
|
// Constructor.
|
|
78
80
|
constructor({
|
|
79
81
|
content = [],
|
|
80
|
-
spacing = "1.25em",
|
|
81
82
|
}: {
|
|
82
|
-
|
|
83
|
-
spacing?: string | number,
|
|
83
|
+
content: any[] | any[][] | StepContentOptions[],
|
|
84
84
|
}) {
|
|
85
85
|
|
|
86
86
|
// Inherit.
|
|
87
87
|
super();
|
|
88
|
-
this.
|
|
88
|
+
this._init({
|
|
89
89
|
derived: StepsElement,
|
|
90
90
|
});
|
|
91
91
|
|
|
@@ -97,7 +97,7 @@ export class StepsElement extends VStackElement {
|
|
|
97
97
|
if (Array.isArray(content[i]) || isVElement(content[i])) {
|
|
98
98
|
content[i] = {
|
|
99
99
|
content: content[i],
|
|
100
|
-
|
|
100
|
+
} as StepContentOptions;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -110,6 +110,7 @@ export class StepsElement extends VStackElement {
|
|
|
110
110
|
this._div_bg = StepsElement.default_style["--steps-div-bg"];
|
|
111
111
|
|
|
112
112
|
// Build.
|
|
113
|
+
const spacing = "1.25em";
|
|
113
114
|
this.append(ForEach(content, (item, index, is_last) => {
|
|
114
115
|
|
|
115
116
|
// Build divider.
|
|
@@ -125,7 +126,7 @@ export class StepsElement extends VStackElement {
|
|
|
125
126
|
// Build content.
|
|
126
127
|
const content = (item.hstack ? HStack() : VStack())
|
|
127
128
|
.z_index(1)
|
|
128
|
-
// .width(100%)
|
|
129
|
+
// .width("100%")
|
|
129
130
|
.stretch(true)
|
|
130
131
|
.overflow("hidden"); // required otherwise when inside Tabs will mess up.
|
|
131
132
|
if (typeof item.title === "string") {
|
|
@@ -170,7 +171,7 @@ export class StepsElement extends VStackElement {
|
|
|
170
171
|
.font_size("0.7em")
|
|
171
172
|
.flex_shrink(0)
|
|
172
173
|
.frame("1.8em", "1.8em")
|
|
173
|
-
|
|
174
|
+
.margin("0.2em", this._step_margin_right, null, null)
|
|
174
175
|
// .border_radius(this._step_border_radius)
|
|
175
176
|
.border_radius(5)
|
|
176
177
|
.border(1, this._step_border)
|
|
@@ -181,7 +182,7 @@ export class StepsElement extends VStackElement {
|
|
|
181
182
|
divider,
|
|
182
183
|
content,
|
|
183
184
|
)
|
|
184
|
-
.fixed_width(100%)
|
|
185
|
+
.fixed_width("100%")
|
|
185
186
|
.margin_top(index > 0 ? spacing : 0)
|
|
186
187
|
.position("relative")
|
|
187
188
|
.exec(e => this._step_nodes.append(e))
|
|
@@ -311,6 +312,21 @@ export class StepsElement extends VStackElement {
|
|
|
311
312
|
return this;
|
|
312
313
|
}
|
|
313
314
|
|
|
315
|
+
/* @docs:
|
|
316
|
+
@title: Set step number border radius
|
|
317
|
+
@description: Set or get the step number border radius.
|
|
318
|
+
*/
|
|
319
|
+
step_number_margin_right(): string;
|
|
320
|
+
step_number_margin_right(value: string): this;
|
|
321
|
+
step_number_margin_right(value?: string): this | string {
|
|
322
|
+
if (value == null) { return this._step_margin_right; }
|
|
323
|
+
this._step_margin_right = value;
|
|
324
|
+
this._step_nr_nodes.iterate(node => {
|
|
325
|
+
node.margin_right(value);
|
|
326
|
+
})
|
|
327
|
+
return this;
|
|
328
|
+
}
|
|
329
|
+
|
|
314
330
|
/* @docs:
|
|
315
331
|
@title: Iterate step number nodes
|
|
316
332
|
@description: Iterate the step number nodes. When the callback returns any non null value the iteration will be stopped.
|
package/frontend/src/ui/style.ts
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, VHTMLElement } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, VHTMLElement } from "../elements/module.js"
|
|
8
8
|
|
|
9
9
|
// Span.
|
|
10
|
-
@Elements.
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
@Elements.create({
|
|
11
|
+
name: "StyleElement",
|
|
12
|
+
tag: "section",
|
|
13
|
+
})
|
|
14
|
+
export class StyleElement extends (VHTMLElement as any as VElementBaseSignature) {
|
|
15
|
+
|
|
13
16
|
constructor(style?: CSSStyleDeclaration) {
|
|
14
17
|
|
|
15
18
|
// Initialize base class.
|
|
@@ -4,18 +4,21 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement } from "../elements/module.js"
|
|
8
8
|
import { VStack, VStackElement } from "./stack"
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export namespace SwitchElement {
|
|
11
|
+
export type OnChangeCallback<This> = (element: This, enabled: boolean) => void;
|
|
12
|
+
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// Switch button.
|
|
15
|
+
@Elements.create({
|
|
16
|
+
name: "SwitchElement",
|
|
17
|
+
})
|
|
18
|
+
export class SwitchElement extends (VStackElement as any as VElementBaseSignature) {
|
|
16
19
|
|
|
17
20
|
// Attributes.
|
|
18
|
-
|
|
21
|
+
public on_change_handler: SwitchElement.OnChangeCallback<this>;
|
|
19
22
|
public _enabled: boolean;
|
|
20
23
|
public _enabled_color: string;
|
|
21
24
|
public _disabled_color: string
|
|
@@ -29,7 +32,9 @@ export class SwitchElement extends VStackElement {
|
|
|
29
32
|
|
|
30
33
|
// Initialize base class.
|
|
31
34
|
super();
|
|
32
|
-
this.
|
|
35
|
+
this._init({
|
|
36
|
+
derived: SwitchElement,
|
|
37
|
+
});
|
|
33
38
|
|
|
34
39
|
// The slider background.
|
|
35
40
|
this.slider = VStack()
|
|
@@ -269,11 +274,11 @@ export class SwitchElement extends VStackElement {
|
|
|
269
274
|
|
|
270
275
|
// Set the on change handler.
|
|
271
276
|
// @ts-expect-error
|
|
272
|
-
on_change()
|
|
277
|
+
on_change(): SwitchElement.OnChangeCallback<this>;
|
|
273
278
|
// @ts-expect-error
|
|
274
|
-
on_change(handler: OnChangeCallback) : this;
|
|
279
|
+
on_change(handler: SwitchElement.OnChangeCallback<this>) : this;
|
|
275
280
|
// @ts-expect-error
|
|
276
|
-
on_change(handler?: OnChangeCallback)
|
|
281
|
+
on_change(handler?: SwitchElement.OnChangeCallback<this>): SwitchElement.OnChangeCallback<this> | this {
|
|
277
282
|
if (handler == null) {
|
|
278
283
|
return this.on_change_handler;
|
|
279
284
|
}
|
package/frontend/src/ui/table.ts
CHANGED
|
@@ -4,16 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, VElementTagMap, VDivElement } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, VElementTagMap, VDivElement } from "../elements/module.js"
|
|
8
8
|
import { Scheme } from "../modules/scheme"
|
|
9
9
|
|
|
10
10
|
// Table head element.
|
|
11
|
-
@Elements.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
static default_style = {
|
|
11
|
+
@Elements.create({
|
|
12
|
+
name: "TableHeadElement",
|
|
13
|
+
default_style: {
|
|
15
14
|
"padding": "0px",
|
|
16
|
-
}
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
export class TableHeadElement extends VElementTagMap.thead {
|
|
17
18
|
|
|
18
19
|
// Constructor.
|
|
19
20
|
constructor(...content: any[]) {
|
|
@@ -32,13 +33,14 @@ export const NullTableHead = Elements.create_null(TableHeadElement);
|
|
|
32
33
|
declare module './any_element.d.ts' { interface AnyElementMap { TableHeadElement: TableHeadElement }}
|
|
33
34
|
|
|
34
35
|
// Table header element.
|
|
35
|
-
@Elements.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
static default_style = {
|
|
36
|
+
@Elements.create({
|
|
37
|
+
name: "TableHeaderElement",
|
|
38
|
+
default_style: {
|
|
39
39
|
"text-align": "left",
|
|
40
40
|
"padding": "0px 10px",
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
export class TableHeaderElement extends VElementTagMap.th {
|
|
42
44
|
|
|
43
45
|
// Constructor.
|
|
44
46
|
constructor(...content: any[]) {
|
|
@@ -57,12 +59,13 @@ export const NullTableHeader = Elements.create_null(TableHeaderElement);
|
|
|
57
59
|
declare module './any_element.d.ts' { interface AnyElementMap { TableHeaderElement: TableHeaderElement }}
|
|
58
60
|
|
|
59
61
|
// Table body element.
|
|
60
|
-
@Elements.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
static default_style = {
|
|
62
|
+
@Elements.create({
|
|
63
|
+
name: "TableBodyElement",
|
|
64
|
+
default_style: {
|
|
64
65
|
"padding": "0px",
|
|
65
|
-
}
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
export class TableBodyElement extends VElementTagMap.tbody {
|
|
66
69
|
|
|
67
70
|
// Constructor.
|
|
68
71
|
constructor(...content: any[]) {
|
|
@@ -82,9 +85,11 @@ declare module './any_element.d.ts' { interface AnyElementMap { TableBodyElement
|
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
// Table row element.
|
|
85
|
-
@Elements.
|
|
88
|
+
@Elements.create({
|
|
89
|
+
name: "TableRowElement",
|
|
90
|
+
})
|
|
86
91
|
export class TableRowElement extends VElementTagMap.tr {
|
|
87
|
-
|
|
92
|
+
|
|
88
93
|
// Constructor.
|
|
89
94
|
constructor(...content: any[]) {
|
|
90
95
|
|
|
@@ -102,13 +107,14 @@ export const NullTableRow = Elements.create_null(TableRowElement);
|
|
|
102
107
|
declare module './any_element.d.ts' { interface AnyElementMap { TableRowElement: TableRowElement }}
|
|
103
108
|
|
|
104
109
|
// Table data element.
|
|
105
|
-
@Elements.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
static default_style = {
|
|
110
|
+
@Elements.create({
|
|
111
|
+
name: "TableDataElement",
|
|
112
|
+
default_style: {
|
|
109
113
|
"text-align": "left",
|
|
110
114
|
"padding": "0px 10px",
|
|
111
|
-
}
|
|
115
|
+
},
|
|
116
|
+
})
|
|
117
|
+
export class TableDataElement extends VElementTagMap.td {
|
|
112
118
|
|
|
113
119
|
// Constructor.
|
|
114
120
|
constructor(...content: any[]) {
|
|
@@ -129,15 +135,16 @@ declare module './any_element.d.ts' { interface AnyElementMap { TableDataElement
|
|
|
129
135
|
// Inner Table element.
|
|
130
136
|
// Use a container for the Table element so a border color + border radius can be set.
|
|
131
137
|
// Since border-collapse collapse prevents a border radius but is required for different background for the table head.
|
|
132
|
-
@Elements.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
static default_style = {
|
|
138
|
+
@Elements.create({
|
|
139
|
+
name: "InnerTableElement",
|
|
140
|
+
default_style: {
|
|
136
141
|
"border-collapse": "collapse", /* Ensures there is no spacing between table cells */
|
|
137
142
|
"padding": "0",
|
|
138
143
|
"margin": 0,
|
|
139
144
|
"border-spacing": 0, /* Removes any default spacing between cells */
|
|
140
|
-
}
|
|
145
|
+
},
|
|
146
|
+
})
|
|
147
|
+
export class InnerTableElement extends VElementTagMap.table {
|
|
141
148
|
|
|
142
149
|
// Constructor.
|
|
143
150
|
constructor(...content: any[]) {
|
|
@@ -156,12 +163,13 @@ export const NullInnerTable = Elements.create_null(InnerTableElement);
|
|
|
156
163
|
declare module './any_element.d.ts' { interface AnyElementMap { InnerTableElement: InnerTableElement }}
|
|
157
164
|
|
|
158
165
|
// Table data element.
|
|
159
|
-
@Elements.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
static default_style = {
|
|
166
|
+
@Elements.create({
|
|
167
|
+
name: "TableElement",
|
|
168
|
+
default_style: {
|
|
163
169
|
"color": "black",
|
|
164
|
-
}
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
export class TableElement extends VElementTagMap.div {
|
|
165
173
|
|
|
166
174
|
// Attributes.
|
|
167
175
|
public table_rows: TableRowElement[];
|
|
@@ -268,7 +276,7 @@ export class TableElement extends VElementTagMap.div {
|
|
|
268
276
|
)
|
|
269
277
|
.parent(this),
|
|
270
278
|
)
|
|
271
|
-
.width(100%)
|
|
279
|
+
.width("100%")
|
|
272
280
|
)
|
|
273
281
|
}
|
|
274
282
|
|
package/frontend/src/ui/tabs.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement } from "../elements/module.js"
|
|
8
8
|
import { Scheme } from "../modules/scheme"
|
|
9
9
|
import { VStack, VStackElement, HStack, HStackElement, ZStack } from "./stack"
|
|
10
10
|
import { ForEach } from "./for_each"
|
|
@@ -60,20 +60,21 @@ type OnTabHeader = ((name: string, header: HStackElement, tab: TabsElement) => a
|
|
|
60
60
|
A callback that can be set to edit the tab's header title node.
|
|
61
61
|
The callback takes the arguments local header node and parent tabs node as `(header_node, tabs_node)`.
|
|
62
62
|
*/
|
|
63
|
-
@Elements.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
63
|
+
@Elements.create({
|
|
64
|
+
name: "TabsElement",
|
|
65
|
+
default_style: {
|
|
66
|
+
...VStackElement.default_style,
|
|
67
|
+
"font-size": "16px",
|
|
68
|
+
"font-weight": "500",
|
|
69
|
+
"overflow-x": "hidden",
|
|
70
|
+
"width": "100%",
|
|
71
|
+
"--tabs-tint": "blue",
|
|
72
|
+
"--tabs-tab-opac": 0.8,
|
|
73
|
+
"--tabs-div-bg": "gray",
|
|
74
|
+
"--tabs-div-opac": 0.5,
|
|
75
|
+
},
|
|
76
|
+
})
|
|
77
|
+
export class TabsElement extends (VStackElement as any as VElementBaseSignature) {
|
|
77
78
|
|
|
78
79
|
// Attributes.
|
|
79
80
|
public _tint: string;
|
|
@@ -101,7 +102,7 @@ export class TabsElement extends VStackElement {
|
|
|
101
102
|
|
|
102
103
|
// Inherit.
|
|
103
104
|
super();
|
|
104
|
-
this.
|
|
105
|
+
this._init({
|
|
105
106
|
derived: TabsElement,
|
|
106
107
|
})
|
|
107
108
|
|
|
@@ -293,10 +294,10 @@ export class TabsElement extends VStackElement {
|
|
|
293
294
|
return item;
|
|
294
295
|
}),
|
|
295
296
|
)
|
|
296
|
-
.width(100%),
|
|
297
|
+
.width("100%"),
|
|
297
298
|
|
|
298
299
|
this._div = Divider()
|
|
299
|
-
.frame(100
|
|
300
|
+
.frame("100%", 1)
|
|
300
301
|
.background(this._div_bg)
|
|
301
302
|
.margin(1, 0, 25, 0),
|
|
302
303
|
|
|
@@ -316,7 +317,7 @@ export class TabsElement extends VStackElement {
|
|
|
316
317
|
if (content_stack.overflow_x() === "visible") {
|
|
317
318
|
content_stack.overflow_x("hidden");
|
|
318
319
|
}
|
|
319
|
-
content_stack.width(100%);
|
|
320
|
+
content_stack.width("100%");
|
|
320
321
|
content_stack.transition(`opacity ${this._duration}ms ease-in-out`)
|
|
321
322
|
zstack.append(content_stack);
|
|
322
323
|
++index;
|
package/frontend/src/ui/text.ts
CHANGED
|
@@ -4,20 +4,21 @@
|
|
|
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
|
// Text.
|
|
10
|
-
@Elements.
|
|
10
|
+
@Elements.create({
|
|
11
|
+
name: "TextElement",
|
|
12
|
+
default_style: {
|
|
13
|
+
"margin": "0px 0px 0px 0px",
|
|
14
|
+
"padding": "0", // 2.5px
|
|
15
|
+
"font-size": "20px",
|
|
16
|
+
"color": "inherit",
|
|
17
|
+
"text-align": "inherit",
|
|
18
|
+
"white-space": "wrap",
|
|
19
|
+
}
|
|
20
|
+
})
|
|
11
21
|
export class TextElement extends VElementTagMap.p {
|
|
12
|
-
|
|
13
|
-
static default_style = {
|
|
14
|
-
"margin": "0px 0px 0px 0px",
|
|
15
|
-
"padding": "0", // 2.5px
|
|
16
|
-
"font-size": "20px",
|
|
17
|
-
"color": "inherit",
|
|
18
|
-
"text-align": "inherit",
|
|
19
|
-
"white-space": "wrap",
|
|
20
|
-
};
|
|
21
22
|
|
|
22
23
|
// Constructor.
|
|
23
24
|
constructor(text?: string) {
|
package/frontend/src/ui/title.ts
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
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
|
// Title.
|
|
10
|
-
@Elements.
|
|
10
|
+
@Elements.create({
|
|
11
|
+
name: "TitleElement",
|
|
12
|
+
default_style: {
|
|
13
|
+
"margin": "0px 0px 0px 0px",
|
|
14
|
+
"color": "inherit",
|
|
15
|
+
"white-space": "wrap",
|
|
16
|
+
"text-align": "inherit",
|
|
17
|
+
"font-weight": "700", // for safari since it inherits HTMLElement only.
|
|
18
|
+
}
|
|
19
|
+
})
|
|
11
20
|
export class TitleElement extends VElementTagMap.h1 {
|
|
12
|
-
|
|
13
|
-
static default_style = {
|
|
14
|
-
"margin": "0px 0px 0px 0px",
|
|
15
|
-
"color": "inherit",
|
|
16
|
-
"white-space": "wrap",
|
|
17
|
-
"text-align": "inherit",
|
|
18
|
-
"font-weight": "700", // for safari since it inherits HTMLElement only.
|
|
19
|
-
}
|
|
20
21
|
|
|
21
22
|
// Constructor.
|
|
22
23
|
constructor(text: string = "") {
|
|
@@ -35,17 +36,18 @@ export const NullTitle = Elements.create_null(TitleElement);
|
|
|
35
36
|
declare module './any_element.d.ts' { interface AnyElementMap { TitleElement: TitleElement }}
|
|
36
37
|
|
|
37
38
|
// Subtitle.
|
|
38
|
-
@Elements.
|
|
39
|
+
@Elements.create({
|
|
40
|
+
name: "SubtitleElement",
|
|
41
|
+
tag: "h2",
|
|
42
|
+
default_style: {
|
|
43
|
+
"margin": "0px 0px 0px 0px",
|
|
44
|
+
"color": "inherit",
|
|
45
|
+
"white-space": "wrap",
|
|
46
|
+
"text-align": "inherit",
|
|
47
|
+
"font-weight": "700", // for safari since it inherits HTMLElement only.
|
|
48
|
+
},
|
|
49
|
+
})
|
|
39
50
|
export class SubtitleElement extends VElementTagMap.h1 {
|
|
40
|
-
|
|
41
|
-
static element_tag = "h2";
|
|
42
|
-
static default_style = {
|
|
43
|
-
"margin": "0px 0px 0px 0px",
|
|
44
|
-
"color": "inherit",
|
|
45
|
-
"white-space": "wrap",
|
|
46
|
-
"text-align": "inherit",
|
|
47
|
-
"font-weight": "700", // for safari since it inherits HTMLElement only.
|
|
48
|
-
};
|
|
49
51
|
|
|
50
52
|
// Constructor.
|
|
51
53
|
constructor(text: string = "") {
|
package/frontend/src/ui/ui.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from "./border_button.js"
|
|
|
8
8
|
export * from "./canvas.js"
|
|
9
9
|
export * from "./checkbox.js"
|
|
10
10
|
export * from "./code.js"
|
|
11
|
-
export * from "./color.js"
|
|
12
11
|
export * from "./context_menu.js"
|
|
13
12
|
export * from "./css.js"
|
|
14
13
|
export * from "./divider.js"
|
|
@@ -34,7 +33,6 @@ export * from "./switch.js"
|
|
|
34
33
|
export * from "./table.js"
|
|
35
34
|
export * from "./tabs.js"
|
|
36
35
|
export * from "./text.js"
|
|
37
|
-
export * from "./theme.js"
|
|
38
36
|
export * from "./title.js"
|
|
39
37
|
export * from "./view.js"
|
|
40
38
|
export type { AnyElement } from "./any_element.d.ts"
|
package/frontend/src/ui/view.ts
CHANGED
|
@@ -4,30 +4,31 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, VElementTagMap } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, VElementTagMap, AppendType } from "../elements/module.js"
|
|
8
8
|
|
|
9
9
|
// Scroller.
|
|
10
|
-
@Elements.
|
|
10
|
+
@Elements.create({
|
|
11
|
+
name: "ViewElement",
|
|
12
|
+
default_style: {
|
|
13
|
+
"position": "absolute",
|
|
14
|
+
"top": "0",
|
|
15
|
+
"right": "0",
|
|
16
|
+
"bottom": "0",
|
|
17
|
+
"left": "0",
|
|
18
|
+
"padding": "0px",
|
|
19
|
+
"overflow": "hidden",
|
|
20
|
+
"overflow-y": "none",
|
|
21
|
+
"background": "none",
|
|
22
|
+
"display": "flex", // to support vertical spacers.
|
|
23
|
+
// "text-align": "start",
|
|
24
|
+
"align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
25
|
+
"flex-direction": "column",
|
|
26
|
+
},
|
|
27
|
+
})
|
|
11
28
|
export class ViewElement extends VElementTagMap.div {
|
|
12
|
-
|
|
13
|
-
static default_style = {
|
|
14
|
-
"position": "absolute",
|
|
15
|
-
"top": "0",
|
|
16
|
-
"right": "0",
|
|
17
|
-
"bottom": "0",
|
|
18
|
-
"left": "0",
|
|
19
|
-
"padding": "0px",
|
|
20
|
-
"overflow": "hidden",
|
|
21
|
-
"overflow-y": "none",
|
|
22
|
-
"background": "none",
|
|
23
|
-
"display": "flex", // to support vertical spacers.
|
|
24
|
-
// "text-align": "start",
|
|
25
|
-
"align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
26
|
-
"flex-direction": "column",
|
|
27
|
-
};
|
|
28
29
|
|
|
29
30
|
// Constructor.
|
|
30
|
-
|
|
31
|
+
constructor(...children: AppendType[]) {
|
|
31
32
|
|
|
32
33
|
// Initialize base class.
|
|
33
34
|
super({
|
package/frontend/src/volt.ts
CHANGED
|
@@ -9,7 +9,8 @@ export * from "./modules/string.js" // @noexport
|
|
|
9
9
|
export * from "./modules/array.js" // @noexport
|
|
10
10
|
export * from "./modules/object.js" // @noexport
|
|
11
11
|
export * from "./modules/auth.js"
|
|
12
|
-
export * from "./modules/
|
|
12
|
+
export * from "./modules/color.js"
|
|
13
|
+
// export * from "./modules/colors.js"
|
|
13
14
|
export * from "./modules/compression.js"
|
|
14
15
|
export * from "./modules/cookies.js"
|
|
15
16
|
export * from "./modules/date.js" // @todo
|
|
@@ -23,6 +24,7 @@ export * from "./modules/support.js"
|
|
|
23
24
|
export * from "./modules/themes.js"
|
|
24
25
|
export * from "./modules/user.js"
|
|
25
26
|
export * from "./modules/utils.js"
|
|
27
|
+
export * from "./modules/theme.js"
|
|
26
28
|
|
|
27
29
|
// Elements.
|
|
28
30
|
export * from "./elements/module.js"
|
|
@@ -8,8 +8,8 @@ import * as vhighlight from "/Users/administrator/persistance/private/dev/vinc/v
|
|
|
8
8
|
// -------------------------------------------------------------------------------------------------------------------------
|
|
9
9
|
// Compile Test.
|
|
10
10
|
|
|
11
|
-
import * as Preprocessing from "
|
|
12
|
-
import * as TypeScript from "
|
|
11
|
+
import * as Preprocessing from "../../backend/dist/esm/plugins/ts/preprocessing.js";
|
|
12
|
+
import * as TypeScript from "../../backend/dist/esm/plugins/ts/compiler.js";
|
|
13
13
|
|
|
14
14
|
import * as ts from "typescript";
|
|
15
15
|
import * as fs from "fs";
|