UNPKG

2.66 kBTypeScriptView Raw
1import * as React from 'react';
2import type { BaseOptionType, DefaultOptionType, FieldNames, MultipleCascaderProps as RcMultipleCascaderProps, SingleCascaderProps as RcSingleCascaderProps } from 'rc-cascader';
3import type { SelectCommonPlacement } from '../_util/motion';
4import type { InputStatus } from '../_util/statusUtils';
5import type { SizeType } from '../config-provider/SizeContext';
6import type { Variant } from '../form/hooks/useVariants';
7import CascaderPanel from './Panel';
8export type { BaseOptionType, DefaultOptionType };
9export type FieldNamesType = FieldNames;
10export type FilledFieldNamesType = Required<FieldNamesType>;
11declare const SHOW_CHILD: "SHOW_CHILD", SHOW_PARENT: "SHOW_PARENT";
12export type SingleCascaderProps<OptionType extends BaseOptionType = any> = Omit<RcSingleCascaderProps<OptionType>, 'checkable' | 'options'> & {
13 multiple?: false;
14};
15export type MultipleCascaderProps<OptionType extends BaseOptionType = any> = Omit<RcMultipleCascaderProps<OptionType>, 'checkable' | 'options'> & {
16 multiple: true;
17};
18type UnionCascaderProps<OptionType extends BaseOptionType> = SingleCascaderProps<OptionType> | MultipleCascaderProps<OptionType>;
19export type CascaderProps<DataNodeType extends BaseOptionType = any> = UnionCascaderProps<DataNodeType> & {
20 multiple?: boolean;
21 size?: SizeType;
22 /**
23 * @deprecated `showArrow` is deprecated which will be removed in next major version. It will be a
24 * default behavior, you can hide it by setting `suffixIcon` to null.
25 */
26 showArrow?: boolean;
27 disabled?: boolean;
28 /** @deprecated Use `variant` instead. */
29 bordered?: boolean;
30 placement?: SelectCommonPlacement;
31 suffixIcon?: React.ReactNode;
32 options?: DataNodeType[];
33 status?: InputStatus;
34 autoClearSearchValue?: boolean;
35 rootClassName?: string;
36 popupClassName?: string;
37 /** @deprecated Please use `popupClassName` instead */
38 dropdownClassName?: string;
39 /**
40 * @since 5.13.0
41 * @default "outlined"
42 */
43 variant?: Variant;
44};
45export interface CascaderRef {
46 focus: () => void;
47 blur: () => void;
48}
49declare const Cascader: (<OptionType extends DefaultOptionType | BaseOptionType = DefaultOptionType>(props: React.PropsWithChildren<CascaderProps<OptionType>> & React.RefAttributes<CascaderRef>) => React.ReactElement) & {
50 displayName: string;
51 SHOW_PARENT: typeof SHOW_PARENT;
52 SHOW_CHILD: typeof SHOW_CHILD;
53 Panel: typeof CascaderPanel;
54 _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
55};
56declare const PurePanel: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element;
57export default Cascader;