/// import { ReactNode, UIEventHandler, ReactElement, CSSProperties, MouseEventHandler, WheelEventHandler, HTMLAttributes, RefObject } from 'react'; import { ResizeObserver } from '@juggle/resize-observer'; import { EventListenerHandler } from '@befe/brick-utils'; import { ConfiguredComponent } from '@befe/brick-core'; import { ButtonProps } from '@befe/brick-comp-button'; import { CheckboxProps } from '@befe/brick-comp-checkbox'; import { SwitchProps } from '@befe/brick-comp-switch'; import { MenuItemProps } from '@befe/brick-comp-menu'; import { PopoverConfirmProps, PopoverProps } from '@befe/brick-comp-popover'; import { StickyController } from './utils/sticky'; /** * @public */ export interface TdProps { className?: string; colSpan?: number; rowSpan?: number; } type OperationPropsBase = ButtonProps & MenuItemProps; /** * @public */ export interface OperationProps extends OperationPropsBase { key?: string; label?: string; dropList?: Array; popoverConfirmProps?: PopoverConfirmProps; popoverProps?: PopoverProps; } export declare const TABLE_SIZES: readonly ["sm", "md"]; type TableSize = (typeof TABLE_SIZES)[number]; export declare const TABLE_LINE_SPACINGS: readonly ["compact", "regular"]; type TableLineSpacing = (typeof TABLE_LINE_SPACINGS)[number]; export declare const TABLE_NO_DATA_TYPES: readonly ["empty", "search", "error", "success"]; export type TableNoDataType = (typeof TABLE_NO_DATA_TYPES)[number]; /** * TableRow extends `Record` * @public */ export interface TableRow extends Record { /** * 树状数据.行层级 * @private */ _level?: number; /** * 树状数据.子行 */ children?: TableRow[]; } type CallbackGivesRow = { bivarianceHack(row: TRow, rowIdx: number): Val; }['bivarianceHack']; declare const SORT_ORDER_ASCENT = "ascent"; declare const SORT_ORDER_DESCENT = "descent"; declare const SORT_ORDER_ORIGINAL = "original"; type SortOrder = typeof SORT_ORDER_ORIGINAL | typeof SORT_ORDER_ASCENT | typeof SORT_ORDER_DESCENT; /** * @public */ export interface TableCol { /** * 列的主键 * 可以对应到数据行的字段名 */ key: string | string[]; /** * 列头的内容 */ thContent?: ReactNode; /** * 列头的内容的 title tip * 默认 title tip 与列头的内容一致 */ thTitle?: string; /** * 列的行内容 * * 如不指定,则默认为 `row => row[key]` */ tdContent?: CallbackGivesRow; /** * 列的行内容的 title tip * * 默认 title tip 与行内容一致 */ tdTitle?: CallbackGivesRow; /** * 此列的 td 的 props */ tdProps?: CallbackGivesRow; /** * 固定列于左/右 */ fixed?: 'left' | 'right'; /** * 作为 “序号列” 的,单元改个 */ serial?: CallbackGivesRow; /** * 作为"选择列"的 checkbox props * * **注意** 如果返回的 ReactElement 不是 ``,比如 ``, * 需要自行控制其中 `` 的 size 等以符合其在 Table 中的样式要求 */ checkbox?: CallbackGivesRow; /** * 作为"开关列"的 switch props * * **注意** 如果返回的 ReactElement 不是 ``,比如 ``, * 需要自行控制其中 `` 的 size 等以符合其在 Table 中的样式要求 */ switch?: CallbackGivesRow; /** * 作为"操作列"的 button 列表 * * **注意** 如果返回的 ReactElement 不是 `