@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
|
@@ -4,35 +4,40 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, VDivElement, VDiv } from "../elements/module.js";
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, VDivElement, VDiv, VElementTagMap } from "../elements/module.js";
|
|
8
8
|
import { AnchorHStackElement } from "./stack";
|
|
9
9
|
import { RingLoader, RingLoaderElement } from "./loaders"
|
|
10
|
+
import { AnyElement } from "./any_element.js";
|
|
10
11
|
|
|
11
|
-
export class myClass extends AnchorHStackElement {
|
|
12
|
-
|
|
13
|
-
}
|
|
12
|
+
// export class myClass extends AnchorHStackElement {
|
|
13
|
+
// constructor() { super(); }
|
|
14
|
+
// }
|
|
14
15
|
|
|
15
16
|
// Loader button.
|
|
16
17
|
/**
|
|
17
18
|
* @warning: you should not use function "LoaderButton.loader.hide() / LoaderButton.loader.show()" use "LoaderButton.hide_loader() / LoaderButton.show_loader()" instead.
|
|
18
19
|
* @warning: This class is still experimental and may be subject to future change.
|
|
19
20
|
*/
|
|
20
|
-
@Elements.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
@Elements.create({
|
|
22
|
+
name: "LoaderButtonElement",
|
|
23
|
+
default_style: {
|
|
24
|
+
"margin": "0px",
|
|
25
|
+
"padding": "12.5px 10px 12.5px 10px",
|
|
26
|
+
"border-radius": "25px",
|
|
27
|
+
"cursor": "pointer",
|
|
28
|
+
"background": "black",
|
|
29
|
+
"color": "inherit",
|
|
30
|
+
"font-size": "16px",
|
|
31
|
+
"user-select": "none",
|
|
32
|
+
"text-decoration": "none",
|
|
33
|
+
// Custom.
|
|
34
|
+
"--loader-width": "20px",
|
|
35
|
+
"--loader-height": "20px",
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
export class LoaderButtonElement extends (AnchorHStackElement as any as VElementBaseSignature) {
|
|
39
|
+
|
|
40
|
+
// Attributes.
|
|
36
41
|
public nodes: {
|
|
37
42
|
text: VDivElement;
|
|
38
43
|
loader: RingLoaderElement;
|
|
@@ -62,7 +67,7 @@ export class LoaderButtonElement extends AnchorHStackElement {
|
|
|
62
67
|
|
|
63
68
|
// Initialize base classes.
|
|
64
69
|
super();
|
|
65
|
-
this.
|
|
70
|
+
this._init({
|
|
66
71
|
derived: LoaderButtonElement,
|
|
67
72
|
});
|
|
68
73
|
|
|
@@ -186,7 +191,3 @@ export const NullLoaderButton = Elements.create_null(LoaderButtonElement);
|
|
|
186
191
|
declare module './any_element.d.ts' { interface AnyElementMap { LoaderButtonElement: LoaderButtonElement }}
|
|
187
192
|
|
|
188
193
|
|
|
189
|
-
const x = new LoaderButtonElement();
|
|
190
|
-
x.style.color = "you";
|
|
191
|
-
|
|
192
|
-
|
|
@@ -4,7 +4,7 @@
|
|
|
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
|
// RingLoader.
|
|
10
10
|
// - The width and height must be in pixels.
|
|
@@ -15,17 +15,18 @@ import { Elements, VElementTagMap } from "../elements/module.js"
|
|
|
15
15
|
* @desc:
|
|
16
16
|
* The ring loader element.
|
|
17
17
|
*/
|
|
18
|
-
@Elements.
|
|
18
|
+
@Elements.create({
|
|
19
|
+
name: "RingLoaderElement",
|
|
20
|
+
default_style: {
|
|
21
|
+
"width": "80px",
|
|
22
|
+
"height": "80px",
|
|
23
|
+
"--child-background": "black",
|
|
24
|
+
"--border-width-factor": "1",
|
|
25
|
+
"display": "inline-block",
|
|
26
|
+
"position": "relative",
|
|
27
|
+
},
|
|
28
|
+
})
|
|
19
29
|
export class RingLoaderElement extends VElementTagMap.div {
|
|
20
|
-
|
|
21
|
-
static default_style = {
|
|
22
|
-
"width": "80px",
|
|
23
|
-
"height": "80px",
|
|
24
|
-
"--child-background": "black",
|
|
25
|
-
"--border-width-factor": "1",
|
|
26
|
-
"display": "inline-block",
|
|
27
|
-
"position": "relative",
|
|
28
|
-
}
|
|
29
30
|
|
|
30
31
|
// Constructor.
|
|
31
32
|
constructor() {
|
package/frontend/src/ui/popup.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements } from "../elements/module.js"
|
|
8
|
-
import { Mutex
|
|
9
|
-
import { HStack, HStackElement, VStack, VStackElement } from "./stack"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, AppendType } from "../elements/module.js"
|
|
8
|
+
import { Mutex } from "../modules/mutex"
|
|
9
|
+
import { FrameElement, HStack, HStackElement, VStack, VStackElement } from "./stack"
|
|
10
10
|
import { Text, TextElement } from "./text"
|
|
11
11
|
import { Title, TitleElement } from "./title"
|
|
12
12
|
import { LoaderButtonElement, LoaderButton } from "./loader_button"
|
|
@@ -14,15 +14,17 @@ import { ImageMask, ImageMaskElement } from "./image"
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
// Macros.
|
|
17
|
-
export type OnYesNoPopup = ((element:
|
|
17
|
+
export type OnYesNoPopup = ((element: YesNoPopupElement) => Promise<any> | void)
|
|
18
18
|
|
|
19
19
|
// RingLoader.
|
|
20
20
|
// - The width and height must be in pixels.
|
|
21
|
-
@Elements.
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
@Elements.create({
|
|
22
|
+
name: "YesNoPopupElement",
|
|
23
|
+
})
|
|
24
|
+
export class YesNoPopupElement extends (VStackElement as any as VElementBaseSignature) {
|
|
25
|
+
|
|
24
26
|
// Attributes.
|
|
25
|
-
public p_mutex:
|
|
27
|
+
public p_mutex: Mutex;
|
|
26
28
|
public p_auto_hide: boolean;
|
|
27
29
|
public p_auto_remove: boolean;
|
|
28
30
|
public p_animation_duration: number;
|
|
@@ -78,10 +80,12 @@ export class PopupElement extends VStackElement {
|
|
|
78
80
|
|
|
79
81
|
// Initialize base class.
|
|
80
82
|
super();
|
|
81
|
-
this.
|
|
83
|
+
this._init({
|
|
84
|
+
derived: YesNoPopupElement,
|
|
85
|
+
})
|
|
82
86
|
|
|
83
87
|
// Mutex.
|
|
84
|
-
this.p_mutex = Mutex();
|
|
88
|
+
this.p_mutex = new Mutex();
|
|
85
89
|
|
|
86
90
|
// Args.
|
|
87
91
|
this.p_auto_hide = auto_hide;
|
|
@@ -231,7 +235,7 @@ export class PopupElement extends VStackElement {
|
|
|
231
235
|
|
|
232
236
|
// Set default since it inherits HStackElement.
|
|
233
237
|
set_default(): this {
|
|
234
|
-
return super.set_default(
|
|
238
|
+
return super.set_default(YesNoPopupElement);
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
// Await the previous popup.
|
|
@@ -365,6 +369,156 @@ export class PopupElement extends VStackElement {
|
|
|
365
369
|
document.body.addEventListener("keydown", this.p_escape_handler); // for some reason on_key_down on main element is not catched.
|
|
366
370
|
}
|
|
367
371
|
}
|
|
368
|
-
export const
|
|
369
|
-
export const
|
|
370
|
-
declare module './any_element.d.ts' { interface AnyElementMap {
|
|
372
|
+
export const YesNoPopup = Elements.wrapper(YesNoPopupElement);
|
|
373
|
+
export const NullYesNoPopup = Elements.create_null(YesNoPopupElement);
|
|
374
|
+
declare module './any_element.d.ts' { interface AnyElementMap { YesNoPopupElement: YesNoPopupElement }}
|
|
375
|
+
|
|
376
|
+
// /** Custom popup */
|
|
377
|
+
// @Elements.create({
|
|
378
|
+
// name: "CustomPopupElement",
|
|
379
|
+
// })
|
|
380
|
+
// export class CustomPopupElement extends (VStackElement as any as VElementBaseSignature) {
|
|
381
|
+
|
|
382
|
+
// public content: FrameElement;
|
|
383
|
+
// public close:
|
|
384
|
+
|
|
385
|
+
// close_border(...args) {
|
|
386
|
+
// this.close.border(...args);
|
|
387
|
+
// return this;
|
|
388
|
+
// }
|
|
389
|
+
|
|
390
|
+
// constructor(...children: AppendType[]) {
|
|
391
|
+
|
|
392
|
+
// // Initialize base class.
|
|
393
|
+
// super();
|
|
394
|
+
// this._init({
|
|
395
|
+
// derived: CustomPopupElement,
|
|
396
|
+
// })
|
|
397
|
+
// const close_handler = (event) => {
|
|
398
|
+
// if (event.key === "Escape") {
|
|
399
|
+
// popup.close();
|
|
400
|
+
// }
|
|
401
|
+
// }
|
|
402
|
+
// this.append(
|
|
403
|
+
// this.content = UI.Widget(...children)
|
|
404
|
+
// .background(Theme.bg_1)
|
|
405
|
+
// .max_width(400)
|
|
406
|
+
// .parent(this),
|
|
407
|
+
// Frame(
|
|
408
|
+
// close = ImageMask("/static/icons/close.webp")
|
|
409
|
+
// .frame(10, 10)
|
|
410
|
+
// .flex(0)
|
|
411
|
+
// .transition_mask("background 300ms ease-in-out")
|
|
412
|
+
// .color(Theme.bg),
|
|
413
|
+
// )
|
|
414
|
+
// .background(Theme.auto_darken_lighten("fg", 0.5))
|
|
415
|
+
// .border_radius("50%")
|
|
416
|
+
// .border(1, Theme.div_bg)
|
|
417
|
+
// .frame(30, 30)
|
|
418
|
+
// .center().center_vertical()
|
|
419
|
+
// .position(25, 25, null, null)
|
|
420
|
+
// .on_click(() => popup.close())
|
|
421
|
+
// .hover_transitions([
|
|
422
|
+
// { target: "this", selected: Theme.auto_darken_lighten("fg", 0.6), unselected: Theme.auto_darken_lighten("fg", 0.5), methods: ["background"] },
|
|
423
|
+
// { target: close, selected: Theme.bg_hover, unselected: Theme.bg, methods: ["color"] },
|
|
424
|
+
// // { target: "this", selected: Theme.fg, unselected: Theme.fg_2, methods: ["color"] },
|
|
425
|
+
// // { target: "this", selected: Theme.fg, unselected: Theme.fg_2, methods: ["color"] },
|
|
426
|
+
// ])
|
|
427
|
+
// )
|
|
428
|
+
// .position(0, 0, 0, 0)
|
|
429
|
+
// .center()
|
|
430
|
+
// .center_vertical()
|
|
431
|
+
// .background("#00000008")
|
|
432
|
+
// .padding(25)
|
|
433
|
+
// .background_blur(5)
|
|
434
|
+
// .transition("opacity 300ms ease-in-out")
|
|
435
|
+
// .on_click((e, event) => {
|
|
436
|
+
// if (event.target === content || content.is_nested_child(event.target)) {
|
|
437
|
+
// return;
|
|
438
|
+
// }
|
|
439
|
+
// e.close()
|
|
440
|
+
// })
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
// }
|
|
444
|
+
|
|
445
|
+
// // Set width on content instead of parent.
|
|
446
|
+
// width(): string | number;
|
|
447
|
+
// width(value: string | number, check_attribute?: boolean): this;
|
|
448
|
+
// width(value?: string | number, check_attribute: boolean = true): this | number | string {
|
|
449
|
+
// if (this._e === undefined) {
|
|
450
|
+
// return super.width(value as any, check_attribute);
|
|
451
|
+
// }
|
|
452
|
+
// if (value == null) {
|
|
453
|
+
// return this._e.width.toString();
|
|
454
|
+
// }
|
|
455
|
+
// // Assign percentage values to the root.
|
|
456
|
+
// if (typeof value === "string" && value.includes("%")) {
|
|
457
|
+
// super.width(value as any, false);
|
|
458
|
+
// } else {
|
|
459
|
+
// this._e.style.width = this.pad_numeric(value, "px");
|
|
460
|
+
// this._e.width = value as any;
|
|
461
|
+
// }
|
|
462
|
+
// return this;
|
|
463
|
+
// }
|
|
464
|
+
// min_width(): string | number
|
|
465
|
+
// min_width(value: string | number): this;
|
|
466
|
+
// min_width(value?: string | number): this | string | number {
|
|
467
|
+
// if (this._e === undefined) {
|
|
468
|
+
// return super.min_width(value as any);
|
|
469
|
+
// }
|
|
470
|
+
// if (value == null) {
|
|
471
|
+
// return this._e.style.minWidth;
|
|
472
|
+
// }
|
|
473
|
+
// // Assign percentage values to the root.
|
|
474
|
+
// if (typeof value === "string" && value.includes("%")) {
|
|
475
|
+
// super.min_width(value as any);
|
|
476
|
+
// } else {
|
|
477
|
+
// this._e.style.minWidth = this.pad_numeric(value, "px");
|
|
478
|
+
// }
|
|
479
|
+
// return this;
|
|
480
|
+
// }
|
|
481
|
+
// max_width(): string | number
|
|
482
|
+
// max_width(value: string | number): this;
|
|
483
|
+
// max_width(value?: string | number): this | string | number {
|
|
484
|
+
// if (this._e === undefined) {
|
|
485
|
+
// return super.max_width(value as any);
|
|
486
|
+
// }
|
|
487
|
+
// if (value == null) {
|
|
488
|
+
// return this._e.style.maxWidth;
|
|
489
|
+
// }
|
|
490
|
+
// // Assign percentage values to the root.
|
|
491
|
+
// if (typeof value === "string" && value.includes("%")) {
|
|
492
|
+
// super.max_width(value as any);
|
|
493
|
+
// } else {
|
|
494
|
+
// this._e.style.maxWidth = this.pad_numeric(value, "px");
|
|
495
|
+
// }
|
|
496
|
+
// return this;
|
|
497
|
+
// }
|
|
498
|
+
|
|
499
|
+
// max_width(value: number) {
|
|
500
|
+
// content.max_width(value);
|
|
501
|
+
// return this;
|
|
502
|
+
// }
|
|
503
|
+
|
|
504
|
+
// open() {
|
|
505
|
+
// document.body.addEventListener("keydown", close_handler);
|
|
506
|
+
// UI.view.append(this);
|
|
507
|
+
// this.opacity(0)
|
|
508
|
+
// this.show();
|
|
509
|
+
// this.getBoundingClientRect();
|
|
510
|
+
// this.opacity(1);
|
|
511
|
+
// return this;
|
|
512
|
+
// }
|
|
513
|
+
// close() {
|
|
514
|
+
// document.body.removeEventListener("keydown", close_handler);
|
|
515
|
+
// this.opacity(0)
|
|
516
|
+
// setTimeout(() => this.remove(), 300)
|
|
517
|
+
// return this;
|
|
518
|
+
// }
|
|
519
|
+
|
|
520
|
+
// }
|
|
521
|
+
// }
|
|
522
|
+
// export const CustomPopup = Elements.wrapper(CustomPopupElement);
|
|
523
|
+
// export const NullCustomPopup = Elements.create_null(CustomPopupElement);
|
|
524
|
+
// declare module './any_element.d.ts' { interface AnyElementMap { CustomPopupElement: CustomPopupElement } }
|
|
@@ -4,16 +4,18 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
// Imports.
|
|
7
|
-
import { Elements, VElement, VElementTagMap } from "../elements/module.js"
|
|
7
|
+
import { Elements, VElementBaseSignature, VElement, VElementTagMap, AppendType } from "../elements/module.js"
|
|
8
8
|
|
|
9
9
|
// Divider.
|
|
10
|
-
@Elements.
|
|
10
|
+
@Elements.create({
|
|
11
|
+
name: "PseudoElement",
|
|
12
|
+
})
|
|
11
13
|
export class PseudoElement extends VElementTagMap.div {
|
|
12
14
|
|
|
13
15
|
// Attributes.
|
|
14
16
|
public added_to_elements: { node: VElement, type: string }[] = [];
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
constructor(...children: AppendType[]) {
|
|
17
19
|
super({ derived: PseudoElement, });
|
|
18
20
|
|
|
19
21
|
// Append.
|