@gooddata/react-components
Version:
GoodData.UI - A powerful JavaScript library for building analytical applications
50 lines (49 loc) • 1.83 kB
TypeScript
import * as React from "react";
import { AFM, Execution } from "@gooddata/typings";
import { IntlShape } from "react-intl";
import { IMenu, IMenuAggregationClickConfig } from "../../../interfaces/PivotTable";
export declare type AlignPositions = "left" | "right" | "center";
export declare const ALIGN_LEFT = "left";
export declare const ALIGN_RIGHT = "right";
export interface IHeaderCellProps {
displayText: string;
className?: string;
enableSorting?: boolean;
defaultSortDirection?: AFM.SortDirection;
menuPosition?: AlignPositions;
textAlign?: AlignPositions;
sortDirection?: AFM.SortDirection;
onSortClick?: (direction: AFM.SortDirection) => void;
onMenuAggregationClick?: (config: IMenuAggregationClickConfig) => void;
menu?: IMenu;
getExecutionResponse?: () => Execution.IExecutionResponse;
getColumnTotals?: () => AFM.ITotalItem[];
getAfmFilters: () => AFM.CompatibilityFilter[];
colId?: string;
intl?: IntlShape;
}
export interface IHeaderCellState {
isMenuOpen: boolean;
isMenuButtonVisible: boolean;
currentSortDirection: AFM.SortDirection;
}
export default class HeaderCell extends React.Component<IHeaderCellProps, IHeaderCellState> {
static defaultProps: Partial<IHeaderCellProps>;
state: IHeaderCellState;
componentDidMount(): void;
componentWillReceiveProps(nextProps: IHeaderCellProps): void;
render(): JSX.Element;
private renderMenu;
private renderText;
private renderSorting;
private onMouseEnterHeaderCell;
private onMouseLeaveHeaderCell;
private onMouseEnterHeaderCellText;
private onMouseLeaveHeaderCellText;
private onTextClick;
private showMenuButton;
private hideMenuButton;
private hideAndCloseMenu;
private menuItemClick;
private handleMenuOpenedChange;
}