UNPKG

@turbo-red/strapi-plugin-lookup-enum

Version:

Like enum field, but options are extracted from a field provided by a single-type content.

31 lines (30 loc) 870 B
import { MessageDescriptor } from 'react-intl'; export type DynamicEnumOptions = { lookupSingleType: string; lookupField: string; }; export type DynamicEnumProps = { attribute: { options: DynamicEnumOptions; }; description?: MessageDescriptor | string; placeholder?: MessageDescriptor | string; hint: string; name: string; label?: MessageDescriptor | string; onChange: (value: { target: { name: string; value?: string | string[]; type: string; }; }) => void; contentTypeUID: string; type: string; value?: string | string[]; required?: boolean; error?: MessageDescriptor | string; disabled?: boolean; }; export declare const makeDynamicEnum: (multiSelect: boolean) => React.FunctionComponent<DynamicEnumProps>; export default makeDynamicEnum;