@arim-aisdc/public-components 0.0.14 → 0.0.16
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/dist/components/TableMax/TableBody/Row.d.ts +2 -2
- package/dist/components/TableMax/TableBody/Row.js +5 -5
- package/dist/components/TableMax/TableBody/index.d.ts +2 -4
- package/dist/components/TableMax/TableBody/index.js +13 -10
- package/dist/components/TableMax/TableHeader/index.js +4 -5
- package/dist/components/TableMax/TableHeader/index.less +1 -1
- package/dist/components/TableMax/TableMax.js +30 -45
- package/dist/components/TableMax/components/ColumnEdit/index.d.ts +2 -1
- package/dist/components/TableMax/components/ColumnEdit/index.js +3 -2
- package/dist/components/TableMax/components/ColumnEdit/index.less +3 -0
- package/dist/components/TableMax/tableMax.less +1 -1
- package/dist/components/TableMax/type.d.ts +5 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { OnSelectChangeType } from "../type";
|
|
|
2
2
|
import { Table } from '@tanstack/react-table';
|
|
3
3
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
4
|
import './index.less';
|
|
5
|
-
declare const Row: ({ table, tableId, row, rowSelectedId, setRowSelectedId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, reorderRow,
|
|
5
|
+
declare const Row: ({ tableBodyRef, table, tableId, row, rowSelectedId, setRowSelectedId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, reorderRow, canRowDrag, rowClassName, cellClassName, rowStyle, getCellProps, editting, rowEditing, renderSubComponent, selectedRowDragging, setSelectedRowDragging, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, rowHeight, disableDragRowIds, selectRowWhenClick, hasVerticalScrollBar, handleEditRowWhenDClick, canEditRowWhenDClick, theme, pinShadowVisible, dragBeforeStart, }: {
|
|
6
6
|
table: Table<any>;
|
|
7
7
|
tableId: string;
|
|
8
8
|
row: any;
|
|
@@ -10,7 +10,7 @@ declare const Row: ({ table, tableId, row, rowSelectedId, setRowSelectedId, sele
|
|
|
10
10
|
setRowSelectedId?: Dispatch<SetStateAction<string | undefined>>;
|
|
11
11
|
selectedRowChange?: (row: any) => void;
|
|
12
12
|
onSelectChange?: OnSelectChangeType;
|
|
13
|
-
|
|
13
|
+
tableBodyRef: any;
|
|
14
14
|
canSelection?: boolean;
|
|
15
15
|
selectionWithoutChecked?: boolean;
|
|
16
16
|
reorderRow?: (targetRowIndex: any, draggedRowIndex: any) => void;
|
|
@@ -23,8 +23,9 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
23
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
var initselectedIndex;
|
|
25
25
|
var Row = function Row(_ref) {
|
|
26
|
-
var _row, _row2;
|
|
27
|
-
var
|
|
26
|
+
var _row, _row2, _tableBodyRef$current, _tableBodyRef$current2;
|
|
27
|
+
var tableBodyRef = _ref.tableBodyRef,
|
|
28
|
+
table = _ref.table,
|
|
28
29
|
tableId = _ref.tableId,
|
|
29
30
|
row = _ref.row,
|
|
30
31
|
rowSelectedId = _ref.rowSelectedId,
|
|
@@ -34,7 +35,6 @@ var Row = function Row(_ref) {
|
|
|
34
35
|
canSelection = _ref.canSelection,
|
|
35
36
|
selectionWithoutChecked = _ref.selectionWithoutChecked,
|
|
36
37
|
reorderRow = _ref.reorderRow,
|
|
37
|
-
tableContainerWidth = _ref.tableContainerWidth,
|
|
38
38
|
canRowDrag = _ref.canRowDrag,
|
|
39
39
|
rowClassName = _ref.rowClassName,
|
|
40
40
|
cellClassName = _ref.cellClassName,
|
|
@@ -287,13 +287,13 @@ var Row = function Row(_ref) {
|
|
|
287
287
|
style: {
|
|
288
288
|
padding: 0
|
|
289
289
|
},
|
|
290
|
-
children:
|
|
290
|
+
children: (tableBodyRef === null || tableBodyRef === void 0 || (_tableBodyRef$current = tableBodyRef.current) === null || _tableBodyRef$current === void 0 ? void 0 : _tableBodyRef$current.clientWidth) && /*#__PURE__*/_jsx("div", {
|
|
291
291
|
id: "".concat(tableId, "_expand-table"),
|
|
292
292
|
className: "subRowWrapper"
|
|
293
293
|
// 减去10,避免被父表滚动条覆盖
|
|
294
294
|
,
|
|
295
295
|
style: {
|
|
296
|
-
width: "".concat(
|
|
296
|
+
width: "".concat(tableBodyRef === null || tableBodyRef === void 0 || (_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 ? void 0 : _tableBodyRef$current2.clientWidth, "px")
|
|
297
297
|
},
|
|
298
298
|
children: renderSubComponent && renderSubComponent({
|
|
299
299
|
row: row
|
|
@@ -3,6 +3,7 @@ import { OnSelectChangeType } from "../type";
|
|
|
3
3
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
4
|
import './index.less';
|
|
5
5
|
type TableBodyPropsType = {
|
|
6
|
+
tableBodyRef?: any;
|
|
6
7
|
table: Table<any>;
|
|
7
8
|
tableId: string;
|
|
8
9
|
theme: string;
|
|
@@ -14,9 +15,6 @@ type TableBodyPropsType = {
|
|
|
14
15
|
canFilter: boolean;
|
|
15
16
|
canSelection: boolean;
|
|
16
17
|
selectionWithoutChecked?: boolean;
|
|
17
|
-
tableBodyHeight: number;
|
|
18
|
-
bodyContentHeight: number;
|
|
19
|
-
tableContainerWidth: number;
|
|
20
18
|
selectedRowDragging: boolean;
|
|
21
19
|
setSelectedRowDragging: Dispatch<SetStateAction<boolean>>;
|
|
22
20
|
canRowDrag: boolean;
|
|
@@ -53,5 +51,5 @@ type TableBodyPropsType = {
|
|
|
53
51
|
};
|
|
54
52
|
dragBeforeStart: (datas: any) => boolean;
|
|
55
53
|
};
|
|
56
|
-
declare const TableBody: ({ table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked,
|
|
54
|
+
declare const TableBody: ({ tableBodyRef, table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, selectedRowDragging, setSelectedRowDragging, canRowDrag, rowKey, loading, rowClassName, cellClassName, rowStyle, getCellProps, rowHeight, renderSubComponent, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, disableDragRowIds, selectRowWhenClick, hasVerticalScrollBar, datas, emptyDataHeight, canEditRowWhenDClick, editingRowId, handleEditRowWhenDClick, pinShadowVisible, dragBeforeStart, }: TableBodyPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
57
55
|
export default TableBody;
|
|
@@ -12,7 +12,6 @@ import { useDrop } from 'react-dnd';
|
|
|
12
12
|
import { CustomDragLayer } from "../components/CustomDragerLayer";
|
|
13
13
|
// import RowContent from "../components/RowContent";
|
|
14
14
|
|
|
15
|
-
import { useEffect } from 'react';
|
|
16
15
|
import { createPortal } from 'react-dom';
|
|
17
16
|
import Row from "./Row";
|
|
18
17
|
import "./index.less";
|
|
@@ -21,7 +20,8 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
21
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
22
21
|
var TableBody = function TableBody(_ref) {
|
|
23
22
|
var _headerGroups;
|
|
24
|
-
var
|
|
23
|
+
var tableBodyRef = _ref.tableBodyRef,
|
|
24
|
+
table = _ref.table,
|
|
25
25
|
tableId = _ref.tableId,
|
|
26
26
|
theme = _ref.theme,
|
|
27
27
|
reorderRow = _ref.reorderRow,
|
|
@@ -31,8 +31,6 @@ var TableBody = function TableBody(_ref) {
|
|
|
31
31
|
onSelectChange = _ref.onSelectChange,
|
|
32
32
|
canSelection = _ref.canSelection,
|
|
33
33
|
selectionWithoutChecked = _ref.selectionWithoutChecked,
|
|
34
|
-
tableBodyHeight = _ref.tableBodyHeight,
|
|
35
|
-
tableContainerWidth = _ref.tableContainerWidth,
|
|
36
34
|
selectedRowDragging = _ref.selectedRowDragging,
|
|
37
35
|
setSelectedRowDragging = _ref.setSelectedRowDragging,
|
|
38
36
|
canRowDrag = _ref.canRowDrag,
|
|
@@ -164,6 +162,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
164
162
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
165
163
|
dropRef = _useDrop2[1];
|
|
166
164
|
var EmptyContent = function EmptyContent() {
|
|
165
|
+
var _tableBodyRef$current;
|
|
167
166
|
return /*#__PURE__*/_jsx("tr", {
|
|
168
167
|
className: "empty-container",
|
|
169
168
|
style: {
|
|
@@ -172,7 +171,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
172
171
|
children: /*#__PURE__*/_jsx("td", {
|
|
173
172
|
className: "empty-wapper",
|
|
174
173
|
style: {
|
|
175
|
-
width: "".concat(
|
|
174
|
+
width: "".concat(tableBodyRef === null || tableBodyRef === void 0 || (_tableBodyRef$current = tableBodyRef.current) === null || _tableBodyRef$current === void 0 ? void 0 : _tableBodyRef$current.clientWidth, "px"),
|
|
176
175
|
height: emptyDataHeight
|
|
177
176
|
},
|
|
178
177
|
children: loading ? /*#__PURE__*/_jsx(_Spin, {}) : /*#__PURE__*/_jsxs("span", {
|
|
@@ -195,9 +194,11 @@ var TableBody = function TableBody(_ref) {
|
|
|
195
194
|
// 当前行是否编辑中
|
|
196
195
|
var rowEditing = row.id === editingRowId;
|
|
197
196
|
return /*#__PURE__*/_jsx(Row, {
|
|
197
|
+
tableBodyRef: tableBodyRef,
|
|
198
198
|
table: table,
|
|
199
|
-
tableId: tableId
|
|
200
|
-
|
|
199
|
+
tableId: tableId
|
|
200
|
+
// tableContainerWidth={tableContainerWidth}
|
|
201
|
+
,
|
|
201
202
|
row: row,
|
|
202
203
|
rowKey: rowKey,
|
|
203
204
|
theme: theme,
|
|
@@ -239,9 +240,11 @@ var TableBody = function TableBody(_ref) {
|
|
|
239
240
|
}
|
|
240
241
|
return EmptyContent();
|
|
241
242
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
|
|
244
|
+
// useEffect(() => {
|
|
245
|
+
// console.log(tableBodyHeight, 'tableBodyHeight*******************');
|
|
246
|
+
// }, [tableBodyHeight]);
|
|
247
|
+
|
|
245
248
|
return (
|
|
246
249
|
/*#__PURE__*/
|
|
247
250
|
// 修复筛选数据为空时,滚动条丢失
|
|
@@ -7,7 +7,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
7
7
|
// import { Column, flexRender } from '@tanstack/react-table';
|
|
8
8
|
// import { useDrag, useDrop } from 'ahooks';
|
|
9
9
|
|
|
10
|
-
import { useMemo } from 'react';
|
|
10
|
+
import { useEffect, useMemo } from 'react';
|
|
11
11
|
import { Filter } from "../components/ColumnFilter";
|
|
12
12
|
import { getShadowInfo } from "../utils";
|
|
13
13
|
import Cell from "./Cell";
|
|
@@ -31,10 +31,9 @@ var TableHeader = function TableHeader(_ref) {
|
|
|
31
31
|
var columnPinning = table.getState().columnPinning;
|
|
32
32
|
return JSON.stringify(columnPinning.left) !== '[]' || JSON.stringify(columnPinning.right) !== '[]' ? true : false;
|
|
33
33
|
}, [table.getState().columnPinning]);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// }, [hasVerticalScrollBar]);
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
console.log(hasVerticalScrollBar, '********************hasVerticalScrollBar====================');
|
|
36
|
+
}, [hasVerticalScrollBar]);
|
|
38
37
|
|
|
39
38
|
// const [headerGroups, setHeaderGroups] = useState([])
|
|
40
39
|
|
|
@@ -54,7 +54,7 @@ export var ColumnType = /*#__PURE__*/function (ColumnType) {
|
|
|
54
54
|
}({});
|
|
55
55
|
export var TableContext = /*#__PURE__*/createContext({});
|
|
56
56
|
var TableMax = function TableMax(_ref) {
|
|
57
|
-
var _JSON$parse, _tableHeaderRef$curre2,
|
|
57
|
+
var _JSON$parse, _tableHeaderRef$curre2, _tableBodyRef$current3, _tableBodyRef$current4, _tableBodyRef$current5;
|
|
58
58
|
var tableId = _ref.tableId,
|
|
59
59
|
originColumns = _ref.columns,
|
|
60
60
|
_ref$datas = _ref.datas,
|
|
@@ -357,36 +357,18 @@ var TableMax = function TableMax(_ref) {
|
|
|
357
357
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
358
358
|
tableHeadHeight = _useState36[0],
|
|
359
359
|
setTableHeadHeight = _useState36[1];
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
tableBodyHeight = _useState38[0],
|
|
363
|
-
setTableBodyHeight = _useState38[1];
|
|
360
|
+
|
|
361
|
+
// const [tableBodyHeight, setTableBodyHeight] = useState(0);
|
|
364
362
|
|
|
365
363
|
/**table-head高度 */
|
|
366
364
|
useEffect(function () {
|
|
367
365
|
var _tableHeaderRef$curre;
|
|
368
366
|
setTableHeadHeight(tableHeaderRef === null || tableHeaderRef === void 0 || (_tableHeaderRef$curre = tableHeaderRef.current) === null || _tableHeaderRef$curre === void 0 ? void 0 : _tableHeaderRef$curre.clientHeight);
|
|
369
367
|
}, [tableHeaderRef === null || tableHeaderRef === void 0 || (_tableHeaderRef$curre2 = tableHeaderRef.current) === null || _tableHeaderRef$curre2 === void 0 ? void 0 : _tableHeaderRef$curre2.clientHeight, enableFilters]);
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
var horizontalScrollHeight = table.getTotalSize() > (tableContentRef === null || tableContentRef === void 0 || (_tableContentRef$curr = tableContentRef.current) === null || _tableContentRef$curr === void 0 ? void 0 : _tableContentRef$curr.offsetWidth) ? 10 : 0;
|
|
375
|
-
setTableBodyHeight(autoHeight ? (tableContentRef === null || tableContentRef === void 0 || (_tableContentRef$curr2 = tableContentRef.current) === null || _tableContentRef$curr2 === void 0 ? void 0 : _tableContentRef$curr2.clientHeight) - tableHeadHeight - horizontalScrollHeight : defaultScrollY - tableHeadHeight - horizontalScrollHeight);
|
|
376
|
-
}, [table.getTotalSize(), defaultScrollY, autoHeight, tableContentRef === null || tableContentRef === void 0 ? void 0 : tableContentRef.current, tableContentRef === null || tableContentRef === void 0 || (_tableContentRef$curr3 = tableContentRef.current) === null || _tableContentRef$curr3 === void 0 ? void 0 : _tableContentRef$curr3.clientHeight, tableHeadHeight]);
|
|
377
|
-
|
|
378
|
-
/**table-body-content 高度 */
|
|
379
|
-
var bodyContentHeight = useMemo(function () {
|
|
380
|
-
return datas.length * Number(rowHeight);
|
|
381
|
-
}, [datas.length, rowHeight]);
|
|
382
|
-
var hasVerticalScrollBar = useMemo(function () {
|
|
383
|
-
return tableBodyHeight - bodyContentHeight + 10 < 0;
|
|
384
|
-
}, [tableBodyHeight, bodyContentHeight]);
|
|
385
|
-
|
|
386
|
-
// const tableViewWidth = useMemo(
|
|
387
|
-
// () => table.getTotalSize() + (hasVerticalScrollBar ? 10 : 0),
|
|
388
|
-
// [table.getTotalSize(), hasVerticalScrollBar],
|
|
389
|
-
// );
|
|
368
|
+
var _useState37 = useState(false),
|
|
369
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
370
|
+
hasVerticalScrollBar = _useState38[0],
|
|
371
|
+
setHasVerticalScrollBar = _useState38[1];
|
|
390
372
|
|
|
391
373
|
// 暴露给外部的api
|
|
392
374
|
useImperativeHandle(refInstance, function () {
|
|
@@ -556,18 +538,20 @@ var TableMax = function TableMax(_ref) {
|
|
|
556
538
|
setTableColumns(cloneDeep(newColumns));
|
|
557
539
|
return getSizeInfo(newColumns);
|
|
558
540
|
}, [columns]);
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
541
|
+
var _useState39 = useState(),
|
|
542
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
543
|
+
emptyColumnWidth = _useState40[0],
|
|
544
|
+
setEmptyColumnWidth = _useState40[1];
|
|
545
|
+
useEffect(function () {
|
|
546
|
+
var _tableBodyRef$current, _tableBodyRef$current2;
|
|
563
547
|
var hasSizeAllWidth = columnSizeInfo.hasSizeAllWidth;
|
|
564
548
|
//表格宽度,offsetWidth?下面监听里用的clientWidth
|
|
565
|
-
var tableContainerWidth = (
|
|
549
|
+
var tableContainerWidth = (_tableBodyRef$current = tableBodyRef.current) === null || _tableBodyRef$current === void 0 ? void 0 : _tableBodyRef$current.clientWidth;
|
|
566
550
|
// 滚动条宽度
|
|
567
|
-
var
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}, [
|
|
551
|
+
var remainWidth = tableContainerWidth - hasSizeAllWidth - table.getLeftTotalSize() - (table === null || table === void 0 ? void 0 : table.getRightTotalSize()) || 0;
|
|
552
|
+
setHasVerticalScrollBar(datas.length * rowHeight - ((_tableBodyRef$current2 = tableBodyRef.current) === null || _tableBodyRef$current2 === void 0 ? void 0 : _tableBodyRef$current2.clientHeight) > 0);
|
|
553
|
+
setEmptyColumnWidth(remainWidth);
|
|
554
|
+
}, [(_tableBodyRef$current3 = tableBodyRef.current) === null || _tableBodyRef$current3 === void 0 ? void 0 : _tableBodyRef$current3.clientWidth, (_tableBodyRef$current4 = tableBodyRef.current) === null || _tableBodyRef$current4 === void 0 ? void 0 : _tableBodyRef$current4.clientHeight, (_tableBodyRef$current5 = tableBodyRef.current) === null || _tableBodyRef$current5 === void 0 ? void 0 : _tableBodyRef$current5.scrollWidth, datas.length, Math.round(table.getLeftTotalSize()), Math.round(table === null || table === void 0 ? void 0 : table.getRightTotalSize())]);
|
|
571
555
|
useEffect(function () {
|
|
572
556
|
//默认宽度
|
|
573
557
|
var defaultSize = 60;
|
|
@@ -588,15 +572,15 @@ var TableMax = function TableMax(_ref) {
|
|
|
588
572
|
newColumns = setRemainColumnsWidth(newColumns);
|
|
589
573
|
}
|
|
590
574
|
setInitTableSizeColumns(cloneDeep(newColumns));
|
|
591
|
-
setTableColumns(cloneDeep(newColumns));
|
|
575
|
+
// setTableColumns(cloneDeep(newColumns));
|
|
592
576
|
}, [columnSizeInfo, emptyColumnWidth]);
|
|
593
577
|
|
|
594
578
|
// 添加空白列
|
|
595
579
|
useLayoutEffect(function () {
|
|
596
580
|
var centerTableSize = table.getTotalSize();
|
|
597
|
-
var containerWidth =
|
|
598
|
-
|
|
599
|
-
var centerTableContainerWidth = containerWidth
|
|
581
|
+
var containerWidth = tableBodyRef.current.clientWidth;
|
|
582
|
+
// const scrollBarWidth = tableBodyRef.current.clientWidth - tableBodyRef.current.scrollHeight < 0 ? 10 : 0;
|
|
583
|
+
var centerTableContainerWidth = containerWidth;
|
|
600
584
|
var centerTableRemainWidth = centerTableContainerWidth - centerTableSize;
|
|
601
585
|
var placeholderColumn = table.getAllColumns().some(function (item) {
|
|
602
586
|
return item.id === ColumnType.PlaceHolder;
|
|
@@ -954,6 +938,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
954
938
|
setEditingRowId(row.id);
|
|
955
939
|
};
|
|
956
940
|
var tableBodyProps = {
|
|
941
|
+
tableBodyRef: tableBodyRef,
|
|
957
942
|
emptyDataHeight: emptyDataHeight,
|
|
958
943
|
table: table,
|
|
959
944
|
tableId: tableId,
|
|
@@ -967,10 +952,10 @@ var TableMax = function TableMax(_ref) {
|
|
|
967
952
|
selectionWithoutChecked: selectionWithoutChecked,
|
|
968
953
|
// scroll,
|
|
969
954
|
// setScroll,
|
|
970
|
-
|
|
955
|
+
// tableBodyHeight,
|
|
971
956
|
// tableHeadHeight,
|
|
972
957
|
// setTableHeadHeight,
|
|
973
|
-
|
|
958
|
+
// bodyContentHeight,
|
|
974
959
|
// setBodyContentHeight,
|
|
975
960
|
tableContainerWidth: tableContainerWidth,
|
|
976
961
|
selectedRowDragging: selectedRowDragging,
|
|
@@ -1006,10 +991,10 @@ var TableMax = function TableMax(_ref) {
|
|
|
1006
991
|
hasVerticalScrollBar: hasVerticalScrollBar
|
|
1007
992
|
};
|
|
1008
993
|
var getPinShadowInfo = useCallback(function () {
|
|
1009
|
-
var _tableBodyRef$
|
|
1010
|
-
scrollWidth = _tableBodyRef$
|
|
1011
|
-
clientWidth = _tableBodyRef$
|
|
1012
|
-
scrollLeft = _tableBodyRef$
|
|
994
|
+
var _tableBodyRef$current6 = tableBodyRef.current,
|
|
995
|
+
scrollWidth = _tableBodyRef$current6.scrollWidth,
|
|
996
|
+
clientWidth = _tableBodyRef$current6.clientWidth,
|
|
997
|
+
scrollLeft = _tableBodyRef$current6.scrollLeft;
|
|
1013
998
|
var newLeftShadowVisible, newRightShadowVisible;
|
|
1014
999
|
newLeftShadowVisible = scrollLeft > 0;
|
|
1015
1000
|
newRightShadowVisible = scrollLeft < scrollWidth - clientWidth;
|
|
@@ -1126,7 +1111,7 @@ var TableMax = function TableMax(_ref) {
|
|
|
1126
1111
|
className: "table-center",
|
|
1127
1112
|
ref: tableContentRef,
|
|
1128
1113
|
style: {
|
|
1129
|
-
|
|
1114
|
+
maxHeight: !autoHeight ? defaultScrollY : 'fix-content'
|
|
1130
1115
|
},
|
|
1131
1116
|
children: [/*#__PURE__*/_jsx("div", {
|
|
1132
1117
|
ref: tableHeaderRef,
|
|
@@ -22,7 +22,8 @@ interface EditableCellProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
22
22
|
numberMin: number;
|
|
23
23
|
children: React.ReactNode;
|
|
24
24
|
precision: number | undefined;
|
|
25
|
-
ellipsis
|
|
25
|
+
ellipsis?: boolean;
|
|
26
|
+
tooltip?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare const EditableCell: React.FC<EditableCellProps>;
|
|
28
29
|
export {};
|
|
@@ -34,7 +34,8 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
34
34
|
numberMin = _ref.numberMin,
|
|
35
35
|
_ref$editOptions = _ref.editOptions,
|
|
36
36
|
editOptions = _ref$editOptions === void 0 ? [] : _ref$editOptions,
|
|
37
|
-
ellipsis = _ref.ellipsis
|
|
37
|
+
ellipsis = _ref.ellipsis,
|
|
38
|
+
tooltip = _ref.tooltip;
|
|
38
39
|
var getEditComponent = function getEditComponent() {
|
|
39
40
|
switch (editComType) {
|
|
40
41
|
case InputType.InputNumber:
|
|
@@ -93,7 +94,7 @@ export var EditableCell = function EditableCell(_ref) {
|
|
|
93
94
|
// onClick={e => e.stopPropagation()}
|
|
94
95
|
,
|
|
95
96
|
children: getEditComponent()
|
|
96
|
-
}) : ellipsis ? /*#__PURE__*/_jsx(_Tooltip, {
|
|
97
|
+
}) : ellipsis || tooltip ? /*#__PURE__*/_jsx(_Tooltip, {
|
|
97
98
|
placement: "topLeft",
|
|
98
99
|
title: children,
|
|
99
100
|
mouseEnterDelay: 0.5,
|
|
@@ -263,8 +263,12 @@ export interface TableMaxColumnType {
|
|
|
263
263
|
value: any;
|
|
264
264
|
label: any;
|
|
265
265
|
}[];
|
|
266
|
-
|
|
266
|
+
/** @deprecated 已废弃,使用tooltip替代;现在表格单元格默认就是超出部分省略号展示
|
|
267
|
+
* 是否显示tooltip
|
|
268
|
+
*/
|
|
267
269
|
ellipsis?: boolean;
|
|
270
|
+
/**是否显示tooltip */
|
|
271
|
+
tooltip?: boolean;
|
|
268
272
|
/**当前列是否可排序 */
|
|
269
273
|
enableSorting?: boolean;
|
|
270
274
|
/**排序函数 */
|
package/package.json
CHANGED