mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-19 01:20:20 +02:00
fix(Field): fix filter for field on beta
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
import { ReactNode, FC } from 'react';
|
||||
|
||||
import { CommonUIModule } from '../webpack';
|
||||
import { ItemProps } from './Item';
|
||||
import { createPropListRegex } from '../utils';
|
||||
import type { ContextMenuPositionOptions } from './Menu';
|
||||
|
||||
export interface SingleDropdownOption {
|
||||
data: any;
|
||||
label: ReactNode;
|
||||
|
||||
options?: never;
|
||||
}
|
||||
|
||||
export interface MultiDropdownOption {
|
||||
label: ReactNode;
|
||||
options: DropdownOption[];
|
||||
|
||||
data?: never;
|
||||
}
|
||||
|
||||
export type DropdownOption = SingleDropdownOption | MultiDropdownOption;
|
||||
|
||||
export interface DropdownProps {
|
||||
rgOptions: DropdownOption[];
|
||||
selectedOption: any;
|
||||
disabled?: boolean;
|
||||
onMenuWillOpen?(showMenu: () => void): void;
|
||||
onMenuOpened?(): void;
|
||||
onChange?(data: SingleDropdownOption): void;
|
||||
contextMenuPositionOptions?: ContextMenuPositionOptions;
|
||||
menuLabel?: string;
|
||||
strDefaultLabel?: string;
|
||||
renderButtonValue?(element: ReactNode): ReactNode;
|
||||
focusable?: boolean;
|
||||
}
|
||||
|
||||
export const Dropdown = Object.values(CommonUIModule).find(
|
||||
(mod: any) => mod?.prototype?.SetSelectedOption && mod?.prototype?.BuildMenu,
|
||||
) as FC<DropdownProps>;
|
||||
|
||||
export interface DropdownItemProps extends DropdownProps, ItemProps {}
|
||||
|
||||
const dropdownItemRegex = createPropListRegex(["dropDownControlRef", "description"], false);
|
||||
export const DropdownItem = Object.values(CommonUIModule).find((mod: any) =>
|
||||
mod?.toString && dropdownItemRegex.test(mod.toString()),
|
||||
) as FC<DropdownItemProps>;
|
||||
@@ -24,6 +24,7 @@ export interface FieldProps extends FooterLegendProps {
|
||||
onClick?: (e: CustomEvent | MouseEvent) => void;
|
||||
}
|
||||
|
||||
export const Field = findModuleExport((e: Export) => e?.render?.toString().includes('"shift-children-below"')) as FC<
|
||||
// new || old
|
||||
export const Field = findModuleExport((e: Export) => (e?.toString()?.includes('().Field') && e?.toString()?.includes('"shift-children-below"')) || e?.render?.toString()?.includes('"shift-children-below"')) as FC<
|
||||
FieldProps & RefAttributes<HTMLDivElement>
|
||||
>;
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface ItemProps {
|
||||
layout?: 'below' | 'inline';
|
||||
icon?: ReactNode;
|
||||
bottomSeparator?: 'standard' | 'thick' | 'none';
|
||||
childrenContainerWidth?: 'min' | 'max' | 'fixed'; // Does not work with layout==='below'
|
||||
indentLevel?: number;
|
||||
tooltip?: string;
|
||||
highlightOnFocus?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user