web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit b64b837dbb9c4ec47b077350f62ce44c75c5db65
parent d42fc6de0edaee16e5e335f4377ab9fd46465cc0
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Tue,  8 Oct 2024 04:59:52 +0000

apps-lib: add el to input element callback keydown, add locales

Diffstat:
Mapps-lib/src/lib/locales/en/common.json | 4++++
Mapps-lib/src/lib/locales/en/icu.json | 4++++
Aapps-lib/src/lib/locales/en/legal.json | 6++++++
Mapps-lib/src/lib/types/ui.ts | 2+-
Mapps-lib/src/lib/ui/input_element.svelte | 4++--
5 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/apps-lib/src/lib/locales/en/common.json b/apps-lib/src/lib/locales/en/common.json @@ -7,12 +7,15 @@ "authenticated": "Authenticated", "back": "Back", "cancel": "Cancel", + "configure": "Configure", "connect": "Connect", "connected": "Connected", "connection": "Connection", + "continue": "Continue", "delete": "Delete", "description": "Description", "details": "Details", + "device": "Device", "disconnect": "Disconnect", "done": "Done", "edit": "Edit", @@ -49,6 +52,7 @@ "relays": "Relays", "secret_key": "Secret key", "settings": "Settings", + "setup": "Setup", "status": "Status", "subject": "Subject", "submit": "Submit", diff --git a/apps-lib/src/lib/locales/en/icu.json b/apps-lib/src/lib/locales/en/icu.json @@ -3,9 +3,11 @@ "*_available": "{value} Available", "*_copied": "{value} copied", "*_details": "{value} details", + "*_your_device": "{value} your device", "add_*": "Add {value}", "add_a_*": "Add a {value}", "as_*": "As {value}", + "choose_a_*": "Choose a {}", "connect_*": "Connect {value}", "connected_*": "Connected {value}", "delete_*": "Delete {value}", @@ -24,6 +26,8 @@ "post_*": "Post {value}", "set_as_*": "Set as {value}", "show_*": "Show {value}", + "the_*_is_available": "The {value} is available", + "the_*_is_registered": "The {value} is registered", "total_*": "Total {value}", "unconnected_*": "Unconnected {value}", "view_*": "View {value}", diff --git a/apps-lib/src/lib/locales/en/legal.json b/apps-lib/src/lib/locales/en/legal.json @@ -0,0 +1,5 @@ +{ + "eula": { + "document_name": "Terms of Use agreement" + } +} +\ No newline at end of file diff --git a/apps-lib/src/lib/types/ui.ts b/apps-lib/src/lib/types/ui.ts @@ -140,7 +140,7 @@ export type IInputElement = IClOpt & ILyOptTs & { glyph: GlyphKey | IGlyph; };*/ callback?: CallbackPromiseGeneric<{ val: string; pass: boolean; }>; - callback_keydown?: CallbackPromiseGeneric<{ key: string; }>; + callback_keydown?: CallbackPromiseGeneric<{ key: string; el: HTMLInputElement }>; on_mount?: CallbackPromiseGeneric<HTMLInputElement>; }; diff --git a/apps-lib/src/lib/ui/input_element.svelte b/apps-lib/src/lib/ui/input_element.svelte @@ -36,7 +36,7 @@ bind:this={el} {id} type="text" - class={`${fmt_cl(basis.classes)} form-input h-full text-layer-${layer}-glyph placeholder:text-layer-${layer}-glyph_pl caret-layer-${layer}-glyph`} + class={`${fmt_cl(basis.classes)} form-input text-layer-${layer}-glyph placeholder:text-layer-${layer}-glyph_pl caret-layer-${layer}-glyph`} placeholder={basis.placeholder || ""} on:input={async ({ currentTarget: el }) => { let pass = true; @@ -59,6 +59,6 @@ }} on:keydown={async (ev) => { if (basis.callback_keydown) - await basis.callback_keydown({ key: ev.key }); + await basis.callback_keydown({ key: ev.key, el: ev.currentTarget }); }} />