UNPKG

2.56 kBTypeScriptView Raw
1import React, { ReactNode } from 'react';
2import { PopupProps } from '../popup';
3import { CascaderValue, CascaderValueExtend, CascaderOption } from '../cascader-view';
4import { NativeProps } from '../../utils/native-props';
5import type { FieldNamesType } from '../../hooks';
6export declare type CascaderActions = {
7 open: () => void;
8 close: () => void;
9 toggle: () => void;
10};
11export declare type CascaderRef = CascaderActions;
12export declare type CascaderProps = {
13 options: CascaderOption[];
14 value?: CascaderValue[];
15 defaultValue?: CascaderValue[];
16 placeholder?: string;
17 onSelect?: (value: CascaderValue[], extend: CascaderValueExtend) => void;
18 onConfirm?: (value: CascaderValue[], extend: CascaderValueExtend) => void;
19 onCancel?: () => void;
20 onClose?: () => void;
21 visible?: boolean;
22 title?: ReactNode;
23 confirmText?: ReactNode;
24 cancelText?: ReactNode;
25 loading?: boolean;
26 children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
27 onTabsChange?: (index: number) => void;
28 activeIcon?: ReactNode;
29 fieldNames?: FieldNamesType;
30} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
31export declare const Cascader: React.ForwardRefExoticComponent<{
32 options: CascaderOption[];
33 value?: import("../check-list").CheckListValue[] | undefined;
34 defaultValue?: import("../check-list").CheckListValue[] | undefined;
35 placeholder?: string | undefined;
36 onSelect?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
37 onConfirm?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
38 onCancel?: (() => void) | undefined;
39 onClose?: (() => void) | undefined;
40 visible?: boolean | undefined;
41 title?: ReactNode;
42 confirmText?: ReactNode;
43 cancelText?: ReactNode;
44 loading?: boolean | undefined;
45 children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
46 onTabsChange?: ((index: number) => void) | undefined;
47 activeIcon?: ReactNode;
48 fieldNames?: FieldNamesType | undefined;
49} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
50 className?: string | undefined;
51 style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
52 tabIndex?: number | undefined;
53} & React.AriaAttributes & React.RefAttributes<CascaderActions>>;
54
\No newline at end of file