More work on the menus...

This commit is contained in:
Scott Idem
2025-07-16 14:29:57 -04:00
parent eaffc44772
commit 047f6d7048
4 changed files with 30 additions and 18 deletions

View File

@@ -343,6 +343,10 @@ let ae_app_session_data_defaults: key_val = {
hide_quick_info: true hide_quick_info: true
}, },
app_cfg: {
show_element__passcode_input: true,
},
'ds': { 'ds': {
'submit_status': null, 'submit_status': null,
}, },

View File

@@ -283,7 +283,7 @@ function handle_clear_access() {
flex flex-col flex-wrap gap-1 flex flex-col flex-wrap gap-1
items-end justify-center items-end justify-center
w-72 max-w-72 w-full
p-1 p-1
border-2 border-gray-200 border-2 border-gray-200
@@ -295,7 +295,7 @@ function handle_clear_access() {
<!-- class:hidden={!$ae_sess.show__sign_in_out__fields} --> <!-- class:hidden={!$ae_sess.show__sign_in_out__fields} -->
<header <header
class="ae_header w-64 hidden" class="ae_header hidden"
> >
<h2 class="text-sm text-center font-semibold"> <h2 class="text-sm text-center font-semibold">
Passcode Sign In Passcode Sign In
@@ -400,7 +400,7 @@ function handle_clear_access() {
{/if} {/if}
</div> </div>
<div class="transition-all flex flex-row flex-wrap gap-1 items-end justify-end"> <div class="flex flex-row flex-wrap gap-1 items-end justify-end w-full transition-all">
{#if $ae_loc?.access_type && $ae_loc?.access_type == 'anonymous' && 1==3} {#if $ae_loc?.access_type && $ae_loc?.access_type == 'anonymous' && 1==3}
<span> <span>
@@ -497,9 +497,11 @@ function handle_clear_access() {
{/if} {/if}
{#if (show_passcode_input)} {#if (show_passcode_input)}
<span class="flex flex-row gap-1 items-center justify-center"> <span class="flex flex-row gap-1 items-center justify-between w-full">
<ShieldEllipsis class="inline-block" /> <span>
<span class="unlock_text">Passcode:</span> <ShieldEllipsis class="inline-block text-gray-500" />
<span class="unlock_text text-sm">Passcode:</span>
</span>
<!-- svelte-ignore a11y_autofocus --> <!-- svelte-ignore a11y_autofocus -->
<input <input

View File

@@ -12,6 +12,7 @@ import {
Key, Key,
LogIn, LogOut, LockKeyhole, LogIn, LogOut, LockKeyhole,
Mail, MailCheck, Mail, MailCheck,
ShieldUser,
User, UserCheck, UserLock User, UserCheck, UserLock
} from '@lucide/svelte'; } from '@lucide/svelte';
@@ -722,15 +723,16 @@ async function handle_change_password() {
<div <div
class="flex flex-row gap-2 items-center justify-between w-full" class="flex flex-row gap-1 items-center justify-between w-full transition-all"
> >
<span> <span>
{#if $ae_loc?.person_id && $ae_loc?.user_id} {#if $ae_loc?.person_id && $ae_loc?.user_id}
<span class="fas fa-user mx-1 text-gray-500"></span> <span class="fas fa-user mx-1 text-gray-500"></span>
{$ae_loc?.person?.full_name_override ?? $ae_loc?.person?.full_name} {$ae_loc?.person?.full_name_override ?? $ae_loc?.person?.full_name}
{:else} {:else}
<span class="fas fa-user-x mx-1 text-gray-500"></span> <!-- <span class="fas fa-user-x mx-1 text-gray-500"></span> -->
Sign in? <ShieldUser class="inline-block text-gray-500" />
User sign in:
{/if} {/if}
</span> </span>
@@ -744,6 +746,9 @@ async function handle_change_password() {
title="Sign In" title="Sign In"
onclick={() => { onclick={() => {
$ae_sess.show__sign_in_out__fields = !$ae_sess.show__sign_in_out__fields; // Toggle the visibility of the sign-in form $ae_sess.show__sign_in_out__fields = !$ae_sess.show__sign_in_out__fields; // Toggle the visibility of the sign-in form
if (!$ae_sess.show__sign_in_out__fields) {
$ae_sess.app_cfg.show_element__passcode_input = true;
}
}} }}
> >
{#if $ae_loc?.person_id && $ae_loc?.user_id} {#if $ae_loc?.person_id && $ae_loc?.user_id}

View File

@@ -93,7 +93,6 @@ max-w-max -->
opacity-90 opacity-90
hover:opacity-100 hover:opacity-100
active:opacity-100
w-min w-min
max-w-md max-w-md
@@ -118,10 +117,10 @@ max-w-max -->
ease-in-out ease-in-out
" "
class:top-0={expand && 1 == 3} class:top-0={expand && 1 == 3}
class:opacity-100={expand}
class:w-full={expand} class:w-full={expand}
class:hidden={false} class:hidden={false}
class:border-transparent={!expand} class:border-transparent={!expand}
class:hover:bg-transparent={!expand} class:hover:bg-transparent={!expand}
> >
@@ -292,7 +291,7 @@ max-w-max -->
// $ae_loc.sys_menu.expand = true; // $ae_loc.sys_menu.expand = true;
// $ae_loc.sys_menu.expand_btn = false; // $ae_loc.sys_menu.expand_btn = false;
$ae_loc.app_cfg.show_element__access_type = true; $ae_loc.app_cfg.show_element__access_type = true;
$ae_loc.app_cfg.show_element__passcode_input = true; $ae_sess.app_cfg.show_element__passcode_input = true;
// await tick(); // await tick();
// console.log('Layout button click: Focus on passcode input!'); // console.log('Layout button click: Focus on passcode input!');
@@ -367,7 +366,7 @@ max-w-max -->
// dispatch_edit_mode_changed(); // dispatch_edit_mode_changed();
}} }}
class=" class="
btn btn-sm text-xs btn btn-base text-sm
preset-tonal-warning preset-tonal-warning
preset-outlined-warning-800-200 preset-outlined-warning-800-200
hover:preset-tonal-success hover:preset-tonal-success
@@ -390,12 +389,13 @@ max-w-max -->
// dispatch_edit_mode_changed(); // dispatch_edit_mode_changed();
}} }}
class=" class="
btn btn-sm text-xs btn btn-base text-sm
preset-tonal-surface preset-tonal-surface
preset-outlined-warning-400-600 preset-outlined-warning-400-600
hover:preset-tonal-warning hover:preset-tonal-warning
transition-all group transition-all group
gap-1 gap-1
min-w-24
" "
title="Edit mode is currently disabled. Click to enable." title="Edit mode is currently disabled. Click to enable."
> >
@@ -417,11 +417,12 @@ max-w-max -->
type="button" type="button"
class:w-full={expand} class:w-full={expand}
class=" class="
btn btn-sm btn btn-base text-sm
preset-filled-tertiary-400-600 preset-filled-tertiary-400-600
preset-outlined-tertiary-400-600 preset-outlined-tertiary-400-600
hover:preset-filled-success active:preset-filled-success hover:preset-filled-success active:preset-filled-success
px-6 py-1 px-6 py-1
min-w-24
transition-all group transition-all group
" "
title="Show/Hide the system menu" title="Show/Hide the system menu"
@@ -433,9 +434,9 @@ max-w-max -->
$ae_loc.app_cfg.show_element__access_type = true; $ae_loc.app_cfg.show_element__access_type = true;
if ($ae_loc?.access_type == 'anonymous') { if ($ae_loc?.access_type == 'anonymous') {
$ae_loc.app_cfg.show_element__passcode_input = true; $ae_sess.app_cfg.show_element__passcode_input = true;
} else { } else {
$ae_loc.app_cfg.show_element__passcode_input = false; $ae_sess.app_cfg.show_element__passcode_input = false;
} }
// $ae_loc.app_cfg.show_element__passcode_input = true; // $ae_loc.app_cfg.show_element__passcode_input = true;
await tick(); await tick();
@@ -580,7 +581,7 @@ max-w-max -->
<Element_access_type <Element_access_type
bind:hide={$ae_loc.sys_menu.hide_access_type} bind:hide={$ae_loc.sys_menu.hide_access_type}
bind:expand={$ae_loc.sys_menu.expand_access_type} bind:expand={$ae_loc.sys_menu.expand_access_type}
bind:show_passcode_input={$ae_loc.app_cfg.show_element__passcode_input} bind:show_passcode_input={$ae_sess.app_cfg.show_element__passcode_input}
bind:trigger_clear_access={trigger_clear_access} bind:trigger_clear_access={trigger_clear_access}
/> />
{/if} {/if}