Prettier for Journals
This commit is contained in:
@@ -1,92 +1,91 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
lq__journal_obj: any;
|
||||
interface Props {
|
||||
log_lvl?: number;
|
||||
lq__journal_obj: any;
|
||||
}
|
||||
|
||||
let { log_lvl = $bindable(0), lq__journal_obj }: Props = $props();
|
||||
|
||||
import {
|
||||
ArrowDown01,
|
||||
ArrowDown10,
|
||||
ArrowDownUp,
|
||||
BetweenVerticalEnd,
|
||||
BetweenVerticalStart,
|
||||
BookHeart,
|
||||
BookImage,
|
||||
Bookmark,
|
||||
BookOpenText,
|
||||
BriefcaseBusiness,
|
||||
Check,
|
||||
Copy,
|
||||
Expand,
|
||||
Eye,
|
||||
EyeOff,
|
||||
Flag,
|
||||
FlagOff,
|
||||
FilePlus,
|
||||
Fingerprint,
|
||||
Globe,
|
||||
Library,
|
||||
MessageSquareWarning,
|
||||
Minus,
|
||||
Notebook,
|
||||
Pencil,
|
||||
Plus,
|
||||
RemoveFormatting,
|
||||
SquareLibrary,
|
||||
Shapes,
|
||||
Share2,
|
||||
ShieldCheck,
|
||||
ShieldMinus,
|
||||
Siren,
|
||||
Skull,
|
||||
Tags,
|
||||
Target,
|
||||
ToggleLeft,
|
||||
ToggleRight,
|
||||
Trash2,
|
||||
TypeOutline,
|
||||
X
|
||||
} from '@lucide/svelte';
|
||||
|
||||
import {
|
||||
ae_snip,
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
import {
|
||||
journals_loc,
|
||||
journals_sess,
|
||||
journals_slct,
|
||||
journals_prom,
|
||||
journals_trig
|
||||
} from '$lib/ae_journals/ae_journals_stores';
|
||||
import { journals_func } from '$lib/ae_journals/ae_journals_functions';
|
||||
|
||||
// *** Functions and Logic
|
||||
function handle_search_trigger() {
|
||||
if ($journals_loc.entry.search_version === undefined) {
|
||||
$journals_loc.entry.search_version = 0;
|
||||
}
|
||||
$journals_loc.entry.search_version++;
|
||||
}
|
||||
|
||||
let { log_lvl = $bindable(0), lq__journal_obj }: Props = $props();
|
||||
|
||||
import {
|
||||
ArrowDown01,
|
||||
ArrowDown10,
|
||||
ArrowDownUp,
|
||||
BetweenVerticalEnd,
|
||||
BetweenVerticalStart,
|
||||
BookHeart,
|
||||
BookImage,
|
||||
Bookmark,
|
||||
BookOpenText,
|
||||
BriefcaseBusiness,
|
||||
Check,
|
||||
Copy,
|
||||
Expand,
|
||||
Eye,
|
||||
EyeOff,
|
||||
Flag,
|
||||
FlagOff,
|
||||
FilePlus,
|
||||
Fingerprint,
|
||||
Globe,
|
||||
Library,
|
||||
MessageSquareWarning,
|
||||
Minus,
|
||||
Notebook,
|
||||
Pencil,
|
||||
Plus,
|
||||
RemoveFormatting,
|
||||
SquareLibrary,
|
||||
Shapes,
|
||||
Share2,
|
||||
ShieldCheck,
|
||||
ShieldMinus,
|
||||
Siren,
|
||||
Skull,
|
||||
Tags,
|
||||
Target,
|
||||
ToggleLeft,
|
||||
ToggleRight,
|
||||
Trash2,
|
||||
TypeOutline,
|
||||
X
|
||||
} from '@lucide/svelte';
|
||||
|
||||
import {
|
||||
ae_snip,
|
||||
ae_loc,
|
||||
ae_sess,
|
||||
ae_api,
|
||||
ae_trig,
|
||||
slct,
|
||||
slct_trigger
|
||||
} from '$lib/stores/ae_stores';
|
||||
import {
|
||||
journals_loc,
|
||||
journals_sess,
|
||||
journals_slct,
|
||||
journals_prom,
|
||||
journals_trig
|
||||
} from '$lib/ae_journals/ae_journals_stores';
|
||||
import { journals_func } from '$lib/ae_journals/ae_journals_functions';
|
||||
|
||||
// *** Functions and Logic
|
||||
function handle_search_trigger() {
|
||||
if ($journals_loc.entry.search_version === undefined) {
|
||||
$journals_loc.entry.search_version = 0;
|
||||
}
|
||||
$journals_loc.entry.search_version++;
|
||||
}
|
||||
|
||||
function prevent_default<T extends Event>(fn: (event: T) => void) {
|
||||
return function (event: T) {
|
||||
event.preventDefault();
|
||||
fn(event);
|
||||
};
|
||||
}
|
||||
function prevent_default<T extends Event>(fn: (event: T) => void) {
|
||||
return function (event: T) {
|
||||
event.preventDefault();
|
||||
fn(event);
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div
|
||||
class="ae_group filters_and_search flex flex-row flex-wrap items-center justify-center gap-2"
|
||||
>
|
||||
class="ae_group filters_and_search flex flex-row flex-wrap items-center justify-center gap-2">
|
||||
<!-- Search input form -->
|
||||
<span class="flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<form
|
||||
@@ -94,9 +93,8 @@
|
||||
handle_search_trigger();
|
||||
})}
|
||||
autocomplete="off"
|
||||
class="search_form flex flex-row flex-wrap gap-1 items-center justify-center"
|
||||
>
|
||||
<span class="text-sm text-gray-500 hidden lg:inline">
|
||||
class="search_form flex flex-row flex-wrap items-center justify-center gap-1">
|
||||
<span class="hidden text-sm text-gray-500 lg:inline">
|
||||
Search:
|
||||
</span>
|
||||
<input
|
||||
@@ -111,18 +109,16 @@
|
||||
autocomplete="off"
|
||||
class="
|
||||
input input-sm
|
||||
w-44 md:w-52
|
||||
text-sm
|
||||
w-44 text-sm
|
||||
md:w-52
|
||||
"
|
||||
class:bg-red-200={$journals_sess.entry_li == null}
|
||||
class:dark:bg-red-800={$journals_sess.entry_li == null}
|
||||
/>
|
||||
class:dark:bg-red-800={$journals_sess.entry_li == null} />
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-sm preset-filled-primary transition"
|
||||
title="Perform detailed search"
|
||||
>
|
||||
title="Perform detailed search">
|
||||
<Library size="1.25em" />
|
||||
</button>
|
||||
|
||||
@@ -142,12 +138,10 @@
|
||||
hover:preset-filled-surface-500
|
||||
transition-all
|
||||
"
|
||||
title="Clear search query text"
|
||||
>
|
||||
title="Clear search query text">
|
||||
<RemoveFormatting
|
||||
size="1.25em"
|
||||
class="text-neutral-800/60 dark:text-neutral-50/60"
|
||||
/>
|
||||
class="text-neutral-800/60 dark:text-neutral-50/60" />
|
||||
<span class="hidden md:inline"> Clear </span>
|
||||
</button>
|
||||
</form>
|
||||
@@ -155,15 +149,14 @@
|
||||
|
||||
<!-- Give list of categories to base the new entry on -->
|
||||
<span class="flex flex-row items-center gap-2">
|
||||
<span class="text-sm text-gray-500 hidden md:inline"> Category: </span>
|
||||
<span class="hidden text-sm text-gray-500 md:inline"> Category: </span>
|
||||
<select
|
||||
class="select select-sm"
|
||||
bind:value={$journals_loc.entry.qry__category_code}
|
||||
onchange={(event) => {
|
||||
handle_search_trigger();
|
||||
}}
|
||||
title="Filter by category"
|
||||
>
|
||||
title="Filter by category">
|
||||
<option value="">All Categories</option>
|
||||
{#each $lq__journal_obj?.cfg_json?.category_li as category (category.code)}
|
||||
<option value={category.code}>{category.name}</option>
|
||||
@@ -173,8 +166,7 @@
|
||||
|
||||
<!-- Search Control Toggles -->
|
||||
<span
|
||||
class="flex flex-row flex-wrap items-center gap-2 border-l border-surface-300-700 pl-2"
|
||||
>
|
||||
class="border-surface-300-700 flex flex-row flex-wrap items-center gap-2 border-l pl-2">
|
||||
<!-- Global Search hidden until backend supports person_id in entries 2026-01-27 -->
|
||||
<!--
|
||||
<label
|
||||
@@ -193,9 +185,8 @@
|
||||
|
||||
{#if $ae_loc.edit_mode}
|
||||
<label
|
||||
class="flex items-center gap-1 cursor-pointer"
|
||||
title="When enabled, search results are fetched directly from the server first."
|
||||
>
|
||||
class="flex cursor-pointer items-center gap-1"
|
||||
title="When enabled, search results are fetched directly from the server first.">
|
||||
<span class="text-xs font-semibold text-gray-500">
|
||||
Remote First?
|
||||
</span>
|
||||
@@ -203,8 +194,7 @@
|
||||
type="checkbox"
|
||||
bind:checked={$journals_loc.entry.qry__remote_first}
|
||||
onchange={handle_search_trigger}
|
||||
class="checkbox checkbox-sm"
|
||||
/>
|
||||
class="checkbox checkbox-sm" />
|
||||
</label>
|
||||
{/if}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user