UNPKG

antd

Version:

An enterprise-class UI design language and React components implementation

58 lines (57 loc) 2.66 kB
import * as React from 'react'; import type { BaseOptionType, DefaultOptionType, FieldNames, MultipleCascaderProps as RcMultipleCascaderProps, SingleCascaderProps as RcSingleCascaderProps } from 'rc-cascader'; import type { SelectCommonPlacement } from '../_util/motion'; import type { InputStatus } from '../_util/statusUtils'; import type { SizeType } from '../config-provider/SizeContext'; import type { Variant } from '../form/hooks/useVariants'; import CascaderPanel from './Panel'; export type { BaseOptionType, DefaultOptionType }; export type FieldNamesType = FieldNames; export type FilledFieldNamesType = Required<FieldNamesType>; declare const SHOW_CHILD: "SHOW_CHILD", SHOW_PARENT: "SHOW_PARENT"; export type SingleCascaderProps<OptionType extends BaseOptionType = any> = Omit<RcSingleCascaderProps<OptionType>, 'checkable' | 'options'> & { multiple?: false; }; export type MultipleCascaderProps<OptionType extends BaseOptionType = any> = Omit<RcMultipleCascaderProps<OptionType>, 'checkable' | 'options'> & { multiple: true; }; type UnionCascaderProps<OptionType extends BaseOptionType> = SingleCascaderProps<OptionType> | MultipleCascaderProps<OptionType>; export type CascaderProps<DataNodeType extends BaseOptionType = any> = UnionCascaderProps<DataNodeType> & { multiple?: boolean; size?: SizeType; /** * @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a * default behavior, you can hide it by setting `suffixIcon` to null. */ showArrow?: boolean; disabled?: boolean; /** @deprecated Use `variant` instead. */ bordered?: boolean; placement?: SelectCommonPlacement; suffixIcon?: React.ReactNode; options?: DataNodeType[]; status?: InputStatus; autoClearSearchValue?: boolean; rootClassName?: string; popupClassName?: string; /** @deprecated Please use `popupClassName` instead */ dropdownClassName?: string; /** * @since 5.13.0 * @default "outlined" */ variant?: Variant; }; export interface CascaderRef { focus: () => void; blur: () => void; } declare const Cascader: (<OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: React.PropsWithChildren<CascaderProps<OptionType>> & React.RefAttributes<CascaderRef>) => React.ReactElement) & { displayName: string; SHOW_PARENT: typeof SHOW_PARENT; SHOW_CHILD: typeof SHOW_CHILD; Panel: typeof CascaderPanel; _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel; }; declare const PurePanel: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element; export default Cascader;