xdesign-vue-next
Version:
XDesign Component for vue-next
177 lines (176 loc) • 7.93 kB
TypeScript
import { PropType, SetupContext, h } from 'vue';
import { BaseTableCellParams, TableRowData, RowspanColspan, TdPrimaryTableProps, TdBaseTableProps } from './type';
import { RowAndColFixedPosition } from './interface';
import { SkipSpansValue } from './hooks/useRowspanAndColspan';
import { PaginationProps } from '..';
import { VirtualScrollConfig } from '../hooks/useVirtualScrollNew';
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 {
rowKey: string;
row: TableRowData;
rowIndex: number;
ellipsisOverlayClassName: string;
classPrefix: string;
dataLength: number;
rowAndColFixedPosition?: RowAndColFixedPosition;
skipSpansMap?: Map<string, SkipSpansValue>;
tableElm?: any;
tableContentElm?: any;
cellEmptyContent: TdBaseTableProps['cellEmptyContent'];
virtualConfig: VirtualScrollConfig;
attach?: AttachNode;
}
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").DefineComponent<{
tableElm: {};
tableContentElm: {};
columns: {
type: PropType<import("./type").BaseTableCol<TableRowData>[]>;
default: () => import("./type").BaseTableCol<TableRowData>[];
};
scroll: {
type: PropType<import("..").TScroll>;
};
pagination: {
type: PropType<import("..").TdPaginationProps>;
};
attach: {
type: PropType<AttachNode>;
};
onCellClick: PropType<(context: import("./type").BaseTableCellEventContext<TableRowData>) => void>;
cellEmptyContent: {
type: PropType<string | ((h: typeof h, props: BaseTableCellParams<TableRowData>) => import("..").SlotReturnValue)>;
};
fixedRows: {
type: PropType<number[]>;
};
footData: {
type: PropType<TableRowData[]>;
default: () => TableRowData[];
};
rowAttributes: {
type: PropType<import("./type").TableRowAttributes<TableRowData>>;
};
rowClassName: {
type: PropType<import("..").ClassName | ((params: import("./type").RowClassNameParams<TableRowData>) => import("..").ClassName)>;
};
rowKey: {
type: StringConstructor;
default: string;
required: boolean;
};
rowspanAndColspan: {
type: PropType<import("./type").TableRowspanAndColspanFunc<TableRowData>>;
};
onRowClick: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowDblclick: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMousedown: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseenter: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseleave: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseover: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseup: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
row: PropType<TableRowData>;
rowIndex: NumberConstructor;
dataLength: NumberConstructor;
ellipsisOverlayClassName: StringConstructor;
classPrefix: StringConstructor;
rowAndColFixedPosition: PropType<RowAndColFixedPosition>;
skipSpansMap: PropType<Map<string, SkipSpansValue>>;
virtualConfig: PropType<{
visibleData: import("vue").Ref<any[]>;
translateY: import("vue").Ref<number>;
scrollHeight: import("vue").Ref<number>;
isVirtualScroll: import("vue").ComputedRef<boolean>;
handleScroll: () => void;
handleRowMounted: (rowData: any) => void;
scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void;
}>;
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "row-mounted"[], "row-mounted", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
tableElm: {};
tableContentElm: {};
columns: {
type: PropType<import("./type").BaseTableCol<TableRowData>[]>;
default: () => import("./type").BaseTableCol<TableRowData>[];
};
scroll: {
type: PropType<import("..").TScroll>;
};
pagination: {
type: PropType<import("..").TdPaginationProps>;
};
attach: {
type: PropType<AttachNode>;
};
onCellClick: PropType<(context: import("./type").BaseTableCellEventContext<TableRowData>) => void>;
cellEmptyContent: {
type: PropType<string | ((h: typeof h, props: BaseTableCellParams<TableRowData>) => import("..").SlotReturnValue)>;
};
fixedRows: {
type: PropType<number[]>;
};
footData: {
type: PropType<TableRowData[]>;
default: () => TableRowData[];
};
rowAttributes: {
type: PropType<import("./type").TableRowAttributes<TableRowData>>;
};
rowClassName: {
type: PropType<import("..").ClassName | ((params: import("./type").RowClassNameParams<TableRowData>) => import("..").ClassName)>;
};
rowKey: {
type: StringConstructor;
default: string;
required: boolean;
};
rowspanAndColspan: {
type: PropType<import("./type").TableRowspanAndColspanFunc<TableRowData>>;
};
onRowClick: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowDblclick: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMousedown: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseenter: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseleave: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseover: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
onRowMouseup: PropType<(context: import("./type").RowEventContext<TableRowData>) => void>;
row: PropType<TableRowData>;
rowIndex: NumberConstructor;
dataLength: NumberConstructor;
ellipsisOverlayClassName: StringConstructor;
classPrefix: StringConstructor;
rowAndColFixedPosition: PropType<RowAndColFixedPosition>;
skipSpansMap: PropType<Map<string, SkipSpansValue>>;
virtualConfig: PropType<{
visibleData: import("vue").Ref<any[]>;
translateY: import("vue").Ref<number>;
scrollHeight: import("vue").Ref<number>;
isVirtualScroll: import("vue").ComputedRef<boolean>;
handleScroll: () => void;
handleRowMounted: (rowData: any) => void;
scrollToElement: (p: import("../hooks/useVirtualScrollNew").ScrollToElementParams) => void;
}>;
}>> & {
"onRow-mounted"?: (...args: any[]) => any;
}, {
columns: import("./type").BaseTableCol<TableRowData>[];
footData: TableRowData[];
rowKey: string;
}, {}>;
export default _default;