zent
Version:
一套前端设计语言和基于React的实现
41 lines (40 loc) • 1.64 kB
TypeScript
import { Component } from 'react';
import { IconType } from '../icon';
import { IDisabledContext } from '../disabled';
export interface ISplitButtonProps<Value> {
type?: 'default' | 'primary' | 'danger' | 'success' | 'text';
size?: 'medium' | 'large' | 'small';
disabled?: boolean;
loading?: boolean;
dropdownData: Value[];
dropdownTrigger?: 'click' | 'hover';
dropdownText: keyof Value;
dropdownValue: keyof Value;
dropdownIcon: IconType;
dropdownPosition?: 'left-top' | 'left-center' | 'left-bottom' | 'right-top' | 'right-center' | 'right-bottom' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'auto-bottom-center' | 'auto-bottom-left' | 'auto-bottom-right' | 'auto-top-center' | 'auto-top-left' | 'auto-top-right';
className?: string;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
onSelect?: (key: string) => void;
}
export declare class SplitButton<Value> extends Component<ISplitButtonProps<Value>> {
static defaultProps: {
type: string;
size: string;
dropdownTrigger: string;
dropdownData: any[];
dropdownValue: string;
dropdownText: string;
dropdownIcon: string;
dropdownPosition: string;
};
static contextType: import("react").Context<IDisabledContext>;
context: IDisabledContext;
splitButton: import("react").RefObject<HTMLDivElement>;
state: {
isShowDropdown: boolean;
};
toggleDropdown: (isShow: any) => void;
handleSelect: (e: any, key: any) => void;
render(): JSX.Element;
}
export default SplitButton;