2022-06-22 22:57:42 -04:00
|
|
|
import { FC } from 'react';
|
|
|
|
|
|
|
|
|
|
import { CommonUIModule } from '../webpack';
|
|
|
|
|
import { ItemProps } from './Item';
|
|
|
|
|
|
|
|
|
|
export interface ToggleFieldProps extends ItemProps {
|
2023-02-19 03:58:50 +08:00
|
|
|
highlightOnFocus?: boolean;
|
2022-06-22 22:57:42 -04:00
|
|
|
checked: boolean;
|
|
|
|
|
disabled?: boolean;
|
|
|
|
|
onChange?(checked: boolean): void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const ToggleField = Object.values(CommonUIModule).find((mod: any) =>
|
2024-10-03 16:46:50 -04:00
|
|
|
// stable || beta as of oct 2 2024
|
2024-10-11 14:47:27 -04:00
|
|
|
mod?.render?.toString?.()?.includes('ToggleField,fallback') || mod?.render?.toString?.()?.includes("ToggleField\",")
|
2022-06-22 22:57:42 -04:00
|
|
|
) as FC<ToggleFieldProps>;
|