fix: resolve all typescript errors in sv check (#715)
This commit is contained in:
1 parent
2a5fb886ae
commit
7bddf16559
38 files changed
+233
-287
No files matched your search
@@ -32,10 +32,13 @@
|
||||
: ''}
|
||||
{url != undefined ? 'rounded-b-none' : ''}
|
||||
"
|
||||
ondrop={preventDefault((event) => (files = event.dataTransfer?.files))}
|
||||
ondrop={preventDefault(
|
||||
(event) => (files = (event as DragEvent).dataTransfer?.files ?? null),
|
||||
)}
|
||||
ondragover={preventDefault((event) => {
|
||||
if (event.dataTransfer) {
|
||||
event.dataTransfer.dropEffect = 'copy'
|
||||
const dragEvent = event as DragEvent
|
||||
if (dragEvent.dataTransfer) {
|
||||
dragEvent.dataTransfer.dropEffect = 'copy'
|
||||
dragover = true
|
||||
}
|
||||
})}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
children?: import('svelte').Snippet
|
||||
style?: 'header' | 'subpage'
|
||||
margin?: boolean
|
||||
class?: string
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -22,6 +23,7 @@
|
||||
children,
|
||||
style = 'header',
|
||||
margin = true,
|
||||
class: clazz = '',
|
||||
}: Props = $props()
|
||||
|
||||
let matchType = $derived<('search' | 'pathname')[]>(
|
||||
@@ -59,6 +61,7 @@
|
||||
style == 'header' ? 'bar-header' : 'gap-2',
|
||||
margin && 'my-2',
|
||||
margin && style == 'subpage' && 'mb-3',
|
||||
clazz,
|
||||
]}
|
||||
>
|
||||
{#each routes as route, index (route.href)}
|
||||
|
||||
@@ -2,11 +2,7 @@
|
||||
import { Spinner } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import { type IconSource, Icon } from 'svelte-hero-icons/dist'
|
||||
import type {
|
||||
ClassValue,
|
||||
HTMLAnchorAttributes,
|
||||
HTMLButtonAttributes,
|
||||
} from 'svelte/elements'
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
export type ButtonColor = keyof typeof buttonColor
|
||||
export type ButtonAlignment = keyof typeof buttonAlignment
|
||||
@@ -77,8 +73,7 @@
|
||||
}
|
||||
type ButtonGap = keyof typeof buttonGap
|
||||
|
||||
interface Props
|
||||
extends Omit<HTMLButtonAttributes | HTMLAnchorAttributes, 'prefix'> {
|
||||
interface Props extends Record<string, any> {
|
||||
loading?: boolean
|
||||
submit?: boolean
|
||||
type?: 'button' | 'none'
|
||||
@@ -94,7 +89,7 @@
|
||||
prefix?: Snippet
|
||||
children?: Snippet
|
||||
suffix?: Snippet
|
||||
onclick?: HTMLButtonAttributes['onclick']
|
||||
onclick?: any
|
||||
icon?: IconSource
|
||||
weight?: ButtonWeight
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
title={$shownModal.title}
|
||||
dismissable={$shownModal.dismissable}
|
||||
ondismissed={() => shownModal.set(undefined)}
|
||||
bind:open={$shownModal}
|
||||
open={!!$shownModal}
|
||||
>
|
||||
{#if $shownModal.snippet}
|
||||
{@render $shownModal.snippet?.()}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
selected?: T | undefined
|
||||
search: (query: string) => Promise<T[]>
|
||||
extractName: (item: T) => string
|
||||
select?: (item: T) => void
|
||||
select?: (item?: T) => void
|
||||
input?: import('svelte').Snippet
|
||||
noresults?: import('svelte').Snippet
|
||||
required?: boolean
|
||||
@@ -43,7 +43,8 @@
|
||||
selected = $bindable(undefined),
|
||||
search,
|
||||
extractName,
|
||||
select = (item: T) => {
|
||||
select = (item?: T) => {
|
||||
if (item == null) return
|
||||
selected = item
|
||||
query = extractName(item)
|
||||
onselect?.(item)
|
||||
|
||||
Reference in new issue
Block a user