@vandenberghinc/volt 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vrepo +28 -0
- package/.vscode/tasks.json +87 -0
- package/README.md +67 -0
- package/backend/dist/cjs/blacklist.d.ts +10 -0
- package/backend/dist/cjs/blacklist.js +53 -0
- package/backend/dist/cjs/cli.d.ts +2 -0
- package/backend/dist/cjs/cli.js +263 -0
- package/backend/dist/cjs/database.d.ts +364 -0
- package/backend/dist/cjs/database.js +1962 -0
- package/backend/dist/cjs/endpoint.d.ts +57 -0
- package/backend/dist/cjs/endpoint.js +425 -0
- package/backend/dist/cjs/file_watcher.d.ts +44 -0
- package/backend/dist/cjs/file_watcher.js +348 -0
- package/backend/dist/cjs/frontend.d.ts +13 -0
- package/backend/dist/cjs/frontend.js +30 -0
- package/backend/dist/cjs/image_endpoint.d.ts +24 -0
- package/backend/dist/cjs/image_endpoint.js +210 -0
- package/backend/dist/cjs/logger.d.ts +5 -0
- package/backend/dist/cjs/logger.js +16 -0
- package/backend/dist/cjs/meta.d.ts +50 -0
- package/backend/dist/cjs/meta.js +153 -0
- package/backend/dist/cjs/mutex.d.ts +24 -0
- package/backend/dist/cjs/mutex.js +52 -0
- package/backend/dist/cjs/package.json +1 -0
- package/backend/dist/cjs/payments/paddle.d.ts +161 -0
- package/backend/dist/cjs/payments/paddle.js +2301 -0
- package/backend/dist/cjs/plugins/browser.d.ts +36 -0
- package/backend/dist/cjs/plugins/browser.js +183 -0
- package/backend/dist/cjs/plugins/communication.d.ts +70 -0
- package/backend/dist/cjs/plugins/communication.js +177 -0
- package/backend/dist/cjs/plugins/css.d.ts +10 -0
- package/backend/dist/cjs/plugins/css.js +71 -0
- package/backend/dist/cjs/plugins/mail.d.ts +277 -0
- package/backend/dist/cjs/plugins/mail.js +1419 -0
- package/backend/dist/cjs/plugins/pdf.d.ts +757 -0
- package/backend/dist/cjs/plugins/pdf.js +1694 -0
- package/backend/dist/cjs/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/cjs/plugins/thread_monitor.js +127 -0
- package/backend/dist/cjs/plugins/ts/compiler.d.ts +132 -0
- package/backend/dist/cjs/plugins/ts/compiler.js +944 -0
- package/backend/dist/cjs/plugins/ts/preprocessing.d.ts +14 -0
- package/backend/dist/cjs/plugins/ts/preprocessing.js +762 -0
- package/backend/dist/cjs/rate_limit.d.ts +65 -0
- package/backend/dist/cjs/rate_limit.js +463 -0
- package/backend/dist/cjs/request.deprc.d.ts +48 -0
- package/backend/dist/cjs/request.deprc.js +572 -0
- package/backend/dist/cjs/response.deprc.d.ts +55 -0
- package/backend/dist/cjs/response.deprc.js +275 -0
- package/backend/dist/cjs/server.d.ts +311 -0
- package/backend/dist/cjs/server.js +3475 -0
- package/backend/dist/cjs/splash_screen.d.ts +35 -0
- package/backend/dist/cjs/splash_screen.js +152 -0
- package/backend/dist/cjs/status.d.ts +60 -0
- package/backend/dist/cjs/status.js +199 -0
- package/backend/dist/cjs/stream.d.ts +75 -0
- package/backend/dist/cjs/stream.js +954 -0
- package/backend/dist/cjs/users.d.ts +111 -0
- package/backend/dist/cjs/users.js +1945 -0
- package/backend/dist/cjs/utils.d.ts +27 -0
- package/backend/dist/cjs/utils.js +329 -0
- package/backend/dist/cjs/view.d.ts +52 -0
- package/backend/dist/cjs/view.js +568 -0
- package/backend/dist/cjs/vinc.d.ts +2 -0
- package/backend/dist/cjs/vinc.dev.d.ts +2 -0
- package/backend/dist/cjs/vinc.dev.js +42 -0
- package/backend/dist/cjs/vinc.js +42 -0
- package/backend/dist/cjs/volt.d.ts +15 -0
- package/backend/dist/cjs/volt.js +64 -0
- package/backend/dist/css/adyen.css +92 -0
- package/backend/dist/css/volt.css +65 -0
- package/backend/dist/esm/blacklist.d.ts +10 -0
- package/backend/dist/esm/blacklist.js +49 -0
- package/backend/dist/esm/cli.d.ts +2 -0
- package/backend/dist/esm/cli.js +228 -0
- package/backend/dist/esm/database.d.ts +364 -0
- package/backend/dist/esm/database.js +1957 -0
- package/backend/dist/esm/endpoint.d.ts +57 -0
- package/backend/dist/esm/endpoint.js +421 -0
- package/backend/dist/esm/file_watcher.d.ts +44 -0
- package/backend/dist/esm/file_watcher.js +313 -0
- package/backend/dist/esm/frontend.d.ts +13 -0
- package/backend/dist/esm/frontend.js +27 -0
- package/backend/dist/esm/image_endpoint.d.ts +24 -0
- package/backend/dist/esm/image_endpoint.js +206 -0
- package/backend/dist/esm/logger.d.ts +5 -0
- package/backend/dist/esm/logger.js +13 -0
- package/backend/dist/esm/meta.d.ts +50 -0
- package/backend/dist/esm/meta.js +149 -0
- package/backend/dist/esm/mutex.d.ts +24 -0
- package/backend/dist/esm/mutex.js +48 -0
- package/backend/dist/esm/payments/paddle.d.ts +161 -0
- package/backend/dist/esm/payments/paddle.js +2261 -0
- package/backend/dist/esm/plugins/browser.d.ts +36 -0
- package/backend/dist/esm/plugins/browser.js +176 -0
- package/backend/dist/esm/plugins/communication.d.ts +70 -0
- package/backend/dist/esm/plugins/communication.js +169 -0
- package/backend/dist/esm/plugins/css.d.ts +10 -0
- package/backend/dist/esm/plugins/css.js +64 -0
- package/backend/dist/esm/plugins/mail.d.ts +277 -0
- package/backend/dist/esm/plugins/mail.js +1403 -0
- package/backend/dist/esm/plugins/pdf.d.ts +757 -0
- package/backend/dist/esm/plugins/pdf.js +1694 -0
- package/backend/dist/esm/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/esm/plugins/thread_monitor.js +120 -0
- package/backend/dist/esm/plugins/ts/compiler.d.ts +132 -0
- package/backend/dist/esm/plugins/ts/compiler.js +907 -0
- package/backend/dist/esm/plugins/ts/preprocessing.d.ts +14 -0
- package/backend/dist/esm/plugins/ts/preprocessing.js +724 -0
- package/backend/dist/esm/rate_limit.d.ts +65 -0
- package/backend/dist/esm/rate_limit.js +425 -0
- package/backend/dist/esm/request.deprc.d.ts +48 -0
- package/backend/dist/esm/request.deprc.js +572 -0
- package/backend/dist/esm/response.deprc.d.ts +55 -0
- package/backend/dist/esm/response.deprc.js +275 -0
- package/backend/dist/esm/server.d.ts +311 -0
- package/backend/dist/esm/server.js +3435 -0
- package/backend/dist/esm/splash_screen.d.ts +35 -0
- package/backend/dist/esm/splash_screen.js +148 -0
- package/backend/dist/esm/status.d.ts +60 -0
- package/backend/dist/esm/status.js +196 -0
- package/backend/dist/esm/stream.d.ts +75 -0
- package/backend/dist/esm/stream.js +947 -0
- package/backend/dist/esm/users.d.ts +111 -0
- package/backend/dist/esm/users.js +1908 -0
- package/backend/dist/esm/utils.d.ts +27 -0
- package/backend/dist/esm/utils.js +324 -0
- package/backend/dist/esm/view.d.ts +52 -0
- package/backend/dist/esm/view.js +561 -0
- package/backend/dist/esm/vinc.d.ts +2 -0
- package/backend/dist/esm/vinc.dev.d.ts +2 -0
- package/backend/dist/esm/vinc.dev.js +6 -0
- package/backend/dist/esm/vinc.js +6 -0
- package/backend/dist/esm/volt.d.ts +15 -0
- package/backend/dist/esm/volt.js +23 -0
- package/backend/dist/esm-dev/blacklist.d.ts +10 -0
- package/backend/dist/esm-dev/blacklist.js +49 -0
- package/backend/dist/esm-dev/cli.d.ts +2 -0
- package/backend/dist/esm-dev/cli.js +228 -0
- package/backend/dist/esm-dev/database.d.ts +364 -0
- package/backend/dist/esm-dev/database.js +1957 -0
- package/backend/dist/esm-dev/endpoint.d.ts +57 -0
- package/backend/dist/esm-dev/endpoint.js +421 -0
- package/backend/dist/esm-dev/file_watcher.d.ts +44 -0
- package/backend/dist/esm-dev/file_watcher.js +313 -0
- package/backend/dist/esm-dev/frontend.d.ts +13 -0
- package/backend/dist/esm-dev/frontend.js +27 -0
- package/backend/dist/esm-dev/image_endpoint.d.ts +24 -0
- package/backend/dist/esm-dev/image_endpoint.js +206 -0
- package/backend/dist/esm-dev/logger.d.ts +5 -0
- package/backend/dist/esm-dev/logger.js +13 -0
- package/backend/dist/esm-dev/meta.d.ts +50 -0
- package/backend/dist/esm-dev/meta.js +149 -0
- package/backend/dist/esm-dev/mutex.d.ts +24 -0
- package/backend/dist/esm-dev/mutex.js +48 -0
- package/backend/dist/esm-dev/payments/paddle.d.ts +161 -0
- package/backend/dist/esm-dev/payments/paddle.js +2261 -0
- package/backend/dist/esm-dev/plugins/browser.d.ts +36 -0
- package/backend/dist/esm-dev/plugins/browser.js +176 -0
- package/backend/dist/esm-dev/plugins/communication.d.ts +70 -0
- package/backend/dist/esm-dev/plugins/communication.js +169 -0
- package/backend/dist/esm-dev/plugins/css.d.ts +10 -0
- package/backend/dist/esm-dev/plugins/css.js +64 -0
- package/backend/dist/esm-dev/plugins/mail.d.ts +277 -0
- package/backend/dist/esm-dev/plugins/mail.js +1403 -0
- package/backend/dist/esm-dev/plugins/pdf.d.ts +757 -0
- package/backend/dist/esm-dev/plugins/pdf.js +1694 -0
- package/backend/dist/esm-dev/plugins/thread_monitor.d.ts +18 -0
- package/backend/dist/esm-dev/plugins/thread_monitor.js +120 -0
- package/backend/dist/esm-dev/plugins/ts/compiler.d.ts +132 -0
- package/backend/dist/esm-dev/plugins/ts/compiler.js +907 -0
- package/backend/dist/esm-dev/plugins/ts/preprocessing.d.ts +14 -0
- package/backend/dist/esm-dev/plugins/ts/preprocessing.js +724 -0
- package/backend/dist/esm-dev/rate_limit.d.ts +65 -0
- package/backend/dist/esm-dev/rate_limit.js +425 -0
- package/backend/dist/esm-dev/request.deprc.d.ts +48 -0
- package/backend/dist/esm-dev/request.deprc.js +572 -0
- package/backend/dist/esm-dev/response.deprc.d.ts +55 -0
- package/backend/dist/esm-dev/response.deprc.js +275 -0
- package/backend/dist/esm-dev/server.d.ts +311 -0
- package/backend/dist/esm-dev/server.js +3435 -0
- package/backend/dist/esm-dev/splash_screen.d.ts +35 -0
- package/backend/dist/esm-dev/splash_screen.js +148 -0
- package/backend/dist/esm-dev/status.d.ts +60 -0
- package/backend/dist/esm-dev/status.js +196 -0
- package/backend/dist/esm-dev/stream.d.ts +75 -0
- package/backend/dist/esm-dev/stream.js +947 -0
- package/backend/dist/esm-dev/users.d.ts +111 -0
- package/backend/dist/esm-dev/users.js +1908 -0
- package/backend/dist/esm-dev/utils.d.ts +27 -0
- package/backend/dist/esm-dev/utils.js +324 -0
- package/backend/dist/esm-dev/view.d.ts +52 -0
- package/backend/dist/esm-dev/view.js +561 -0
- package/backend/dist/esm-dev/vinc.d.ts +2 -0
- package/backend/dist/esm-dev/vinc.dev.d.ts +2 -0
- package/backend/dist/esm-dev/vinc.dev.js +6 -0
- package/backend/dist/esm-dev/vinc.js +6 -0
- package/backend/dist/esm-dev/volt.d.ts +15 -0
- package/backend/dist/esm-dev/volt.js +23 -0
- package/backend/src/blacklist.ts +69 -0
- package/backend/src/cli.js +245 -0
- package/backend/src/database.ts +2241 -0
- package/backend/src/endpoint.ts +494 -0
- package/backend/src/file_watcher.ts +359 -0
- package/backend/src/frontend.ts +35 -0
- package/backend/src/globals.d.ts +8 -0
- package/backend/src/image_endpoint.ts +258 -0
- package/backend/src/logger.ts +18 -0
- package/backend/src/meta.ts +202 -0
- package/backend/src/mutex.ts +51 -0
- package/backend/src/payments/paddle.ts +2659 -0
- package/backend/src/plugins/browser.ts +188 -0
- package/backend/src/plugins/communication.ts +204 -0
- package/backend/src/plugins/css.ts +84 -0
- package/backend/src/plugins/fonts/Menlo-Bold.ttf +0 -0
- package/backend/src/plugins/fonts/Menlo-Regular.ttf +0 -0
- package/backend/src/plugins/mail.ts +1720 -0
- package/backend/src/plugins/pdf.js +1932 -0
- package/backend/src/plugins/thread_monitor.ts +164 -0
- package/backend/src/plugins/ts/compiler.ts +1242 -0
- package/backend/src/plugins/ts/preprocessing.ts +812 -0
- package/backend/src/rate_limit.ts +503 -0
- package/backend/src/request.deprc.js +626 -0
- package/backend/src/response.deprc.js +354 -0
- package/backend/src/server.ts +4149 -0
- package/backend/src/splash_screen.ts +192 -0
- package/backend/src/status.ts +199 -0
- package/backend/src/stream.ts +1070 -0
- package/backend/src/users.ts +2077 -0
- package/backend/src/utils.ts +359 -0
- package/backend/src/view.ts +655 -0
- package/backend/src/vinc.dev.js +6 -0
- package/backend/src/vinc.ts +6 -0
- package/backend/src/volt.js +25 -0
- package/backend/tsconfig.cjs.json +29 -0
- package/backend/tsconfig.esm.dev.json +34 -0
- package/backend/tsconfig.esm.json +30 -0
- package/backend/tsconfig.json +2 -0
- package/frontend/compile.js +436 -0
- package/frontend/dist/elements/base.d.ts +9891 -0
- package/frontend/dist/elements/base.js +8818 -0
- package/frontend/dist/elements/module.d.ts +16 -0
- package/frontend/dist/elements/module.js +178 -0
- package/frontend/dist/modules/array.d.ts +37 -0
- package/frontend/dist/modules/array.js +284 -0
- package/frontend/dist/modules/auth.d.ts +45 -0
- package/frontend/dist/modules/auth.js +138 -0
- package/frontend/dist/modules/colors.d.ts +26 -0
- package/frontend/dist/modules/colors.js +340 -0
- package/frontend/dist/modules/compression.d.ts +6 -0
- package/frontend/dist/modules/compression.js +999 -0
- package/frontend/dist/modules/cookies.d.ts +17 -0
- package/frontend/dist/modules/cookies.js +166 -0
- package/frontend/dist/modules/date.d.ts +142 -0
- package/frontend/dist/modules/date.js +493 -0
- package/frontend/dist/modules/events.d.ts +7 -0
- package/frontend/dist/modules/events.js +90 -0
- package/frontend/dist/modules/google.d.ts +10 -0
- package/frontend/dist/modules/google.js +53 -0
- package/frontend/dist/modules/meta.d.ts +9 -0
- package/frontend/dist/modules/meta.js +45 -0
- package/frontend/dist/modules/mutex.d.ts +8 -0
- package/frontend/dist/modules/mutex.js +52 -0
- package/frontend/dist/modules/number.d.ts +12 -0
- package/frontend/dist/modules/number.js +8 -0
- package/frontend/dist/modules/object.d.ts +50 -0
- package/frontend/dist/modules/object.js +147 -0
- package/frontend/dist/modules/paddle.d.ts +1403 -0
- package/frontend/dist/modules/paddle.js +2641 -0
- package/frontend/dist/modules/scheme.d.ts +207 -0
- package/frontend/dist/modules/scheme.js +649 -0
- package/frontend/dist/modules/settings.d.ts +3 -0
- package/frontend/dist/modules/settings.js +4 -0
- package/frontend/dist/modules/statics.d.ts +4 -0
- package/frontend/dist/modules/statics.js +45 -0
- package/frontend/dist/modules/string.d.ts +163 -0
- package/frontend/dist/modules/string.js +291 -0
- package/frontend/dist/modules/support.d.ts +18 -0
- package/frontend/dist/modules/support.js +102 -0
- package/frontend/dist/modules/themes.d.ts +8 -0
- package/frontend/dist/modules/themes.js +17 -0
- package/frontend/dist/modules/user.d.ts +58 -0
- package/frontend/dist/modules/user.js +279 -0
- package/frontend/dist/modules/utils.d.ts +58 -0
- package/frontend/dist/modules/utils.js +1159 -0
- package/frontend/dist/types/gradient.d.ts +12 -0
- package/frontend/dist/types/gradient.js +79 -0
- package/frontend/dist/ui/border_button.d.ts +177 -0
- package/frontend/dist/ui/border_button.js +235 -0
- package/frontend/dist/ui/button.d.ts +42 -0
- package/frontend/dist/ui/button.js +114 -0
- package/frontend/dist/ui/canvas.d.ts +56 -0
- package/frontend/dist/ui/canvas.js +411 -0
- package/frontend/dist/ui/checkbox.d.ts +72 -0
- package/frontend/dist/ui/checkbox.js +277 -0
- package/frontend/dist/ui/code.d.ts +232 -0
- package/frontend/dist/ui/code.js +977 -0
- package/frontend/dist/ui/color.d.ts +1 -0
- package/frontend/dist/ui/color.js +110 -0
- package/frontend/dist/ui/context_menu.d.ts +30 -0
- package/frontend/dist/ui/context_menu.js +211 -0
- package/frontend/dist/ui/css.d.ts +10 -0
- package/frontend/dist/ui/css.js +44 -0
- package/frontend/dist/ui/divider.d.ts +18 -0
- package/frontend/dist/ui/divider.js +82 -0
- package/frontend/dist/ui/dropdown.d.ts +115 -0
- package/frontend/dist/ui/dropdown.js +446 -0
- package/frontend/dist/ui/for_each.d.ts +38 -0
- package/frontend/dist/ui/for_each.js +97 -0
- package/frontend/dist/ui/form.d.ts +25 -0
- package/frontend/dist/ui/form.js +227 -0
- package/frontend/dist/ui/frame_modes.d.ts +28 -0
- package/frontend/dist/ui/frame_modes.js +116 -0
- package/frontend/dist/ui/google_map.d.ts +31 -0
- package/frontend/dist/ui/google_map.js +111 -0
- package/frontend/dist/ui/gradient.d.ts +24 -0
- package/frontend/dist/ui/gradient.js +115 -0
- package/frontend/dist/ui/image.d.ts +138 -0
- package/frontend/dist/ui/image.js +570 -0
- package/frontend/dist/ui/input.d.ts +316 -0
- package/frontend/dist/ui/input.js +1187 -0
- package/frontend/dist/ui/link.d.ts +39 -0
- package/frontend/dist/ui/link.js +146 -0
- package/frontend/dist/ui/list.d.ts +33 -0
- package/frontend/dist/ui/list.js +161 -0
- package/frontend/dist/ui/loader_button.d.ts +108 -0
- package/frontend/dist/ui/loader_button.js +207 -0
- package/frontend/dist/ui/loaders.d.ts +60 -0
- package/frontend/dist/ui/loaders.js +150 -0
- package/frontend/dist/ui/popup.d.ts +84 -0
- package/frontend/dist/ui/popup.js +331 -0
- package/frontend/dist/ui/pseudo.d.ts +16 -0
- package/frontend/dist/ui/pseudo.js +81 -0
- package/frontend/dist/ui/scroller.d.ts +131 -0
- package/frontend/dist/ui/scroller.js +1251 -0
- package/frontend/dist/ui/slider.d.ts +35 -0
- package/frontend/dist/ui/slider.js +203 -0
- package/frontend/dist/ui/spacer.d.ts +20 -0
- package/frontend/dist/ui/spacer.js +83 -0
- package/frontend/dist/ui/span.d.ts +11 -0
- package/frontend/dist/ui/span.js +75 -0
- package/frontend/dist/ui/stack.d.ts +123 -0
- package/frontend/dist/ui/stack.js +344 -0
- package/frontend/dist/ui/steps.d.ts +72 -0
- package/frontend/dist/ui/steps.js +306 -0
- package/frontend/dist/ui/style.d.ts +12 -0
- package/frontend/dist/ui/style.js +78 -0
- package/frontend/dist/ui/switch.d.ts +44 -0
- package/frontend/dist/ui/switch.js +280 -0
- package/frontend/dist/ui/table.d.ts +118 -0
- package/frontend/dist/ui/table.js +411 -0
- package/frontend/dist/ui/tabs.d.ts +85 -0
- package/frontend/dist/ui/tabs.js +392 -0
- package/frontend/dist/ui/text.d.ts +19 -0
- package/frontend/dist/ui/text.js +88 -0
- package/frontend/dist/ui/theme.d.ts +25 -0
- package/frontend/dist/ui/theme.js +237 -0
- package/frontend/dist/ui/title.d.ts +36 -0
- package/frontend/dist/ui/title.js +127 -0
- package/frontend/dist/ui/ui.d.ts +38 -0
- package/frontend/dist/ui/ui.js +41 -0
- package/frontend/dist/ui/view.d.ts +25 -0
- package/frontend/dist/ui/view.js +93 -0
- package/frontend/dist/volt.d.ts +22 -0
- package/frontend/dist/volt.js +27 -0
- package/frontend/exports.json +1340 -0
- package/frontend/src/css/adyen.css +92 -0
- package/frontend/src/css/volt.css +65 -0
- package/frontend/src/elements/base.ts +16790 -0
- package/frontend/src/elements/module.ts +184 -0
- package/frontend/src/elements/types.d.ts +155 -0
- package/frontend/src/modules/array.ts +366 -0
- package/frontend/src/modules/auth.ts +188 -0
- package/frontend/src/modules/colors.ts +449 -0
- package/frontend/src/modules/compression.ts +67 -0
- package/frontend/src/modules/cookies.ts +182 -0
- package/frontend/src/modules/date.js +535 -0
- package/frontend/src/modules/date.ts +583 -0
- package/frontend/src/modules/events.ts +96 -0
- package/frontend/src/modules/google.ts +60 -0
- package/frontend/src/modules/meta.ts +59 -0
- package/frontend/src/modules/mutex.ts +59 -0
- package/frontend/src/modules/number.ts +20 -0
- package/frontend/src/modules/object.ts +212 -0
- package/frontend/src/modules/paddle.ts +2990 -0
- package/frontend/src/modules/scheme.ts +740 -0
- package/frontend/src/modules/settings.ts +5 -0
- package/frontend/src/modules/statics.ts +47 -0
- package/frontend/src/modules/string.ts +500 -0
- package/frontend/src/modules/support.ts +118 -0
- package/frontend/src/modules/themes.ts +24 -0
- package/frontend/src/modules/user.ts +321 -0
- package/frontend/src/modules/utils.ts +1260 -0
- package/frontend/src/static/admin/admin.png +0 -0
- package/frontend/src/static/admin/password.webp +0 -0
- package/frontend/src/static/icons/copy.webp +0 -0
- package/frontend/src/static/payments/arrow.long.webp +0 -0
- package/frontend/src/static/payments/arrow.long2.webp +0 -0
- package/frontend/src/static/payments/cancelled.webp +0 -0
- package/frontend/src/static/payments/check.sign.webp +0 -0
- package/frontend/src/static/payments/check.webp +0 -0
- package/frontend/src/static/payments/close.webp +0 -0
- package/frontend/src/static/payments/error.webp +0 -0
- package/frontend/src/static/payments/exclamation.webp +0 -0
- package/frontend/src/static/payments/minus.webp +0 -0
- package/frontend/src/static/payments/party.webp +0 -0
- package/frontend/src/static/payments/plus.webp +0 -0
- package/frontend/src/static/payments/shopping_cart.webp +0 -0
- package/frontend/src/static/payments/trash.webp +0 -0
- package/frontend/src/types/global.d.ts +4 -0
- package/frontend/src/types/gradient.ts +87 -0
- package/frontend/src/ui/any_element.d.ts +5 -0
- package/frontend/src/ui/border_button.ts +320 -0
- package/frontend/src/ui/button.ts +62 -0
- package/frontend/src/ui/canvas.ts +431 -0
- package/frontend/src/ui/checkbox.ts +284 -0
- package/frontend/src/ui/code.ts +1049 -0
- package/frontend/src/ui/color.ts +117 -0
- package/frontend/src/ui/context_menu.ts +194 -0
- package/frontend/src/ui/css.ts +57 -0
- package/frontend/src/ui/divider.ts +28 -0
- package/frontend/src/ui/dropdown.ts +503 -0
- package/frontend/src/ui/for_each.ts +71 -0
- package/frontend/src/ui/form.ts +208 -0
- package/frontend/src/ui/frame_modes.ts +140 -0
- package/frontend/src/ui/google_map.ts +70 -0
- package/frontend/src/ui/gradient.ts +73 -0
- package/frontend/src/ui/image.ts +587 -0
- package/frontend/src/ui/input.ts +1284 -0
- package/frontend/src/ui/link.ts +77 -0
- package/frontend/src/ui/list.ts +88 -0
- package/frontend/src/ui/loader_button.ts +192 -0
- package/frontend/src/ui/loaders.ts +126 -0
- package/frontend/src/ui/popup.ts +370 -0
- package/frontend/src/ui/pseudo.ts +33 -0
- package/frontend/src/ui/scroller.ts +1324 -0
- package/frontend/src/ui/slider.ts +215 -0
- package/frontend/src/ui/spacer.ts +29 -0
- package/frontend/src/ui/span.ts +23 -0
- package/frontend/src/ui/stack.ts +238 -0
- package/frontend/src/ui/steps.ts +334 -0
- package/frontend/src/ui/style.ts +26 -0
- package/frontend/src/ui/switch.ts +286 -0
- package/frontend/src/ui/table.ts +323 -0
- package/frontend/src/ui/tabs.ts +441 -0
- package/frontend/src/ui/text.ts +38 -0
- package/frontend/src/ui/theme.ts +279 -0
- package/frontend/src/ui/title.ts +64 -0
- package/frontend/src/ui/ui.ts +47 -0
- package/frontend/src/ui/view.ts +44 -0
- package/frontend/src/volt.ts +31 -0
- package/package.json +58 -0
|
@@ -0,0 +1,1419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Author: Daan van den Bergh
|
|
4
|
+
* Copyright: © 2022 - 2024 Daan van den Bergh.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.NullMailElement = exports.Mail = exports.MailElement = exports.NullCSSElement = exports.CSS = exports.CSSElement = exports.NullTableElement = exports.Table = exports.TableElement = exports.NullTableRowElement = exports.TableRow = exports.TableRowElement = exports.NullTableDataElement = exports.TableData = exports.TableDataElement = exports.NullDividerElement = exports.Divider = exports.DividerElement = exports.NullVStackElement = exports.VStack = exports.VStackElement = exports.NullImageMaskElement = exports.ImageMask = exports.ImageMaskElement = exports.NullImageElement = exports.Image = exports.ImageElement = exports.NullText = exports.Text = exports.TextElement = exports.NullSubtitle = exports.Subtitle = exports.SubtitleElement = exports.NullTitle = exports.Title = exports.TitleElement = exports.Element = void 0;
|
|
8
|
+
// ---------------------------------------------------------
|
|
9
|
+
// The HTML element server side for creating mails.
|
|
10
|
+
// Element.
|
|
11
|
+
// The class.
|
|
12
|
+
class Element {
|
|
13
|
+
// ---------------------------------------------------------
|
|
14
|
+
// Attributes.
|
|
15
|
+
// static element_tag: string = tag; // must remain static.
|
|
16
|
+
type;
|
|
17
|
+
element_type;
|
|
18
|
+
tag;
|
|
19
|
+
_style;
|
|
20
|
+
_attrs;
|
|
21
|
+
classes;
|
|
22
|
+
_inner_html;
|
|
23
|
+
children;
|
|
24
|
+
_lang;
|
|
25
|
+
_charset;
|
|
26
|
+
_viewport;
|
|
27
|
+
_title;
|
|
28
|
+
_links;
|
|
29
|
+
_disabled;
|
|
30
|
+
// ---------------------------------------------------------
|
|
31
|
+
// Constructor.
|
|
32
|
+
constructor({ type = "VElement", tag = "div", default_style = null, default_attributes = null, default_events = null, }) {
|
|
33
|
+
// Arguments.
|
|
34
|
+
this.type = type;
|
|
35
|
+
this.element_type = type;
|
|
36
|
+
this.tag = tag;
|
|
37
|
+
// Attributes.
|
|
38
|
+
this._style = {};
|
|
39
|
+
this._attrs = {};
|
|
40
|
+
this.classes = [];
|
|
41
|
+
this._inner_html = null;
|
|
42
|
+
this.children = [];
|
|
43
|
+
// Assign default style.
|
|
44
|
+
if (default_style != null) {
|
|
45
|
+
Object.keys(default_style).forEach((key) => {
|
|
46
|
+
this._style[key] = default_style[key];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Assign default attributes.
|
|
50
|
+
if (default_attributes != null) {
|
|
51
|
+
Object.keys(default_attributes).forEach((key) => {
|
|
52
|
+
this._attrs[key] = default_attributes[key];
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
// Assign default events.
|
|
56
|
+
if (default_events != null) {
|
|
57
|
+
Object.keys(default_events).forEach((key) => {
|
|
58
|
+
this._attrs[key] = default_events[key];
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// ---------------------------------------------------------
|
|
63
|
+
// Utils.
|
|
64
|
+
// Pad a numeric with px.
|
|
65
|
+
pad_numeric(value, padding = "px") {
|
|
66
|
+
if (typeof value === "number") {
|
|
67
|
+
return value + padding;
|
|
68
|
+
}
|
|
69
|
+
return value;
|
|
70
|
+
}
|
|
71
|
+
// ---------------------------------------------------------
|
|
72
|
+
// Build functions.
|
|
73
|
+
// Build the html.
|
|
74
|
+
html() {
|
|
75
|
+
// Vars.
|
|
76
|
+
let html = "", tag;
|
|
77
|
+
// A default element.
|
|
78
|
+
if (this.tag !== "mail") {
|
|
79
|
+
tag = this.tag;
|
|
80
|
+
}
|
|
81
|
+
// The parent mail element.
|
|
82
|
+
else {
|
|
83
|
+
tag = "body";
|
|
84
|
+
// Build header.
|
|
85
|
+
html += "<!DOCTYPE html>";
|
|
86
|
+
html += `<html lang="${this._lang || "en"}" style="height: 100%;">`;
|
|
87
|
+
html += `<head>`;
|
|
88
|
+
html += `<meta charset="${this._charset || "UTF-8"}">`;
|
|
89
|
+
html += `<meta name="viewport" charset="${this._viewport || "width=device-width, initial-scale=1.0"}">`;
|
|
90
|
+
html += `<meta name="color-scheme" content="light">`;
|
|
91
|
+
html += `<meta name="supported-color-schemes" content="light">`;
|
|
92
|
+
html += `<title>${this._title || ""}"</title>`;
|
|
93
|
+
html += "<style type=\"text/css\">* {box-sizing:border-box;}</style>";
|
|
94
|
+
// Links.
|
|
95
|
+
if (this._links !== undefined) {
|
|
96
|
+
this._links.forEach((url) => {
|
|
97
|
+
if (typeof url === "string") {
|
|
98
|
+
html += `<link rel="stylesheet" href="${url}">`;
|
|
99
|
+
}
|
|
100
|
+
else if (typeof url === "object") {
|
|
101
|
+
if (url.rel == null) {
|
|
102
|
+
url.rel = "stylesheet";
|
|
103
|
+
}
|
|
104
|
+
html += "<link";
|
|
105
|
+
Object.keys(url).forEach((key) => {
|
|
106
|
+
html += ` ${key}="${url[key]}"`;
|
|
107
|
+
});
|
|
108
|
+
html += ">";
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
throw Error("Invalid type for a css include, the valid value types are \"string\" and \"object\".");
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// Close header.
|
|
116
|
+
html += `</head>`;
|
|
117
|
+
// Set presentation role.
|
|
118
|
+
if (this.children.length > 0 && this.children[0].tag === "table") {
|
|
119
|
+
this.children[0]._attrs.role = "presentation";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Open.
|
|
123
|
+
html += "<";
|
|
124
|
+
html += tag;
|
|
125
|
+
html += " ";
|
|
126
|
+
// Classes.
|
|
127
|
+
if (this.classes.length > 0) {
|
|
128
|
+
html += "class=\"";
|
|
129
|
+
let i = 0;
|
|
130
|
+
this.classes.forEach((key) => {
|
|
131
|
+
html += key;
|
|
132
|
+
if (i < this.classes.length - 1) {
|
|
133
|
+
html += " ";
|
|
134
|
+
}
|
|
135
|
+
++i;
|
|
136
|
+
});
|
|
137
|
+
html += "\" ";
|
|
138
|
+
}
|
|
139
|
+
// Style.
|
|
140
|
+
if (Object.keys(this._style).length > 0) {
|
|
141
|
+
html += "style=\"";
|
|
142
|
+
Object.keys(this._style).forEach((key) => {
|
|
143
|
+
html += `${key}:${this._style[key].replaceAll('"', '\'')};`;
|
|
144
|
+
});
|
|
145
|
+
html += "\"";
|
|
146
|
+
}
|
|
147
|
+
// Attributes.
|
|
148
|
+
Object.keys(this._attrs).forEach((key) => {
|
|
149
|
+
html += ` ${key}="${this._attrs[key]}"`;
|
|
150
|
+
});
|
|
151
|
+
// End opening.
|
|
152
|
+
html += ">\n";
|
|
153
|
+
// Add inner html.
|
|
154
|
+
if (this._inner_html != null) {
|
|
155
|
+
html += this._inner_html;
|
|
156
|
+
}
|
|
157
|
+
// Add children.
|
|
158
|
+
this.children.forEach((child) => {
|
|
159
|
+
html += child.html();
|
|
160
|
+
});
|
|
161
|
+
// Close.
|
|
162
|
+
html += "</";
|
|
163
|
+
html += this.tag;
|
|
164
|
+
html += "";
|
|
165
|
+
html += ">\n";
|
|
166
|
+
// The parent mail element.
|
|
167
|
+
if (this.tag === "mail") {
|
|
168
|
+
html += "</html>";
|
|
169
|
+
}
|
|
170
|
+
// Response.
|
|
171
|
+
return html;
|
|
172
|
+
}
|
|
173
|
+
// Add links to the main MailElement.
|
|
174
|
+
links(links) {
|
|
175
|
+
if (this._links === undefined) {
|
|
176
|
+
this._links = [];
|
|
177
|
+
}
|
|
178
|
+
this._links = this._links.concat(links);
|
|
179
|
+
return this;
|
|
180
|
+
}
|
|
181
|
+
background_color(value) {
|
|
182
|
+
if (value == null)
|
|
183
|
+
return this._style["background-color"];
|
|
184
|
+
this._style["background-color"] = value;
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
display(value) {
|
|
188
|
+
if (value == null)
|
|
189
|
+
return this._style["display"];
|
|
190
|
+
this._style["display"] = value;
|
|
191
|
+
return this;
|
|
192
|
+
}
|
|
193
|
+
background_image(value) {
|
|
194
|
+
if (value == null)
|
|
195
|
+
return this._style["background-image"];
|
|
196
|
+
this._style["background-image"] = value;
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
background_repeat(value) {
|
|
200
|
+
if (value == null)
|
|
201
|
+
return this._style["background-repeat"];
|
|
202
|
+
this._style["background-repeat"] = value;
|
|
203
|
+
return this;
|
|
204
|
+
}
|
|
205
|
+
border_top(value) {
|
|
206
|
+
if (value == null)
|
|
207
|
+
return this._style["border-top"];
|
|
208
|
+
this._style["border-top"] = value;
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
211
|
+
border_bottom(value) {
|
|
212
|
+
if (value == null)
|
|
213
|
+
return this._style["border-bottom"];
|
|
214
|
+
this._style["border-bottom"] = value;
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
border_right(value) {
|
|
218
|
+
if (value == null)
|
|
219
|
+
return this._style["border-right"];
|
|
220
|
+
this._style["border-right"] = value;
|
|
221
|
+
return this;
|
|
222
|
+
}
|
|
223
|
+
border_left(value) {
|
|
224
|
+
if (value == null)
|
|
225
|
+
return this._style["border-left"];
|
|
226
|
+
this._style["border-left"] = value;
|
|
227
|
+
return this;
|
|
228
|
+
}
|
|
229
|
+
border_color(value) {
|
|
230
|
+
if (value == null)
|
|
231
|
+
return this._style["border-color"];
|
|
232
|
+
this._style["border-color"] = value;
|
|
233
|
+
return this;
|
|
234
|
+
}
|
|
235
|
+
border_style(value) {
|
|
236
|
+
if (value == null)
|
|
237
|
+
return this._style["border-style"];
|
|
238
|
+
this._style["border-style"] = value;
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
cursor(value) {
|
|
242
|
+
if (value == null)
|
|
243
|
+
return this._style["cursor"];
|
|
244
|
+
this._style["cursor"] = value;
|
|
245
|
+
return this;
|
|
246
|
+
}
|
|
247
|
+
justify_items(value) {
|
|
248
|
+
if (value == null)
|
|
249
|
+
return this._style["justify-items"];
|
|
250
|
+
this._style["justify-items"] = value;
|
|
251
|
+
return this;
|
|
252
|
+
}
|
|
253
|
+
letter_spacing(value) {
|
|
254
|
+
if (value == null)
|
|
255
|
+
return this._style["letter-spacing"];
|
|
256
|
+
this._style["letter-spacing"] = value;
|
|
257
|
+
return this;
|
|
258
|
+
}
|
|
259
|
+
line_height(value) {
|
|
260
|
+
if (value == null)
|
|
261
|
+
return this._style["line-height"];
|
|
262
|
+
this._style["line-height"] = value;
|
|
263
|
+
return this;
|
|
264
|
+
}
|
|
265
|
+
outline(value) {
|
|
266
|
+
if (value == null)
|
|
267
|
+
return this._style["outline"];
|
|
268
|
+
this._style["outline"] = value;
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
overflow(value) {
|
|
272
|
+
if (value == null)
|
|
273
|
+
return this._style["overflow"];
|
|
274
|
+
this._style["overflow"] = value;
|
|
275
|
+
return this;
|
|
276
|
+
}
|
|
277
|
+
overflow_x(value) {
|
|
278
|
+
if (value == null)
|
|
279
|
+
return this._style["overflow-x"];
|
|
280
|
+
this._style["overflow-x"] = value;
|
|
281
|
+
return this;
|
|
282
|
+
}
|
|
283
|
+
overflow_y(value) {
|
|
284
|
+
if (value == null)
|
|
285
|
+
return this._style["overflow-y"];
|
|
286
|
+
this._style["overflow-y"] = value;
|
|
287
|
+
return this;
|
|
288
|
+
}
|
|
289
|
+
text_align(value) {
|
|
290
|
+
if (value == null)
|
|
291
|
+
return this._style["text-align"];
|
|
292
|
+
this._style["text-align"] = value;
|
|
293
|
+
return this;
|
|
294
|
+
}
|
|
295
|
+
text_align_last(value) {
|
|
296
|
+
if (value == null)
|
|
297
|
+
return this._style["text-align-last"];
|
|
298
|
+
this._style["text-align-last"] = value;
|
|
299
|
+
return this;
|
|
300
|
+
}
|
|
301
|
+
text_decoration(value) {
|
|
302
|
+
if (value == null)
|
|
303
|
+
return this._style["text-decoration"];
|
|
304
|
+
this._style["text-decoration"] = value;
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
text_decoration_color(value) {
|
|
308
|
+
if (value == null)
|
|
309
|
+
return this._style["text-decoration-color"];
|
|
310
|
+
this._style["text-decoration-color"] = value;
|
|
311
|
+
return this;
|
|
312
|
+
}
|
|
313
|
+
text_wrap(value) {
|
|
314
|
+
if (value == null)
|
|
315
|
+
return this._style["text-wrap"];
|
|
316
|
+
this._style["text-wrap"] = value;
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
white_space(value) {
|
|
320
|
+
if (value == null)
|
|
321
|
+
return this._style["white-space"];
|
|
322
|
+
this._style["white-space"] = value;
|
|
323
|
+
return this;
|
|
324
|
+
}
|
|
325
|
+
overflow_wrap(value) {
|
|
326
|
+
if (value == null)
|
|
327
|
+
return this._style["overflow-wrap"];
|
|
328
|
+
this._style["overflow-wrap"] = value;
|
|
329
|
+
return this;
|
|
330
|
+
}
|
|
331
|
+
word_wrap(value) {
|
|
332
|
+
if (value == null)
|
|
333
|
+
return this._style["word-wrap"];
|
|
334
|
+
this._style["word-wrap"] = value;
|
|
335
|
+
return this;
|
|
336
|
+
}
|
|
337
|
+
box_shadow(value) {
|
|
338
|
+
if (value == null)
|
|
339
|
+
return this._style["box-shadow"];
|
|
340
|
+
this._style["box-shadow"] = value;
|
|
341
|
+
return this;
|
|
342
|
+
}
|
|
343
|
+
drop_shadow(value) {
|
|
344
|
+
if (value == null)
|
|
345
|
+
return this._style["drop-shadow"];
|
|
346
|
+
this._style["drop-shadow"] = value;
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
349
|
+
font_size(value) {
|
|
350
|
+
if (value == null)
|
|
351
|
+
return this._style["font-size"];
|
|
352
|
+
this._style["font-size"] = this.pad_numeric(value);
|
|
353
|
+
return this;
|
|
354
|
+
}
|
|
355
|
+
font(value) {
|
|
356
|
+
if (value == null)
|
|
357
|
+
return this._style["font"];
|
|
358
|
+
this._style["font"] = this.pad_numeric(value);
|
|
359
|
+
return this;
|
|
360
|
+
}
|
|
361
|
+
font_family(value) {
|
|
362
|
+
if (value == null)
|
|
363
|
+
return this._style["font-family"];
|
|
364
|
+
this._style["font-family"] = this.pad_numeric(value);
|
|
365
|
+
return this;
|
|
366
|
+
}
|
|
367
|
+
font_style(value) {
|
|
368
|
+
if (value == null)
|
|
369
|
+
return this._style["font-style"];
|
|
370
|
+
this._style["font-style"] = this.pad_numeric(value);
|
|
371
|
+
return this;
|
|
372
|
+
}
|
|
373
|
+
font_weight(value) {
|
|
374
|
+
if (value == null)
|
|
375
|
+
return this._style["font-weight"];
|
|
376
|
+
this._style["font-weight"] = this.pad_numeric(value);
|
|
377
|
+
return this;
|
|
378
|
+
}
|
|
379
|
+
width(value) {
|
|
380
|
+
if (value == null)
|
|
381
|
+
return this._style["width"];
|
|
382
|
+
this._style["width"] = this.pad_numeric(value);
|
|
383
|
+
return this;
|
|
384
|
+
}
|
|
385
|
+
min_width(value) {
|
|
386
|
+
if (value == null)
|
|
387
|
+
return this._style["min-width"];
|
|
388
|
+
this._style["min-width"] = this.pad_numeric(value);
|
|
389
|
+
return this;
|
|
390
|
+
}
|
|
391
|
+
max_width(value) {
|
|
392
|
+
if (value == null)
|
|
393
|
+
return this._style["max-width"];
|
|
394
|
+
this._style["max-width"] = this.pad_numeric(value);
|
|
395
|
+
return this;
|
|
396
|
+
}
|
|
397
|
+
height(value) {
|
|
398
|
+
if (value == null)
|
|
399
|
+
return this._style["height"];
|
|
400
|
+
this._style["height"] = this.pad_numeric(value);
|
|
401
|
+
return this;
|
|
402
|
+
}
|
|
403
|
+
min_height(value) {
|
|
404
|
+
if (value == null)
|
|
405
|
+
return this._style["min-height"];
|
|
406
|
+
this._style["min-height"] = this.pad_numeric(value);
|
|
407
|
+
return this;
|
|
408
|
+
}
|
|
409
|
+
max_height(value) {
|
|
410
|
+
if (value == null)
|
|
411
|
+
return this._style["max-height"];
|
|
412
|
+
this._style["max-height"] = this.pad_numeric(value);
|
|
413
|
+
return this;
|
|
414
|
+
}
|
|
415
|
+
margin_top(value) {
|
|
416
|
+
if (value == null)
|
|
417
|
+
return this._style["margin-top"];
|
|
418
|
+
this._style["margin-top"] = this.pad_numeric(value);
|
|
419
|
+
return this;
|
|
420
|
+
}
|
|
421
|
+
margin_bottom(value) {
|
|
422
|
+
if (value == null)
|
|
423
|
+
return this._style["margin-bottom"];
|
|
424
|
+
this._style["margin-bottom"] = this.pad_numeric(value);
|
|
425
|
+
return this;
|
|
426
|
+
}
|
|
427
|
+
margin_right(value) {
|
|
428
|
+
if (value == null)
|
|
429
|
+
return this._style["margin-right"];
|
|
430
|
+
this._style["margin-right"] = this.pad_numeric(value);
|
|
431
|
+
return this;
|
|
432
|
+
}
|
|
433
|
+
margin_left(value) {
|
|
434
|
+
if (value == null)
|
|
435
|
+
return this._style["margin-left"];
|
|
436
|
+
this._style["margin-left"] = this.pad_numeric(value);
|
|
437
|
+
return this;
|
|
438
|
+
}
|
|
439
|
+
padding_top(value) {
|
|
440
|
+
if (value == null)
|
|
441
|
+
return this._style["padding-top"];
|
|
442
|
+
this._style["padding-top"] = this.pad_numeric(value);
|
|
443
|
+
return this;
|
|
444
|
+
}
|
|
445
|
+
padding_bottom(value) {
|
|
446
|
+
if (value == null)
|
|
447
|
+
return this._style["padding-bottom"];
|
|
448
|
+
this._style["padding-bottom"] = this.pad_numeric(value);
|
|
449
|
+
return this;
|
|
450
|
+
}
|
|
451
|
+
padding_right(value) {
|
|
452
|
+
if (value == null)
|
|
453
|
+
return this._style["padding-right"];
|
|
454
|
+
this._style["padding-right"] = this.pad_numeric(value);
|
|
455
|
+
return this;
|
|
456
|
+
}
|
|
457
|
+
padding_left(value) {
|
|
458
|
+
if (value == null)
|
|
459
|
+
return this._style["padding-left"];
|
|
460
|
+
this._style["padding-left"] = this.pad_numeric(value);
|
|
461
|
+
return this;
|
|
462
|
+
}
|
|
463
|
+
border_width(value) {
|
|
464
|
+
if (value == null)
|
|
465
|
+
return this._style["border-width"];
|
|
466
|
+
this._style["border-width"] = this.pad_numeric(value);
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
align_items(value) {
|
|
470
|
+
if (value == null)
|
|
471
|
+
return this._style["align-items"];
|
|
472
|
+
this._style["align-items"] = value;
|
|
473
|
+
this._style["-ms-align-items"] = value;
|
|
474
|
+
this._style["-webkit-align-items"] = value;
|
|
475
|
+
this._style["-moz-align-items"] = value;
|
|
476
|
+
return this;
|
|
477
|
+
}
|
|
478
|
+
align_content(value) {
|
|
479
|
+
if (value == null)
|
|
480
|
+
return this._style["align-content"];
|
|
481
|
+
this._style["align-content"] = value;
|
|
482
|
+
this._style["-ms-align-content"] = value;
|
|
483
|
+
this._style["-webkit-align-content"] = value;
|
|
484
|
+
this._style["-moz-align-content"] = value;
|
|
485
|
+
return this;
|
|
486
|
+
}
|
|
487
|
+
background_size(value) {
|
|
488
|
+
if (value == null)
|
|
489
|
+
return this._style["background-size"];
|
|
490
|
+
this._style["background-size"] = value;
|
|
491
|
+
this._style["-ms-background-size"] = value;
|
|
492
|
+
this._style["-webkit-background-size"] = value;
|
|
493
|
+
this._style["-moz-background-size"] = value;
|
|
494
|
+
return this;
|
|
495
|
+
}
|
|
496
|
+
box_sizing(value) {
|
|
497
|
+
if (value == null)
|
|
498
|
+
return this._style["box-sizing"];
|
|
499
|
+
this._style["box-sizing"] = value;
|
|
500
|
+
this._style["-ms-box-sizing"] = value;
|
|
501
|
+
this._style["-webkit-box-sizing"] = value;
|
|
502
|
+
this._style["-moz-box-sizing"] = value;
|
|
503
|
+
return this;
|
|
504
|
+
}
|
|
505
|
+
flex(value) {
|
|
506
|
+
if (value == null)
|
|
507
|
+
return this._style["flex"];
|
|
508
|
+
this._style["flex"] = value;
|
|
509
|
+
this._style["-ms-flex"] = value;
|
|
510
|
+
this._style["-webkit-flex"] = value;
|
|
511
|
+
this._style["-moz-flex"] = value;
|
|
512
|
+
return this;
|
|
513
|
+
}
|
|
514
|
+
flex_grow(value) {
|
|
515
|
+
if (value == null)
|
|
516
|
+
return this._style["flex-grow"];
|
|
517
|
+
this._style["flex-grow"] = value;
|
|
518
|
+
this._style["-ms-flex-grow"] = value;
|
|
519
|
+
this._style["-webkit-flex-grow"] = value;
|
|
520
|
+
this._style["-moz-flex-grow"] = value;
|
|
521
|
+
return this;
|
|
522
|
+
}
|
|
523
|
+
flex_shrink(value) {
|
|
524
|
+
if (value == null)
|
|
525
|
+
return this._style["flex-shrink"];
|
|
526
|
+
this._style["flex-shrink"] = value;
|
|
527
|
+
this._style["-ms-flex-shrink"] = value;
|
|
528
|
+
this._style["-webkit-flex-shrink"] = value;
|
|
529
|
+
this._style["-moz-flex-shrink"] = value;
|
|
530
|
+
return this;
|
|
531
|
+
}
|
|
532
|
+
justify_content(value) {
|
|
533
|
+
if (value == null)
|
|
534
|
+
return this._style["justify-content"];
|
|
535
|
+
this._style["justify-content"] = value;
|
|
536
|
+
this._style["-ms-justify-content"] = value;
|
|
537
|
+
this._style["-webkit-justify-content"] = value;
|
|
538
|
+
this._style["-moz-justify-content"] = value;
|
|
539
|
+
return this;
|
|
540
|
+
}
|
|
541
|
+
mask(value) {
|
|
542
|
+
if (value == null)
|
|
543
|
+
return this._style["mask"];
|
|
544
|
+
this._style["mask"] = value;
|
|
545
|
+
this._style["-ms-mask"] = value;
|
|
546
|
+
this._style["-webkit-mask"] = value;
|
|
547
|
+
this._style["-moz-mask"] = value;
|
|
548
|
+
return this;
|
|
549
|
+
}
|
|
550
|
+
user_select(value) {
|
|
551
|
+
if (value == null)
|
|
552
|
+
return this._style["user-select"];
|
|
553
|
+
this._style["user-select"] = value;
|
|
554
|
+
this._style["-ms-user-select"] = value;
|
|
555
|
+
this._style["-webkit-user-select"] = value;
|
|
556
|
+
this._style["-moz-user-select"] = value;
|
|
557
|
+
return this;
|
|
558
|
+
}
|
|
559
|
+
// ---------------------------------------------------------
|
|
560
|
+
// Edit the element.
|
|
561
|
+
// Style the element.
|
|
562
|
+
styles(styles) {
|
|
563
|
+
Object.keys(styles).forEach((key) => {
|
|
564
|
+
this._style[key] = styles[key];
|
|
565
|
+
});
|
|
566
|
+
return this;
|
|
567
|
+
}
|
|
568
|
+
// Add attributes to the element.
|
|
569
|
+
attrs(attrs) {
|
|
570
|
+
Object.keys(attrs).forEach((key) => {
|
|
571
|
+
this._attrs[key] = attrs[key];
|
|
572
|
+
});
|
|
573
|
+
return this;
|
|
574
|
+
}
|
|
575
|
+
// Add events to the element.
|
|
576
|
+
events(events) {
|
|
577
|
+
Object.keys(events).forEach((key) => {
|
|
578
|
+
this._attrs[key] = events[key];
|
|
579
|
+
});
|
|
580
|
+
return this;
|
|
581
|
+
}
|
|
582
|
+
// Add class.
|
|
583
|
+
add_class(name) {
|
|
584
|
+
if (this.classes.includes(name) === false) {
|
|
585
|
+
this.classes.push(name);
|
|
586
|
+
}
|
|
587
|
+
return this;
|
|
588
|
+
}
|
|
589
|
+
// Remove class.
|
|
590
|
+
remove_class(name) {
|
|
591
|
+
this.classes = this.classes.filter((cls) => cls !== name);
|
|
592
|
+
return this;
|
|
593
|
+
}
|
|
594
|
+
// Append a child.
|
|
595
|
+
append(...children) {
|
|
596
|
+
children.forEach((child) => {
|
|
597
|
+
// Skip undefined.
|
|
598
|
+
if (child == null) {
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
// Array.
|
|
602
|
+
else if (Array.isArray(child)) {
|
|
603
|
+
this.append(...child);
|
|
604
|
+
}
|
|
605
|
+
// Execute function.
|
|
606
|
+
else if (typeof child === "function") {
|
|
607
|
+
this.append(child(this));
|
|
608
|
+
}
|
|
609
|
+
// Default.
|
|
610
|
+
else {
|
|
611
|
+
this.children.push(child);
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
return this;
|
|
615
|
+
}
|
|
616
|
+
inner_html(value) {
|
|
617
|
+
if (value == null) {
|
|
618
|
+
return this._inner_html;
|
|
619
|
+
}
|
|
620
|
+
this._inner_html = value;
|
|
621
|
+
return this;
|
|
622
|
+
}
|
|
623
|
+
// ---------------------------------------------------------
|
|
624
|
+
// Styling.
|
|
625
|
+
// Center the data.
|
|
626
|
+
center() {
|
|
627
|
+
switch (this.tag) {
|
|
628
|
+
case "table":
|
|
629
|
+
case "tr":
|
|
630
|
+
case "td":
|
|
631
|
+
this._attrs["align"] = "center";
|
|
632
|
+
return this;
|
|
633
|
+
default:
|
|
634
|
+
this._style["text-align"] = "center";
|
|
635
|
+
return this;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
padding(...values) {
|
|
639
|
+
if (values.length === 0) {
|
|
640
|
+
return this._style.padding;
|
|
641
|
+
}
|
|
642
|
+
else if (values.length === 1) {
|
|
643
|
+
this._style.padding = this.pad_numeric(values[0]);
|
|
644
|
+
}
|
|
645
|
+
else if (values.length === 2) {
|
|
646
|
+
if (values[0] != null) {
|
|
647
|
+
this._style["padding-top"] = this.pad_numeric(values[0]);
|
|
648
|
+
}
|
|
649
|
+
if (values[1] != null) {
|
|
650
|
+
this._style["padding-right"] = this.pad_numeric(values[1]);
|
|
651
|
+
}
|
|
652
|
+
if (values[0] != null) {
|
|
653
|
+
this._style["padding-bottom"] = this.pad_numeric(values[0]);
|
|
654
|
+
}
|
|
655
|
+
if (values[1] != null) {
|
|
656
|
+
this._style["padding-left"] = this.pad_numeric(values[1]);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
else if (values.length === 4) {
|
|
660
|
+
this._style["padding-top"] = this.pad_numeric(values[0]);
|
|
661
|
+
if (values[1] != null) {
|
|
662
|
+
this._style["padding-right"] = this.pad_numeric(values[1]);
|
|
663
|
+
}
|
|
664
|
+
if (values[2] != null) {
|
|
665
|
+
this._style["padding-bottom"] = this.pad_numeric(values[2]);
|
|
666
|
+
}
|
|
667
|
+
if (values[3] != null) {
|
|
668
|
+
this._style["padding-left"] = this.pad_numeric(values[3]);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
console.error("Invalid number of arguments for function \"padding()\".");
|
|
673
|
+
}
|
|
674
|
+
return this;
|
|
675
|
+
}
|
|
676
|
+
margin(...values) {
|
|
677
|
+
if (values.length === 0) {
|
|
678
|
+
return this._style.margin;
|
|
679
|
+
}
|
|
680
|
+
else if (values.length === 1) {
|
|
681
|
+
this._style.margin = this.pad_numeric(values[0]);
|
|
682
|
+
}
|
|
683
|
+
else if (values.length === 2) {
|
|
684
|
+
this._style["margin-top"] = this.pad_numeric(values[0]);
|
|
685
|
+
if (values[1] != null) {
|
|
686
|
+
this._style["margin-left"] = this.pad_numeric(values[1]);
|
|
687
|
+
}
|
|
688
|
+
if (values[0] != null) {
|
|
689
|
+
this._style["margin-bottom"] = this.pad_numeric(values[0]);
|
|
690
|
+
}
|
|
691
|
+
if (values[1] != null) {
|
|
692
|
+
this._style["margin-left"] = this.pad_numeric(values[1]);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
else if (values.length === 4) {
|
|
696
|
+
this._style["margin-top"] = this.pad_numeric(values[0]);
|
|
697
|
+
if (values[1] != null) {
|
|
698
|
+
this._style["margin-left"] = this.pad_numeric(values[1]);
|
|
699
|
+
}
|
|
700
|
+
if (values[2] != null) {
|
|
701
|
+
this._style["margin-bottom"] = this.pad_numeric(values[2]);
|
|
702
|
+
}
|
|
703
|
+
if (values[3] != null) {
|
|
704
|
+
this._style["margin-left"] = this.pad_numeric(values[3]);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
console.error("Invalid number of arguments for function \"margin()\".");
|
|
709
|
+
}
|
|
710
|
+
return this;
|
|
711
|
+
}
|
|
712
|
+
fixed_width(value) {
|
|
713
|
+
if (value == null) {
|
|
714
|
+
return this._style["min-width"];
|
|
715
|
+
}
|
|
716
|
+
value = this.pad_numeric(value);
|
|
717
|
+
this._style["width"] = value; // also required for for example image masks.
|
|
718
|
+
this._style["min-width"] = value;
|
|
719
|
+
this._style["max-width"] = value;
|
|
720
|
+
return this;
|
|
721
|
+
}
|
|
722
|
+
fixed_height(value) {
|
|
723
|
+
if (value == null) {
|
|
724
|
+
return this._style.height;
|
|
725
|
+
}
|
|
726
|
+
value = this.pad_numeric(value);
|
|
727
|
+
this._style["height"] = value; // also required for for example image masks.
|
|
728
|
+
this._style["min-height"] = value;
|
|
729
|
+
this._style["max-height"] = value;
|
|
730
|
+
return this;
|
|
731
|
+
}
|
|
732
|
+
// Frame.
|
|
733
|
+
frame(width, height) {
|
|
734
|
+
if (width != null) {
|
|
735
|
+
this.width(width);
|
|
736
|
+
}
|
|
737
|
+
if (height != null) {
|
|
738
|
+
this.height(height);
|
|
739
|
+
}
|
|
740
|
+
return this;
|
|
741
|
+
}
|
|
742
|
+
min_frame(width, height) {
|
|
743
|
+
if (width != null) {
|
|
744
|
+
this.min_width(width);
|
|
745
|
+
}
|
|
746
|
+
if (height != null) {
|
|
747
|
+
this.min_height(height);
|
|
748
|
+
}
|
|
749
|
+
return this;
|
|
750
|
+
}
|
|
751
|
+
max_frame(width, height) {
|
|
752
|
+
if (width != null) {
|
|
753
|
+
this.max_width(width);
|
|
754
|
+
}
|
|
755
|
+
if (height != null) {
|
|
756
|
+
this.max_height(height);
|
|
757
|
+
}
|
|
758
|
+
return this;
|
|
759
|
+
}
|
|
760
|
+
fixed_frame(width, height) {
|
|
761
|
+
if (width != null) {
|
|
762
|
+
width = this.pad_numeric(width);
|
|
763
|
+
this._style.width = width; // also required for for example image masks.
|
|
764
|
+
this._style["min-width"] = width;
|
|
765
|
+
this._style["max-width"] = width;
|
|
766
|
+
}
|
|
767
|
+
if (height != null) {
|
|
768
|
+
height = this.pad_numeric(height);
|
|
769
|
+
this._style.height = height; // also required for for example image masks.
|
|
770
|
+
this._style["min-height"] = height;
|
|
771
|
+
this._style["max-height"] = height;
|
|
772
|
+
}
|
|
773
|
+
return this;
|
|
774
|
+
}
|
|
775
|
+
color(value) {
|
|
776
|
+
if (value == null) {
|
|
777
|
+
return this._style.color;
|
|
778
|
+
}
|
|
779
|
+
if (value.startsWith("linear-gradient(") || value.startsWith("radial-gradient(")) {
|
|
780
|
+
this._style["background-image"] = value;
|
|
781
|
+
this._style["background-clip"] = "text";
|
|
782
|
+
this._style["-webkit-background-clip"] = "text";
|
|
783
|
+
this._style.color = "transparent";
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
this._style.color = value;
|
|
787
|
+
}
|
|
788
|
+
return this;
|
|
789
|
+
}
|
|
790
|
+
border(...values) {
|
|
791
|
+
if (values.length === 0) {
|
|
792
|
+
return this._style.border;
|
|
793
|
+
}
|
|
794
|
+
else if (values.length === 1) {
|
|
795
|
+
this._style.border = values[0].toString();
|
|
796
|
+
}
|
|
797
|
+
else if (values.length === 2) {
|
|
798
|
+
this._style.border = `${this.pad_numeric(values[0])} solid ${values[1]}`;
|
|
799
|
+
}
|
|
800
|
+
else if (values.length === 3) {
|
|
801
|
+
this._style.border = `${this.pad_numeric(values[0])} ${values[1]} ${values[2]}`;
|
|
802
|
+
}
|
|
803
|
+
else {
|
|
804
|
+
console.error("Invalid number of arguments for function \"border()\".");
|
|
805
|
+
}
|
|
806
|
+
return this;
|
|
807
|
+
}
|
|
808
|
+
border_radius(value) {
|
|
809
|
+
if (value == null) {
|
|
810
|
+
return this._style["border-radius"];
|
|
811
|
+
}
|
|
812
|
+
const paddedValue = this.pad_numeric(value);
|
|
813
|
+
this._style["border-radius"] = paddedValue;
|
|
814
|
+
this._style["-ms-border-radius"] = paddedValue;
|
|
815
|
+
this._style["-webkit-border-radius"] = paddedValue;
|
|
816
|
+
this._style["-moz-border-radius"] = paddedValue;
|
|
817
|
+
return this;
|
|
818
|
+
}
|
|
819
|
+
background(value) {
|
|
820
|
+
if (value == null) {
|
|
821
|
+
return this._style.background;
|
|
822
|
+
}
|
|
823
|
+
if (typeof value === "string" && (value.startsWith("linear-gradient") || value.startsWith("radial-gradient"))) {
|
|
824
|
+
this._style.background = value;
|
|
825
|
+
this._style["background-image"] = value;
|
|
826
|
+
this._style["background-repeat"] = "no-repeat";
|
|
827
|
+
this._style["background-size"] = "cover";
|
|
828
|
+
}
|
|
829
|
+
else {
|
|
830
|
+
this._style.background = value;
|
|
831
|
+
}
|
|
832
|
+
return this;
|
|
833
|
+
}
|
|
834
|
+
ellipsis_overflow(to = true) {
|
|
835
|
+
if (to == null) {
|
|
836
|
+
return this._style["text-overflow"] === "ellipsis";
|
|
837
|
+
}
|
|
838
|
+
else if (to === true) {
|
|
839
|
+
this._style["text-overflow"] = "ellipsis";
|
|
840
|
+
this._style["white-space"] = "nowrap";
|
|
841
|
+
this._style.overflow = "hidden";
|
|
842
|
+
this._style["text-wrap"] = "wrap";
|
|
843
|
+
this._style["overflow-wrap"] = "break-word";
|
|
844
|
+
}
|
|
845
|
+
else if (to === false) {
|
|
846
|
+
this._style["text-overflow"] = "default";
|
|
847
|
+
this._style["white-space"] = "default";
|
|
848
|
+
this._style.overflow = "default";
|
|
849
|
+
this._style["text-wrap"] = "default";
|
|
850
|
+
this._style["overflow-wrap"] = "default";
|
|
851
|
+
}
|
|
852
|
+
return this;
|
|
853
|
+
}
|
|
854
|
+
on_click(callback) {
|
|
855
|
+
if (callback == null) {
|
|
856
|
+
return this._attrs.onclick;
|
|
857
|
+
}
|
|
858
|
+
this._style.cursor = "pointer";
|
|
859
|
+
const e = this;
|
|
860
|
+
this._attrs.onclick = (t) => {
|
|
861
|
+
if (this._disabled !== true) {
|
|
862
|
+
callback(e, t);
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
return this;
|
|
866
|
+
}
|
|
867
|
+
lang(value) {
|
|
868
|
+
if (value == null) {
|
|
869
|
+
return this._lang;
|
|
870
|
+
}
|
|
871
|
+
this._lang = value;
|
|
872
|
+
return this;
|
|
873
|
+
}
|
|
874
|
+
charset(value) {
|
|
875
|
+
if (value == null) {
|
|
876
|
+
return this._charset;
|
|
877
|
+
}
|
|
878
|
+
this._charset = value;
|
|
879
|
+
return this;
|
|
880
|
+
}
|
|
881
|
+
viewport(value) {
|
|
882
|
+
if (value == null) {
|
|
883
|
+
return this._viewport;
|
|
884
|
+
}
|
|
885
|
+
this._viewport = value;
|
|
886
|
+
return this;
|
|
887
|
+
}
|
|
888
|
+
title(value) {
|
|
889
|
+
if (value == null) {
|
|
890
|
+
return this._title;
|
|
891
|
+
}
|
|
892
|
+
this._title = value;
|
|
893
|
+
return this;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
exports.Element = Element;
|
|
897
|
+
// Create a constructor wrapper.
|
|
898
|
+
function wrapper(constructor) {
|
|
899
|
+
return (...args) => new constructor(...args);
|
|
900
|
+
}
|
|
901
|
+
// Create a shared null element mainly for typescript types.
|
|
902
|
+
function create_null(target_class) {
|
|
903
|
+
let instance;
|
|
904
|
+
return () => {
|
|
905
|
+
if (instance === undefined) {
|
|
906
|
+
instance = new target_class();
|
|
907
|
+
}
|
|
908
|
+
return instance;
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
// ---------------------------------------------------------
|
|
912
|
+
// Title.
|
|
913
|
+
class TitleElement extends Element {
|
|
914
|
+
// Constructor.
|
|
915
|
+
constructor(text) {
|
|
916
|
+
// Initialize base class.
|
|
917
|
+
super({
|
|
918
|
+
type: "Title",
|
|
919
|
+
tag: "h1",
|
|
920
|
+
default_style: {
|
|
921
|
+
"margin": "0px 0px 0px 0px",
|
|
922
|
+
"color": "inherit",
|
|
923
|
+
"white-space": "wrap",
|
|
924
|
+
"text-align": "inherit",
|
|
925
|
+
"font-size": "26px",
|
|
926
|
+
"line-height": "1.2em",
|
|
927
|
+
},
|
|
928
|
+
});
|
|
929
|
+
// Set text.
|
|
930
|
+
if (text) {
|
|
931
|
+
this._inner_html = text;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
exports.TitleElement = TitleElement;
|
|
936
|
+
exports.Title = wrapper(TitleElement);
|
|
937
|
+
exports.NullTitle = create_null(TitleElement);
|
|
938
|
+
// ---------------------------------------------------------
|
|
939
|
+
// Subtitle.
|
|
940
|
+
class SubtitleElement extends Element {
|
|
941
|
+
// Constructor.
|
|
942
|
+
constructor(text) {
|
|
943
|
+
// Initialize base class.
|
|
944
|
+
super({
|
|
945
|
+
type: "Subtitle",
|
|
946
|
+
tag: "h2",
|
|
947
|
+
default_style: {
|
|
948
|
+
"margin": "0px",
|
|
949
|
+
"color": "inherit",
|
|
950
|
+
"white-space": "wrap",
|
|
951
|
+
"text-align": "inherit",
|
|
952
|
+
"font-size": "22px",
|
|
953
|
+
"line-height": "1.2em",
|
|
954
|
+
},
|
|
955
|
+
});
|
|
956
|
+
// Set text.
|
|
957
|
+
if (text) {
|
|
958
|
+
this._inner_html = text;
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
exports.SubtitleElement = SubtitleElement;
|
|
963
|
+
exports.Subtitle = wrapper(SubtitleElement);
|
|
964
|
+
exports.NullSubtitle = create_null(SubtitleElement);
|
|
965
|
+
// ---------------------------------------------------------
|
|
966
|
+
// Text.
|
|
967
|
+
class TextElement extends Element {
|
|
968
|
+
// Constructor.
|
|
969
|
+
constructor(text) {
|
|
970
|
+
// Initialize base class.
|
|
971
|
+
super({
|
|
972
|
+
type: "Text",
|
|
973
|
+
tag: "p",
|
|
974
|
+
default_style: {
|
|
975
|
+
"margin": "0px",
|
|
976
|
+
"padding": "0px",
|
|
977
|
+
"font-size": "18px",
|
|
978
|
+
"line-height": "1.4em",
|
|
979
|
+
"color": "inherit",
|
|
980
|
+
"text-align": "inherit",
|
|
981
|
+
"white-space": "wrap",
|
|
982
|
+
},
|
|
983
|
+
});
|
|
984
|
+
// Set text.
|
|
985
|
+
if (text) {
|
|
986
|
+
this._inner_html = text;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
exports.TextElement = TextElement;
|
|
991
|
+
exports.Text = wrapper(TextElement);
|
|
992
|
+
exports.NullText = create_null(TextElement);
|
|
993
|
+
// ---------------------------------------------------------
|
|
994
|
+
// Image.
|
|
995
|
+
class ImageElement extends Element {
|
|
996
|
+
// Constructor.
|
|
997
|
+
constructor(src) {
|
|
998
|
+
// Initialize base class.
|
|
999
|
+
super({
|
|
1000
|
+
type: "Image",
|
|
1001
|
+
tag: "img",
|
|
1002
|
+
default_style: {
|
|
1003
|
+
"margin": "0px",
|
|
1004
|
+
"padding": "0px",
|
|
1005
|
+
"object-fit": "cover",
|
|
1006
|
+
},
|
|
1007
|
+
});
|
|
1008
|
+
// Set src.
|
|
1009
|
+
if (src) {
|
|
1010
|
+
this._attrs.src = src;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
exports.ImageElement = ImageElement;
|
|
1015
|
+
exports.Image = wrapper(ImageElement);
|
|
1016
|
+
exports.NullImageElement = create_null(ImageElement);
|
|
1017
|
+
// ---------------------------------------------------------
|
|
1018
|
+
// ImageMask.
|
|
1019
|
+
class ImageMaskElement extends Element {
|
|
1020
|
+
mask_child;
|
|
1021
|
+
_src;
|
|
1022
|
+
// Constructor.
|
|
1023
|
+
constructor(src) {
|
|
1024
|
+
// Initialize base class.
|
|
1025
|
+
super({
|
|
1026
|
+
type: "ImageMask",
|
|
1027
|
+
tag: "div",
|
|
1028
|
+
default_style: {
|
|
1029
|
+
"margin": "0px",
|
|
1030
|
+
"padding": "0px",
|
|
1031
|
+
"object-fit": "cover",
|
|
1032
|
+
"display": "inline-block",
|
|
1033
|
+
},
|
|
1034
|
+
});
|
|
1035
|
+
// Append child.
|
|
1036
|
+
this.mask_child = (0, exports.VStack)()
|
|
1037
|
+
.width("100%")
|
|
1038
|
+
.height("100%")
|
|
1039
|
+
.background("black");
|
|
1040
|
+
if (src != null) {
|
|
1041
|
+
this.mask_child.mask(`url('${src}') no-repeat center/contain`);
|
|
1042
|
+
}
|
|
1043
|
+
this.append(this.mask_child);
|
|
1044
|
+
// Set src.
|
|
1045
|
+
if (src) {
|
|
1046
|
+
this.src(src);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
mask_color(value) {
|
|
1050
|
+
if (value == null) {
|
|
1051
|
+
return this.mask_child._style.background;
|
|
1052
|
+
}
|
|
1053
|
+
this.mask_child._style.background = value;
|
|
1054
|
+
return this;
|
|
1055
|
+
}
|
|
1056
|
+
src(value) {
|
|
1057
|
+
if (value == null) {
|
|
1058
|
+
return this._src;
|
|
1059
|
+
}
|
|
1060
|
+
this.mask_child.mask(`url('${value}') no-repeat center/contain`);
|
|
1061
|
+
this._src = value;
|
|
1062
|
+
return this;
|
|
1063
|
+
}
|
|
1064
|
+
mask(value) {
|
|
1065
|
+
if (value == null) {
|
|
1066
|
+
return this.mask_child.mask();
|
|
1067
|
+
}
|
|
1068
|
+
this.mask_child.mask(value);
|
|
1069
|
+
return this;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
exports.ImageMaskElement = ImageMaskElement;
|
|
1073
|
+
exports.ImageMask = wrapper(ImageMaskElement);
|
|
1074
|
+
exports.NullImageMaskElement = create_null(ImageMaskElement);
|
|
1075
|
+
// ---------------------------------------------------------
|
|
1076
|
+
// VStack.
|
|
1077
|
+
class VStackElement extends Element {
|
|
1078
|
+
// Constructor.
|
|
1079
|
+
constructor(...children) {
|
|
1080
|
+
// Initialize base class.
|
|
1081
|
+
super({
|
|
1082
|
+
type: "VStack",
|
|
1083
|
+
tag: "div",
|
|
1084
|
+
});
|
|
1085
|
+
// Add children.
|
|
1086
|
+
this.append(...children);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
exports.VStackElement = VStackElement;
|
|
1090
|
+
exports.VStack = wrapper(VStackElement);
|
|
1091
|
+
exports.NullVStackElement = create_null(VStackElement);
|
|
1092
|
+
// ---------------------------------------------------------
|
|
1093
|
+
// Divider.
|
|
1094
|
+
class DividerElement extends Element {
|
|
1095
|
+
// Constructor.
|
|
1096
|
+
constructor(text) {
|
|
1097
|
+
// Initialize base class.
|
|
1098
|
+
super({
|
|
1099
|
+
type: "Divider",
|
|
1100
|
+
tag: "div",
|
|
1101
|
+
default_style: {
|
|
1102
|
+
"margin": "0px",
|
|
1103
|
+
"padding": "0px",
|
|
1104
|
+
"width": "100%",
|
|
1105
|
+
"height": "1px",
|
|
1106
|
+
"min-height": "1px",
|
|
1107
|
+
// "background": "black",
|
|
1108
|
+
},
|
|
1109
|
+
});
|
|
1110
|
+
// Set text.
|
|
1111
|
+
if (text) {
|
|
1112
|
+
this._inner_html = text;
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
exports.DividerElement = DividerElement;
|
|
1117
|
+
exports.Divider = wrapper(DividerElement);
|
|
1118
|
+
exports.NullDividerElement = create_null(DividerElement);
|
|
1119
|
+
// ---------------------------------------------------------
|
|
1120
|
+
// Table data.
|
|
1121
|
+
class TableDataElement extends Element {
|
|
1122
|
+
// Constructor.
|
|
1123
|
+
constructor(...children) {
|
|
1124
|
+
// Initialize base class.
|
|
1125
|
+
super({
|
|
1126
|
+
type: "TableData",
|
|
1127
|
+
tag: "td",
|
|
1128
|
+
default_style: {
|
|
1129
|
+
"width": "100%",
|
|
1130
|
+
},
|
|
1131
|
+
default_attributes: {}
|
|
1132
|
+
});
|
|
1133
|
+
// Add children.
|
|
1134
|
+
this.append(...children);
|
|
1135
|
+
}
|
|
1136
|
+
// Center the data.
|
|
1137
|
+
center() {
|
|
1138
|
+
this.attrs({ align: "center" });
|
|
1139
|
+
return this;
|
|
1140
|
+
}
|
|
1141
|
+
// Vertically center.
|
|
1142
|
+
center_vertical() {
|
|
1143
|
+
this._style["vertical-align"] = "middle";
|
|
1144
|
+
return this;
|
|
1145
|
+
}
|
|
1146
|
+
leading_vertical() {
|
|
1147
|
+
this._style["vertical-align"] = "top";
|
|
1148
|
+
return this;
|
|
1149
|
+
}
|
|
1150
|
+
trailing_vertical() {
|
|
1151
|
+
this._style["vertical-align"] = "bottom";
|
|
1152
|
+
return this;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
exports.TableDataElement = TableDataElement;
|
|
1156
|
+
exports.TableData = wrapper(TableDataElement);
|
|
1157
|
+
exports.NullTableDataElement = create_null(TableDataElement);
|
|
1158
|
+
// ---------------------------------------------------------
|
|
1159
|
+
// Table row.
|
|
1160
|
+
class TableRowElement extends Element {
|
|
1161
|
+
current_cell;
|
|
1162
|
+
_wrap = false;
|
|
1163
|
+
// Constructor.
|
|
1164
|
+
constructor(...children) {
|
|
1165
|
+
// Initialize base class.
|
|
1166
|
+
super({
|
|
1167
|
+
type: "TableRow",
|
|
1168
|
+
tag: "tr",
|
|
1169
|
+
default_style: {
|
|
1170
|
+
"width": "100%",
|
|
1171
|
+
},
|
|
1172
|
+
default_attributes: {}
|
|
1173
|
+
});
|
|
1174
|
+
// Add children.
|
|
1175
|
+
this.append(...children);
|
|
1176
|
+
}
|
|
1177
|
+
// Append.
|
|
1178
|
+
append(...children) {
|
|
1179
|
+
for (let i = 0; i < children.length; i++) {
|
|
1180
|
+
const child = children[i];
|
|
1181
|
+
// Skip undefined.
|
|
1182
|
+
if (child == null) {
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
// Array.
|
|
1186
|
+
else if (Array.isArray(child)) {
|
|
1187
|
+
this.append(...child);
|
|
1188
|
+
}
|
|
1189
|
+
// Execute function.
|
|
1190
|
+
else if (typeof child === "function") {
|
|
1191
|
+
this.append(child(this));
|
|
1192
|
+
}
|
|
1193
|
+
// Table data.
|
|
1194
|
+
else if (child instanceof TableDataElement) {
|
|
1195
|
+
this.current_cell = child;
|
|
1196
|
+
this.children.push(child);
|
|
1197
|
+
}
|
|
1198
|
+
// Default.
|
|
1199
|
+
else {
|
|
1200
|
+
if (this.current_cell == null) {
|
|
1201
|
+
this.current_cell = (0, exports.TableData)();
|
|
1202
|
+
this.children.push(this.current_cell);
|
|
1203
|
+
if (this._attrs["align"] === "center") {
|
|
1204
|
+
this.current_cell.attrs({ align: "center" });
|
|
1205
|
+
}
|
|
1206
|
+
if (this._style["vertical-align"] === "middle") {
|
|
1207
|
+
this.current_cell._style["align"] = "middle";
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
|
|
1211
|
+
if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
|
|
1212
|
+
child._style.display = "inline";
|
|
1213
|
+
}
|
|
1214
|
+
else {
|
|
1215
|
+
child._style.display = "inline-block";
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
this.current_cell.append(child);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
return this;
|
|
1222
|
+
}
|
|
1223
|
+
wrap(value) {
|
|
1224
|
+
if (value == null) {
|
|
1225
|
+
return this._wrap;
|
|
1226
|
+
}
|
|
1227
|
+
this._wrap = value;
|
|
1228
|
+
const set_display_inline = (child) => {
|
|
1229
|
+
if (child instanceof TableDataElement) {
|
|
1230
|
+
child.children.forEach(set_display_inline);
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
if ((child._style.display == null || child._style.display === "") && this._wrap === true) {
|
|
1234
|
+
if (child.tag === "p" || child.tag === "h1" || child.tag === "h2") {
|
|
1235
|
+
child._style.display = "inline";
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
child._style.display = "inline-block";
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
else if ((child._style.display === "inline" || child._style.display === "inline-block") && this._wrap === false) {
|
|
1242
|
+
child._style.display = "default";
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
};
|
|
1246
|
+
this.children.forEach(set_display_inline);
|
|
1247
|
+
return this;
|
|
1248
|
+
}
|
|
1249
|
+
// Center.
|
|
1250
|
+
center() {
|
|
1251
|
+
this._attrs["align"] = "center";
|
|
1252
|
+
this.children.forEach((child) => {
|
|
1253
|
+
if (child instanceof TableDataElement) {
|
|
1254
|
+
child.attrs({ align: "center" });
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
return this;
|
|
1258
|
+
}
|
|
1259
|
+
// Vertically center.
|
|
1260
|
+
center_vertical() {
|
|
1261
|
+
this._style["vertical-align"] = "middle";
|
|
1262
|
+
this.children.forEach((child) => {
|
|
1263
|
+
child._style["vertical-align"] = "middle";
|
|
1264
|
+
if (child instanceof TableDataElement) {
|
|
1265
|
+
child.children.forEach((nested) => {
|
|
1266
|
+
nested._style["vertical-align"] = "middle";
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
return this;
|
|
1271
|
+
}
|
|
1272
|
+
leading_vertical() {
|
|
1273
|
+
this._style["vertical-align"] = "top";
|
|
1274
|
+
this.children.forEach((child) => {
|
|
1275
|
+
child._style["vertical-align"] = "top";
|
|
1276
|
+
if (child instanceof TableDataElement) {
|
|
1277
|
+
child.children.forEach((nested) => {
|
|
1278
|
+
nested._style["vertical-align"] = "top";
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
});
|
|
1282
|
+
return this;
|
|
1283
|
+
}
|
|
1284
|
+
trailing_vertical() {
|
|
1285
|
+
this._style["vertical-align"] = "bottom";
|
|
1286
|
+
this.children.forEach((child) => {
|
|
1287
|
+
child._style["vertical-align"] = "bottom";
|
|
1288
|
+
if (child instanceof TableDataElement) {
|
|
1289
|
+
child.children.forEach((nested) => {
|
|
1290
|
+
nested._style["vertical-align"] = "bottom";
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
});
|
|
1294
|
+
return this;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
exports.TableRowElement = TableRowElement;
|
|
1298
|
+
exports.TableRow = wrapper(TableRowElement);
|
|
1299
|
+
exports.NullTableRowElement = create_null(TableRowElement);
|
|
1300
|
+
// ---------------------------------------------------------
|
|
1301
|
+
// Table, automatically inserts table rows and optionally table data's when the appended object is not already a table data.
|
|
1302
|
+
class TableElement extends Element {
|
|
1303
|
+
current_cell;
|
|
1304
|
+
current_row;
|
|
1305
|
+
// Constructor.
|
|
1306
|
+
constructor(...children) {
|
|
1307
|
+
// Initialize base class.
|
|
1308
|
+
super({
|
|
1309
|
+
type: "Stack",
|
|
1310
|
+
tag: "table",
|
|
1311
|
+
default_style: {
|
|
1312
|
+
"width": "100%",
|
|
1313
|
+
},
|
|
1314
|
+
default_attributes: {
|
|
1315
|
+
"cellspacing": "0",
|
|
1316
|
+
"cellpadding": "0",
|
|
1317
|
+
"border": "0",
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
// Add children.
|
|
1321
|
+
this.current_row = (0, exports.TableRow)();
|
|
1322
|
+
this.children.append(this.current_row);
|
|
1323
|
+
this.append(...children);
|
|
1324
|
+
}
|
|
1325
|
+
// Add a row.
|
|
1326
|
+
row(...children) {
|
|
1327
|
+
this.current_row = (0, exports.TableRow)();
|
|
1328
|
+
this.children.push(this.current_row);
|
|
1329
|
+
this.current_cell = undefined;
|
|
1330
|
+
this.append(...children);
|
|
1331
|
+
return this;
|
|
1332
|
+
}
|
|
1333
|
+
// Append.
|
|
1334
|
+
append(...children) {
|
|
1335
|
+
for (let i = 0; i < children.length; i++) {
|
|
1336
|
+
const child = children[i];
|
|
1337
|
+
// Skip undefined.
|
|
1338
|
+
if (child == null) {
|
|
1339
|
+
continue;
|
|
1340
|
+
}
|
|
1341
|
+
// Array.
|
|
1342
|
+
else if (Array.isArray(child)) {
|
|
1343
|
+
this.append(...child);
|
|
1344
|
+
}
|
|
1345
|
+
// Execute function.
|
|
1346
|
+
else if (typeof child === "function") {
|
|
1347
|
+
this.append(child(this));
|
|
1348
|
+
}
|
|
1349
|
+
// Table row.
|
|
1350
|
+
else if (child instanceof TableRowElement) {
|
|
1351
|
+
this.current_row = child;
|
|
1352
|
+
this.children.push(child);
|
|
1353
|
+
}
|
|
1354
|
+
// Default.
|
|
1355
|
+
else {
|
|
1356
|
+
if (this.current_row == null) {
|
|
1357
|
+
this.current_row = (0, exports.TableRow)();
|
|
1358
|
+
this.children.push(this.current_row);
|
|
1359
|
+
}
|
|
1360
|
+
this.current_row.append(child);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
return this;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
exports.TableElement = TableElement;
|
|
1367
|
+
exports.Table = wrapper(TableElement);
|
|
1368
|
+
exports.NullTableElement = create_null(TableElement);
|
|
1369
|
+
// ---------------------------------------------------------
|
|
1370
|
+
// CSS.
|
|
1371
|
+
class CSSElement extends Element {
|
|
1372
|
+
// Constructor.
|
|
1373
|
+
constructor(style) {
|
|
1374
|
+
// Initialize base class.
|
|
1375
|
+
super({
|
|
1376
|
+
type: "CSS",
|
|
1377
|
+
tag: "style",
|
|
1378
|
+
});
|
|
1379
|
+
// Add inner html.
|
|
1380
|
+
if (style) {
|
|
1381
|
+
this._inner_html = style;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
exports.CSSElement = CSSElement;
|
|
1386
|
+
exports.CSS = wrapper(CSSElement);
|
|
1387
|
+
exports.NullCSSElement = create_null(CSSElement);
|
|
1388
|
+
// ---------------------------------------------------------
|
|
1389
|
+
// Mail.
|
|
1390
|
+
class MailElement extends Element {
|
|
1391
|
+
_subject;
|
|
1392
|
+
// Constructor.
|
|
1393
|
+
constructor(...children) {
|
|
1394
|
+
// Initialize base class.
|
|
1395
|
+
super({
|
|
1396
|
+
type: "Mail",
|
|
1397
|
+
tag: "mail",
|
|
1398
|
+
default_style: {
|
|
1399
|
+
"width": "100% !important",
|
|
1400
|
+
"min-height": "100% !important",
|
|
1401
|
+
"box-sizing": "border-box",
|
|
1402
|
+
"padding": "0px", // this is required, sometimes it glitches and makes it scrolling without zero padding.
|
|
1403
|
+
"margin": "0px",
|
|
1404
|
+
},
|
|
1405
|
+
});
|
|
1406
|
+
// Add children.
|
|
1407
|
+
this.append(...children);
|
|
1408
|
+
}
|
|
1409
|
+
subject(subj) {
|
|
1410
|
+
if (subj == null) {
|
|
1411
|
+
return this._subject;
|
|
1412
|
+
}
|
|
1413
|
+
this._subject = subj;
|
|
1414
|
+
return this;
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
exports.MailElement = MailElement;
|
|
1418
|
+
exports.Mail = wrapper(MailElement);
|
|
1419
|
+
exports.NullMailElement = create_null(MailElement);
|