mirror of
https://github.com/ByteAtATime/raycast-linux.git
synced 2025-08-31 03:07:23 +00:00
chore(client): fix type errors
This commit is contained in:
parent
9a176d6590
commit
d4d134bc20
6 changed files with 23 additions and 10 deletions
|
@ -91,7 +91,10 @@ export function resolveIcon(
|
|||
type: 'image',
|
||||
src: src,
|
||||
mask: icon.mask,
|
||||
tintColor: icon.tintColor
|
||||
tintColor:
|
||||
typeof icon.tintColor === 'object' && icon.tintColor
|
||||
? { adjustContrast: false, ...icon.tintColor }
|
||||
: icon.tintColor
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import { openUrl } from '@tauri-apps/plugin-opener';
|
|||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.HTMLElement.prototype.animate = () => ({
|
||||
finished: Promise.resolve(),
|
||||
finished: Promise.resolve({} as Animation),
|
||||
cancel: () => {},
|
||||
play: () => {},
|
||||
pause: () => {},
|
||||
|
@ -23,12 +23,16 @@ if (typeof window !== 'undefined') {
|
|||
playbackRate: 1,
|
||||
pending: false,
|
||||
playState: 'idle',
|
||||
ready: Promise.resolve(),
|
||||
ready: Promise.resolve({} as Animation),
|
||||
onfinish: null,
|
||||
oncancel: null,
|
||||
onremove: null,
|
||||
effect: null,
|
||||
id: ''
|
||||
id: '',
|
||||
replaceState: 'active',
|
||||
addEventListener: () => {},
|
||||
removeEventListener: () => {},
|
||||
dispatchEvent: () => false
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -5,16 +5,16 @@
|
|||
import type { HTMLInputAttributes } from 'svelte/elements';
|
||||
|
||||
type Props = {
|
||||
value: string | undefined | null;
|
||||
value?: string | undefined | null;
|
||||
} & HTMLInputAttributes;
|
||||
|
||||
let { value, ...restProps }: Props = $props();
|
||||
let { value = $bindable(), ...restProps }: Props = $props();
|
||||
let showPassword = $state(false);
|
||||
const inputType = $derived(showPassword ? 'text' : 'password');
|
||||
</script>
|
||||
|
||||
<div class="relative">
|
||||
<Input {...restProps} {value} type={inputType} files={undefined} class="pr-10" />
|
||||
<Input {...restProps} bind:value type={inputType} files={undefined} class="pr-10" />
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
if (componentProps && !isInitialized) {
|
||||
const initial = componentProps.defaultValue ?? componentProps.value;
|
||||
if (initial !== undefined) {
|
||||
internalValue = initial;
|
||||
internalValue = initial ?? undefined;
|
||||
} else if (firstItemValue !== undefined) {
|
||||
onDispatch(nodeId, 'onChange', [firstItemValue]);
|
||||
if (!isControlled) {
|
||||
|
|
|
@ -49,7 +49,6 @@ export * from './detail';
|
|||
export * from './grid';
|
||||
export * from './list';
|
||||
export * from './form';
|
||||
export * from '@raycast-linux/protocol';
|
||||
export * from './color';
|
||||
export * from './dropdown';
|
||||
export * from './section';
|
||||
|
|
|
@ -55,7 +55,14 @@ export function useGridView(args: () => GridViewArgs) {
|
|||
|
||||
if (!root) return { allItems: items, emptyViewNodeId };
|
||||
|
||||
const defaultSectionProps = { ...gridProps, title: undefined, subtitle: undefined };
|
||||
const defaultSectionProps = {
|
||||
isLoading: false,
|
||||
throttle: false,
|
||||
columns: 6,
|
||||
...gridProps,
|
||||
title: undefined,
|
||||
subtitle: undefined
|
||||
};
|
||||
|
||||
const processSection = (sectionNode: UINode, sectionPropsOverride?: Partial<GridProps>) => {
|
||||
const rawSectionProps = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue