|
@@ -16,10 +16,11 @@ import {
|
|
import BaseComponent from '../_base/baseComponent';
|
|
import BaseComponent from '../_base/baseComponent';
|
|
import TableContext, { TableContextProps } from './table-context';
|
|
import TableContext, { TableContextProps } from './table-context';
|
|
import { TableComponents, OnHeaderRow, Fixed } from './interface';
|
|
import { TableComponents, OnHeaderRow, Fixed } from './interface';
|
|
|
|
+import type { TableHeaderCell } from './TableHeader';
|
|
|
|
|
|
export interface TableHeaderRowProps {
|
|
export interface TableHeaderRowProps {
|
|
components?: TableComponents;
|
|
components?: TableComponents;
|
|
- row?: any[];
|
|
|
|
|
|
+ row?: TableHeaderCell[];
|
|
prefixCls?: string;
|
|
prefixCls?: string;
|
|
onHeaderRow?: OnHeaderRow<any>;
|
|
onHeaderRow?: OnHeaderRow<any>;
|
|
index?: number;
|
|
index?: number;
|
|
@@ -81,7 +82,7 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
this.context.setHeadWidths(
|
|
this.context.setHeadWidths(
|
|
map(heads, (head, headIndex) => {
|
|
map(heads, (head, headIndex) => {
|
|
let configWidth = get(row, [headIndex, 'column', 'width']);
|
|
let configWidth = get(row, [headIndex, 'column', 'width']);
|
|
- const key = get(row, [headIndex, 'column', 'key']);
|
|
|
|
|
|
+ const key = get(row, [headIndex, 'column', 'key']) as any;
|
|
if (typeof configWidth !== 'number') {
|
|
if (typeof configWidth !== 'number') {
|
|
configWidth = (head && head.getBoundingClientRect().width) || 0;
|
|
configWidth = (head && head.getBoundingClientRect().width) || 0;
|
|
}
|
|
}
|
|
@@ -175,6 +176,8 @@ export default class TableHeaderRow extends BaseComponent<TableHeaderRowProps, R
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Object.assign(cellProps, { resize: column.resize });
|
|
|
|
+
|
|
const props = omit({ ...cellProps, ...customProps }, [
|
|
const props = omit({ ...cellProps, ...customProps }, [
|
|
'colStart',
|
|
'colStart',
|
|
'colEnd',
|
|
'colEnd',
|