Skip to content

Commit

Permalink
v.8.8
Browse files Browse the repository at this point in the history
  • Loading branch information
urania-dev committed Dec 23, 2024
1 parent dfe0cbe commit 551ed5e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,7 @@
- fix: snapps api not sanitizing input
- 0.8.7.5
- general update, cleaning and optimization of the dependencies
- 0.8.8
- general cleanup after updating some dependencies (svelte-search-params and
svelte5 updates)
- fixed cased https check
22 changes: 10 additions & 12 deletions src/lib/ui/chart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { onMount } from 'svelte';
import Input from './input.svelte';
import { _ } from 'svelte-i18n';
import { queryParam } from 'sveltekit-search-params';
import { queryParameters } from 'sveltekit-search-params';
import { type DateValue, CalendarDate } from '@internationalized/date';
let {
Expand Down Expand Up @@ -67,9 +67,10 @@
let clientHeight = $state(0);
const _start = new CalendarDate(start.getFullYear(), start.getMonth() + 1, start.getDate());
const _end = new CalendarDate(end.getFullYear(), end.getMonth() + 1, end.getDate());
const startParam = queryParam<DateValue>(
'start',
const params = queryParameters(
{
'start':{
defaultValue: _start,
encode: (value) => value.toString(),
decode: (value) => {
Expand All @@ -78,12 +79,7 @@
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
}
},
{ showDefaults: false }
);
const endParam = queryParam<DateValue>(
'end',
{
end:{
defaultValue: _end,
encode: (value) => value.toString(),
decode: (value) => {
Expand All @@ -92,8 +88,10 @@
return new CalendarDate(date.getFullYear(), date.getMonth() + 1, date.getDate());
}
},
{ showDefaults: false }
}
);
</script>

<div class="relative flex h-full w-full flex-col">
Expand All @@ -114,7 +112,7 @@
name="start"
label={$_('globals.start')}
type="date"
bind:date={$startParam}
bind:date={params.start}
actions={{
focus: (e) => {
(e.currentTarget as HTMLInputElement)?.showPicker();
Expand All @@ -125,7 +123,7 @@
name="end"
label={$_('globals.end')}
type="date"
bind:date={$endParam}
bind:date={params.end}
actions={{
focus: (e) => {
(e.currentTarget as HTMLInputElement)?.showPicker();
Expand Down
8 changes: 6 additions & 2 deletions src/lib/ui/input.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
name: string;
label?: string;
type?: HTMLInputElement['type'];
icons?: { left?: string; right?: string, sizeLeft?:number };
icons?: { left?: string; right?: string; sizeLeft?: number };
actions?: {
left?: MouseEventHandler<HTMLButtonElement>;
right?: MouseEventHandler<HTMLButtonElement>;
Expand Down Expand Up @@ -58,7 +58,11 @@
class="flex w-full max-w-max items-center gap-2 px-2"
onclick={(e) => actions?.left?.(e) || element?.focus()}
>
<Icon ph={icons.left} css={css ? { icon: css?.['icon-left'] } : undefined} size={icons.sizeLeft}></Icon>
<Icon
ph={icons.left}
css={css ? { icon: css?.['icon-left'] } : undefined}
size={icons.sizeLeft}
></Icon>
</button>
{/if}
{#if type !== 'textarea' && type !== 'date'}
Expand Down

0 comments on commit 551ed5e

Please sign in to comment.