From e44664c9704b3b284284619bc26cf6a910890136 Mon Sep 17 00:00:00 2001 From: AAGaming Date: Thu, 14 May 2026 23:57:56 -0400 Subject: [PATCH] fix(dropdown): hack to fix styling in dropdownitem --- src/components/Dropdown.tsx | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/components/Dropdown.tsx diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx new file mode 100644 index 0000000..05a072f --- /dev/null +++ b/src/components/Dropdown.tsx @@ -0,0 +1,49 @@ +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; + +export interface DropdownItemProps extends DropdownProps, ItemProps {} + +const dropdownItemRegex = createPropListRegex(["dropDownControlRef", "description"], false); +export const DropdownItemInternal = Object.values(CommonUIModule).find((mod: any) => + mod?.toString && dropdownItemRegex.test(mod.toString()), +) as FC; + +export const DropdownItem = ((args: DropdownItemProps) => ) as FC; \ No newline at end of file