format: whole project
This commit is contained in:
1 parent
b883b5f6e0
commit
80269cf275
79 files changed
+590
-612
No files matched your search
@@ -1,25 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { locale } from '$lib/translations'
|
||||
|
||||
|
||||
interface Props {
|
||||
number: number;
|
||||
locale?: string;
|
||||
options?: Intl.NumberFormatOptions;
|
||||
class?: string;
|
||||
number: number
|
||||
locale?: string
|
||||
options?: Intl.NumberFormatOptions
|
||||
class?: string
|
||||
}
|
||||
|
||||
let {
|
||||
number,
|
||||
locale: localeToUse = $locale,
|
||||
options = {
|
||||
notation: 'compact',
|
||||
},
|
||||
class: clazz = ''
|
||||
}: Props = $props();
|
||||
|
||||
|
||||
|
||||
notation: 'compact',
|
||||
},
|
||||
class: clazz = '',
|
||||
}: Props = $props()
|
||||
</script>
|
||||
|
||||
<span class={clazz ?? ''}>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
date: Date,
|
||||
options: Intl.RelativeTimeFormatOptions,
|
||||
locale?: string,
|
||||
relativeTo?: Date
|
||||
relativeTo?: Date,
|
||||
) {
|
||||
try {
|
||||
const now = relativeTo?.getTime() ?? Date.now()
|
||||
@@ -41,7 +41,6 @@
|
||||
<script lang="ts">
|
||||
import { locale } from '$lib/translations'
|
||||
|
||||
|
||||
const toLocaleDateString = (date: Date): string => {
|
||||
try {
|
||||
return date.toLocaleString()
|
||||
@@ -51,24 +50,24 @@
|
||||
}
|
||||
|
||||
interface Props {
|
||||
date: Date;
|
||||
relativeTo?: Date | undefined;
|
||||
options?: Intl.RelativeTimeFormatOptions;
|
||||
style?: string;
|
||||
class?: string;
|
||||
date: Date
|
||||
relativeTo?: Date | undefined
|
||||
options?: Intl.RelativeTimeFormatOptions
|
||||
style?: string
|
||||
class?: string
|
||||
}
|
||||
|
||||
let {
|
||||
date,
|
||||
relativeTo = undefined,
|
||||
options = {
|
||||
numeric: 'always',
|
||||
style: 'narrow',
|
||||
},
|
||||
numeric: 'always',
|
||||
style: 'narrow',
|
||||
},
|
||||
style = '',
|
||||
class: clazz = ''
|
||||
}: Props = $props();
|
||||
|
||||
class: clazz = '',
|
||||
}: Props = $props()
|
||||
|
||||
let dateTime = $derived(toLocaleDateString(date))
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,17 +3,19 @@
|
||||
import { Modal } from 'mono-svelte'
|
||||
|
||||
interface Props {
|
||||
object: any;
|
||||
open?: boolean;
|
||||
title?: import('svelte').Snippet;
|
||||
object: any
|
||||
open?: boolean
|
||||
title?: import('svelte').Snippet
|
||||
}
|
||||
|
||||
let { object, open = $bindable(false), title }: Props = $props();
|
||||
let { object, open = $bindable(false), title }: Props = $props()
|
||||
</script>
|
||||
|
||||
<Modal bind:open>
|
||||
{#snippet title()}
|
||||
<span >{#if title}{@render title()}{:else}Debug{/if}</span>
|
||||
<span>
|
||||
{#if title}{@render title()}{:else}Debug{/if}
|
||||
</span>
|
||||
{/snippet}
|
||||
<DebugTree {object} isParent={true} />
|
||||
</Modal>
|
||||
@@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import DebugTree from './DebugTree.svelte';
|
||||
import DebugTree from './DebugTree.svelte'
|
||||
interface Props {
|
||||
object: any;
|
||||
isParent?: boolean;
|
||||
object: any
|
||||
isParent?: boolean
|
||||
}
|
||||
|
||||
let { object, isParent = false }: Props = $props();
|
||||
let { object, isParent = false }: Props = $props()
|
||||
</script>
|
||||
|
||||
<ul class:ml-4={!isParent} class="leading-8">
|
||||
|
||||
Reference in new issue
Block a user