UNPKG

tdesign-vue

Version:
431 lines (430 loc) 18.6 kB
import { PropType, SetupContext } from '@vue/composition-api'; import { CreateElement } from 'vue'; import { ScopedSlotReturnValue } from 'vue/types/vnode'; import { RowAndColFixedPosition } from './interface'; import { SkipSpansValue } from './hooks/useRowspanAndColspan'; import { PaginationProps } from '../pagination'; import { VirtualScrollConfig } from '../hooks/useVirtualScrollNew'; import { BaseTableCellParams, TableRowData, RowspanColspan, TdPrimaryTableProps, TdBaseTableProps } from './type'; import { AttachNode } from '../common'; export interface RenderTdExtra { rowAndColFixedPosition: RowAndColFixedPosition; columnLength: number; dataLength: number; cellSpans: RowspanColspan; cellEmptyContent: TdBaseTableProps['cellEmptyContent']; } export interface RenderEllipsisCellParams { cellNode: any; } export declare type TrCommonProps = Pick<TdPrimaryTableProps, TrPropsKeys>; export declare const TABLE_PROPS: readonly ["rowKey", "rowClassName", "columns", "fixedRows", "footData", "rowAttributes", "rowspanAndColspan", "scroll", "cellEmptyContent", "pagination", "attach", "onCellClick", "onRowClick", "onRowDblclick", "onRowMouseover", "onRowMousedown", "onRowMouseenter", "onRowMouseleave", "onRowMouseup"]; export declare type TrPropsKeys = (typeof TABLE_PROPS)[number]; export interface TrProps extends TrCommonProps { row: TableRowData; rowIndex: number; ellipsisOverlayClassName?: string; classPrefix?: string; dataLength?: number; rowAndColFixedPosition?: RowAndColFixedPosition; skipSpansMap?: Map<string, SkipSpansValue>; tableElm?: HTMLDivElement; scrollType?: string; isVirtual?: boolean; rowHeight?: number; trs?: Map<number, object>; bufferSize?: number; tableContentElm?: HTMLDivElement; cellEmptyContent?: TdBaseTableProps['cellEmptyContent']; virtualConfig: VirtualScrollConfig; attach?: AttachNode; active?: boolean; isHover?: boolean; } export declare const ROW_LISTENERS: string[]; export declare function renderCell(params: BaseTableCellParams<TableRowData>, slots: SetupContext['slots'], extra?: { cellEmptyContent?: TdBaseTableProps['cellEmptyContent']; pagination?: PaginationProps; }): any; declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{ trRef: any; tableColFixedClasses: { left: string; right: string; lastLeft: string; firstRight: string; leftShadow: string; rightShadow: string; }; tableDraggableClasses: { rowDraggable: string; rowHandlerDraggable: string; colDraggable: string; handle: string; ghost: string; chosen: string; dragging: string; dragSortTh: string; }; tdEllipsisClass: string; tableBaseClass: { table: (string | { [x: string]: boolean; })[]; columnResizableTable: string; overflowVisible: string; body: string; content: string; topContent: string; bottomContent: string; paginationWrap: string; tdLastRow: string; tdFirstCol: string; thCellInner: string; tableRowEdit: string; cellEditable: string; cellEditWrap: string; bordered: string; striped: string; hover: string; loading: string; rowspanAndColspan: string; empty: string; emptyRow: string; headerFixed: string; columnFixed: string; widthOverflow: string; multipleHeader: string; footerAffixed: string; horizontalBarAffixed: string; affixedHeader: string; affixedHeaderElm: string; affixedFooterElm: string; affixedFooterWrap: string; scrollbarDivider: string; fullHeight: string; resizeLine: string; obviousScrollbar: string; affixedHeaderWrap: string; }; tdAlignClasses: { left: string; right: string; center: string; }; trStyles: import("@vue/composition-api").ComputedRef<{ style: import("../common").Styles; classes: import("../common").ClassName; }>; classes: import("@vue/composition-api").ComputedRef<import("../common").ClassName[]>; trAttributes: import("@vue/composition-api").ComputedRef<import("../common").HTMLElementAttributes>; tRowHeight: import("@vue/composition-api").ComputedRef<number>; hasLazyLoadHolder: import("@vue/composition-api").ComputedRef<boolean>; getTrListeners: (row: TableRowData, rowIndex: number) => { [eventName: string]: (e: MouseEvent) => void; }; }> & import("@vue/composition-api").Data, { renderEllipsisCell(h: CreateElement, cellParams: BaseTableCellParams<TableRowData>, params: RenderEllipsisCellParams): JSX.Element; renderTd(h: CreateElement, params: BaseTableCellParams<TableRowData>, extra: RenderTdExtra): JSX.Element; }, {}, { tableElm: {}; tableContentElm: {}; columns: { type: import("vue").PropType<import("./type").BaseTableCol<TableRowData>[]>; default: () => import("./type").BaseTableCol<TableRowData>[]; }; scroll: { type: import("vue").PropType<import("../common").TScroll>; }; attach: { type: import("vue").PropType<AttachNode>; }; pagination: { type: import("vue").PropType<import("../pagination").TdPaginationProps>; }; onCellClick: import("vue").PropType<(context: import("./type").BaseTableCellEventContext<TableRowData>) => void>; cellEmptyContent: { type: import("vue").PropType<string | ((h: CreateElement, props: BaseTableCellParams<TableRowData>) => ScopedSlotReturnValue)>; }; fixedRows: { type: import("vue").PropType<number[]>; }; footData: { type: import("vue").PropType<TableRowData[]>; default: () => TableRowData[]; }; rowAttributes: { type: import("vue").PropType<import("./type").TableRowAttributes<TableRowData>>; }; rowClassName: { type: import("vue").PropType<import("../common").ClassName | ((params: import("./type").RowClassNameParams<TableRowData>) => import("../common").ClassName)>; }; rowKey: { type: StringConstructor; default: string; required: boolean; }; rowspanAndColspan: { type: import("vue").PropType<import("./type").TableRowspanAndColspanFunc<TableRowData>>; }; onRowClick: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowDblclick: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMousedown: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseenter: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseleave: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseover: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseup: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; row: PropType<TableRowData>; rowIndex: NumberConstructor; ellipsisOverlayClassName: StringConstructor; classPrefix: StringConstructor; dataLength: NumberConstructor; rowAndColFixedPosition: PropType<RowAndColFixedPosition>; skipSpansMap: PropType<Map<string, SkipSpansValue>>; virtualConfig: PropType<{ visibleData: import("@vue/composition-api").Ref<any[]>; translateY: import("@vue/composition-api").Ref<number>; scrollHeight: import("@vue/composition-api").Ref<number>; isVirtualScroll: import("@vue/composition-api").ComputedRef<boolean>; handleScroll: () => void; handleRowMounted: (rowData: any) => void; scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void; }>; active: BooleanConstructor; isHover: BooleanConstructor; }, import("@vue/composition-api").ExtractPropTypes<{ tableElm: {}; tableContentElm: {}; columns: { type: import("vue").PropType<import("./type").BaseTableCol<TableRowData>[]>; default: () => import("./type").BaseTableCol<TableRowData>[]; }; scroll: { type: import("vue").PropType<import("../common").TScroll>; }; attach: { type: import("vue").PropType<AttachNode>; }; pagination: { type: import("vue").PropType<import("../pagination").TdPaginationProps>; }; onCellClick: import("vue").PropType<(context: import("./type").BaseTableCellEventContext<TableRowData>) => void>; cellEmptyContent: { type: import("vue").PropType<string | ((h: CreateElement, props: BaseTableCellParams<TableRowData>) => ScopedSlotReturnValue)>; }; fixedRows: { type: import("vue").PropType<number[]>; }; footData: { type: import("vue").PropType<TableRowData[]>; default: () => TableRowData[]; }; rowAttributes: { type: import("vue").PropType<import("./type").TableRowAttributes<TableRowData>>; }; rowClassName: { type: import("vue").PropType<import("../common").ClassName | ((params: import("./type").RowClassNameParams<TableRowData>) => import("../common").ClassName)>; }; rowKey: { type: StringConstructor; default: string; required: boolean; }; rowspanAndColspan: { type: import("vue").PropType<import("./type").TableRowspanAndColspanFunc<TableRowData>>; }; onRowClick: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowDblclick: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMousedown: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseenter: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseleave: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseover: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; onRowMouseup: import("vue").PropType<(context: import("./type").RowEventContext<TableRowData>) => void>; row: PropType<TableRowData>; rowIndex: NumberConstructor; ellipsisOverlayClassName: StringConstructor; classPrefix: StringConstructor; dataLength: NumberConstructor; rowAndColFixedPosition: PropType<RowAndColFixedPosition>; skipSpansMap: PropType<Map<string, SkipSpansValue>>; virtualConfig: PropType<{ visibleData: import("@vue/composition-api").Ref<any[]>; translateY: import("@vue/composition-api").Ref<number>; scrollHeight: import("@vue/composition-api").Ref<number>; isVirtualScroll: import("@vue/composition-api").ComputedRef<boolean>; handleScroll: () => void; handleRowMounted: (rowData: any) => void; scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void; }>; active: BooleanConstructor; isHover: BooleanConstructor; }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{ active: boolean; columns: import("./type").BaseTableCol<TableRowData>[]; isHover: boolean; footData: TableRowData[]; rowKey: string; } & { scroll?: import("../common").TScroll; classPrefix?: string; attach?: AttachNode; pagination?: unknown; rowIndex?: number; onCellClick?: (context: import("./type").BaseTableCellEventContext<TableRowData>) => void; row?: unknown; virtualConfig?: { visibleData: import("@vue/composition-api").Ref<any[]>; translateY: import("@vue/composition-api").Ref<number>; scrollHeight: import("@vue/composition-api").Ref<number>; isVirtualScroll: import("@vue/composition-api").ComputedRef<boolean>; handleScroll: () => void; handleRowMounted: (rowData: any) => void; scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void; }; cellEmptyContent?: string | ((h: CreateElement, props: BaseTableCellParams<TableRowData>) => ScopedSlotReturnValue); fixedRows?: number[]; rowAttributes?: import("./type").TableRowAttributes<TableRowData>; rowClassName?: unknown; rowspanAndColspan?: import("./type").TableRowspanAndColspanFunc<TableRowData>; onRowClick?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowDblclick?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMousedown?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseenter?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseleave?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseover?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseup?: (context: import("./type").RowEventContext<TableRowData>) => void; skipSpansMap?: Map<string, SkipSpansValue>; ellipsisOverlayClassName?: string; dataLength?: number; tableElm?: unknown; tableContentElm?: unknown; rowAndColFixedPosition?: RowAndColFixedPosition; }, import("@vue/composition-api").ShallowUnwrapRef<{ trRef: any; tableColFixedClasses: { left: string; right: string; lastLeft: string; firstRight: string; leftShadow: string; rightShadow: string; }; tableDraggableClasses: { rowDraggable: string; rowHandlerDraggable: string; colDraggable: string; handle: string; ghost: string; chosen: string; dragging: string; dragSortTh: string; }; tdEllipsisClass: string; tableBaseClass: { table: (string | { [x: string]: boolean; })[]; columnResizableTable: string; overflowVisible: string; body: string; content: string; topContent: string; bottomContent: string; paginationWrap: string; tdLastRow: string; tdFirstCol: string; thCellInner: string; tableRowEdit: string; cellEditable: string; cellEditWrap: string; bordered: string; striped: string; hover: string; loading: string; rowspanAndColspan: string; empty: string; emptyRow: string; headerFixed: string; columnFixed: string; widthOverflow: string; multipleHeader: string; footerAffixed: string; horizontalBarAffixed: string; affixedHeader: string; affixedHeaderElm: string; affixedFooterElm: string; affixedFooterWrap: string; scrollbarDivider: string; fullHeight: string; resizeLine: string; obviousScrollbar: string; affixedHeaderWrap: string; }; tdAlignClasses: { left: string; right: string; center: string; }; trStyles: import("@vue/composition-api").ComputedRef<{ style: import("../common").Styles; classes: import("../common").ClassName; }>; classes: import("@vue/composition-api").ComputedRef<import("../common").ClassName[]>; trAttributes: import("@vue/composition-api").ComputedRef<import("../common").HTMLElementAttributes>; tRowHeight: import("@vue/composition-api").ComputedRef<number>; hasLazyLoadHolder: import("@vue/composition-api").ComputedRef<boolean>; getTrListeners: (row: TableRowData, rowIndex: number) => { [eventName: string]: (e: MouseEvent) => void; }; }>, import("@vue/composition-api").Data, {}, { renderEllipsisCell(h: CreateElement, cellParams: BaseTableCellParams<TableRowData>, params: RenderEllipsisCellParams): JSX.Element; renderTd(h: CreateElement, params: BaseTableCellParams<TableRowData>, extra: RenderTdExtra): JSX.Element; }, {}, {}, {}, { active: boolean; columns: import("./type").BaseTableCol<TableRowData>[]; isHover: boolean; footData: TableRowData[]; rowKey: string; } & { scroll?: import("../common").TScroll; classPrefix?: string; attach?: AttachNode; pagination?: unknown; rowIndex?: number; onCellClick?: (context: import("./type").BaseTableCellEventContext<TableRowData>) => void; row?: unknown; virtualConfig?: { visibleData: import("@vue/composition-api").Ref<any[]>; translateY: import("@vue/composition-api").Ref<number>; scrollHeight: import("@vue/composition-api").Ref<number>; isVirtualScroll: import("@vue/composition-api").ComputedRef<boolean>; handleScroll: () => void; handleRowMounted: (rowData: any) => void; scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void; }; cellEmptyContent?: string | ((h: CreateElement, props: BaseTableCellParams<TableRowData>) => ScopedSlotReturnValue); fixedRows?: number[]; rowAttributes?: import("./type").TableRowAttributes<TableRowData>; rowClassName?: unknown; rowspanAndColspan?: import("./type").TableRowspanAndColspanFunc<TableRowData>; onRowClick?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowDblclick?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMousedown?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseenter?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseleave?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseover?: (context: import("./type").RowEventContext<TableRowData>) => void; onRowMouseup?: (context: import("./type").RowEventContext<TableRowData>) => void; skipSpansMap?: Map<string, SkipSpansValue>; ellipsisOverlayClassName?: string; dataLength?: number; tableElm?: unknown; tableContentElm?: unknown; rowAndColFixedPosition?: RowAndColFixedPosition; }, { active: boolean; columns: import("./type").BaseTableCol<TableRowData>[]; isHover: boolean; footData: TableRowData[]; rowKey: string; }, true>); export default _default;