Skip to content

Commit

Permalink
Add more EuiContextMenuItemProps typings (#1006)
Browse files Browse the repository at this point in the history
* Add disabled and onClick options to EuiContextMenuItemProps

* extend common props

* Add more props, add HTMLElement as acceptable for icon.
  • Loading branch information
stacey-gammon authored Jul 13, 2018
1 parent d07d71d commit 72b77cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Add more typings to `EuiContextMenuItemProps` ([#1006](https://github.com/elastic/eui/pull/1006))
- Make some proprties of `EuiFlyout` optional ([#1003](https://github.com/elastic/eui/pull/1003))
- Add typings for `EuiFlyout`, `EuiFlyoutBody`, `EuiFlyoutHeader`, and `EuiFlyoutFooter` ([#1001](https://github.com/elastic/eui/pull/1001))
- Gave `EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000))
Expand Down
14 changes: 12 additions & 2 deletions src/components/context_menu/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,22 @@ declare module '@elastic/eui' {
* @see './context_menu_item.js`
*/

export type EuiContextMenuItemIcon = ReactElement<any> | string;
export type EuiContextMenuItemIcon = ReactElement<any> | string | HTMLElement;

export interface EuiContextMenuItemProps {
export interface EuiContextMenuItemProps extends CommonProps {
icon?: EuiContextMenuItemIcon;
hasPanel?: boolean;
disabled?: boolean;
onClick?: () => void;
buttonRef?: RefCallback<HTMLButtonElement>;
hasPanel?: boolean;
toolTipContent?: ReactNode;
toolTipTitle?: ReactNode;
toolTipPosition?: string;
href?: string;
target?: string;
rel?: string;
children?: ReactNode;
}

export const EuiContextMenuItem: SFC<
Expand Down

0 comments on commit 72b77cb

Please sign in to comment.