style(journals): standardize and stabilize 'Config' interfaces across all levels
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
MessageSquareWarning,
|
||||
Copy,
|
||||
FilePlus,
|
||||
FileDown,
|
||||
FileUp,
|
||||
Globe,
|
||||
BookHeart,
|
||||
BriefcaseBusiness,
|
||||
@@ -34,7 +36,8 @@
|
||||
X,
|
||||
Settings,
|
||||
CalendarClock,
|
||||
MousePointerClick
|
||||
MousePointerClick,
|
||||
Zap
|
||||
} from '@lucide/svelte';
|
||||
import { Modal } from 'flowbite-svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
@@ -57,16 +60,22 @@
|
||||
log_lvl?: number;
|
||||
lq__journal_obj: any;
|
||||
show?: boolean;
|
||||
onNewEntry?: () => void;
|
||||
onShowExport?: () => void;
|
||||
onShowImport?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
log_lvl = $bindable(0),
|
||||
lq__journal_obj,
|
||||
show = $bindable(false)
|
||||
show = $bindable(false),
|
||||
onNewEntry,
|
||||
onShowExport,
|
||||
onShowImport
|
||||
}: Props = $props();
|
||||
|
||||
// *** Internal State
|
||||
let tab: 'general' | 'security' | 'ui' | 'json' = $state('general');
|
||||
let tab: 'actions' | 'general' | 'security' | 'ui' | 'json' = $state('actions');
|
||||
let tmp__journal_obj: any = $state({});
|
||||
|
||||
// Deep copy on mount or when lq changes to ensure we have a working copy
|
||||
@@ -118,7 +127,8 @@
|
||||
default_private: tmp__journal_obj.default_private,
|
||||
default_public: tmp__journal_obj.default_public,
|
||||
default_personal: tmp__journal_obj.default_personal,
|
||||
default_professional: tmp__journal_obj.default_professional
|
||||
default_professional: tmp__journal_obj.default_professional,
|
||||
code: tmp__journal_obj.code
|
||||
};
|
||||
|
||||
await journals_func.update_ae_obj__journal({
|
||||
@@ -163,14 +173,17 @@
|
||||
>
|
||||
{#snippet header()}
|
||||
<h3 class="flex items-center gap-2 text-lg font-bold">
|
||||
<BookOpenText class="text-primary-500" />
|
||||
<span>Edit Journal: {$lq__journal_obj?.name ?? '--'}</span>
|
||||
<Settings class="text-primary-500" />
|
||||
<span>Journal Config: {$lq__journal_obj?.name ?? '--'}</span>
|
||||
</h3>
|
||||
{/snippet}
|
||||
|
||||
<div class="space-y-6 py-2 h-[75vh] overflow-y-auto px-4">
|
||||
<!-- Navigation Tabs -->
|
||||
<div class="flex justify-center gap-1 mb-4 p-1 bg-surface-500/10 rounded-lg max-w-fit mx-auto sticky top-0 z-10 backdrop-blur-sm">
|
||||
<button class="btn btn-sm transition-all {tab === 'actions' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'actions')}>
|
||||
<Zap size="1.1em" class="mr-1" /> Quick Actions
|
||||
</button>
|
||||
<button class="btn btn-sm transition-all {tab === 'general' ? 'variant-filled-primary' : 'variant-soft-surface'}" onclick={() => (tab = 'general')}>
|
||||
<Layout size="1.1em" class="mr-1" /> General
|
||||
</button>
|
||||
@@ -185,7 +198,22 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if tab === 'general'}
|
||||
{#if tab === 'actions'}
|
||||
<div class="space-y-6 animate-in fade-in duration-300">
|
||||
<section class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<button class="btn variant-soft-secondary w-full py-4 text-lg font-bold" onclick={() => { show = false; onNewEntry?.(); }}>
|
||||
<FilePlus size="1.5em" class="mr-2"/> New Journal Entry
|
||||
</button>
|
||||
<button class="btn variant-soft-surface w-full py-4" onclick={() => { show = false; onShowExport?.(); }}>
|
||||
<FileDown size="1.5em" class="mr-2"/> Export Entries
|
||||
</button>
|
||||
<button class="btn variant-soft-surface w-full py-4" onclick={() => { show = false; onShowImport?.(); }}>
|
||||
<FileUp size="1.5em" class="mr-2"/> Import Entries
|
||||
</button>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
{:else if tab === 'general'}
|
||||
<div class="space-y-6 animate-in fade-in duration-300">
|
||||
<!-- Core Meta -->
|
||||
<section class="grid grid-cols-1 gap-4 p-2">
|
||||
|
||||
Reference in New Issue
Block a user