feat: Implemented filtering and searching

This commit is contained in:
Simeon Radivoev 2026-04-12 22:19:24 +03:00
parent 4806f3487a
commit 444d8c4c27
Signed by: simeonradivoev
GPG key ID: 7611A451D2A5D37A
49 changed files with 841 additions and 290 deletions

View file

@ -36,9 +36,9 @@ export function Button (data: {
tooltipType?: "base" | "accent" | "error" | "warning";
} & InteractParams & FocusParams)
{
const handleAction = (e?: any) =>
const handleAction = (event?: Event) =>
{
data.onAction?.(e);
data.onAction?.({ event, focusKey });
oneShot('click');
};
const { ref, focused, focusKey } = useFocusable({
@ -50,12 +50,12 @@ export function Button (data: {
if (data.shortcutLabel)
{
useShortcuts(focusKey, () => [{ label: data.shortcutLabel, action: data.onAction, button: GamePadButtonCode.A }], [data.shortcutLabel]);
useShortcuts(focusKey, () => [{ label: data.shortcutLabel, action: handleAction, button: GamePadButtonCode.A }], [data.shortcutLabel]);
}
return <button
ref={ref}
onClick={handleAction}
onClick={e => handleAction(e.nativeEvent)}
disabled={data.disabled}
data-tooltip={data.tooltip}
data-tooltip-type={data.tooltipType}

View file

@ -101,7 +101,7 @@ export function PathSettingsOptionBase (data: PathSettingsOptionParams & {
onBlur={handleInputBlur}
onChange={(e) =>
{
data.setLocalValue(e);
data.setLocalValue(String(e));
}}
value={data.localValue}
/>

View file

@ -29,7 +29,7 @@ function FormOption (data: { type: HTMLInputTypeAttribute, icon?: JSX.Element; l
name={field.name}
value={field.state.value}
type={data.type}
onChange={v => field.handleChange(v)}
onChange={v => field.handleChange(String(v))}
placeholder={data.placeholder}
className={classNames({ " flex-3 ring-4 ring-accent": field.getMeta().isDirty })}
/>

View file

@ -15,7 +15,7 @@ export function SettingsOption (data: {
})
{
const [dirty, setDirty] = useState(false);
const [localValue, setLocalValue] = useState<string | boolean | undefined>();
const [localValue, setLocalValue] = useState<string | number | boolean | undefined>();
const { data: serverValue } = useQuery(getSettingQuery(data.id));
const setMutation = useMutation(setSettingMutation(data.id));