Rework of the IDAA Recovery Meetings search. Other related updates and bug fixes. Added preventDefault()
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
<script lang="ts">
|
||||
/** @type {import('./$types').PageData} */
|
||||
let log_lvl: number = 0;
|
||||
interface Props {
|
||||
/** @type {import('./$types').PageData} */
|
||||
data: any;
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
let {
|
||||
data,
|
||||
log_lvl = 0
|
||||
}: Props = $props();
|
||||
|
||||
// *** Import Svelte specific
|
||||
import { browser } from '$app/environment';
|
||||
@@ -9,7 +17,7 @@ import { browser } from '$app/environment';
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
// import Element_data_store from '$lib/element_data_store_v2.svelte';
|
||||
import Comp_event_session_obj_li from '../ae_comp__event_session_obj_li.svelte';
|
||||
// import Comp_event_session_obj_li from '../ae_comp__event_session_obj_li.svelte';
|
||||
import Comp_event_session_obj_li_wrapper from '../ae_comp__event_session_obj_li_wrapper.svelte';
|
||||
|
||||
import { liveQuery } from "dexie";
|
||||
@@ -23,11 +31,6 @@ import Comp_event_files_upload from '../ae_comp__event_files_upload.svelte';
|
||||
import Element_manage_event_file_li_wrap from '$lib/element_manage_event_file_li_direct.svelte';
|
||||
import Event_page_menu from './event_page_menu.svelte';
|
||||
|
||||
interface Props {
|
||||
data: any;
|
||||
}
|
||||
|
||||
let { data }: Props = $props();
|
||||
|
||||
// Quickly save the data passed from the parent(s) to the Svelte stores, localStorage, and other.
|
||||
// $slct.account_id = data.account_id;
|
||||
@@ -104,7 +107,7 @@ let event_session_id_random_li: Array<string> = $state([]);
|
||||
|
||||
let lq__event_location_obj_li = $derived(liveQuery(async () => {
|
||||
let results = await db_events.locations
|
||||
.where('event_id_random')
|
||||
.where('event_id')
|
||||
.equals($events_slct.event_id)
|
||||
.sortBy('name')
|
||||
;
|
||||
@@ -133,6 +136,13 @@ if (browser) {
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}
|
||||
|
||||
function preventDefault(fn) {
|
||||
return function (event) {
|
||||
event.preventDefault();
|
||||
fn.call(this, event);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Updated 2024-06-12 late
|
||||
$effect(() => {
|
||||
@@ -303,10 +313,12 @@ async function handle_search__event_session(
|
||||
}
|
||||
|
||||
if ($events_sess.pres_mgmt?.status_qry__search != null && $events_sess.pres_mgmt?.status_qry__search != 'done') {
|
||||
|
||||
let random_delay = Math.floor(Math.random() * 25);
|
||||
search_delay += 25+random_delay;
|
||||
console.log(`*** TEST SEARCH - $events_sess.pres_mgmt.status_qry__search == loading wait *** search_delay=${search_delay}`);
|
||||
// $events_sess.status_qry__last_request_str = lk_search_str;
|
||||
|
||||
} else {
|
||||
// console.log('*** TEST SEARCH - $events_sess.pres_mgmt.status_qry__search != loading ***');
|
||||
|
||||
@@ -483,9 +495,9 @@ max-w-max -->
|
||||
<div class="ae_container_actions">
|
||||
|
||||
<form
|
||||
onsubmit={() => {
|
||||
onsubmit={preventDefault(() => {
|
||||
$events_trigger = 'load__event_session_obj_li';
|
||||
}}
|
||||
})}
|
||||
autocomplete="off"
|
||||
class="form grow flex flex-row flex-wrap gap-1 justify-center items-center w-full"
|
||||
>
|
||||
@@ -539,7 +551,7 @@ max-w-max -->
|
||||
<!-- Clear text -->
|
||||
</button>
|
||||
|
||||
<!-- svelte-ignore a11y-autofocus -->
|
||||
<!-- svelte-ignore a11y_autofocus -->
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Search for a session"
|
||||
@@ -566,9 +578,8 @@ max-w-max -->
|
||||
{#if $events_sess.pres_mgmt.status_qry__search == 'loading'}
|
||||
<span class="fas fa-spinner fa-spin"></span>
|
||||
{:else }
|
||||
<!-- Nothing -->
|
||||
<span class="fas fa-search mx-1"></span>
|
||||
{/if}
|
||||
<span class="fas fa-search mx-1"></span>
|
||||
Search
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
|
||||
|
||||
// *** Import Svelte specific
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { ae_util } from '$lib/ae_utils/ae_utils';
|
||||
@@ -69,14 +68,14 @@ let ae_triggers: key_val = $state({});
|
||||
<!-- sm:border-red-200 md:border-yellow-200 lg:border-gray-100 -->
|
||||
<section
|
||||
class="
|
||||
ae_comp event_session_obj_li
|
||||
border-2 border-dashed border-x-red-500 border-y-white
|
||||
sm:border-x-red-400 md:border-x-yellow-400 lg:border-x-gray-100
|
||||
px-0.5 py-2 space-y-2
|
||||
min-w-full
|
||||
w-full
|
||||
container overflow-x-scroll {container_class_li}
|
||||
"
|
||||
ae_comp event_session_obj_li
|
||||
border-2 border-dashed border-x-red-500 border-y-white
|
||||
sm:border-x-red-400 md:border-x-yellow-400 lg:border-x-gray-100
|
||||
px-0.5 py-2 space-y-2
|
||||
min-w-full
|
||||
w-full
|
||||
container overflow-x-scroll {container_class_li}
|
||||
"
|
||||
>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user