antd-mobile
Version:
<div align="center">
54 lines (53 loc) • 2.56 kB
TypeScript
import React, { ReactNode } from 'react';
import { PopupProps } from '../popup';
import { CascaderValue, CascaderValueExtend, CascaderOption } from '../cascader-view';
import { NativeProps } from '../../utils/native-props';
import type { FieldNamesType } from '../../hooks';
export declare type CascaderActions = {
open: () => void;
close: () => void;
toggle: () => void;
};
export declare type CascaderRef = CascaderActions;
export declare type CascaderProps = {
options: CascaderOption[];
value?: CascaderValue[];
defaultValue?: CascaderValue[];
placeholder?: string;
onSelect?: (value: CascaderValue[], extend: CascaderValueExtend) => void;
onConfirm?: (value: CascaderValue[], extend: CascaderValueExtend) => void;
onCancel?: () => void;
onClose?: () => void;
visible?: boolean;
title?: ReactNode;
confirmText?: ReactNode;
cancelText?: ReactNode;
loading?: boolean;
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
onTabsChange?: (index: number) => void;
activeIcon?: ReactNode;
fieldNames?: FieldNamesType;
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
export declare const Cascader: React.ForwardRefExoticComponent<{
options: CascaderOption[];
value?: import("../check-list").CheckListValue[] | undefined;
defaultValue?: import("../check-list").CheckListValue[] | undefined;
placeholder?: string | undefined;
onSelect?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
onConfirm?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
onCancel?: (() => void) | undefined;
onClose?: (() => void) | undefined;
visible?: boolean | undefined;
title?: ReactNode;
confirmText?: ReactNode;
cancelText?: ReactNode;
loading?: boolean | undefined;
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
onTabsChange?: ((index: number) => void) | undefined;
activeIcon?: ReactNode;
fieldNames?: FieldNamesType | undefined;
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
className?: string | undefined;
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
tabIndex?: number | undefined;
} & React.AriaAttributes & React.RefAttributes<CascaderActions>>;