/** @packageDocumentation * @module Tree */ import "./Node.scss"; import * as React from "react"; import { CheckboxProps } from "../checkbox/Checkbox"; import { CheckBoxState } from "../enums/CheckBoxState"; import { CommonProps } from "../utils/Props"; import { Omit } from "../utils/typeUtils"; /** Props for node Checkbox renderer * @beta */ export declare type NodeCheckboxRenderProps = Omit & { onChange: (checked: boolean) => void; onClick: (e: React.MouseEvent) => void; }; /** Type for node Checkbox renderer * @beta */ export declare type NodeCheckboxRenderer = (props: NodeCheckboxRenderProps) => React.ReactNode; /** Number of pixels the node gets offset per each hierarchy level */ export declare const LEVEL_OFFSET = 20; /** Properties for Tree Node CheckBox * @beta */ export interface NodeCheckboxProps { /** State of the checkbox */ state?: CheckBoxState; /** Click event callback */ onClick?: (newState: CheckBoxState) => void; /** Indicates whether checkbox is disabled */ isDisabled?: boolean; /** Tooltip to be displayed when mouse is hovered over checkbox */ tooltip?: string; } /** Properties for the [[TreeNode]] React component * @public */ export interface TreeNodeProps extends CommonProps { label: React.ReactNode; level: number; icon?: React.ReactChild; /** Properties for the checkbox. @beta */ checkboxProps?: NodeCheckboxProps; isLeaf?: boolean; isLoading?: boolean; isExpanded?: boolean; isFocused?: boolean; isSelected?: boolean; isHoverDisabled?: boolean; onClick?: (e: React.MouseEvent) => void; onContextMenu?: (e: React.MouseEvent) => void; onMouseMove?: (e: React.MouseEvent) => void; onMouseDown?: (e: React.MouseEvent) => void; onMouseUp?: (e: React.MouseEvent) => void; onClickExpansionToggle?: () => void; children?: React.ReactNode; /** Contains render overrides for different pieces of the node component. */ renderOverrides?: { /** Callback to render a checkbox. Only called when checkbox is displayed. @beta */ renderCheckbox?: NodeCheckboxRenderer; }; ["data-testid"]?: string; } /** Presentation React component for a Tree node * @public */ export declare class TreeNode extends React.Component { constructor(props: TreeNodeProps); render(): JSX.Element; private createSubComponentTestId; private _onCheckboxChange; private _onCheckboxClick; private _onClickExpansionToggle; private _onClick; } //# sourceMappingURL=Node.d.ts.map