forked from react-toolbox/react-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
241 lines (229 loc) · 5.7 KB
/
index.d.ts
File metadata and controls
241 lines (229 loc) · 5.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
import __ReactToolbox from "../index.d.ts";
export interface MenuTheme {
/**
* Added to the root element when menu is active.
*/
active?: string;
/**
* Added to the root when position is bottom left.
*/
bottomLeft?: string;
/**
* Added to the root when position is bottom right.
*/
bottomRight?: string;
/**
* Used for the root element of the menu.
*/
menu?: string;
/**
* Used for the inner wrapper.
*/
menuInner?: string;
/**
* Used to draw the outline.
*/
outline?: string;
/**
* Added to the menu in case if should have ripple.
*/
rippled?: string;
/**
* Added to the root in case its static.
*/
static?: string;
/**
* Added to the root when position is top left.
*/
topLeft?: string;
/**
* Added to the root when position is top right.
*/
topRight?: string;
}
interface MenuProps extends __ReactToolbox.Props {
/**
* If true, the menu will be displayed as opened by default.
* @default false
*/
active?: boolean;
/**
* Children to pass through the component.
*/
children?: __React.ReactNode;
/**
* Callback that will be called when the menu is being hidden.
*/
onHide?: Function;
/**
* Callback that will be invoked when a menu item is selected.
*/
onSelect?: Function;
/**
* Callback that will be invoked when the menu is being shown.
*/
onShow?: Function;
/**
* If true the menu wrapper will show an outline with a soft shadow.
* @default false
*/
outline?: boolean;
/**
* Determine the position of the menu. With static value the menu will be always shown, auto means that the it will decide the opening direction based on the current position. To force a position use topLeft, topRight, bottomLeft, bottomRight.
* @default static
*/
position?: "auto" | "static" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
/**
* If true, the menu items will show a ripple effect on click.
* @default true
*/
ripple?: boolean;
/**
* If true, the menu will keep a value to highlight the active child item.
* @default false
*/
selectable?: boolean;
/**
* Used for selectable menus. Indicates the current selected value so the child item with this value can be highlighted.
*/
selected?: any;
/**
* Classnames object defining the component style.
*/
theme?: MenuTheme;
}
export class Menu extends __React.Component<MenuProps, {}> { }
export interface IconMenuTheme {
/**
* Used for the icon element.
*/
icon?: string;
/**
* Used for the root element of the icon menu.
*/
iconMenu?: string;
}
interface IconMenuProps extends __ReactToolbox.Props {
/**
* Children to pass through the component.
*/
children?: __React.ReactNode;
/**
* Icon font key string or Element to display the opener icon.
* @default more_vert
*/
icon?: __React.ReactNode | string;
/**
* If true, the icon will show a ripple when is clicked.
* @default true
*/
iconRipple?: boolean;
/**
* Transferred to the Menu component.
* @default true
*/
menuRipple?: boolean;
/**
* Callback that will be called when the menu is being hidden.
*/
onHide?: Function;
/**
* Callback that will be invoked when a menu item is selected.
*/
onSelect?: Function;
/**
* Callback that will be invoked when the menu is being shown.
*/
onShow?: Function;
/**
* Determines the position of the menu. This property is transferred to the inner Menu component.
* @default auto
*/
position?: "auto" | "static" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight";
/**
* If true, the menu will keep a value to highlight the active child item.
* @default false
*/
selectable?: boolean;
/**
* Used for selectable menus. Indicates the current selected value so the child item with this value can be highlighted.
*/
selected?: any;
/**
* Classnames object defining the component style.
*/
theme?: IconMenuTheme;
}
export class IconMenu extends __React.Component<IconMenuProps, {}> { }
export interface MenuDividerTheme {
/**
*
*/
menuDivider?: string;
}
interface MenuDividerProps extends __ReactToolbox.Props {
/**
* Classnames object defining the component style.
*/
theme?: MenuDividerTheme;
}
export class MenuDivider extends __React.Component<MenuDividerProps, {}> { }
export interface MenuItemTheme {
/**
* Used for the caption inside the item.
*/
caption?: string;
/**
* Added to the root element if it's disabled.
*/
disabled?: string;
/**
* Used for the icon element if exists.
*/
icon?: string;
/**
* Used as the root class for the component.
*/
menuItem?: string;
/**
* Added to the root element in case it's selected.
*/
selected?: string;
/**
* Used for the shortcut element if exists.
*/
shortcut?: string;
}
interface MenuItemProps extends __ReactToolbox.Props {
/**
* The text to include in the menu item. Required.
*/
caption: string;
/**
* Children to pass through the component.
*/
children?: __React.ReactNode;
/**
* If true, the item will be displayed as disabled and is not selectable.
* @default false
*/
disabled?: boolean;
/**
* Icon font key string or Element to display in the right side of the option.
*/
icon?: __React.ReactNode | string;
/**
* Transferred from the Menu component for selectable menus. Indicates if it's the current active option.
* @default false
*/
selected?: boolean;
/**
* Displays shortcut text on the right side of the caption attribute.
*/
shortcut?: string;
/**
* Classnames object defining the component style.
*/
theme?: MenuItemTheme;
}
export class MenuItem extends __React.Component<MenuItemProps, {}> { }