@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
97 lines • 3.52 kB
TypeScript
/** @packageDocumentation
* @module RadialMenu
*/
import "./RadialMenu.scss";
import * as React from "react";
import type { IconSpec } from "../icons/IconComponent.js";
import type { CommonProps } from "../utils/Props.js";
import { AnnularSector } from "./Annulus.js";
/** Properties for [[RadialMenu]]
* @public
* @deprecated in 4.14.0. Props of deprecated component {@link RadialMenu}.
*/
export interface RadialMenuProps extends CommonProps {
/** Whether to show RadialMenu */
opened: boolean;
/** Radius of inner portion of RadialMenu */
innerRadius: number;
/** Radius of outer portion of RadialMenu */
outerRadius: number;
/** Optional parameter to specify left position in viewport. */
left?: number | string;
/** Optional parameter to specify top position in viewport. */
top?: number | string;
/** Whether to rotate labels according to location on the RadialMenu, or to keep labels upright.
* Default: false
*/
labelRotate?: boolean;
/** Which child RadialButton to highlight */
selected?: number;
/** triggered in case of onClick events anywhere other than radial menu */
onBlur?: (event: any) => any;
/** triggered onKeyUp for <Esc> key */
onEsc?: (event: any) => any;
/** Content */
children?: React.ReactNode;
}
interface RadialMenuState {
sectors: AnnularSector[];
}
/** A context menu arranged in a radial layout.
* @public
* @deprecated in 4.14.0. Use {@link ContextMenu} or {@link https://itwinui.bentley.com/docs/dropdownmenu iTwinUI dropdown menu} instead.
*/
export declare class RadialMenu extends React.Component<RadialMenuProps, RadialMenuState> {
private _root;
private _selectedButton;
static defaultProps: Partial<RadialMenuProps>;
readonly state: Readonly<RadialMenuState>;
constructor(props: RadialMenuProps);
render(): React.ReactElement;
componentDidMount(): void;
componentWillUnmount(): void;
/** @internal */
componentDidUpdate(prevProps: RadialMenuProps): void;
private _handleKeyUp;
private _handleClick;
/** Manually call onSelect of highlighted button. */
select: () => void;
private _generateAnnularSectors;
}
/** Properties for [[RadialButton]] component
* @public
* @deprecated in 4.14.0. Props of deprecated component {@link RadialButton}.
*/
export interface RadialButtonProps extends CommonProps {
/** Whether label is rotated to radial menu. Default: Inherit */
labelRotate?: boolean;
/** which icon to display in on the menu button */
icon?: IconSpec;
/** @internal */
annularSector?: AnnularSector;
/** listens to any onClick event, or any select event, which can be triggered by the select() method. */
onSelect?: (e: any) => any;
/** Whether item is highlighted */
selected?: boolean;
/** Content */
children?: React.ReactNode;
}
interface RadialButtonState {
hover: boolean;
}
/** Button for use within a [[RadialMenu]]
* @public
* @deprecated in 4.14.0. Component used in a deprecated component {@link RadialMenu}.
*/
export declare class RadialButton extends React.Component<RadialButtonProps, RadialButtonState> {
readonly state: Readonly<RadialButtonState>;
constructor(props: RadialButtonProps);
render(): React.ReactElement;
/** Manually call this.props.onSelect */
select: () => void;
private _handleClick;
private _handleMouseOver;
private _handleMouseOut;
}
export {};
//# sourceMappingURL=RadialMenu.d.ts.map