From 4641668f78f0d12f344db0e3bbab4d63a8104465 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Wed, 11 Feb 2026 20:04:46 +0700 Subject: [PATCH] fix: Improve SelectDropdown handling and valueset caching --- src/lib/api/geography.js | 6 +- src/lib/components/Modal.svelte | 12 +- src/lib/components/SelectDropdown.svelte | 22 +- src/lib/stores/valuesets.js | 116 ++++----- src/routes/(app)/patients/+page.svelte | 301 +++++++++++------------ 5 files changed, 226 insertions(+), 231 deletions(-) diff --git a/src/lib/api/geography.js b/src/lib/api/geography.js index e703669..184948e 100644 --- a/src/lib/api/geography.js +++ b/src/lib/api/geography.js @@ -8,7 +8,7 @@ export async function fetchProvinces() { return get('/api/areageo/provinces'); } -export async function fetchCities(provinceId = null) { - const query = provinceId ? `?province_id=${provinceId}` : ''; + export async function fetchCities(provinceId = null) { + const query = provinceId ? `?province_id=${encodeURIComponent(provinceId)}` : ''; return get(`/api/areageo/cities${query}`); -} + } diff --git a/src/lib/components/Modal.svelte b/src/lib/components/Modal.svelte index 9aaff48..6f40ae5 100644 --- a/src/lib/components/Modal.svelte +++ b/src/lib/components/Modal.svelte @@ -29,6 +29,16 @@ lg: 'modal-lg', xl: 'modal-xl', full: 'modal-full', + wide: 'modal-wide', + }; + + const widthStyles = { + sm: 'max-width: 400px;', + md: 'max-width: 500px;', + lg: 'max-width: 800px;', + xl: 'max-width: 1200px;', + full: 'max-width: 100%; width: 100%; height: 100%;', + wide: 'max-width: 90vw; width: 1200px;', }; /** @@ -67,7 +77,7 @@ -