1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 |
|
6 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
7 | onClick?: any;
|
8 | }
|
9 |
|
10 | export interface CloseableProps extends HTMLAttributesWeak, CommonProps {
|
11 | |
12 |
|
13 |
|
14 | closeArea?: 'tag' | 'tail';
|
15 |
|
16 | type?: 'normal' | 'primary';
|
17 |
|
18 | |
19 |
|
20 |
|
21 | onClose?: (from: string) => boolean;
|
22 |
|
23 | |
24 |
|
25 |
|
26 | afterClose?: () => void;
|
27 |
|
28 | |
29 |
|
30 |
|
31 | onClick?: React.MouseEventHandler;
|
32 |
|
33 | |
34 |
|
35 |
|
36 | size?: 'small' | 'medium' | 'large';
|
37 | }
|
38 |
|
39 | export class Closeable extends React.Component<CloseableProps, any> {}
|
40 |
|
41 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
42 | onChange?: any;
|
43 | }
|
44 |
|
45 | export interface SelectableProps extends HTMLAttributesWeak, CommonProps {
|
46 | |
47 |
|
48 |
|
49 |
|
50 | checked?: boolean;
|
51 |
|
52 | type?: 'normal' | 'primary';
|
53 | |
54 |
|
55 |
|
56 |
|
57 | defaultChecked?: boolean;
|
58 |
|
59 | |
60 |
|
61 |
|
62 | onChange?: (checked: boolean, e: any) => void;
|
63 |
|
64 | |
65 |
|
66 |
|
67 | disabled?: boolean;
|
68 | |
69 |
|
70 |
|
71 | size?: 'small' | 'medium' | 'large';
|
72 | }
|
73 |
|
74 | export class Selectable extends React.Component<SelectableProps, any> {}
|
75 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
76 | onClick?: any;
|
77 | }
|
78 |
|
79 | export interface TagGroupProps
|
80 | extends React.HTMLAttributes<HTMLElement>,
|
81 | CommonProps {}
|
82 |
|
83 | export class TagGroup extends React.Component<TagGroupProps, any> {}
|
84 |
|
85 | export interface TagProps extends HTMLAttributesWeak, CommonProps {
|
86 | |
87 |
|
88 |
|
89 | prefix?: string;
|
90 |
|
91 | |
92 |
|
93 |
|
94 | type?: 'normal' | 'primary';
|
95 |
|
96 | |
97 |
|
98 |
|
99 | size?: 'small' | 'medium' | 'large';
|
100 |
|
101 | |
102 |
|
103 |
|
104 | color?: string;
|
105 |
|
106 | |
107 |
|
108 |
|
109 | animation?: boolean;
|
110 |
|
111 | |
112 |
|
113 |
|
114 | afterAppear?: () => void;
|
115 |
|
116 | |
117 |
|
118 |
|
119 | onClick?: React.MouseEventHandler;
|
120 | }
|
121 |
|
122 | export default class Tag extends React.Component<TagProps, any> {
|
123 | static Closeable: typeof Closeable;
|
124 | static Selectable: typeof Selectable;
|
125 | static Group: typeof TagGroup;
|
126 | }
|