@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
|
@@ -36,25 +36,62 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
36
36
|
}
|
|
37
37
|
return useValue ? value : void 0;
|
|
38
38
|
};
|
|
39
|
-
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
40
|
-
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
41
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
42
|
-
};
|
|
43
39
|
// Imports.
|
|
44
40
|
import { Elements, VElementTagMap } from "../elements/module.js";
|
|
45
41
|
import { Utils } from "../modules/utils.js";
|
|
46
|
-
import { Span } from "./span";
|
|
47
42
|
import { VStack, VStackElement } from "./stack";
|
|
48
43
|
// Scroller.
|
|
49
44
|
// - Warning: Setting padding on element attribute "content" may cause undefined behaviour.
|
|
50
45
|
let ScrollerElement = (() => {
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
let _classDecorators = [Elements.create({
|
|
47
|
+
name: "ScrollerElement",
|
|
48
|
+
default_style: {
|
|
49
|
+
"position": "relative", // is required for attribute "track"
|
|
50
|
+
"margin": "0px",
|
|
51
|
+
"padding": "0px",
|
|
52
|
+
// "clear": "both",
|
|
53
|
+
"display": "flex", // to support vertical spacers.
|
|
54
|
+
"overflow": "hidden",
|
|
55
|
+
// "flex": "1", // disabled to support horizontal spacers in VStacks.
|
|
56
|
+
"align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
57
|
+
"flex-direction": "column",
|
|
58
|
+
// "text-align": "start",
|
|
59
|
+
"scroll-behavior": "auto",
|
|
60
|
+
"overscroll-behavior": "auto", // relay to parent to resume scroll when local scroll has ended.
|
|
61
|
+
"height": "fit-content", // set height to max compared to parents non overflow, so scrolling can take effect.
|
|
62
|
+
"content-visibility": "auto", // improve rendering.
|
|
63
|
+
// "align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
64
|
+
// "align-items": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
65
|
+
},
|
|
66
|
+
})];
|
|
53
67
|
let _classDescriptor;
|
|
54
68
|
let _classExtraInitializers = [];
|
|
55
69
|
let _classThis;
|
|
56
70
|
let _classSuper = VElementTagMap.div;
|
|
57
|
-
var ScrollerElement =
|
|
71
|
+
var ScrollerElement = class extends _classSuper {
|
|
72
|
+
static { _classThis = this; }
|
|
73
|
+
static {
|
|
74
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
75
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
76
|
+
ScrollerElement = _classThis = _classDescriptor.value;
|
|
77
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
78
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
79
|
+
}
|
|
80
|
+
// @ts-expect-error
|
|
81
|
+
content;
|
|
82
|
+
thumb;
|
|
83
|
+
track;
|
|
84
|
+
on_scroll_callbacks;
|
|
85
|
+
iterate;
|
|
86
|
+
iterate_nodes;
|
|
87
|
+
m_delay;
|
|
88
|
+
_h_alignment;
|
|
89
|
+
_current_h_alignment;
|
|
90
|
+
_v_alignment;
|
|
91
|
+
_current_v_alignment;
|
|
92
|
+
_alignment_callback_activated;
|
|
93
|
+
_alignment_callback;
|
|
94
|
+
_fadeout_timeout;
|
|
58
95
|
// Constructor.
|
|
59
96
|
constructor(...children) {
|
|
60
97
|
// Initialize base class.
|
|
@@ -497,34 +534,6 @@ let ScrollerElement = (() => {
|
|
|
497
534
|
return this;
|
|
498
535
|
}
|
|
499
536
|
};
|
|
500
|
-
__setFunctionName(_classThis, "ScrollerElement");
|
|
501
|
-
(() => {
|
|
502
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
503
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
504
|
-
ScrollerElement = _classThis = _classDescriptor.value;
|
|
505
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
506
|
-
})();
|
|
507
|
-
_classThis.default_style = {
|
|
508
|
-
"position": "relative", // is required for attribute "track"
|
|
509
|
-
"margin": "0px",
|
|
510
|
-
"padding": "0px",
|
|
511
|
-
// "clear": "both",
|
|
512
|
-
"display": "flex", // to support vertical spacers.
|
|
513
|
-
"overflow": "hidden",
|
|
514
|
-
// "flex": "1", // disabled to support horizontal spacers in VStacks.
|
|
515
|
-
"align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
516
|
-
"flex-direction": "column",
|
|
517
|
-
// "text-align": "start",
|
|
518
|
-
"scroll-behavior": "auto",
|
|
519
|
-
"overscroll-behavior": "auto", // relay to parent to resume scroll when local scroll has ended.
|
|
520
|
-
"height": "fit-content", // set height to max compared to parents non overflow, so scrolling can take effect.
|
|
521
|
-
"content-visibility": "auto", // improve rendering.
|
|
522
|
-
// "align-content": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
523
|
-
// "align-items": "flex-start", // align items at start, do not stretch / space when inside HStack.
|
|
524
|
-
};
|
|
525
|
-
(() => {
|
|
526
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
527
|
-
})();
|
|
528
537
|
return ScrollerElement = _classThis;
|
|
529
538
|
})();
|
|
530
539
|
export { ScrollerElement };
|
|
@@ -555,258 +564,250 @@ export const NullScroller = Elements.create_null(ScrollerElement);
|
|
|
555
564
|
@description: The elements children.
|
|
556
565
|
@type: array[Node]
|
|
557
566
|
*/
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
803
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
804
|
-
})();
|
|
805
|
-
return VirtualScrollerElement = _classThis;
|
|
806
|
-
})();
|
|
807
|
-
export { VirtualScrollerElement };
|
|
808
|
-
export const VirtualScroller = Elements.wrapper(VirtualScrollerElement);
|
|
809
|
-
export const NullVirtualScroller = Elements.create_null(VirtualScrollerElement);
|
|
567
|
+
// @Elements.register
|
|
568
|
+
// export class VirtualScrollerElement extends (ScrollerElement as any as VElementBaseSignature) {
|
|
569
|
+
// public _v_children: any[];
|
|
570
|
+
// public top_diff: number;
|
|
571
|
+
// public scroll_top_value: number;
|
|
572
|
+
// public _last_v_children: number;
|
|
573
|
+
// public visible_container: VStackElement;
|
|
574
|
+
// public height_measurer: any;
|
|
575
|
+
// // Constructor.
|
|
576
|
+
// constructor(...children: AppendType[]) {
|
|
577
|
+
// // Initialize base class.
|
|
578
|
+
// super();
|
|
579
|
+
// this._init_derived({ derived: VirtualScrollerElement, })
|
|
580
|
+
// // Virtual children.
|
|
581
|
+
// this._v_children = [];
|
|
582
|
+
// // Attributes.
|
|
583
|
+
// this.top_diff = 0;
|
|
584
|
+
// this.scroll_top_value = 0;
|
|
585
|
+
// this._last_v_children = 0;
|
|
586
|
+
// // Append children.
|
|
587
|
+
// this.append(...children);
|
|
588
|
+
// // The visible container with the scroll dimensions and positioned children inside.
|
|
589
|
+
// this.visible_container = VStack()
|
|
590
|
+
// .position("relative")
|
|
591
|
+
// .overflow_x("visible")
|
|
592
|
+
// .overflow_y("hidden")
|
|
593
|
+
// .styles({
|
|
594
|
+
// "content-visibility": "auto",
|
|
595
|
+
// })
|
|
596
|
+
// this.content.append(this.visible_container)
|
|
597
|
+
// // The height measurer.
|
|
598
|
+
// this.height_measurer = Span()
|
|
599
|
+
// .visibility("hidden")
|
|
600
|
+
// this.content.append(this.height_measurer)
|
|
601
|
+
// // Render.
|
|
602
|
+
// this.render();
|
|
603
|
+
// // Set scroll event listener.
|
|
604
|
+
// // @todo set_scroll_top_without event wont work with this new scroll event.
|
|
605
|
+
// this.content.addEventListener("scroll", () => this.render())
|
|
606
|
+
// }
|
|
607
|
+
// // Set default since it inherits HStackElement.
|
|
608
|
+
// set_default(): this {
|
|
609
|
+
// return super.set_default(VirtualScrollerElement);
|
|
610
|
+
// }
|
|
611
|
+
// // Replace overflow.
|
|
612
|
+
// overflow(): string;
|
|
613
|
+
// overflow(value: string): this;
|
|
614
|
+
// overflow(value?: string): string | this {
|
|
615
|
+
// if (value == null) {
|
|
616
|
+
// return this.content.overflow();
|
|
617
|
+
// }
|
|
618
|
+
// this.content.overflow(value);
|
|
619
|
+
// this.visible_container.overflow_x(value.split(" ")[0]);
|
|
620
|
+
// return this;
|
|
621
|
+
// }
|
|
622
|
+
// overflow_x(): string;
|
|
623
|
+
// overflow_x(value: string): this;
|
|
624
|
+
// overflow_x(value?: string): string | this {
|
|
625
|
+
// if (value == null) {
|
|
626
|
+
// return this.content.overflow_x();
|
|
627
|
+
// }
|
|
628
|
+
// this.content.overflow_x(value);
|
|
629
|
+
// this.visible_container.overflow_x(value);
|
|
630
|
+
// return this;
|
|
631
|
+
// }
|
|
632
|
+
// // keep overflow y on this.visible_container always hidden otherwise it may mess with expanding this.content and cause an infinite scroll event.
|
|
633
|
+
// // Set remove children to content.
|
|
634
|
+
// remove_children(): this {
|
|
635
|
+
// this._v_children = [];
|
|
636
|
+
// this.visible_container.min_height(0);
|
|
637
|
+
// this.visible_container.max_height(0);
|
|
638
|
+
// this.visible_container.inner_html("");
|
|
639
|
+
// return this;
|
|
640
|
+
// }
|
|
641
|
+
// // Render the visible content.
|
|
642
|
+
// render(): this {
|
|
643
|
+
// // Do not use a clearTimeout setTimout structure cause that will cause some elements to be appended too late on a very fast sroll.
|
|
644
|
+
// // Get scroll direction.
|
|
645
|
+
// const last_scroll_top = this.scroll_top_value;
|
|
646
|
+
// this.scroll_top_value = this.content.scrollTop;
|
|
647
|
+
// const last_v_children = this._last_v_children;
|
|
648
|
+
// this._last_v_children = this._v_children.length;
|
|
649
|
+
// let scrolling_down = true;
|
|
650
|
+
// if (this.scroll_top_value > last_scroll_top) {
|
|
651
|
+
// scrolling_down = true;
|
|
652
|
+
// } else if (this.scroll_top_value < last_scroll_top) {
|
|
653
|
+
// scrolling_down = false;
|
|
654
|
+
// }
|
|
655
|
+
// // Disable forced behaviour because when height edits are made it should also be updated, but this is easily forgotten by the user.
|
|
656
|
+
// // else if (!forced && this.last_v_children == last_v_children) {
|
|
657
|
+
// // return null; // horizontal scroll.
|
|
658
|
+
// // }
|
|
659
|
+
// // Get the start and end y.
|
|
660
|
+
// const start_y = this.content.scrollTop;
|
|
661
|
+
// const end_y = start_y + this.content.offsetHeight + this.top_diff;
|
|
662
|
+
// // Iterate.
|
|
663
|
+
// let is_first = true;
|
|
664
|
+
// let is_visible = false;
|
|
665
|
+
// let total_height = 0;
|
|
666
|
+
// let visible_height = 0;
|
|
667
|
+
// this._v_children.iterate((child) => {
|
|
668
|
+
// // Child vars.
|
|
669
|
+
// const height = child.v_height !== undefined ? child.v_height : this.get_height(child);
|
|
670
|
+
// if (height == 0) {
|
|
671
|
+
// return null; // no fixed height or no height.
|
|
672
|
+
// }
|
|
673
|
+
// const child_start_y = total_height;
|
|
674
|
+
// const child_end_y = total_height + height; // Adjust as needed
|
|
675
|
+
// total_height += height;
|
|
676
|
+
// // First item.
|
|
677
|
+
// if (is_first && child_end_y >= start_y) {
|
|
678
|
+
// child.transform(`translateY(${child_start_y}px)`); // also update when still visible but height changes may have been made to an element.
|
|
679
|
+
// visible_height += height;
|
|
680
|
+
// is_first = false;
|
|
681
|
+
// is_visible = true;
|
|
682
|
+
// if (!child.rendered) {
|
|
683
|
+
// if (scrolling_down) {
|
|
684
|
+
// this.visible_container.appendChild(child);
|
|
685
|
+
// } else {
|
|
686
|
+
// this.visible_container.insertBefore(child, this.visible_container.firstChild);
|
|
687
|
+
// }
|
|
688
|
+
// child.rendered = true;
|
|
689
|
+
// }
|
|
690
|
+
// }
|
|
691
|
+
// // Last visible element.
|
|
692
|
+
// else if (is_visible && child_start_y >= end_y) {
|
|
693
|
+
// child.transform(`translateY(${child_start_y - visible_height}px)`); // also update when still visible but height changes may have been made to an element.
|
|
694
|
+
// visible_height += height;
|
|
695
|
+
// is_visible = false;
|
|
696
|
+
// if (!child.rendered) {
|
|
697
|
+
// if (scrolling_down) {
|
|
698
|
+
// this.visible_container.appendChild(child);
|
|
699
|
+
// } else {
|
|
700
|
+
// this.visible_container.insertBefore(child, this.visible_container.firstChild);
|
|
701
|
+
// }
|
|
702
|
+
// child.rendered = true;
|
|
703
|
+
// }
|
|
704
|
+
// }
|
|
705
|
+
// // Visible elements.
|
|
706
|
+
// else if (is_visible) {
|
|
707
|
+
// child.transform(`translateY(${child_start_y - visible_height}px)`); // also update when still visible but height changes may have been made to an element.
|
|
708
|
+
// visible_height += height;
|
|
709
|
+
// if (!child.rendered) {
|
|
710
|
+
// if (scrolling_down) {
|
|
711
|
+
// this.visible_container.appendChild(child);
|
|
712
|
+
// } else {
|
|
713
|
+
// this.visible_container.insertBefore(child, this.visible_container.firstChild);
|
|
714
|
+
// }
|
|
715
|
+
// child.rendered = true;
|
|
716
|
+
// }
|
|
717
|
+
// }
|
|
718
|
+
// // Invisible elements.
|
|
719
|
+
// else if (child.rendered) {
|
|
720
|
+
// child.remove();
|
|
721
|
+
// child.rendered = false;
|
|
722
|
+
// }
|
|
723
|
+
// })
|
|
724
|
+
// // Set scroll dimension.
|
|
725
|
+
// this.visible_container.min_height(total_height);
|
|
726
|
+
// this.visible_container.max_height(total_height);
|
|
727
|
+
// // Return this.
|
|
728
|
+
// return this;
|
|
729
|
+
// }
|
|
730
|
+
// // Update heights.
|
|
731
|
+
// update_heights(): this {
|
|
732
|
+
// this._v_children.iterate((child) => {
|
|
733
|
+
// child.v_height = this.get_height(child, false);
|
|
734
|
+
// })
|
|
735
|
+
// return this;
|
|
736
|
+
// }
|
|
737
|
+
// // Update height of a certain child.
|
|
738
|
+
// update_height(child: any): this {
|
|
739
|
+
// child.v_height = this.get_height(child, false);
|
|
740
|
+
// return this;
|
|
741
|
+
// }
|
|
742
|
+
// // Get the height of an element.
|
|
743
|
+
// get_height(element, fixed = true): number {
|
|
744
|
+
// let height;
|
|
745
|
+
// // Get fixed height.
|
|
746
|
+
// if (fixed) {
|
|
747
|
+
// height = parseFloat(element.style.height);
|
|
748
|
+
// if (isNaN(height)) {
|
|
749
|
+
// console.error("Every element in the virtual scroller must have a fixed height, ignoring element: " + element);
|
|
750
|
+
// element.style.display = "none";
|
|
751
|
+
// return 0;
|
|
752
|
+
// }
|
|
753
|
+
// }
|
|
754
|
+
// // Append to document and get height.
|
|
755
|
+
// // Does not require fixed heights but is slow.
|
|
756
|
+
// else {
|
|
757
|
+
// element.rendered = false; // set rendered to false because this will remove the child from this.visible_container when it was rendered.
|
|
758
|
+
// this.height_measurer.appendChild(element);
|
|
759
|
+
// height = element.offsetHeight;
|
|
760
|
+
// this.height_measurer.removeChild(element);
|
|
761
|
+
// }
|
|
762
|
+
// // Add margin.
|
|
763
|
+
// const margin_top = parseFloat(element.style.marginTop);
|
|
764
|
+
// if (!isNaN(margin_top)) {
|
|
765
|
+
// height += margin_top;
|
|
766
|
+
// }
|
|
767
|
+
// const margin_bottom = parseFloat(element.style.marginBottom);
|
|
768
|
+
// if (!isNaN(margin_bottom)) {
|
|
769
|
+
// height += margin_bottom;
|
|
770
|
+
// }
|
|
771
|
+
// // Handler.
|
|
772
|
+
// return height;
|
|
773
|
+
// }
|
|
774
|
+
// // Custom append function.
|
|
775
|
+
// append(...children: AppendType[]): this {
|
|
776
|
+
// for (let i = 0; i < children.length; i++) {
|
|
777
|
+
// const child = children[i];
|
|
778
|
+
// if (child != null) {
|
|
779
|
+
// // VWeb element.
|
|
780
|
+
// if (child.element_name != null) {
|
|
781
|
+
// if (
|
|
782
|
+
// child.element_name == "ForEachElement" ||
|
|
783
|
+
// child.element_name == "IfElement" ||
|
|
784
|
+
// child.element_name == "IfDeviceWithElement"
|
|
785
|
+
// ) {
|
|
786
|
+
// child.append_children_to(this);
|
|
787
|
+
// } else {
|
|
788
|
+
// this._v_children.push(child);
|
|
789
|
+
// }
|
|
790
|
+
// }
|
|
791
|
+
// // Execute function.
|
|
792
|
+
// else if (Utils.is_func(child)) {
|
|
793
|
+
// this.append(child());
|
|
794
|
+
// }
|
|
795
|
+
// // Node element.
|
|
796
|
+
// else if (child instanceof Node) {
|
|
797
|
+
// this._v_children.push(child);
|
|
798
|
+
// }
|
|
799
|
+
// // Append text.
|
|
800
|
+
// else if (Utils.is_string(child)) {
|
|
801
|
+
// this._v_children.push(document.createTextNode(child));
|
|
802
|
+
// }
|
|
803
|
+
// }
|
|
804
|
+
// }
|
|
805
|
+
// return this;
|
|
806
|
+
// }
|
|
807
|
+
// }
|
|
808
|
+
// export const VirtualScroller = Elements.wrapper(VirtualScrollerElement);
|
|
809
|
+
// export const NullVirtualScroller = Elements.create_null(VirtualScrollerElement);
|
|
810
|
+
// declare module './any_element.d.ts' { interface AnyElementMap { VirtualScrollerElement: VirtualScrollerElement }}
|
|
810
811
|
/* @docs:
|
|
811
812
|
@nav: Frontend
|
|
812
813
|
@chapter: Elements
|
|
@@ -819,17 +820,29 @@ export const NullVirtualScroller = Elements.create_null(VirtualScrollerElement);
|
|
|
819
820
|
This class is still experimental.
|
|
820
821
|
*/
|
|
821
822
|
let SnapScrollerElement = (() => {
|
|
822
|
-
|
|
823
|
-
|
|
823
|
+
let _classDecorators = [Elements.create({
|
|
824
|
+
name: "SnapScrollerElement",
|
|
825
|
+
})];
|
|
824
826
|
let _classDescriptor;
|
|
825
827
|
let _classExtraInitializers = [];
|
|
826
828
|
let _classThis;
|
|
827
829
|
let _classSuper = VStackElement;
|
|
828
|
-
var SnapScrollerElement =
|
|
830
|
+
var SnapScrollerElement = class extends _classSuper {
|
|
831
|
+
static { _classThis = this; }
|
|
832
|
+
static {
|
|
833
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
834
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
835
|
+
SnapScrollerElement = _classThis = _classDescriptor.value;
|
|
836
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
837
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
838
|
+
}
|
|
839
|
+
// Constructor.
|
|
829
840
|
constructor(...children) {
|
|
830
841
|
// Base.
|
|
831
842
|
super();
|
|
832
|
-
this.
|
|
843
|
+
this._init({
|
|
844
|
+
derived: SnapScrollerElement,
|
|
845
|
+
});
|
|
833
846
|
// Style.
|
|
834
847
|
this.overflow_y("scroll");
|
|
835
848
|
this.scroll_snap_type("y mandatory");
|
|
@@ -837,6 +850,7 @@ let SnapScrollerElement = (() => {
|
|
|
837
850
|
this.append(...children);
|
|
838
851
|
}
|
|
839
852
|
// Append.
|
|
853
|
+
// @ts-ignore base type accepts more input types, this one only accepts velements
|
|
840
854
|
append(...children) {
|
|
841
855
|
for (let i = 0; i < children.length; i++) {
|
|
842
856
|
const win = children[i];
|
|
@@ -888,14 +902,6 @@ let SnapScrollerElement = (() => {
|
|
|
888
902
|
return this;
|
|
889
903
|
}
|
|
890
904
|
};
|
|
891
|
-
__setFunctionName(_classThis, "SnapScrollerElement");
|
|
892
|
-
(() => {
|
|
893
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
894
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
895
|
-
SnapScrollerElement = _classThis = _classDescriptor.value;
|
|
896
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
897
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
898
|
-
})();
|
|
899
905
|
return SnapScrollerElement = _classThis;
|
|
900
906
|
})();
|
|
901
907
|
export { SnapScrollerElement };
|