@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
66 lines • 2.71 kB
TypeScript
/** @packageDocumentation
* @module ContextMenu
*/
import * as React from "react";
import { ConditionalBooleanValue } from "@itwin/appui-abstract";
import type { CommonProps } from "../utils/Props.js";
import type { ContextMenu } from "./ContextMenu.js";
import type { BadgeType } from "../badge/BadgeType.js";
import type { IconSpec } from "../icons/IconComponent.js";
/** Properties for the [[ContextMenuItem]] component
* @public
* @deprecated in 4.16.0. Props of deprecated {@link ContextMenuItem} component.
*/
export interface ContextMenuItemProps extends Omit<React.AllHTMLAttributes<HTMLDivElement>, "disabled" | "hidden">, CommonProps {
onSelect?: (event: any) => any;
/** @internal */
onHotKeyParsed?: (hotKey: string) => void;
/** Icon to display in the left margin. */
icon?: IconSpec;
/** Disables any onSelect calls, hover/keyboard highlighting, and grays item. */
disabled?: boolean | ConditionalBooleanValue;
/** Indicates whether the item is visible or hidden. The default is for the item to be visible. */
hidden?: boolean | ConditionalBooleanValue;
/** Badge to be overlaid on the item.
* @deprecated in 4.16.0. Use `badgeKind` property instead.
*/
badgeType?: BadgeType;
/** Specifies the kind of badge, if any, to be overlaid on the item. */
badgeKind?: "technical-preview" | "new" | "deprecated" | (string & {});
/** Icon to display in the right margin. */
iconRight?: IconSpec;
/** Hide the icon container. This can be used to eliminate space used to display an icon at the left of the menu item. */
hideIconContainer?: boolean;
/** @internal */
onHover?: () => any;
isSelected?: boolean;
/** @internal */
parentMenu?: ContextMenu;
}
interface ContextMenuItemState {
hotKey?: string;
}
/** Menu item component for use within a [[ContextMenu]] component.
* @public
* @deprecated in 4.16.0. Use {@link https://itwinui.bentley.com/docs/dropdownmenu iTwinUI MenuItem} instead.
*/
export declare class ContextMenuItem extends React.PureComponent<ContextMenuItemProps, ContextMenuItemState> {
private _root;
private _lastChildren;
private _parsedChildren;
static defaultProps: Partial<ContextMenuItemProps>;
constructor(props: ContextMenuItemProps);
readonly state: Readonly<ContextMenuItemState>;
render(): React.ReactElement;
componentDidMount(): void;
/** @internal */
componentDidUpdate(prevProps: ContextMenuItemProps): void;
private _updateHotkey;
private _handleFocus;
private _handleMouseOver;
select: () => void;
private _handleClick;
private _handleKeyUp;
}
export {};
//# sourceMappingURL=ContextMenuItem.d.ts.map