From 72b77cb22a07b4350f625df8a0f85f4a2ba54968 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Thu, 12 Jul 2018 20:40:47 -0400 Subject: [PATCH] Add more EuiContextMenuItemProps typings (#1006) * Add disabled and onClick options to EuiContextMenuItemProps * extend common props * Add more props, add HTMLElement as acceptable for icon. --- CHANGELOG.md | 1 + src/components/context_menu/index.d.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de4c1dedcb..484d49da42e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/src/components/context_menu/index.d.ts b/src/components/context_menu/index.d.ts index c1d716701c2..d7ff21fa1d0 100644 --- a/src/components/context_menu/index.d.ts +++ b/src/components/context_menu/index.d.ts @@ -53,12 +53,22 @@ declare module '@elastic/eui' { * @see './context_menu_item.js` */ - export type EuiContextMenuItemIcon = ReactElement | string; + export type EuiContextMenuItemIcon = ReactElement | string | HTMLElement; - export interface EuiContextMenuItemProps { + export interface EuiContextMenuItemProps extends CommonProps { icon?: EuiContextMenuItemIcon; hasPanel?: boolean; + disabled?: boolean; + onClick?: () => void; buttonRef?: RefCallback; + hasPanel?: boolean; + toolTipContent?: ReactNode; + toolTipTitle?: ReactNode; + toolTipPosition?: string; + href?: string; + target?: string; + rel?: string; + children?: ReactNode; } export const EuiContextMenuItem: SFC<