@aloudata/aloudata-design 1.9.16 → 1.10.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/dist/Button/style/type.less +1 -1
- package/dist/Checkbox/style/index.less +35 -9
- package/dist/ConfigProvider/getUserList.d.ts +13 -1
- package/dist/ConfigProvider/getUserList.js +5 -0
- package/dist/Icon/components/AlertTriangleDuotone.d.ts +3 -2
- package/dist/Icon/components/AlertTriangleDuotone.js +3 -3
- package/dist/Icon/components/CancelCircleDuotone.d.ts +3 -2
- package/dist/Icon/components/CancelCircleDuotone.js +4 -4
- package/dist/Icon/components/CheckCircleDuotone.d.ts +3 -2
- package/dist/Icon/components/CheckCircleDuotone.js +4 -4
- package/dist/Icon/components/ChevronDownLine.d.ts +3 -2
- package/dist/Icon/components/ChevronDownLine.js +3 -3
- package/dist/Icon/components/ChevronLeftLine.d.ts +3 -2
- package/dist/Icon/components/ChevronLeftLine.js +3 -3
- package/dist/Icon/components/ChevronRightLine.d.ts +3 -2
- package/dist/Icon/components/ChevronRightLine.js +3 -3
- package/dist/Icon/components/CloseLLine.d.ts +3 -2
- package/dist/Icon/components/CloseLLine.js +4 -4
- package/dist/Icon/components/CloseMLine.d.ts +3 -2
- package/dist/Icon/components/CloseMLine.js +3 -3
- package/dist/Icon/components/DragLine.d.ts +11 -0
- package/dist/Icon/components/DragLine.js +35 -0
- package/dist/Icon/components/EyeOffLine.d.ts +3 -2
- package/dist/Icon/components/EyeOffLine.js +3 -3
- package/dist/Icon/components/EyeOnLine.d.ts +3 -2
- package/dist/Icon/components/EyeOnLine.js +3 -3
- package/dist/Icon/components/FoldDownFill.d.ts +3 -2
- package/dist/Icon/components/FoldDownFill.js +4 -4
- package/dist/Icon/components/FoldUpFill.d.ts +3 -2
- package/dist/Icon/components/FoldUpFill.js +4 -4
- package/dist/Icon/components/InfoCircleDuotone.d.ts +3 -2
- package/dist/Icon/components/InfoCircleDuotone.js +3 -3
- package/dist/Icon/components/InfoCircleLine.d.ts +3 -2
- package/dist/Icon/components/InfoCircleLine.js +3 -3
- package/dist/Icon/components/LoadingLine.d.ts +3 -2
- package/dist/Icon/components/LoadingLine.js +3 -3
- package/dist/Icon/components/MoreVerticalLine.d.ts +3 -2
- package/dist/Icon/components/MoreVerticalLine.js +3 -3
- package/dist/Icon/components/SearchLine.d.ts +3 -2
- package/dist/Icon/components/SearchLine.js +3 -3
- package/dist/Icon/index.d.ts +1 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Icon/svg/drag-line.svg +5 -0
- package/dist/MemberPicker/components/MemberSelection.d.ts +1 -1
- package/dist/MemberPicker/components/MemberSelection.js +8 -3
- package/dist/MemberPicker/components/MultipleOption.d.ts +5 -2
- package/dist/MemberPicker/components/MultipleOption.js +20 -5
- package/dist/MemberPicker/components/NickLabel.d.ts +3 -3
- package/dist/MemberPicker/components/NickLabel.js +6 -6
- package/dist/MemberPicker/components/Panel.d.ts +7 -4
- package/dist/MemberPicker/components/Panel.js +70 -20
- package/dist/MemberPicker/components/PanelWrapper.d.ts +14 -0
- package/dist/MemberPicker/components/PanelWrapper.js +126 -0
- package/dist/MemberPicker/components/SelectedMemberTags.d.ts +3 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +8 -5
- package/dist/MemberPicker/components/SelectorFooter.js +1 -1
- package/dist/MemberPicker/components/SingleOption.d.ts +3 -2
- package/dist/MemberPicker/components/SingleOption.js +7 -4
- package/dist/MemberPicker/components/UserGroupSelection.d.ts +14 -0
- package/dist/MemberPicker/components/UserGroupSelection.js +130 -0
- package/dist/MemberPicker/index.d.ts +2 -0
- package/dist/MemberPicker/index.js +28 -17
- package/dist/MemberPicker/interface.d.ts +11 -5
- package/dist/MemberPicker/interface.js +6 -1
- package/dist/MemberPicker/style/index.less +18 -3
- package/dist/MemberPicker/utils/getUsersWithUserId.d.ts +4 -0
- package/dist/MemberPicker/utils/getUsersWithUserId.js +23 -2
- package/dist/MemberPicker/utils/index.d.ts +6 -0
- package/dist/MemberPicker/utils/index.js +16 -0
- package/dist/Modal/index.js +1 -1
- package/dist/Radio/style/index.less +1 -1
- package/dist/ScrollArea/index.d.ts +1 -0
- package/dist/ScrollArea/index.js +6 -3
- package/dist/Table/components/Cell.d.ts +7 -0
- package/dist/Table/components/Cell.js +20 -0
- package/dist/Table/components/Header.d.ts +6 -0
- package/dist/Table/components/Header.js +19 -0
- package/dist/{AldTable → Table}/helper.d.ts +9 -2
- package/dist/Table/helper.js +121 -0
- package/dist/Table/hooks/useScroll.d.ts +26 -0
- package/dist/Table/hooks/useScroll.js +57 -0
- package/dist/Table/index.d.ts +3 -1
- package/dist/Table/index.js +176 -1
- package/dist/Table/style/index.less +106 -203
- package/dist/{AldTable → Table}/types.d.ts +5 -4
- package/dist/Tree/DirectoryTree.d.ts +20 -0
- package/dist/Tree/DirectoryTree.js +175 -0
- package/dist/Tree/Tree.d.ts +136 -0
- package/dist/Tree/Tree.js +130 -0
- package/dist/Tree/demo/basic/index.js +3 -2
- package/dist/Tree/demo/drag/index.d.ts +3 -0
- package/dist/Tree/demo/drag/index.js +52 -0
- package/dist/Tree/index.d.ts +19 -13
- package/dist/Tree/index.js +7 -17
- package/dist/Tree/style/checkbox.less +226 -0
- package/dist/Tree/style/directory.less +68 -0
- package/dist/Tree/style/index.less +68 -29
- package/dist/Tree/style/mixin.less +333 -0
- package/dist/Tree/style/reset.less +11 -0
- package/dist/Tree/style/rtl.less +68 -0
- package/dist/Tree/style/var.less +42 -0
- package/dist/Tree/utils/dictUtil.d.ts +9 -0
- package/dist/Tree/utils/dictUtil.js +74 -0
- package/dist/Tree/utils/dropIndicator.d.ts +9 -0
- package/dist/Tree/utils/dropIndicator.js +35 -0
- package/dist/Tree/utils/iconUtil.d.ts +5 -0
- package/dist/Tree/utils/iconUtil.js +63 -0
- package/dist/_utils/motion.d.ts +8 -0
- package/dist/_utils/motion.js +52 -0
- package/dist/_utils/reactNode.d.ts +8 -0
- package/dist/_utils/reactNode.js +15 -0
- package/dist/_utils/type.d.ts +9 -0
- package/dist/_utils/type.js +20 -0
- package/dist/index.d.ts +11 -13
- package/dist/index.js +6 -7
- package/dist/style/color/bezierEasing.less +110 -0
- package/dist/style/color/colorPalette.less +84 -0
- package/dist/style/color/colors.less +162 -0
- package/dist/style/color/tinyColor.less +1184 -0
- package/dist/style/core/index.less +2 -0
- package/dist/style/core/motion/fade.less +34 -0
- package/dist/style/core/motion/move.less +129 -0
- package/dist/style/core/motion/other.less +48 -0
- package/dist/style/core/motion/slide.less +131 -0
- package/dist/style/core/motion/zoom.less +179 -0
- package/dist/style/core/motion.less +22 -0
- package/dist/style/index.less +2 -0
- package/dist/style/mixins/index.less +1 -0
- package/dist/style/mixins/motion.less +33 -0
- package/dist/style/themes/default/default.less +24 -0
- package/dist/style/themes/default/index.less +1 -0
- package/package.json +2 -2
- package/dist/AldTable/helper.js +0 -109
- package/dist/AldTable/index.d.ts +0 -4
- package/dist/AldTable/index.js +0 -146
- package/dist/AldTable/style/index.d.ts +0 -2
- package/dist/AldTable/style/index.js +0 -2
- package/dist/AldTable/style/index.less +0 -135
- package/dist/Table/Table.d.ts +0 -6
- package/dist/Table/Table.js +0 -360
- package/dist/Table/components/Empty/index.d.ts +0 -3
- package/dist/Table/components/Empty/index.js +0 -14
- package/dist/Table/components/Loading/index.d.ts +0 -3
- package/dist/Table/components/Loading/index.js +0 -12
- package/dist/Table/components/TableBodyRowList/index.d.ts +0 -13
- package/dist/Table/components/TableBodyRowList/index.js +0 -75
- package/dist/Table/components/TableHead/index.d.ts +0 -23
- package/dist/Table/components/TableHead/index.js +0 -229
- package/dist/Table/constant.d.ts +0 -0
- package/dist/Table/constant.js +0 -0
- package/dist/Table/hooks/useFrame.d.ts +0 -7
- package/dist/Table/hooks/useFrame.js +0 -75
- package/dist/Table/interface.d.ts +0 -42
- package/dist/Table/interface.js +0 -1
- package/dist/Table/react-table-config.d.ts +0 -122
- package/dist/Table/style/variable.less +0 -4
- package/dist/Table/utils.d.ts +0 -15
- package/dist/Table/utils.js +0 -122
- /package/dist/{AldTable → Table}/types.js +0 -0
package/dist/Table/Table.js
DELETED
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
9
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
/* eslint-disable no-unneeded-ternary */
|
|
15
|
-
/// <reference types ='./react-table-config' />
|
|
16
|
-
import classnames from 'classnames';
|
|
17
|
-
import ResizeObserver from 'rc-resize-observer';
|
|
18
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
19
|
-
import { useBlockLayout, useResizeColumns, useRowSelect, useSortBy, useTable } from 'react-table';
|
|
20
|
-
import message from "../message";
|
|
21
|
-
import usePrefixCls from "../_utils/hooks/usePrefixCls";
|
|
22
|
-
import Empty from "./components/Empty";
|
|
23
|
-
import Loading from "./components/Loading";
|
|
24
|
-
import TableBodyRowList from "./components/TableBodyRowList";
|
|
25
|
-
import TableHead from "./components/TableHead";
|
|
26
|
-
import { useTimeoutLock } from "./hooks/useFrame";
|
|
27
|
-
import "./style/index";
|
|
28
|
-
import { getColumnsWidthMap, getValidScrollThreshold } from "./utils";
|
|
29
|
-
var tableHeadRowHeight = 44;
|
|
30
|
-
var ZERO = 0;
|
|
31
|
-
function Table(props, ref) {
|
|
32
|
-
var _classnames3;
|
|
33
|
-
var tableKey = props.key,
|
|
34
|
-
columns = props.columns,
|
|
35
|
-
data = props.data,
|
|
36
|
-
onRowSelected = props.onRowSelected,
|
|
37
|
-
loadMore = props.loadMore,
|
|
38
|
-
loading = props.loading,
|
|
39
|
-
hasNextPage = props.hasNextPage,
|
|
40
|
-
_props$sortable = props.sortable,
|
|
41
|
-
sortable = _props$sortable === void 0 ? false : _props$sortable,
|
|
42
|
-
defaultSort = props.defaultSort,
|
|
43
|
-
_props$resizeColumn = props.resizeColumn,
|
|
44
|
-
resizeColumn = _props$resizeColumn === void 0 ? false : _props$resizeColumn,
|
|
45
|
-
allSortDirections = props.sortDirections,
|
|
46
|
-
_props$onChange = props.onChange,
|
|
47
|
-
onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
|
|
48
|
-
_props$scrollThreshol = props.scrollThreshold,
|
|
49
|
-
scrollThreshold = _props$scrollThreshol === void 0 ? '150px' : _props$scrollThreshol,
|
|
50
|
-
_props$rowClassName = props.rowClassName,
|
|
51
|
-
rowClassName = _props$rowClassName === void 0 ? '' : _props$rowClassName,
|
|
52
|
-
_props$ellipsis = props.ellipsis,
|
|
53
|
-
ellipsis = _props$ellipsis === void 0 ? true : _props$ellipsis,
|
|
54
|
-
rowKey = props.rowKey,
|
|
55
|
-
height = props.height,
|
|
56
|
-
_props$canSelected = props.canSelected,
|
|
57
|
-
canSelected = _props$canSelected === void 0 ? false : _props$canSelected;
|
|
58
|
-
var _useState = useState(undefined),
|
|
59
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
60
|
-
tableClientWidth = _useState2[0],
|
|
61
|
-
setTableClientWidth = _useState2[1];
|
|
62
|
-
var _useState3 = useState(undefined),
|
|
63
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
|
-
tableClientHeight = _useState4[0],
|
|
65
|
-
setTableClientHeight = _useState4[1];
|
|
66
|
-
var prefixCls = usePrefixCls('', 'ald-table');
|
|
67
|
-
var tableRef = useRef(null);
|
|
68
|
-
var tableHeadRef = useRef(null);
|
|
69
|
-
var tableBodyRef = useRef(null);
|
|
70
|
-
var columnsWidthMapRef = useRef();
|
|
71
|
-
var columnsTotalWidthRef = useRef(ZERO);
|
|
72
|
-
var _useState5 = useState(false),
|
|
73
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
74
|
-
loadMoreLoading = _useState6[0],
|
|
75
|
-
setLoadMoreLoading = _useState6[1];
|
|
76
|
-
var lastOffsetLeftRef = useRef(ZERO);
|
|
77
|
-
var lastOffsetTopRef = useRef(ZERO);
|
|
78
|
-
var _useTimeoutLock = useTimeoutLock(),
|
|
79
|
-
_useTimeoutLock2 = _slicedToArray(_useTimeoutLock, 2),
|
|
80
|
-
setScrollTarget = _useTimeoutLock2[0],
|
|
81
|
-
getScrollTarget = _useTimeoutLock2[1];
|
|
82
|
-
|
|
83
|
-
// 初始化进入时 渲染表格容器宽度
|
|
84
|
-
useEffect(function () {
|
|
85
|
-
if (tableRef.current) {
|
|
86
|
-
setTableClientWidth(tableRef.current.clientWidth);
|
|
87
|
-
}
|
|
88
|
-
}, []);
|
|
89
|
-
|
|
90
|
-
// 转换外部传入的columns
|
|
91
|
-
var newColumns = useMemo(function () {
|
|
92
|
-
if (!tableClientWidth) {
|
|
93
|
-
return [];
|
|
94
|
-
}
|
|
95
|
-
var _getColumnsWidthMap = getColumnsWidthMap(columns, tableClientWidth, columnsWidthMapRef.current),
|
|
96
|
-
columnsWidthMap = _getColumnsWidthMap.columnsWidthMap,
|
|
97
|
-
totalColumnWidth = _getColumnsWidthMap.totalColumnWidth;
|
|
98
|
-
columnsWidthMapRef.current = columnsWidthMap;
|
|
99
|
-
columnsTotalWidthRef.current = totalColumnWidth;
|
|
100
|
-
return columns.map(function (column, index) {
|
|
101
|
-
var _columnsWidthMapRef$c, _columnsWidthMapRef$c2;
|
|
102
|
-
var key = index.toString();
|
|
103
|
-
// 不设置dataIndex同时进行排序 则报错
|
|
104
|
-
if (column.dataIndex === undefined && sortable) {
|
|
105
|
-
message.error('不支持未设置dataIndex时进行排序设置');
|
|
106
|
-
}
|
|
107
|
-
return _objectSpread(_objectSpread({}, column), {}, {
|
|
108
|
-
width: (_columnsWidthMapRef$c = columnsWidthMapRef.current) === null || _columnsWidthMapRef$c === void 0 ? void 0 : (_columnsWidthMapRef$c2 = _columnsWidthMapRef$c.get(key)) === null || _columnsWidthMapRef$c2 === void 0 ? void 0 : _columnsWidthMapRef$c2.width,
|
|
109
|
-
Header: column.title ? column.title : function () {
|
|
110
|
-
return /*#__PURE__*/React.createElement("span", null, "\xA0");
|
|
111
|
-
},
|
|
112
|
-
disableSortBy: !sortable || typeof column.sorter === 'boolean',
|
|
113
|
-
accessor: column.dataIndex,
|
|
114
|
-
Cell: function (_Cell) {
|
|
115
|
-
function Cell(_x2) {
|
|
116
|
-
return _Cell.apply(this, arguments);
|
|
117
|
-
}
|
|
118
|
-
Cell.toString = function () {
|
|
119
|
-
return _Cell.toString();
|
|
120
|
-
};
|
|
121
|
-
return Cell;
|
|
122
|
-
}(function (_ref) {
|
|
123
|
-
var row = _ref.row,
|
|
124
|
-
value = _ref.value;
|
|
125
|
-
return typeof column.render === 'function' ? column.render(value, row.original, row.index) : value;
|
|
126
|
-
})
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
}, [columns, sortable, tableClientWidth]);
|
|
130
|
-
|
|
131
|
-
// 将rowId转为React Table支持的值
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
-
var transformRowId = function transformRowId(row, relativeIndex, parent) {
|
|
134
|
-
if (rowKey && parent) {
|
|
135
|
-
if (typeof rowKey === 'string') {
|
|
136
|
-
return [rowKey, relativeIndex].join('.');
|
|
137
|
-
}
|
|
138
|
-
if (typeof rowKey === 'function') {
|
|
139
|
-
return [rowKey(row), relativeIndex].join('.');
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return relativeIndex.toString();
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* 计算初始传递给 React Table的排序字段
|
|
147
|
-
* 1. 不存在 sortable 或者存在loadMore(内部滚动时),不进行排序操作防止内部滚动时冲突;
|
|
148
|
-
* 2. 存在默认排序以及默认排序规则,以默认为准
|
|
149
|
-
* 3. 如果给了排序但没有默认,则按第一行排序
|
|
150
|
-
* @returns
|
|
151
|
-
*/
|
|
152
|
-
var getTableInitSort = function getTableInitSort() {
|
|
153
|
-
var EMPTY_SIZE = 0;
|
|
154
|
-
if (!sortable || loadMore || newColumns.length === EMPTY_SIZE) {
|
|
155
|
-
return [];
|
|
156
|
-
}
|
|
157
|
-
if (defaultSort && defaultSort.id) {
|
|
158
|
-
return [defaultSort];
|
|
159
|
-
}
|
|
160
|
-
var firstColumnSortData = {
|
|
161
|
-
id: newColumns[ZERO].accessor,
|
|
162
|
-
desc: !!(newColumns[ZERO].sortOrder && newColumns[ZERO].sortOrder === 'descend')
|
|
163
|
-
};
|
|
164
|
-
if (firstColumnSortData.id) {
|
|
165
|
-
return [firstColumnSortData];
|
|
166
|
-
}
|
|
167
|
-
return [];
|
|
168
|
-
};
|
|
169
|
-
var _useTable = useTable({
|
|
170
|
-
columns: newColumns,
|
|
171
|
-
// 对齐columns属性
|
|
172
|
-
data: data,
|
|
173
|
-
disableMultiSort: true,
|
|
174
|
-
disableSortBy: !sortable,
|
|
175
|
-
getRowId: transformRowId,
|
|
176
|
-
initialState: {
|
|
177
|
-
sortBy: getTableInitSort()
|
|
178
|
-
}
|
|
179
|
-
}, useBlockLayout, useSortBy, useRowSelect, useResizeColumns),
|
|
180
|
-
getTableProps = _useTable.getTableProps,
|
|
181
|
-
getTableBodyProps = _useTable.getTableBodyProps,
|
|
182
|
-
headerGroups = _useTable.headerGroups,
|
|
183
|
-
rows = _useTable.rows,
|
|
184
|
-
prepareRow = _useTable.prepareRow,
|
|
185
|
-
setSortBy = _useTable.setSortBy;
|
|
186
|
-
var scrollToTop = function scrollToTop() {
|
|
187
|
-
var INITIAL_OFFSET_TOP = 0;
|
|
188
|
-
if (tableBodyRef && tableBodyRef.current) {
|
|
189
|
-
tableBodyRef.current.scrollTop = INITIAL_OFFSET_TOP;
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
React.useImperativeHandle(ref, function () {
|
|
193
|
-
return {
|
|
194
|
-
backToTop: function backToTop() {
|
|
195
|
-
scrollToTop();
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
});
|
|
199
|
-
var tableHeadNode = /*#__PURE__*/React.createElement(TableHead, {
|
|
200
|
-
tableHeadRef: tableHeadRef,
|
|
201
|
-
canResizeColumn: resizeColumn,
|
|
202
|
-
headerGroups: headerGroups
|
|
203
|
-
// tableContentWidth={columnsTotalWidthRef.current}
|
|
204
|
-
,
|
|
205
|
-
defaultSort: defaultSort,
|
|
206
|
-
sortable: sortable,
|
|
207
|
-
columns: newColumns,
|
|
208
|
-
sortDirections: allSortDirections,
|
|
209
|
-
setSortBy: setSortBy,
|
|
210
|
-
onChange: onChange,
|
|
211
|
-
columnsWidthMapRef: columnsWidthMapRef,
|
|
212
|
-
columnsTotalWidthRef: columnsTotalWidthRef
|
|
213
|
-
});
|
|
214
|
-
var tableRowListNode = /*#__PURE__*/React.createElement(TableBodyRowList, {
|
|
215
|
-
data: data,
|
|
216
|
-
rows: rows,
|
|
217
|
-
prepareRow: prepareRow,
|
|
218
|
-
columnsTotalWidthRef: columnsTotalWidthRef,
|
|
219
|
-
rowClassName: rowClassName,
|
|
220
|
-
ellipsis: ellipsis,
|
|
221
|
-
onRowSelected: onRowSelected
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
// 渲染没有设置高度的表格
|
|
225
|
-
var renderTableWithoutHeight = function renderTableWithoutHeight() {
|
|
226
|
-
var renderNoHeightTableBody = function renderNoHeightTableBody() {
|
|
227
|
-
if (loading && !rows.length) {
|
|
228
|
-
return /*#__PURE__*/React.createElement(Loading, null);
|
|
229
|
-
}
|
|
230
|
-
if (!loading && !rows.length) {
|
|
231
|
-
return /*#__PURE__*/React.createElement(Empty, null);
|
|
232
|
-
}
|
|
233
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
234
|
-
className: "".concat(prefixCls, "-list")
|
|
235
|
-
}, tableRowListNode);
|
|
236
|
-
};
|
|
237
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
238
|
-
className: classnames("".concat(prefixCls, "-inner-wrap"))
|
|
239
|
-
}, tableHeadNode, /*#__PURE__*/React.createElement("div", _extends({}, getTableBodyProps(), {
|
|
240
|
-
className: classnames("".concat(prefixCls, "-tbody")),
|
|
241
|
-
style: {
|
|
242
|
-
width: columnsTotalWidthRef.current
|
|
243
|
-
}
|
|
244
|
-
}), renderNoHeightTableBody()));
|
|
245
|
-
};
|
|
246
|
-
var forceScroll = useCallback(function (scrollLeftNum, target) {
|
|
247
|
-
if (!target) {
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
if (typeof target === 'function') {
|
|
251
|
-
target(scrollLeftNum);
|
|
252
|
-
} else if (target.scrollLeft !== scrollLeftNum) {
|
|
253
|
-
// eslint-disable-next-line no-param-reassign
|
|
254
|
-
target.scrollLeft = scrollLeftNum;
|
|
255
|
-
}
|
|
256
|
-
}, []);
|
|
257
|
-
|
|
258
|
-
// 内部滚动时 纵向的滚动
|
|
259
|
-
var onBodyVerticalScroll = useCallback(function (target) {
|
|
260
|
-
if (!tableClientHeight) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
var scrollHeight = target.scrollHeight,
|
|
264
|
-
clientHeight = target.clientHeight,
|
|
265
|
-
scrollTop = target.scrollTop;
|
|
266
|
-
var currentPosToBottomGap = scrollHeight - clientHeight - scrollTop; // 当前滚动条到底部的距离
|
|
267
|
-
|
|
268
|
-
var scrollThresholdValue = getValidScrollThreshold(scrollThreshold, tableClientHeight);
|
|
269
|
-
if (currentPosToBottomGap < scrollThresholdValue && hasNextPage && !loadMoreLoading) {
|
|
270
|
-
var _ref2;
|
|
271
|
-
setLoadMoreLoading(true);
|
|
272
|
-
(_ref2 = loadMore()) === null || _ref2 === void 0 ? void 0 : _ref2.then(function () {
|
|
273
|
-
setLoadMoreLoading(false);
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
lastOffsetTopRef.current = scrollTop;
|
|
277
|
-
}, [hasNextPage, loadMore, loadMoreLoading, scrollThreshold, tableClientHeight]);
|
|
278
|
-
|
|
279
|
-
// 内部滚动 对于滚动的处理
|
|
280
|
-
var onBodyScroll = useCallback(function (e) {
|
|
281
|
-
var currentTarget = e.target;
|
|
282
|
-
if (!currentTarget) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
var scrollLeftNum = currentTarget.scrollLeft;
|
|
286
|
-
var scrollTopNum = currentTarget.scrollTop;
|
|
287
|
-
|
|
288
|
-
// 纵向滚动
|
|
289
|
-
if (scrollTopNum !== lastOffsetLeftRef.current) {
|
|
290
|
-
onBodyVerticalScroll(currentTarget);
|
|
291
|
-
}
|
|
292
|
-
if (scrollLeftNum === lastOffsetLeftRef.current) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
var compareTarget = currentTarget;
|
|
296
|
-
|
|
297
|
-
// 横向滚动
|
|
298
|
-
if (!getScrollTarget() || getScrollTarget() === compareTarget) {
|
|
299
|
-
setScrollTarget(compareTarget);
|
|
300
|
-
forceScroll(scrollLeftNum, tableBodyRef.current);
|
|
301
|
-
forceScroll(scrollLeftNum, tableHeadRef.current);
|
|
302
|
-
lastOffsetLeftRef.current = scrollLeftNum;
|
|
303
|
-
}
|
|
304
|
-
}, [forceScroll, getScrollTarget, onBodyVerticalScroll, setScrollTarget]);
|
|
305
|
-
useEffect(function () {
|
|
306
|
-
if (!hasNextPage) {
|
|
307
|
-
setLoadMoreLoading(false);
|
|
308
|
-
}
|
|
309
|
-
}, [hasNextPage]);
|
|
310
|
-
|
|
311
|
-
// 渲染有设置高度的表格
|
|
312
|
-
var renderTableWithHeight = function renderTableWithHeight() {
|
|
313
|
-
if (!tableClientWidth || !tableClientHeight) {
|
|
314
|
-
return null;
|
|
315
|
-
}
|
|
316
|
-
var renderNoHeightTableBody = function renderNoHeightTableBody() {
|
|
317
|
-
if (loading && !rows.length) {
|
|
318
|
-
return /*#__PURE__*/React.createElement(Loading, null);
|
|
319
|
-
}
|
|
320
|
-
if (!loading && !rows.length) {
|
|
321
|
-
return /*#__PURE__*/React.createElement(Empty, null);
|
|
322
|
-
}
|
|
323
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
324
|
-
style: {
|
|
325
|
-
overflow: 'auto',
|
|
326
|
-
overflowX: 'unset',
|
|
327
|
-
height: tableClientHeight - tableHeadRowHeight
|
|
328
|
-
},
|
|
329
|
-
ref: tableBodyRef,
|
|
330
|
-
onScroll: onBodyScroll
|
|
331
|
-
}, tableRowListNode, loadMoreLoading && /*#__PURE__*/React.createElement(Loading, null));
|
|
332
|
-
};
|
|
333
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
334
|
-
className: classnames("".concat(prefixCls, "-inner-wrap"), _defineProperty({}, "".concat(prefixCls, "-innerScroll"), !!height))
|
|
335
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
336
|
-
className: "".concat(prefixCls, "-tableHeadScrollWrap")
|
|
337
|
-
}, tableHeadNode), /*#__PURE__*/React.createElement("div", _extends({}, getTableBodyProps(), {
|
|
338
|
-
className: classnames("".concat(prefixCls, "-tbody"), _defineProperty({}, "".concat(prefixCls, "-tbody-innerScroll"), !!height))
|
|
339
|
-
}), renderNoHeightTableBody()));
|
|
340
|
-
};
|
|
341
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
342
|
-
key: tableKey,
|
|
343
|
-
className: prefixCls,
|
|
344
|
-
ref: tableRef,
|
|
345
|
-
style: {
|
|
346
|
-
height: !height ? 'unset' : height,
|
|
347
|
-
userSelect: canSelected ? 'auto' : 'none'
|
|
348
|
-
}
|
|
349
|
-
}, /*#__PURE__*/React.createElement(ResizeObserver, {
|
|
350
|
-
onResize: function onResize(_ref3) {
|
|
351
|
-
var clientWidth = _ref3.width,
|
|
352
|
-
clientHeight = _ref3.height;
|
|
353
|
-
setTableClientWidth(clientWidth);
|
|
354
|
-
setTableClientHeight(clientHeight);
|
|
355
|
-
}
|
|
356
|
-
}, !tableClientWidth ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null)) : /*#__PURE__*/React.createElement("div", _extends({}, getTableProps(), {
|
|
357
|
-
className: classnames("".concat(prefixCls, "-table-wrap"), (_classnames3 = {}, _defineProperty(_classnames3, "".concat(prefixCls, "-init-loading"), data.length === ZERO && loading), _defineProperty(_classnames3, "".concat(prefixCls, "-empty"), data.length === ZERO && loading), _classnames3))
|
|
358
|
-
}), height ? renderTableWithHeight() : renderTableWithoutHeight())));
|
|
359
|
-
}
|
|
360
|
-
export default /*#__PURE__*/React.forwardRef(Table);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Empty from "../../../Empty";
|
|
3
|
-
import usePrefixCls from "../../../_utils/hooks/usePrefixCls";
|
|
4
|
-
function LoadingNode() {
|
|
5
|
-
var prefixCls = usePrefixCls('', 'ald-table');
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: "".concat(prefixCls, "-empty-icon")
|
|
8
|
-
}, /*#__PURE__*/React.createElement(Empty, {
|
|
9
|
-
title: "No Data",
|
|
10
|
-
size: "large",
|
|
11
|
-
image: Empty.PRESENTED_IMAGE_DATA
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
export default LoadingNode;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Spin from "../../../Spin";
|
|
3
|
-
import usePrefixCls from "../../../_utils/hooks/usePrefixCls";
|
|
4
|
-
function LoadingNode() {
|
|
5
|
-
var prefixCls = usePrefixCls('', 'ald-table');
|
|
6
|
-
return /*#__PURE__*/React.createElement(Spin, {
|
|
7
|
-
tip: "loading"
|
|
8
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: "".concat(prefixCls, "-loading")
|
|
10
|
-
}));
|
|
11
|
-
}
|
|
12
|
-
export default LoadingNode;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
2
|
-
import { Row } from 'react-table';
|
|
3
|
-
interface ITableBodyRowListProps<T extends object> {
|
|
4
|
-
data: T[];
|
|
5
|
-
rows: Row<T>[];
|
|
6
|
-
prepareRow: (row: Row<T>) => void;
|
|
7
|
-
columnsTotalWidthRef: MutableRefObject<number>;
|
|
8
|
-
rowClassName?: string;
|
|
9
|
-
ellipsis?: boolean;
|
|
10
|
-
onRowSelected?: (row: T) => void;
|
|
11
|
-
}
|
|
12
|
-
declare function TableBodyRowList<T extends object>(props: ITableBodyRowListProps<T>): React.JSX.Element;
|
|
13
|
-
export default TableBodyRowList;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["style"];
|
|
3
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
import classnames from 'classnames';
|
|
18
|
-
import React, { useCallback, useState } from 'react';
|
|
19
|
-
import usePrefixCls from "../../../_utils/hooks/usePrefixCls";
|
|
20
|
-
import { getValidWidthByNumber } from "../../utils";
|
|
21
|
-
function TableBodyRowList(props) {
|
|
22
|
-
var _props$ellipsis = props.ellipsis,
|
|
23
|
-
ellipsis = _props$ellipsis === void 0 ? true : _props$ellipsis,
|
|
24
|
-
data = props.data,
|
|
25
|
-
rows = props.rows,
|
|
26
|
-
prepareRow = props.prepareRow,
|
|
27
|
-
columnsTotalWidthRef = props.columnsTotalWidthRef,
|
|
28
|
-
_props$rowClassName = props.rowClassName,
|
|
29
|
-
rowClassName = _props$rowClassName === void 0 ? '' : _props$rowClassName,
|
|
30
|
-
onRowSelected = props.onRowSelected;
|
|
31
|
-
var _useState = useState(null),
|
|
32
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
-
selectedRowId = _useState2[0],
|
|
34
|
-
setSelectedRowId = _useState2[1];
|
|
35
|
-
var prefixCls = usePrefixCls('', 'ald-table');
|
|
36
|
-
var onRowClick = useCallback(function (row) {
|
|
37
|
-
if (!onRowSelected) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
setSelectedRowId(row.id);
|
|
41
|
-
onRowSelected(row.original);
|
|
42
|
-
}, [onRowSelected, setSelectedRowId]);
|
|
43
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item, index) {
|
|
44
|
-
var _classnames;
|
|
45
|
-
var row = rows[index];
|
|
46
|
-
prepareRow(row);
|
|
47
|
-
var _row$getRowProps = row.getRowProps(),
|
|
48
|
-
rowStyle = _row$getRowProps.style,
|
|
49
|
-
rowProps = _objectWithoutProperties(_row$getRowProps, _excluded);
|
|
50
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, rowProps, {
|
|
51
|
-
style: _objectSpread(_objectSpread({}, rowStyle), {}, {
|
|
52
|
-
width: columnsTotalWidthRef.current
|
|
53
|
-
}),
|
|
54
|
-
className: classnames("".concat(prefixCls, "-row"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-row-selected"), row.id === selectedRowId), _defineProperty(_classnames, rowClassName, rowClassName), _defineProperty(_classnames, "".concat(prefixCls, "-row-ellipsis"), ellipsis), _classnames)),
|
|
55
|
-
onClick: function onClick() {
|
|
56
|
-
return onRowClick(row);
|
|
57
|
-
},
|
|
58
|
-
key: row.id
|
|
59
|
-
}), row.cells.map(function (cell, index) {
|
|
60
|
-
var _cell$getCellProps$st, _cell$getCellProps$st2;
|
|
61
|
-
var currentRenderWidth = Number((_cell$getCellProps$st = cell.getCellProps().style) === null || _cell$getCellProps$st === void 0 ? void 0 : (_cell$getCellProps$st2 = _cell$getCellProps$st.width) === null || _cell$getCellProps$st2 === void 0 ? void 0 : _cell$getCellProps$st2.toString().replace('px', '')); // 表格内置计算的宽度 'px'
|
|
62
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
|
63
|
-
key: index
|
|
64
|
-
}, cell.getCellProps(), {
|
|
65
|
-
className: classnames("".concat(prefixCls, "-cell")),
|
|
66
|
-
style: {
|
|
67
|
-
width: getValidWidthByNumber(currentRenderWidth)
|
|
68
|
-
}
|
|
69
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: classnames("".concat(prefixCls, "-cell-container"))
|
|
71
|
-
}, cell.render('Cell')));
|
|
72
|
-
}));
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
export default TableBodyRowList;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React, { MutableRefObject } from 'react';
|
|
2
|
-
import { HeaderGroup, SortingRule } from 'react-table';
|
|
3
|
-
import { ISort, TSortOrder } from '../../interface';
|
|
4
|
-
import { IWidthDetail } from '../../utils';
|
|
5
|
-
interface ITableWithoutHeightProps<T extends object> {
|
|
6
|
-
headerGroups: HeaderGroup<T>[];
|
|
7
|
-
canResizeColumn?: boolean;
|
|
8
|
-
defaultSort?: ISort<T>;
|
|
9
|
-
sortable?: boolean;
|
|
10
|
-
columns?: {
|
|
11
|
-
sortOrder?: TSortOrder;
|
|
12
|
-
accessor: string;
|
|
13
|
-
sorter?: boolean | 'string' | 'number' | 'basic' | 'datetime' | 'alphanumeric';
|
|
14
|
-
}[];
|
|
15
|
-
sortDirections?: Array<'ascend' | 'descend'>;
|
|
16
|
-
setSortBy: (sortBy: SortingRule<T>[]) => void;
|
|
17
|
-
onChange?: (sort: ISort<T>) => void;
|
|
18
|
-
tableHeadRef: React.Ref<HTMLDivElement>;
|
|
19
|
-
columnsWidthMapRef: MutableRefObject<Map<string, IWidthDetail> | undefined>;
|
|
20
|
-
columnsTotalWidthRef: MutableRefObject<number>;
|
|
21
|
-
}
|
|
22
|
-
declare function TableHead<T extends object>(props: ITableWithoutHeightProps<T>): React.JSX.Element;
|
|
23
|
-
export default TableHead;
|