1 | import * as React from "react";
|
2 | import { AbstractPureComponent2, Alignment, ActionProps, IElementRefProps, MaybeElement } from "../../common";
|
3 | import { IconName } from "../icon/icon";
|
4 | export declare type ButtonProps<E extends HTMLButtonElement | HTMLAnchorElement = HTMLButtonElement> = IButtonProps<E>;
|
5 |
|
6 | export interface IButtonProps<E extends HTMLButtonElement | HTMLAnchorElement = HTMLButtonElement> extends ActionProps, IElementRefProps<E> {
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | active?: boolean;
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | alignText?: Alignment;
|
23 |
|
24 | fill?: boolean;
|
25 |
|
26 | large?: boolean;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | loading?: boolean;
|
34 |
|
35 | minimal?: boolean;
|
36 |
|
37 | outlined?: boolean;
|
38 |
|
39 | rightIcon?: IconName | MaybeElement;
|
40 |
|
41 | small?: boolean;
|
42 | |
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | type?: "submit" | "reset" | "button";
|
49 | }
|
50 |
|
51 | export declare type IAnchorButtonProps = ButtonProps<HTMLAnchorElement>;
|
52 | export declare type AnchorButtonProps = IAnchorButtonProps;
|
53 | export interface IButtonState {
|
54 | isActive: boolean;
|
55 | }
|
56 | export declare abstract class AbstractButton<E extends HTMLButtonElement | HTMLAnchorElement> extends AbstractPureComponent2<ButtonProps<E> & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.AnchorHTMLAttributes<HTMLAnchorElement>), IButtonState> {
|
57 | state: {
|
58 | isActive: boolean;
|
59 | };
|
60 | protected abstract buttonRef: HTMLElement | null;
|
61 | private currentKeyDown?;
|
62 | abstract render(): JSX.Element;
|
63 | protected getCommonButtonProps(): {
|
64 | className: string;
|
65 | disabled: (ButtonProps<E> & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.AnchorHTMLAttributes<HTMLAnchorElement>))["loading"] | (ButtonProps<E> & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.AnchorHTMLAttributes<HTMLAnchorElement>))["disabled"] | undefined;
|
66 | onBlur: (e: React.FocusEvent<any>) => void;
|
67 | onClick: (ButtonProps<E> & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.AnchorHTMLAttributes<HTMLAnchorElement>))["onClick"] | undefined;
|
68 | onKeyDown: (e: React.KeyboardEvent<any>) => void;
|
69 | onKeyUp: (e: React.KeyboardEvent<any>) => void;
|
70 | tabIndex: number | (ButtonProps<E> & (E extends HTMLButtonElement ? React.ButtonHTMLAttributes<HTMLButtonElement> : React.AnchorHTMLAttributes<HTMLAnchorElement>))["tabIndex"] | undefined;
|
71 | };
|
72 | protected handleKeyDown: (e: React.KeyboardEvent<any>) => void;
|
73 | protected handleKeyUp: (e: React.KeyboardEvent<any>) => void;
|
74 | protected handleBlur: (e: React.FocusEvent<any>) => void;
|
75 | protected renderChildren(): React.ReactNode;
|
76 | }
|