import * as React from 'react'; import type { BaseProps } from '../../wui-core/src/iCore'; export type SizeType = 'sm' | 'md' | 'nm' | 'lg' | 'small' | 'middle' | 'large'; export interface OptionType { label?: string; value?: string | number | null; children?: OptionType[]; isEmptyNode?: string; } export interface CascaderOption { value?: string | number; label?: React.ReactNode; disabled?: boolean; isLeaf?: boolean; loading?: boolean; children?: CascaderOption[]; [key: string]: any; } export interface FieldNames { label?: string; value?: string; children?: string; } export interface ShowSearchType { filter?: (inputValue?: string, options?: CascaderOption[], fieldNames?: FieldNames) => boolean; render?: (inputValue?: string, path?: CascaderOption[], prefixCls?: string, fieldNames?: FieldNames) => React.ReactNode; sort?: (a: CascaderOption[], b: CascaderOption[], inputValue?: string, fieldNames?: FieldNames) => number; matchInputWidth?: boolean; limit?: number | false; } export interface CascaderProps extends BaseProps { allowClear?: boolean; autoFocus?: boolean; bordered?: boolean; changeOnSelect?: boolean; defaultValue?: Array; disabled?: boolean; displayRender?: (label?: Array, selectedOptions?: CascaderOption[]) => React.ReactNode; dropdownRender?: (menu: React.ReactElement) => React.ReactElement; expandIcon?: React.ReactNode; expandTrigger?: 'hover' | 'click'; fieldNames?: FieldNames; getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement; loadData?: (selectOptions: CascaderOption[]) => void; notFoundContent?: string; options?: CascaderOption[]; placeholder?: string; popupClassName?: string | undefined; popupPlacement?: string; showSearch?: boolean | ShowSearchType; size?: SizeType; separator?: string; suffixIcon?: React.ReactNode; onChange?: (label?: Array, selectedOptions?: CascaderOption[]) => void; onPopupVisibleChange?: (isShow?: boolean) => void; popupVisible?: boolean | undefined; value?: (string | number)[] | CascaderOption[]; prefixCls?: string; inputValue?: string; onSearch?: (label?: string, selectedOptions?: CascaderOption[]) => void; locale?: string; } export interface CascaderState { value: Array | CascaderOption[]; inputValue?: string; inputFocused: boolean; popupVisible: boolean | undefined; prevProps: any; flattenOptions: any; popupClassName: string | undefined; }