es-grid-template 1.7.48 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid-component/TempTable.js +1 -3
- package/es/table-component/ColumnsChoose.js +9 -2
- package/es/table-component/InternalTable.js +1 -0
- package/es/table-component/TableContainer.d.ts +5 -1
- package/es/table-component/TableContainer.js +33 -3
- package/es/table-component/TableContainerEdit.js +87 -62
- package/es/table-component/body/TableBody.js +1 -1
- package/es/table-component/body/TableBodyCell.d.ts +7 -3
- package/es/table-component/body/TableBodyCell.js +268 -135
- package/es/table-component/body/TableBodyCellEdit.d.ts +2 -2
- package/es/table-component/body/TableBodyCellEdit.js +18 -13
- package/es/table-component/body/TableBodyRow.d.ts +2 -2
- package/es/table-component/body/TableBodyRow.js +45 -16
- package/es/table-component/components/command/Command.js +2 -0
- package/es/table-component/footer/TableFooter.js +1 -1
- package/es/table-component/footer/TableFooterCell.js +3 -2
- package/es/table-component/footer/TableFooterRow.js +4 -3
- package/es/table-component/header/TableHead.d.ts +1 -1
- package/es/table-component/header/TableHead.js +83 -20
- package/es/table-component/header/TableHeadCell.js +13 -8
- package/es/table-component/header/TableHeadCell2.d.ts +17 -0
- package/es/table-component/header/TableHeadCell2.js +331 -0
- package/es/table-component/header/TableHeadGroupCell.d.ts +17 -0
- package/es/table-component/header/TableHeadGroupCell.js +327 -0
- package/es/table-component/header/TableHeadRow.js +1 -1
- package/es/table-component/hook/utils.js +5 -2
- package/es/table-component/style.scss +26 -4
- package/es/table-component/table/Grid.js +19 -19
- package/es/table-component/table/TableWrapper.js +1 -1
- package/lib/grid-component/TempTable.js +1 -3
- package/lib/table-component/ColumnsChoose.js +9 -2
- package/lib/table-component/InternalTable.js +1 -0
- package/lib/table-component/TableContainer.d.ts +5 -1
- package/lib/table-component/TableContainer.js +32 -2
- package/lib/table-component/TableContainerEdit.js +87 -62
- package/lib/table-component/body/TableBody.js +1 -1
- package/lib/table-component/body/TableBodyCell.d.ts +7 -3
- package/lib/table-component/body/TableBodyCell.js +267 -136
- package/lib/table-component/body/TableBodyCellEdit.d.ts +2 -2
- package/lib/table-component/body/TableBodyCellEdit.js +18 -13
- package/lib/table-component/body/TableBodyRow.d.ts +2 -2
- package/lib/table-component/body/TableBodyRow.js +45 -16
- package/lib/table-component/components/command/Command.js +2 -0
- package/lib/table-component/footer/TableFooter.js +1 -1
- package/lib/table-component/footer/TableFooterCell.js +3 -2
- package/lib/table-component/footer/TableFooterRow.js +4 -3
- package/lib/table-component/header/TableHead.d.ts +1 -1
- package/lib/table-component/header/TableHead.js +84 -20
- package/lib/table-component/header/TableHeadCell.js +13 -8
- package/lib/table-component/header/TableHeadCell2.d.ts +17 -0
- package/lib/table-component/header/TableHeadCell2.js +340 -0
- package/lib/table-component/header/TableHeadGroupCell.d.ts +17 -0
- package/lib/table-component/header/TableHeadGroupCell.js +336 -0
- package/lib/table-component/header/TableHeadRow.js +1 -1
- package/lib/table-component/hook/utils.js +5 -2
- package/lib/table-component/style.scss +26 -4
- package/lib/table-component/table/Grid.js +19 -19
- package/lib/table-component/table/TableWrapper.js +1 -1
- package/package.json +1 -1
|
@@ -31,29 +31,45 @@ const TableBodyRow = ({
|
|
|
31
31
|
}) => {
|
|
32
32
|
const {
|
|
33
33
|
prefix,
|
|
34
|
-
recordDoubleClick
|
|
34
|
+
recordDoubleClick,
|
|
35
|
+
focusedCell
|
|
35
36
|
} = _react.default.useContext(_useContext.TableContext);
|
|
36
37
|
const visibleCells = row.getVisibleCells();
|
|
37
38
|
const virtualColumns = columnVirtualizer.getVirtualItems();
|
|
38
|
-
|
|
39
|
+
const centerCOlumns = virtualColumns.filter(vc => !(table.getState().columnPinning.left?.includes(visibleCells[vc.index].column.id) || table.getState().columnPinning.right?.includes(visibleCells[vc.index].column.id)));
|
|
40
|
+
const leftTemplate = fixedLeftColumns.length > 0 ? fixedLeftColumns.map(it => row.getVisibleCells().find(c => c.column.id === it.id).column.getSize()) : [];
|
|
41
|
+
const rightTemplate = fixedRightColumns.length > 0 ? fixedRightColumns.map(it => row.getVisibleCells().find(c => c.column.id === it.id).column.getSize()) : [];
|
|
42
|
+
const centerTemplate = centerCOlumns.map(it => it.size);
|
|
43
|
+
const virtualLeft = virtualPaddingLeft ? [virtualPaddingLeft] : [];
|
|
44
|
+
const virtualRight = virtualPaddingRight ? [virtualPaddingRight] : [];
|
|
45
|
+
const templateColumns = [...leftTemplate, ...virtualLeft, ...centerTemplate, ...virtualRight, ...rightTemplate];
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
39
47
|
"data-index": virtualRow.index //needed for dynamic row height measurement
|
|
40
48
|
,
|
|
41
49
|
ref: node => rowVirtualizer.measureElement(node) //measure dynamic row height
|
|
42
50
|
,
|
|
43
51
|
key: row.id
|
|
52
|
+
// data-row-key={cell.row.id}
|
|
53
|
+
,
|
|
54
|
+
"data-row-key": row.id
|
|
44
55
|
|
|
45
56
|
// className={} ui-rc-table-row-selected
|
|
46
57
|
,
|
|
47
58
|
className: (0, _classnames.default)(`${prefix}-grid-row`, {
|
|
48
|
-
[`${prefix}-grid-row-selected`]: row.getIsSelected()
|
|
59
|
+
[`${prefix}-grid-row-selected`]: row.getIsSelected(),
|
|
60
|
+
[`${prefix}-grid-row-focus`]: row.id === focusedCell?.rowId && !editAble
|
|
61
|
+
// [`${prefix}-grid-row-focus`]: true,
|
|
49
62
|
}),
|
|
50
63
|
style: {
|
|
51
64
|
// display: 'flex',
|
|
65
|
+
display: 'grid',
|
|
52
66
|
// position: 'absolute',
|
|
53
67
|
transform: `translateY(${virtualRow.start}px)`,
|
|
54
68
|
//this should always be a `style` as it changes on scroll
|
|
55
69
|
// width: '100%',
|
|
56
70
|
// height: isEditing ? '36px' : undefined,
|
|
71
|
+
gridTemplateColumns: `${templateColumns.map(n => `${n}fr`).join(" ")}`,
|
|
72
|
+
// gridTemplateColumns: `repeat(${centerCOlumns.length + fixedLeftColumns.length + fixedRightColumns.length}, minmax(0, 1fr))`,
|
|
57
73
|
height: isEditing ? virtualRow.size : undefined
|
|
58
74
|
// minHeight: isEditing ? undefined : virtualRow.size
|
|
59
75
|
},
|
|
@@ -84,14 +100,18 @@ const TableBodyRow = ({
|
|
|
84
100
|
columnVirtualizer: columnVirtualizer
|
|
85
101
|
}));
|
|
86
102
|
}
|
|
87
|
-
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
88
|
-
key: column.id,
|
|
103
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, (0, _extends2.default)({}, rest, {
|
|
89
104
|
table: table,
|
|
90
|
-
|
|
105
|
+
tableId: tableId,
|
|
106
|
+
key: cell.id,
|
|
107
|
+
cell: cell,
|
|
91
108
|
commandClick: commandClick,
|
|
92
|
-
virtualRow: virtualRow
|
|
93
|
-
|
|
94
|
-
|
|
109
|
+
virtualRow: virtualRow,
|
|
110
|
+
isEditing: false,
|
|
111
|
+
rowVirtualizer: rowVirtualizer,
|
|
112
|
+
columnVirtualizer: columnVirtualizer
|
|
113
|
+
}));
|
|
114
|
+
}) : null, virtualPaddingLeft ? /*#__PURE__*/_react.default.createElement("div", {
|
|
95
115
|
className: "",
|
|
96
116
|
style: {
|
|
97
117
|
display: "flex",
|
|
@@ -114,13 +134,17 @@ const TableBodyRow = ({
|
|
|
114
134
|
virtualRow: virtualRow
|
|
115
135
|
}));
|
|
116
136
|
}
|
|
117
|
-
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
137
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, (0, _extends2.default)({}, rest, {
|
|
118
138
|
table: table,
|
|
119
139
|
key: cell.id,
|
|
140
|
+
tableId: tableId,
|
|
120
141
|
cell: cell,
|
|
121
142
|
commandClick: commandClick,
|
|
143
|
+
isEditing: false,
|
|
144
|
+
rowVirtualizer: rowVirtualizer,
|
|
145
|
+
columnVirtualizer: columnVirtualizer,
|
|
122
146
|
virtualRow: virtualRow
|
|
123
|
-
});
|
|
147
|
+
}));
|
|
124
148
|
}
|
|
125
149
|
}), fixedRightColumns.length > 0 ? fixedRightColumns.map(column => {
|
|
126
150
|
if (editAble) {
|
|
@@ -136,13 +160,18 @@ const TableBodyRow = ({
|
|
|
136
160
|
virtualRow: virtualRow
|
|
137
161
|
}));
|
|
138
162
|
}
|
|
139
|
-
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, {
|
|
140
|
-
key: column.id,
|
|
163
|
+
return /*#__PURE__*/_react.default.createElement(_TableBodyCell.default, (0, _extends2.default)({}, rest, {
|
|
141
164
|
table: table,
|
|
165
|
+
key: column.id,
|
|
166
|
+
tableId: tableId,
|
|
142
167
|
cell: row.getVisibleCells().find(c => c.column.id === column.id),
|
|
143
|
-
commandClick: commandClick
|
|
144
|
-
|
|
145
|
-
|
|
168
|
+
commandClick: commandClick,
|
|
169
|
+
isEditing: false,
|
|
170
|
+
rowVirtualizer: rowVirtualizer,
|
|
171
|
+
columnVirtualizer: columnVirtualizer,
|
|
172
|
+
virtualRow: virtualRow
|
|
173
|
+
}));
|
|
174
|
+
}) : null, virtualPaddingRight ? /*#__PURE__*/_react.default.createElement("div", {
|
|
146
175
|
className: "",
|
|
147
176
|
style: {
|
|
148
177
|
display: "flex",
|
|
@@ -19,11 +19,13 @@ const Command = props => {
|
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, item.template ? /*#__PURE__*/_react.default.createElement("div", {
|
|
20
20
|
"data-tooltip-id": `${id}-tooltip-content`,
|
|
21
21
|
"data-tooltip-content": item.tooltip || item.title,
|
|
22
|
+
"data-tooltip-delay-show": 500,
|
|
22
23
|
id: item.id,
|
|
23
24
|
onClick: onClick
|
|
24
25
|
}, typeof item.template === 'function' ? item.template(record) : item.template) : /*#__PURE__*/_react.default.createElement("div", {
|
|
25
26
|
tabIndex: -1,
|
|
26
27
|
"data-tooltip-id": `${id}-tooltip-content`,
|
|
28
|
+
"data-tooltip-delay-show": 500,
|
|
27
29
|
"data-tooltip-content": item.tooltip || item.title,
|
|
28
30
|
style: {
|
|
29
31
|
padding: '3px',
|
|
@@ -22,7 +22,7 @@ const TableFooter = ({
|
|
|
22
22
|
const {
|
|
23
23
|
prefix
|
|
24
24
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
26
26
|
className: `${prefix}-grid-tfoot`,
|
|
27
27
|
style: {
|
|
28
28
|
display: "grid",
|
|
@@ -53,7 +53,7 @@ const TableFooterCell = ({
|
|
|
53
53
|
decimalScale: dec,
|
|
54
54
|
fixedDecimalScale: cellFormat?.fixedDecimalScale ?? false
|
|
55
55
|
};
|
|
56
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
57
57
|
// ref={el => {
|
|
58
58
|
// if (el) columnVirtualizer.measureElement(el)
|
|
59
59
|
// }}
|
|
@@ -72,7 +72,8 @@ const TableFooterCell = ({
|
|
|
72
72
|
style: {
|
|
73
73
|
display: 'flex',
|
|
74
74
|
...(0, _utils.getCommonPinningStyles)(column),
|
|
75
|
-
width: column?.getSize() ?? column.getSize(),
|
|
75
|
+
// width: column?.getSize() ?? column.getSize(),
|
|
76
|
+
minWidth: column?.getSize(),
|
|
76
77
|
backgroundColor: "#fafafa"
|
|
77
78
|
}
|
|
78
79
|
}, column.id !== "id" && column.id !== "selection_column" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, col.summaryTemplate ? col.summaryTemplate(numberValue, col.field) : (0, _reactNumericComponent.numericFormatter)(cellValue, numericFormatProps)) : '');
|
|
@@ -31,15 +31,16 @@ const TableFooterRow = ({
|
|
|
31
31
|
|
|
32
32
|
// const
|
|
33
33
|
|
|
34
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
35
|
// data-index={headerGroup.id}
|
|
36
36
|
key: headerGroup.id,
|
|
37
37
|
style: {
|
|
38
|
-
display: "
|
|
38
|
+
display: "grid",
|
|
39
39
|
width: "100%",
|
|
40
40
|
borderBottom: "1px solid #e0e0e0",
|
|
41
41
|
borderTop: "1px solid #e0e0e0",
|
|
42
|
-
height: 37
|
|
42
|
+
height: 37,
|
|
43
|
+
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
|
|
43
44
|
}
|
|
44
45
|
}, visibleColumns.map(header => {
|
|
45
46
|
return /*#__PURE__*/_react.default.createElement(_TableFooterCell.default, {
|
|
@@ -11,5 +11,5 @@ interface TableHeadProps<T> {
|
|
|
11
11
|
fixedLeftColumns: Column<T, unknown>[];
|
|
12
12
|
fixedRightColumns: Column<T, unknown>[];
|
|
13
13
|
}
|
|
14
|
-
declare const TableHead: <RecordType extends object>({ columnVirtualizer, table,
|
|
14
|
+
declare const TableHead: <RecordType extends object>({ columnVirtualizer, table, }: TableHeadProps<RecordType>) => React.JSX.Element;
|
|
15
15
|
export default TableHead;
|
|
@@ -7,41 +7,105 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _useContext = require("../useContext");
|
|
10
|
-
var
|
|
10
|
+
var _TableHeadCell = _interopRequireDefault(require("./TableHeadCell2"));
|
|
11
|
+
var _TableHeadGroupCell = _interopRequireDefault(require("./TableHeadGroupCell"));
|
|
11
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
// import TableHeadRow from './TableHeadRow'
|
|
15
|
+
|
|
13
16
|
// import { getCommonPinningStyles } from '../hook/utils'
|
|
14
17
|
|
|
15
18
|
const TableHead = ({
|
|
16
19
|
columnVirtualizer,
|
|
17
|
-
table
|
|
18
|
-
virtualPaddingLeft,
|
|
19
|
-
virtualPaddingRight,
|
|
20
|
-
fixedLeftColumns,
|
|
21
|
-
fixedRightColumns
|
|
20
|
+
table
|
|
21
|
+
// virtualPaddingLeft,
|
|
22
|
+
// virtualPaddingRight,
|
|
23
|
+
// fixedLeftColumns,
|
|
24
|
+
// fixedRightColumns
|
|
22
25
|
}) => {
|
|
23
26
|
const {
|
|
24
27
|
prefix
|
|
25
28
|
} = (0, _react.useContext)(_useContext.TableContext);
|
|
26
|
-
|
|
29
|
+
const headerGroups = table.getFlatHeaders();
|
|
30
|
+
const leafColumns = table.getVisibleFlatColumns();
|
|
31
|
+
const headerDepth = table.getHeaderGroups().length;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
27
33
|
className: `${prefix}-grid-thead`,
|
|
28
34
|
style: {
|
|
29
|
-
|
|
35
|
+
display: 'grid',
|
|
30
36
|
position: 'sticky',
|
|
31
37
|
top: 0,
|
|
32
|
-
zIndex: 1
|
|
38
|
+
zIndex: 1,
|
|
39
|
+
// gridTemplateRows: `repeat(${table.getHeaderGroups().length}, auto)`,
|
|
40
|
+
// gridTemplateColumns: `repeat(${table.getVisibleLeafColumns().length}, 1fr)`,
|
|
41
|
+
gridTemplateColumns: `${table.getVisibleLeafColumns().map(n => `${n.getSize()}fr`).join(" ")}`
|
|
42
|
+
}
|
|
43
|
+
}, leafColumns.map(column => {
|
|
44
|
+
const depth = column.depth ?? 0;
|
|
45
|
+
// const colSpan = col.getLeafColumns().length || 1;
|
|
46
|
+
const colSpan = column.columns.length || 1;
|
|
47
|
+
const rowSpan = column.columns?.length > 0 ? 1 : headerDepth - depth;
|
|
48
|
+
const header = headerGroups.find(it => it.id === column.id || it.column.id === column.id && it.subHeaders.length >= 2);
|
|
49
|
+
// const groupHeader = headerGroups.find((it) => it.column.id === column.id && it.subHeaders.length >= 2)
|
|
50
|
+
|
|
51
|
+
if (header?.subHeaders && header.subHeaders.length >= 2) {
|
|
52
|
+
return /*#__PURE__*/_react.default.createElement(_TableHeadGroupCell.default, {
|
|
53
|
+
key: column.id,
|
|
54
|
+
depth: depth,
|
|
55
|
+
column: column,
|
|
56
|
+
header: header,
|
|
57
|
+
table: table,
|
|
58
|
+
columnVirtualizer: columnVirtualizer,
|
|
59
|
+
colSpan: colSpan,
|
|
60
|
+
rowSpan: rowSpan
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_TableHeadCell.default, {
|
|
64
|
+
key: column.id,
|
|
65
|
+
depth: depth,
|
|
66
|
+
column: column,
|
|
67
|
+
header: header,
|
|
68
|
+
table: table,
|
|
69
|
+
columnVirtualizer: columnVirtualizer
|
|
70
|
+
// rowHeaderVirtualizer={rowHeaderVirtualizer}
|
|
71
|
+
,
|
|
72
|
+
colSpan: colSpan,
|
|
73
|
+
rowSpan: rowSpan
|
|
74
|
+
});
|
|
33
75
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
76
|
+
|
|
77
|
+
// if (header) {
|
|
78
|
+
// return (
|
|
79
|
+
// <TableHeadCell2
|
|
80
|
+
// key={column.id}
|
|
81
|
+
// depth={depth}
|
|
82
|
+
// column={column}
|
|
83
|
+
// header={header as any}
|
|
84
|
+
// table={table}
|
|
85
|
+
// columnVirtualizer={columnVirtualizer}
|
|
86
|
+
// // rowHeaderVirtualizer={rowHeaderVirtualizer}
|
|
87
|
+
// colSpan={colSpan}
|
|
88
|
+
// rowSpan={rowSpan}
|
|
89
|
+
// />
|
|
90
|
+
// )
|
|
91
|
+
// }
|
|
92
|
+
|
|
93
|
+
// return (
|
|
94
|
+
// <div
|
|
95
|
+
// key={col.id}
|
|
96
|
+
// className="th p-2 border font-bold flex items-center justify-center"
|
|
97
|
+
// style={{
|
|
98
|
+
// // width: col.getSize(),
|
|
99
|
+
// minWidth: col.getSize(),
|
|
100
|
+
// gridRow: `${depth + 1} / span ${rowSpan}`,
|
|
101
|
+
|
|
102
|
+
// gridColumn: `span ${colSpan}`,
|
|
103
|
+
// }}
|
|
104
|
+
// >
|
|
105
|
+
// aaaaa
|
|
106
|
+
// {/* {flexRender(col.columnDef.header, header.getContext())} */}
|
|
107
|
+
// </div>
|
|
108
|
+
// );
|
|
45
109
|
}));
|
|
46
110
|
};
|
|
47
111
|
var _default = exports.default = TableHead;
|
|
@@ -31,12 +31,12 @@ const TableHeadCell = props => {
|
|
|
31
31
|
const {
|
|
32
32
|
header,
|
|
33
33
|
getPopupContainer,
|
|
34
|
-
table
|
|
34
|
+
table
|
|
35
35
|
// t,
|
|
36
36
|
// columnVirtualizer,
|
|
37
37
|
// rowHeaderVirtualizer,
|
|
38
|
-
colSpan,
|
|
39
|
-
rowSpan
|
|
38
|
+
// colSpan,
|
|
39
|
+
// rowSpan
|
|
40
40
|
} = props;
|
|
41
41
|
const {
|
|
42
42
|
t,
|
|
@@ -216,7 +216,7 @@ const TableHeadCell = props => {
|
|
|
216
216
|
// return dropdownContent;
|
|
217
217
|
}
|
|
218
218
|
});
|
|
219
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
219
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
220
220
|
// ref={setNodeRef}
|
|
221
221
|
className: (0, _classnames.default)(`${prefix}-grid-cell`, {
|
|
222
222
|
[`${prefix}-grid-cell-ellipsis`]: !wrapSettings || !(wrapSettings && (wrapSettings.wrapMode === 'Both' || wrapSettings.wrapMode === 'Header')),
|
|
@@ -225,15 +225,20 @@ const TableHeadCell = props => {
|
|
|
225
225
|
[`${prefix}-grid-cell-fix-right-first`]: isFirstRightPinnedColumn,
|
|
226
226
|
[`${prefix}-grid-cell-text-center`]: (originalColumn?.headerTextAlign ?? originalColumn?.textAlign) === 'center',
|
|
227
227
|
[`${prefix}-grid-cell-text-right`]: (originalColumn?.headerTextAlign ?? originalColumn.textAlign) === 'right'
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
})
|
|
229
|
+
// colSpan={colSpan}
|
|
230
|
+
// rowSpan={rowSpan}
|
|
231
|
+
,
|
|
232
|
+
|
|
231
233
|
key: header.id,
|
|
232
234
|
style: {
|
|
233
235
|
// display: 'flex',
|
|
234
236
|
width: header.getSize(),
|
|
235
237
|
minWidth: header.getSize(),
|
|
236
|
-
|
|
238
|
+
flex: 1,
|
|
239
|
+
gridColumn: `span ${header.colSpan}`,
|
|
240
|
+
gridRow: `span 2`,
|
|
241
|
+
// maxWidth: header.getSize(),
|
|
237
242
|
...(0, _utils.getCommonPinningStyles)(header.column),
|
|
238
243
|
...style
|
|
239
244
|
},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
import { type Header } from '@tanstack/react-table';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { Virtualizer } from '@tanstack/react-virtual';
|
|
5
|
+
interface TableHeadCellProps<T> {
|
|
6
|
+
t?: any;
|
|
7
|
+
table: Table<T>;
|
|
8
|
+
column: any;
|
|
9
|
+
header: Header<T, unknown>;
|
|
10
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
11
|
+
columnVirtualizer: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
|
|
12
|
+
colSpan: number;
|
|
13
|
+
rowSpan: number;
|
|
14
|
+
depth: number;
|
|
15
|
+
}
|
|
16
|
+
declare const TableHeadCell2: <RecordType extends object>(props: TableHeadCellProps<RecordType>) => React.JSX.Element;
|
|
17
|
+
export default TableHeadCell2;
|