import { default as VTable } from '@visactor/vtable'; import { ListTable } from '../ListTable'; import { BaseTableAPI } from '@visactor/vtable/es/ts-types/base-table'; import { CellAddress, TableEventHandlersEventArgumentMap } from '@visactor/vtable/es/ts-types'; import { RecordType, RightClickMenuKey } from '../const'; import { WholeRow } from './types'; import { IGraphicAttribute, IGroupAttribute, ITextAttribute } from '@visactor/vtable/es/vrender'; export declare class VTableFeatureUtils { static isValid(value: any): boolean; /** 获取选中表格的值 */ static getSelectedCellValue({ tableInstance, selectCells, filter, }: { tableInstance: ListTable; filter?: (cellInfo: VTable.TYPES.CellInfo) => boolean; selectCells?: VTable.TYPES.CellInfo[][]; }): any[][]; /** 将选中单元格的值设置为空 */ static deleteSelectRange({ selectCells, tableInstance, }: { tableInstance: ListTable; selectCells?: VTable.TYPES.CellInfo[][]; }): VTable.TYPES.CellInfo[][] | undefined; /** 判断单元格col,row是否在选中范围中 */ static cellIsSelectRange({ tableInstance, row, col, selectCells, }: { selectCells?: VTable.TYPES.CellInfo[][]; tableInstance: ListTable; col: number; row: number; }): boolean; /** 合并菜单配置项 */ static mergeMenu(...menusCollection: (VTable.TYPES.MenuListItem[] | undefined)[]): VTable.TYPES.MenuListItem[]; /** 删除默认菜单 */ static deleteDefaultMenu(keys?: RightClickMenuKey[]): VTable.TYPES.MenuListItem[]; /** 获取 padding */ static getPadding({ tableApi, row, col, defaultPadding, }: { tableApi: BaseTableAPI; row: number; col: number; defaultPadding?: number[]; }): any; static getAmendModifyMarkValue({ newValue, oldValue, hasModifyMark, }: { hasModifyMark?: boolean; newValue: any; oldValue: any; }): any; /** * @description 无感知更新数据,不会触发 HistoryEdit 捕获 * @document 示例如下: * ```ts * modified.map((record) => { * insensitiveChangeValue(record) * this.tableInstance.scenegraph.updateCellContent(record.col, record.row) * }) * this.tableInstance.scenegraph.renderSceneGraph(); * ``` */ static insensitiveChangeValue({ tableInstance, col, row, value, renderColl, }: { tableInstance: ListTable; col: number; row: number; value: any; renderColl?: boolean; }): void; /** * @description 自动更新单元格宽高 */ static autoUpdateCellWidthHeight({ tableInstance, col, row, }: { tableInstance: ListTable; col: number; row: number; }): void; /** 获取修改记录类型 */ static getModifyRecordType(param: TableEventHandlersEventArgumentMap['change_cell_value']): RecordType; static getCellModify(param: { tableInstance: ListTable; } & CellAddress): any; static isEmptyValue(value: any): any; static getRowRecordIdx(param: { tableInstance: ListTable; row: number; }): { hasHeader: boolean; recordIdx: any; }; static getColumnIdx(param: { tableInstance: ListTable; col: number; }): { hasNumberColumn: boolean; columnIdx: number; }; static getCellAddressByIndex(param: { tableInstance: ListTable; colIdx: number; rowIdx: number; }): { hasHeader: boolean; hasNumberColumn: boolean; col: number; row: number; }; /** 获取冻结的 column rowData 及其所占用的空间 */ static getFrozenLayout(param: { tableInstance: ListTable; }): { leftFixedColumn: any[]; rightFixedColumn: ColumnsDefine; topFixedRow: (Row | null)[]; bottomFixedRow: Row[]; top: any; left: any; right: any; bottom: any; }; /** 获取表格布局(cover: 覆盖边框 | inside:不覆盖边框) */ static getFixCellLayout({ type, tableInstance, col, row, rect, borderWidth, }: { tableInstance: ListTable; rect: { top: number; left: number; width: number; height: number; }; type: 'cover' | 'inside'; borderWidth?: number; } & CellAddress): { top: number; left: number; width: any; height: any; }; static getMergeType(record: Row): { isEmpty: boolean; isButton: boolean; isTitle: boolean; }; /** 是否是分组列表的合并行 */ static isGroupMergeCell(param: { tableInstance: ListTable; } & CellAddress, callback?: (param: { record?: Row; isGroupMergeCell: boolean; }) => void): boolean; static getSuspectedFnValue(suspected: T | ((p: P) => T), p: P): T; /** 通过单元格渲染时的 cellInfo 获取单元格样式 */ static getCellInfoStyles(cellInfo: VTable.TYPES.CustomRenderFunctionArg): any; static getCellTextStyles(cellInfo: VTable.TYPES.CustomRenderFunctionArg): Partial; static getCellGroupStyles(cellInfo: VTable.TYPES.CustomRenderFunctionArg): Partial; }