import React from 'react'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; import type { OverflowShadowProps } from '@atlaskit/editor-common/ui'; import type { Diff } from '@atlaskit/editor-common/utils'; import { SortOrder } from '@atlaskit/editor-common/types'; import type { RendererAppearance, StickyHeaderConfig } from '../../ui/Renderer/types'; import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage'; import type { StickyMode } from './table/sticky'; import { OverflowParent } from './table/sticky'; import type { SharedTableProps } from './table/types'; import { TableStickyScrollbar } from './TableStickyScrollbar'; export type TableArrayMapped = { rowNodes: Array; rowReact: React.ReactElement; }; export declare const isTableResizingEnabled: (appearance: RendererAppearance) => boolean; export declare const isStickyScrollbarEnabled: (appearance: RendererAppearance) => boolean; export declare const orderChildren: (children: React.ReactElement[], tableNode: PMNode, smartCardStorage: WithSmartCardStorageProps["smartCardStorage"], tableOrderStatus?: TableOrderStatus) => React.ReactElement[]; export declare const hasRowspan: (row: PMNode) => boolean; export declare const getRefTop: (refElement: HTMLElement) => number; export declare const shouldHeaderStick: (scrollTop: number, tableTop: number, tableBottom: number, rowHeight: number) => boolean; export declare const shouldHeaderPinBottom: (scrollTop: number, tableBottom: number, rowHeight: number) => boolean; export declare const addSortableColumn: (rows: React.ReactElement[], tableOrderStatus: TableOrderStatus | undefined, onSorting: (columnIndex: number, sortOrder: SortOrder) => void) => React.ReactElement>[]; export type TableProps = SharedTableProps & { allowColumnSorting?: boolean; allowTableAlignment?: boolean; allowTableResizing?: boolean; children: React.ReactElement | Array>; disableTableOverflowShadow?: boolean; isPresentational?: boolean; rendererAppearance?: RendererAppearance; stickyHeaders?: StickyHeaderConfig; tableNode?: PMNode; }; export declare const isHeaderRowEnabled: (rows: (React.ReactChild | React.ReactFragment | React.ReactPortal)[]) => any; export declare const tableCanBeSticky: (node: PMNode | undefined, children: (React.ReactChild | React.ReactFragment | React.ReactPortal)[]) => any; export interface TableOrderStatus { columnIndex: number; order: SortOrder; } export interface TableState { headerRowHeight: number; stickyMode: StickyMode; wrapperWidth: number; } /** * */ export declare class TableContainer extends React.Component { state: TableState; tableRef: React.RefObject; stickyHeaderRef: React.RefObject; stickyScrollbarRef: React.RefObject; stickyWrapperRef: React.RefObject; wrapperRef: React.RefObject; stickyScrollbar?: TableStickyScrollbar; nextFrame: number | undefined; overflowParent: OverflowParent | null; private resizeObserver; private applyResizerChange; /** * * @example */ componentDidMount(): void; /** * * @param prevProps * @param prevState * @example */ componentDidUpdate(prevProps: TableProps, prevState: TableState): void; componentWillUnmount: () => void; getScrollTop: () => number; updateSticky: () => void; onScroll: () => void; onWrapperScrolled: () => void; /** * */ get pinTop(): number | undefined; /** * */ get shouldAddOverflowParentOffsetTop_DO_NOT_USE(): boolean | null | undefined; /** * */ get stickyTop(): number | undefined; /** * * @example */ render(): React.JSX.Element; private grabFirstRowRef; } type TableProcessorState = { tableOrderStatus?: TableOrderStatus; }; /** * */ export declare class TableProcessor extends React.Component { state: { tableOrderStatus: undefined; }; /** * * @example */ render(): React.JSX.Element | null; private addSortableColumn; private changeSortOrder; private addNumberColumnIndexes; } declare const _default_1: { new (props: Diff): { componentDidCatch?: (error: Error, errorInfo: React.ErrorInfo) => void; componentDidMount?: () => void; componentDidUpdate?: (prevProps: Readonly>, prevState: Readonly<{}>, snapshot?: any) => void; componentWillMount?: () => void; componentWillReceiveProps?: (nextProps: Readonly>, nextContext: any) => void; componentWillUnmount?: () => void; componentWillUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => void; context: unknown; forceUpdate: (callback?: (() => void) | undefined) => void; getSnapshotBeforeUpdate?: (prevProps: Readonly>, prevState: Readonly<{}>) => any; readonly props: Readonly>; refs: { [key: string]: React.ReactInstance; }; render: () => React.JSX.Element; setState: (state: {} | ((prevState: Readonly<{}>, props: Readonly>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined) => void; shouldComponentUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => boolean; state: Readonly<{}>; UNSAFE_componentWillMount?: () => void; UNSAFE_componentWillReceiveProps?: (nextProps: Readonly>, nextContext: any) => void; UNSAFE_componentWillUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => void; }; new (props: Diff, context: any): { componentDidCatch?: (error: Error, errorInfo: React.ErrorInfo) => void; componentDidMount?: () => void; componentDidUpdate?: (prevProps: Readonly>, prevState: Readonly<{}>, snapshot?: any) => void; componentWillMount?: () => void; componentWillReceiveProps?: (nextProps: Readonly>, nextContext: any) => void; componentWillUnmount?: () => void; componentWillUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => void; context: unknown; forceUpdate: (callback?: (() => void) | undefined) => void; getSnapshotBeforeUpdate?: (prevProps: Readonly>, prevState: Readonly<{}>) => any; readonly props: Readonly>; refs: { [key: string]: React.ReactInstance; }; render: () => React.JSX.Element; setState: (state: {} | ((prevState: Readonly<{}>, props: Readonly>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined) => void; shouldComponentUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => boolean; state: Readonly<{}>; UNSAFE_componentWillMount?: () => void; UNSAFE_componentWillReceiveProps?: (nextProps: Readonly>, nextContext: any) => void; UNSAFE_componentWillUpdate?: (nextProps: Readonly>, nextState: Readonly<{}>, nextContext: any) => void; }; contextType?: React.Context | undefined; }; export default _default_1;