fix(components): fix missing children prop

also remove unnessecary use of tsx
This commit is contained in:
AAGaming
2024-05-27 13:19:11 -04:00
parent 6c1b12b95f
commit 688c7471cd
27 changed files with 23 additions and 20 deletions

View File

@@ -0,0 +1,49 @@
import { ReactNode, FC } from 'react';
import { CommonUIModule } from '../webpack';
import { ItemProps } from './Item';
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 DropdownMenuPositionOptions {
[_: string]: unknown
bMatchWidth?: boolean
}
export interface DropdownProps {
rgOptions: DropdownOption[];
selectedOption: any;
disabled?: boolean;
onMenuWillOpen?(showMenu: () => void): void;
onMenuOpened?(): void;
onChange?(data: SingleDropdownOption): void;
contextMenuPositionOptions?: DropdownMenuPositionOptions;
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 {}
export const DropdownItem = Object.values(CommonUIModule).find((mod: any) =>
mod?.toString()?.includes('"dropDownControlRef","description"'),
) as FC<DropdownItemProps>;