|
1 | 1 | import { ITreeItem } from './ITreeItem'; |
2 | 2 | import { IIconProps } from 'office-ui-fabric-react/lib/Icon'; |
| 3 | +import { ITheme } from 'office-ui-fabric-react/lib/Styling'; |
3 | 4 |
|
4 | 5 | /** |
5 | 6 | * Specifies the display mode of the tree item action. |
6 | 7 | */ |
7 | 8 | export enum TreeItemActionsDisplayMode { |
8 | | - Buttons = 1, |
9 | | - ContextualMenu |
| 9 | + Buttons = 1, |
| 10 | + ContextualMenu |
10 | 11 | } |
11 | 12 |
|
12 | 13 | /** |
13 | 14 | * Tree item actions. |
14 | 15 | */ |
15 | 16 | export interface ITreeItemActions { |
16 | | - /** |
17 | | - * List of actions. |
18 | | - */ |
19 | | - actions: ITreeItemAction[]; |
20 | | - /** |
21 | | - * Display mode of the tree item actions. |
22 | | - */ |
23 | | - treeItemActionsDisplayMode?: TreeItemActionsDisplayMode; |
| 17 | + /** |
| 18 | + * List of actions. |
| 19 | + */ |
| 20 | + actions: ITreeItemAction[]; |
| 21 | + /** |
| 22 | + * Display mode of the tree item actions. |
| 23 | + */ |
| 24 | + treeItemActionsDisplayMode?: TreeItemActionsDisplayMode; |
24 | 25 | } |
25 | 26 |
|
26 | 27 | /** |
27 | 28 | * TreeItemActionsControl properties interface |
28 | 29 | */ |
29 | 30 | export interface ITreeItemActionsControlProps { |
30 | | - /** |
31 | | - * Current tree item. |
32 | | - */ |
33 | | - treeItem: ITreeItem; |
34 | | - /** |
35 | | - * List of actions. |
36 | | - */ |
37 | | - treeItemActions: ITreeItemActions; |
38 | | - /** |
39 | | - * Callback after execution of tree item action. |
40 | | - */ |
41 | | - treeItemActionCallback: () => void; |
| 31 | + /** |
| 32 | + * Current tree item. |
| 33 | + */ |
| 34 | + treeItem: ITreeItem; |
| 35 | + /** |
| 36 | + * List of actions. |
| 37 | + */ |
| 38 | + treeItemActions: ITreeItemActions; |
| 39 | + /** |
| 40 | + * Callback after execution of tree item action. |
| 41 | + */ |
| 42 | + treeItemActionCallback: () => void; |
| 43 | + /** |
| 44 | + * Set Fluent UI Theme. |
| 45 | + * */ |
| 46 | + theme: ITheme; |
42 | 47 | } |
43 | 48 |
|
44 | 49 | /** |
45 | 50 | * TreeItemActionsControl state interface |
46 | 51 | */ |
47 | 52 | export interface ITreeItemActionsControlState { |
48 | | - /** |
49 | | - * Specifies the list of the available actions for the tree item. |
50 | | - */ |
51 | | - availableActions: ITreeItemAction[]; |
52 | | - /** |
53 | | - * TreeItemAction display mode. |
54 | | - */ |
55 | | - displayMode: TreeItemActionsDisplayMode; |
| 53 | + /** |
| 54 | + * Specifies the list of the available actions for the tree item. |
| 55 | + */ |
| 56 | + availableActions: ITreeItemAction[]; |
| 57 | + /** |
| 58 | + * TreeItemAction display mode. |
| 59 | + */ |
| 60 | + displayMode: TreeItemActionsDisplayMode; |
56 | 61 | } |
57 | 62 |
|
58 | 63 | /** |
59 | 64 | * ConcreteTreeItemAction properties interface |
60 | 65 | */ |
61 | 66 | export interface IConcreteTreeItemActionProps { |
62 | | - /** |
63 | | - * Specifies the list of the available actions for the tree item. |
64 | | - */ |
65 | | - treeItemActions: ITreeItemAction[]; |
66 | | - /** |
67 | | - * Current tree item |
68 | | - */ |
69 | | - treeItem: ITreeItem; |
| 67 | + /** |
| 68 | + * Specifies the list of the available actions for the tree item. |
| 69 | + */ |
| 70 | + treeItemActions: ITreeItemAction[]; |
| 71 | + /** |
| 72 | + * Current tree item |
| 73 | + */ |
| 74 | + treeItem: ITreeItem; |
70 | 75 |
|
71 | | - /** |
72 | | - * Method to be executed when action is fired. |
73 | | - */ |
74 | | - treeItemActionCallback: () => void; |
| 76 | + /** |
| 77 | + * Method to be executed when action is fired. |
| 78 | + */ |
| 79 | + treeItemActionCallback: () => void; |
| 80 | + /** |
| 81 | + * Set Fluent UI Theme.v |
| 82 | + * */ |
| 83 | + theme: ITheme; |
75 | 84 | } |
76 | 85 |
|
77 | 86 | /** |
78 | 87 | * Interface represents the possible action that could be execute on tree item level. |
79 | 88 | */ |
80 | 89 | export interface ITreeItemAction { |
81 | | - /** |
82 | | - * Action ID |
83 | | - */ |
84 | | - id: string; |
85 | | - /** |
86 | | - * Action title |
87 | | - */ |
88 | | - title?: string; |
89 | | - /** |
90 | | - * Icon to be displayed for the action. |
91 | | - */ |
92 | | - iconProps?: IIconProps; |
93 | | - /** |
94 | | - * Specify if the action is hidden. This could be used for instance when you want to invoke the action right after rendering. |
95 | | - */ |
96 | | - hidden?: boolean; |
97 | | - /** |
98 | | - * Specifies if you want to invoke the action on render |
99 | | - */ |
100 | | - invokeActionOnRender?: boolean; |
| 90 | + /** |
| 91 | + * Action ID |
| 92 | + */ |
| 93 | + id: string; |
| 94 | + /** |
| 95 | + * Action title |
| 96 | + */ |
| 97 | + title?: string; |
| 98 | + /** |
| 99 | + * Icon to be displayed for the action. |
| 100 | + */ |
| 101 | + iconProps?: IIconProps; |
| 102 | + /** |
| 103 | + * Specify if the action is hidden. This could be used for instance when you want to invoke the action right after rendering. |
| 104 | + */ |
| 105 | + hidden?: boolean; |
| 106 | + /** |
| 107 | + * Specifies if you want to invoke the action on render |
| 108 | + */ |
| 109 | + invokeActionOnRender?: boolean; |
101 | 110 |
|
102 | | - /** |
103 | | - * Method to be executed when action is fired. |
104 | | - * @param currentTreeItem |
105 | | - */ |
106 | | - actionCallback: (currentTreeItem: ITreeItem) => void; |
| 111 | + /** |
| 112 | + * Method to be executed when action is fired. |
| 113 | + * @param currentTreeItem |
| 114 | + */ |
| 115 | + actionCallback: (currentTreeItem: ITreeItem) => void; |
107 | 116 | } |
0 commit comments