@dtjoy/dt-design 1.0.5 → 1.0.7
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/esm/_util/easings.js +9 -0
- package/esm/_util/extendsObject.js +17 -0
- package/esm/_util/getScroll.js +32 -0
- package/esm/_util/hooks/index.js +4 -1
- package/esm/_util/hooks/useForceUpdate.js +6 -0
- package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
- package/esm/_util/hooks/useSyncState.js +20 -0
- package/esm/_util/scrollTo.js +38 -0
- package/esm/_util/warning.js +63 -0
- package/esm/blockHeader/index.js +10 -8
- package/esm/blockHeader/style/index.less +143 -143
- package/esm/button/index.js +7 -15
- package/esm/button/style/index.less +52 -127
- package/esm/button/style/mixin.less +34 -42
- package/esm/collapsible/index.js +53 -55
- package/esm/collapsibleActionItems/index.js +2 -2
- package/esm/flex/index.js +1 -1
- package/esm/flex/style/index.less +76 -76
- package/esm/flex/utils.js +1 -1
- package/esm/formList/index.js +13 -11
- package/esm/formList/style/index.less +45 -45
- package/esm/index.js +3 -1
- package/esm/overflowList/index.js +4 -3
- package/esm/resize/index.js +1 -1
- package/esm/resizeObserver/index.js +3 -2
- package/esm/splitter/Panel.js +3 -3
- package/esm/splitter/SplitBar.js +8 -7
- package/esm/splitter/Splitter.js +5 -4
- package/esm/splitter/hooks/useItems.js +2 -2
- package/esm/splitter/hooks/useResize.js +5 -5
- package/esm/statusTag/index.js +8 -8
- package/esm/style/index.less +1 -1
- package/esm/style/themes/index.less +2 -2
- package/esm/style/themes/variable.less +4 -0
- package/esm/table/InternalTable.js +429 -0
- package/esm/table/RcTable/VirtualTable.js +9 -0
- package/esm/table/RcTable/index.js +9 -0
- package/esm/table/Table.js +28 -0
- package/esm/table/TableMeasureRowContext.js +3 -0
- package/esm/table/hooks/useContainerWidth.js +14 -0
- package/esm/table/index.js +2 -0
- package/esm/table/interface.js +4 -0
- package/esm/table/style/bordered.less +141 -0
- package/esm/table/style/fixed.less +88 -0
- package/esm/table/style/index.js +2 -0
- package/esm/table/style/index.less +150 -0
- package/esm/table/style/selection.less +90 -0
- package/esm/table/style/sticky.less +55 -0
- package/esm/table/style/virtual.less +65 -0
- package/esm/table/util.js +33 -0
- package/lib/_util/easings.js +15 -0
- package/lib/_util/extendsObject.js +20 -0
- package/lib/_util/getScroll.js +39 -0
- package/lib/_util/hooks/index.js +33 -0
- package/lib/_util/hooks/useForceUpdate.js +12 -0
- package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
- package/lib/_util/hooks/useSyncState.js +19 -0
- package/lib/_util/scrollTo.js +44 -0
- package/lib/_util/warning.js +75 -0
- package/lib/blockHeader/index.js +10 -8
- package/lib/blockHeader/style/index.less +143 -143
- package/lib/button/index.js +6 -14
- package/lib/button/style/index.less +52 -127
- package/lib/button/style/mixin.less +34 -42
- package/lib/collapsible/index.js +49 -49
- package/lib/collapsibleActionItems/index.js +2 -2
- package/lib/flex/index.js +2 -2
- package/lib/flex/style/index.less +76 -76
- package/lib/flex/utils.js +2 -2
- package/lib/formList/index.js +10 -10
- package/lib/formList/style/index.less +45 -45
- package/lib/index.js +21 -2
- package/lib/overflowList/index.js +4 -3
- package/lib/resize/index.js +1 -1
- package/lib/resizeObserver/index.js +3 -2
- package/lib/splitter/Panel.js +3 -3
- package/lib/splitter/SplitBar.js +8 -7
- package/lib/splitter/Splitter.js +5 -4
- package/lib/splitter/hooks/useItems.js +2 -2
- package/lib/splitter/hooks/useResize.js +5 -5
- package/lib/statusTag/index.js +8 -8
- package/lib/style/index.less +1 -1
- package/lib/style/themes/index.less +2 -2
- package/lib/style/themes/variable.less +4 -0
- package/lib/table/InternalTable.js +395 -0
- package/lib/table/RcTable/VirtualTable.js +17 -0
- package/lib/table/RcTable/index.js +17 -0
- package/lib/table/Table.js +37 -0
- package/lib/table/TableMeasureRowContext.js +10 -0
- package/lib/table/hooks/useContainerWidth.js +20 -0
- package/lib/table/index.js +9 -0
- package/lib/table/interface.js +8 -0
- package/lib/table/style/bordered.less +141 -0
- package/lib/table/style/fixed.less +88 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.less +150 -0
- package/lib/table/style/selection.less +90 -0
- package/lib/table/style/sticky.less +55 -0
- package/lib/table/style/virtual.less +65 -0
- package/lib/table/util.js +44 -0
- package/package.json +82 -66
- package/esm/_util/gapSize.d.ts +0 -3
- package/esm/_util/hooks/index.d.ts +0 -1
- package/esm/_util/hooks/useOrientation.d.ts +0 -2
- package/esm/_util/index.d.ts +0 -3
- package/esm/_util/isNonNullable.d.ts +0 -2
- package/esm/_util/type.d.ts +0 -52
- package/esm/blockHeader/index.d.ts +0 -47
- package/esm/blockHeader/style/index.d.ts +0 -2
- package/esm/button/index.d.ts +0 -10
- package/esm/button/style/index.d.ts +0 -2
- package/esm/collapsible/index.d.ts +0 -97
- package/esm/collapsible/style/index.d.ts +0 -1
- package/esm/collapsibleActionItems/index.d.ts +0 -24
- package/esm/collapsibleActionItems/style/index.d.ts +0 -2
- package/esm/flex/index.d.ts +0 -7
- package/esm/flex/interface.d.ts +0 -16
- package/esm/flex/style/index.d.ts +0 -2
- package/esm/flex/utils.d.ts +0 -7
- package/esm/formList/index.d.ts +0 -77
- package/esm/formList/style/index.d.ts +0 -2
- package/esm/index.d.ts +0 -14
- package/esm/overflowList/index.d.ts +0 -39
- package/esm/overflowList/style/index.d.ts +0 -2
- package/esm/resize/index.d.ts +0 -8
- package/esm/resizeObserver/index.d.ts +0 -45
- package/esm/splitter/Panel.d.ts +0 -7
- package/esm/splitter/SplitBar.d.ts +0 -24
- package/esm/splitter/Splitter.d.ts +0 -5
- package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
- package/esm/splitter/hooks/useItems.d.ts +0 -14
- package/esm/splitter/hooks/useResizable.d.ts +0 -10
- package/esm/splitter/hooks/useResize.d.ts +0 -6
- package/esm/splitter/hooks/useSizes.d.ts +0 -4
- package/esm/splitter/index.d.ts +0 -8
- package/esm/splitter/interface.d.ts +0 -69
- package/esm/splitter/style/index.d.ts +0 -2
- package/esm/statusTag/index.d.ts +0 -28
- package/esm/statusTag/style/index.d.ts +0 -2
- package/esm/style/index.d.ts +0 -1
- package/lib/_util/gapSize.d.ts +0 -3
- package/lib/_util/hooks/index.d.ts +0 -1
- package/lib/_util/hooks/useOrientation.d.ts +0 -2
- package/lib/_util/index.d.ts +0 -3
- package/lib/_util/isNonNullable.d.ts +0 -2
- package/lib/_util/type.d.ts +0 -52
- package/lib/blockHeader/index.d.ts +0 -47
- package/lib/blockHeader/style/index.d.ts +0 -2
- package/lib/button/index.d.ts +0 -10
- package/lib/button/style/index.d.ts +0 -2
- package/lib/collapsible/index.d.ts +0 -97
- package/lib/collapsible/style/index.d.ts +0 -1
- package/lib/collapsibleActionItems/index.d.ts +0 -24
- package/lib/collapsibleActionItems/style/index.d.ts +0 -2
- package/lib/flex/index.d.ts +0 -7
- package/lib/flex/interface.d.ts +0 -16
- package/lib/flex/style/index.d.ts +0 -2
- package/lib/flex/utils.d.ts +0 -7
- package/lib/formList/index.d.ts +0 -77
- package/lib/formList/style/index.d.ts +0 -2
- package/lib/index.d.ts +0 -14
- package/lib/overflowList/index.d.ts +0 -39
- package/lib/overflowList/style/index.d.ts +0 -2
- package/lib/resize/index.d.ts +0 -8
- package/lib/resizeObserver/index.d.ts +0 -45
- package/lib/splitter/Panel.d.ts +0 -7
- package/lib/splitter/SplitBar.d.ts +0 -24
- package/lib/splitter/Splitter.d.ts +0 -5
- package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
- package/lib/splitter/hooks/useItems.d.ts +0 -14
- package/lib/splitter/hooks/useResizable.d.ts +0 -10
- package/lib/splitter/hooks/useResize.d.ts +0 -6
- package/lib/splitter/hooks/useSizes.d.ts +0 -4
- package/lib/splitter/index.d.ts +0 -8
- package/lib/splitter/interface.d.ts +0 -69
- package/lib/splitter/style/index.d.ts +0 -2
- package/lib/statusTag/index.d.ts +0 -28
- package/lib/statusTag/style/index.d.ts +0 -2
- package/lib/style/index.d.ts +0 -1
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { INTERNAL_HOOKS } from '@rc-component/table';
|
|
16
|
+
import { convertChildrenToColumns } from '@rc-component/table/lib/hooks/useColumns';
|
|
17
|
+
import { Pagination, Spin } from 'antd';
|
|
18
|
+
import { ConfigContext } from 'antd/lib/config-provider';
|
|
19
|
+
import defaultRenderEmpty from 'antd/lib/config-provider/defaultRenderEmpty';
|
|
20
|
+
import SizeContext from 'antd/lib/config-provider/SizeContext';
|
|
21
|
+
import useBreakpoint from 'antd/lib/grid/hooks/useBreakpoint';
|
|
22
|
+
import defaultLocale from 'antd/lib/locale/en_US';
|
|
23
|
+
import renderExpandIcon from 'antd/lib/table/ExpandIcon';
|
|
24
|
+
import useFilter, { getFilterData } from 'antd/lib/table/hooks/useFilter';
|
|
25
|
+
import useLazyKVMap from 'antd/lib/table/hooks/useLazyKVMap';
|
|
26
|
+
import usePagination, { DEFAULT_PAGE_SIZE, getPaginationParam } from 'antd/lib/table/hooks/usePagination';
|
|
27
|
+
import useSelection from 'antd/lib/table/hooks/useSelection';
|
|
28
|
+
import useSorter, { getSortData } from 'antd/lib/table/hooks/useSorter';
|
|
29
|
+
import useTitleColumns from 'antd/lib/table/hooks/useTitleColumns';
|
|
30
|
+
import clsx from 'clsx';
|
|
31
|
+
import { omit } from 'lodash-es';
|
|
32
|
+
import "./style";
|
|
33
|
+
import { useProxyImperativeHandle } from "../_util/hooks";
|
|
34
|
+
import scrollTo from "../_util/scrollTo";
|
|
35
|
+
import { devUseWarning } from "../_util/warning";
|
|
36
|
+
import useContainerWidth from "./hooks/useContainerWidth";
|
|
37
|
+
import RcTable from "./RcTable";
|
|
38
|
+
import RcVirtualTable from "./RcTable/VirtualTable";
|
|
39
|
+
var EMPTY_LIST = [];
|
|
40
|
+
var InternalTable = function InternalTable(props, ref) {
|
|
41
|
+
var customizePrefixCls = props.prefixCls,
|
|
42
|
+
className = props.className,
|
|
43
|
+
style = props.style,
|
|
44
|
+
customizeSize = props.size,
|
|
45
|
+
bordered = props.bordered,
|
|
46
|
+
customizeDropdownPrefixCls = props.dropdownPrefixCls,
|
|
47
|
+
dataSource = props.dataSource,
|
|
48
|
+
pagination = props.pagination,
|
|
49
|
+
rowSelection = props.rowSelection,
|
|
50
|
+
_props$rowKey = props.rowKey,
|
|
51
|
+
rowKey = _props$rowKey === void 0 ? 'key' : _props$rowKey,
|
|
52
|
+
rowClassName = props.rowClassName,
|
|
53
|
+
columns = props.columns,
|
|
54
|
+
children = props.children,
|
|
55
|
+
legacyChildrenColumnName = props.childrenColumnName,
|
|
56
|
+
onChange = props.onChange,
|
|
57
|
+
getPopupContainer = props.getPopupContainer,
|
|
58
|
+
loading = props.loading,
|
|
59
|
+
expandIcon = props.expandIcon,
|
|
60
|
+
expandable = props.expandable,
|
|
61
|
+
expandedRowRender = props.expandedRowRender,
|
|
62
|
+
expandIconColumnIndex = props.expandIconColumnIndex,
|
|
63
|
+
indentSize = props.indentSize,
|
|
64
|
+
scroll = props.scroll,
|
|
65
|
+
sortDirections = props.sortDirections,
|
|
66
|
+
locale = props.locale,
|
|
67
|
+
_props$showSorterTool = props.showSorterTooltip,
|
|
68
|
+
showSorterTooltip = _props$showSorterTool === void 0 ? true : _props$showSorterTool,
|
|
69
|
+
virtual = props.virtual;
|
|
70
|
+
var warning = devUseWarning('Table');
|
|
71
|
+
warning(!(typeof rowKey === 'function' && rowKey.length > 1), 'usage', '`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected.');
|
|
72
|
+
[['filterDropdownVisible', 'filterDropdownOpen'], ['onFilterDropdownVisibleChange', 'onFilterDropdownOpenChange']].forEach(function (_ref) {
|
|
73
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
74
|
+
deprecatedName = _ref2[0],
|
|
75
|
+
newName = _ref2[1];
|
|
76
|
+
warning(!(deprecatedName in props), 'usage', "`".concat(deprecatedName, "` is deprecated which will be removed in next major version.Please use `").concat(newName, "` instead. "));
|
|
77
|
+
});
|
|
78
|
+
var baseColumns = React.useMemo(function () {
|
|
79
|
+
return columns || convertChildrenToColumns(children);
|
|
80
|
+
}, [columns, children]);
|
|
81
|
+
var needResponsive = React.useMemo(function () {
|
|
82
|
+
return baseColumns.some(function (col) {
|
|
83
|
+
return col.responsive;
|
|
84
|
+
});
|
|
85
|
+
}, [baseColumns]);
|
|
86
|
+
var screens = useBreakpoint(needResponsive);
|
|
87
|
+
var mergedColumns = React.useMemo(function () {
|
|
88
|
+
var matched = new Set(Object.keys(screens).filter(function (m) {
|
|
89
|
+
return screens[m];
|
|
90
|
+
}));
|
|
91
|
+
return baseColumns.filter(function (c) {
|
|
92
|
+
return !c.responsive || c.responsive.some(function (r) {
|
|
93
|
+
return matched.has(r);
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}, [baseColumns, screens]);
|
|
97
|
+
var tableProps = omit(props, ['className', 'style', 'columns']);
|
|
98
|
+
var size = React.useContext(SizeContext);
|
|
99
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
100
|
+
_React$useContext$loc = _React$useContext.locale,
|
|
101
|
+
contextLocale = _React$useContext$loc === void 0 ? defaultLocale : _React$useContext$loc,
|
|
102
|
+
renderEmpty = _React$useContext.renderEmpty,
|
|
103
|
+
direction = _React$useContext.direction;
|
|
104
|
+
var mergedSize = customizeSize || size;
|
|
105
|
+
var tableLocale = _objectSpread(_objectSpread({}, contextLocale.Table), locale);
|
|
106
|
+
var rawData = dataSource || EMPTY_LIST;
|
|
107
|
+
var _React$useContext2 = React.useContext(ConfigContext),
|
|
108
|
+
getPrefixCls = _React$useContext2.getPrefixCls;
|
|
109
|
+
var prefixCls = getPrefixCls('table', customizePrefixCls);
|
|
110
|
+
var dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls);
|
|
111
|
+
var mergedExpandable = _objectSpread({
|
|
112
|
+
childrenColumnName: legacyChildrenColumnName,
|
|
113
|
+
expandIconColumnIndex: expandIconColumnIndex
|
|
114
|
+
}, expandable);
|
|
115
|
+
var _mergedExpandable$chi = mergedExpandable.childrenColumnName,
|
|
116
|
+
childrenColumnName = _mergedExpandable$chi === void 0 ? 'children' : _mergedExpandable$chi;
|
|
117
|
+
var expandType = React.useMemo(function () {
|
|
118
|
+
if (rawData.some(function (item) {
|
|
119
|
+
return item === null || item === void 0 ? void 0 : item[childrenColumnName];
|
|
120
|
+
})) {
|
|
121
|
+
return 'nest';
|
|
122
|
+
}
|
|
123
|
+
if (expandedRowRender || expandable && expandable.expandedRowRender) {
|
|
124
|
+
return 'row';
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}, [rawData]);
|
|
128
|
+
var internalRefs = {
|
|
129
|
+
body: React.useRef(null)
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// ============================ Width =============================
|
|
133
|
+
var getContainerWidth = useContainerWidth(prefixCls);
|
|
134
|
+
|
|
135
|
+
// ============================= Refs =============================
|
|
136
|
+
var rootRef = React.useRef(null);
|
|
137
|
+
var tblRef = React.useRef(null);
|
|
138
|
+
useProxyImperativeHandle(ref, function () {
|
|
139
|
+
return _objectSpread(_objectSpread({}, tblRef.current), {}, {
|
|
140
|
+
nativeElement: rootRef.current
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// ========================== Render ==========================
|
|
145
|
+
var TableComponent = virtual ? RcVirtualTable : RcTable;
|
|
146
|
+
|
|
147
|
+
// ============================ RowKey ============================
|
|
148
|
+
var getRowKey = React.useMemo(function () {
|
|
149
|
+
if (typeof rowKey === 'function') {
|
|
150
|
+
return rowKey;
|
|
151
|
+
}
|
|
152
|
+
return function (record) {
|
|
153
|
+
return record === null || record === void 0 ? void 0 : record[rowKey];
|
|
154
|
+
};
|
|
155
|
+
}, [rowKey]);
|
|
156
|
+
var _useLazyKVMap = useLazyKVMap(rawData, childrenColumnName, getRowKey),
|
|
157
|
+
_useLazyKVMap2 = _slicedToArray(_useLazyKVMap, 1),
|
|
158
|
+
getRecordByKey = _useLazyKVMap2[0];
|
|
159
|
+
|
|
160
|
+
// ============================ Events =============================
|
|
161
|
+
var changeEventInfo = {};
|
|
162
|
+
var triggerOnChange = function triggerOnChange(info, action) {
|
|
163
|
+
var reset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
164
|
+
var changeInfo = _objectSpread(_objectSpread({}, changeEventInfo), info);
|
|
165
|
+
if (reset) {
|
|
166
|
+
changeEventInfo.resetPagination();
|
|
167
|
+
|
|
168
|
+
// Reset event param
|
|
169
|
+
if (changeInfo.pagination.current) {
|
|
170
|
+
changeInfo.pagination.current = 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Trigger pagination events
|
|
174
|
+
if (pagination && pagination.onChange) {
|
|
175
|
+
pagination.onChange(1, changeInfo.pagination.pageSize);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (scroll && scroll.scrollToFirstRowOnChange !== false && internalRefs.body.current) {
|
|
179
|
+
scrollTo(0, {
|
|
180
|
+
getContainer: function getContainer() {
|
|
181
|
+
return internalRefs.body.current;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
onChange === null || onChange === void 0 || onChange(changeInfo.pagination, changeInfo.filters, changeInfo.sorter, {
|
|
186
|
+
currentDataSource: getFilterData(getSortData(rawData, changeInfo.sorterStates, childrenColumnName), changeInfo.filterStates),
|
|
187
|
+
action: action
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read
|
|
193
|
+
* state out and then put it back to title render. Move these code into `hooks` but still too
|
|
194
|
+
* complex. We should provides Table props like `sorter` & `filter` to handle control in next big
|
|
195
|
+
* version.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
// ============================ Sorter =============================
|
|
199
|
+
var onSorterChange = function onSorterChange(sorter, sorterStates) {
|
|
200
|
+
triggerOnChange({
|
|
201
|
+
sorter: sorter,
|
|
202
|
+
sorterStates: sorterStates
|
|
203
|
+
}, 'sort', false);
|
|
204
|
+
};
|
|
205
|
+
var _useSorter = useSorter({
|
|
206
|
+
prefixCls: prefixCls,
|
|
207
|
+
mergedColumns: mergedColumns,
|
|
208
|
+
onSorterChange: onSorterChange,
|
|
209
|
+
sortDirections: sortDirections || ['ascend', 'descend'],
|
|
210
|
+
tableLocale: tableLocale,
|
|
211
|
+
showSorterTooltip: showSorterTooltip
|
|
212
|
+
}),
|
|
213
|
+
_useSorter2 = _slicedToArray(_useSorter, 4),
|
|
214
|
+
transformSorterColumns = _useSorter2[0],
|
|
215
|
+
sortStates = _useSorter2[1],
|
|
216
|
+
sorterTitleProps = _useSorter2[2],
|
|
217
|
+
getSorters = _useSorter2[3];
|
|
218
|
+
var sortedData = React.useMemo(function () {
|
|
219
|
+
return getSortData(rawData, sortStates, childrenColumnName);
|
|
220
|
+
}, [rawData, sortStates]);
|
|
221
|
+
changeEventInfo.sorter = getSorters();
|
|
222
|
+
changeEventInfo.sorterStates = sortStates;
|
|
223
|
+
|
|
224
|
+
// ============================ Filter ============================
|
|
225
|
+
var onFilterChange = function onFilterChange(filters, filterStates) {
|
|
226
|
+
triggerOnChange({
|
|
227
|
+
filters: filters,
|
|
228
|
+
filterStates: filterStates
|
|
229
|
+
}, 'filter', true);
|
|
230
|
+
};
|
|
231
|
+
var _useFilter = useFilter({
|
|
232
|
+
prefixCls: prefixCls,
|
|
233
|
+
locale: tableLocale,
|
|
234
|
+
dropdownPrefixCls: dropdownPrefixCls,
|
|
235
|
+
mergedColumns: mergedColumns,
|
|
236
|
+
onFilterChange: onFilterChange,
|
|
237
|
+
getPopupContainer: getPopupContainer
|
|
238
|
+
}),
|
|
239
|
+
_useFilter2 = _slicedToArray(_useFilter, 3),
|
|
240
|
+
transformFilterColumns = _useFilter2[0],
|
|
241
|
+
filterStates = _useFilter2[1],
|
|
242
|
+
filters = _useFilter2[2];
|
|
243
|
+
var mergedData = getFilterData(sortedData, filterStates);
|
|
244
|
+
changeEventInfo.filters = filters;
|
|
245
|
+
changeEventInfo.filterStates = filterStates;
|
|
246
|
+
|
|
247
|
+
// ============================ Column ============================
|
|
248
|
+
var columnTitleProps = React.useMemo(function () {
|
|
249
|
+
var mergedFilters = {};
|
|
250
|
+
Object.keys(filters).forEach(function (filterKey) {
|
|
251
|
+
if (filters[filterKey] !== null) {
|
|
252
|
+
mergedFilters[filterKey] = filters[filterKey];
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
return _objectSpread(_objectSpread({}, sorterTitleProps), {}, {
|
|
256
|
+
filters: mergedFilters
|
|
257
|
+
});
|
|
258
|
+
}, [sorterTitleProps, filters]);
|
|
259
|
+
var _useTitleColumns = useTitleColumns(columnTitleProps),
|
|
260
|
+
_useTitleColumns2 = _slicedToArray(_useTitleColumns, 1),
|
|
261
|
+
transformTitleColumns = _useTitleColumns2[0];
|
|
262
|
+
|
|
263
|
+
// ========================== Pagination ==========================
|
|
264
|
+
var onPaginationChange = function onPaginationChange(current, pageSize) {
|
|
265
|
+
triggerOnChange({
|
|
266
|
+
pagination: _objectSpread(_objectSpread({}, changeEventInfo.pagination), {}, {
|
|
267
|
+
current: current,
|
|
268
|
+
pageSize: pageSize
|
|
269
|
+
})
|
|
270
|
+
}, 'paginate');
|
|
271
|
+
};
|
|
272
|
+
var _usePagination = usePagination(mergedData.length, pagination, onPaginationChange),
|
|
273
|
+
_usePagination2 = _slicedToArray(_usePagination, 2),
|
|
274
|
+
mergedPagination = _usePagination2[0],
|
|
275
|
+
resetPagination = _usePagination2[1];
|
|
276
|
+
changeEventInfo.pagination = pagination === false ? {} : getPaginationParam(pagination, mergedPagination);
|
|
277
|
+
changeEventInfo.resetPagination = resetPagination;
|
|
278
|
+
|
|
279
|
+
// ============================= Data =============================
|
|
280
|
+
var pageData = React.useMemo(function () {
|
|
281
|
+
if (pagination === false || !mergedPagination.pageSize) {
|
|
282
|
+
return mergedData;
|
|
283
|
+
}
|
|
284
|
+
var _mergedPagination$cur = mergedPagination.current,
|
|
285
|
+
current = _mergedPagination$cur === void 0 ? 1 : _mergedPagination$cur,
|
|
286
|
+
total = mergedPagination.total,
|
|
287
|
+
_mergedPagination$pag = mergedPagination.pageSize,
|
|
288
|
+
pageSize = _mergedPagination$pag === void 0 ? DEFAULT_PAGE_SIZE : _mergedPagination$pag;
|
|
289
|
+
warning(current > 0, 'usage', '`current` should be positive number.');
|
|
290
|
+
|
|
291
|
+
// Dynamic table data
|
|
292
|
+
if (mergedData.length < total) {
|
|
293
|
+
if (mergedData.length > pageSize) {
|
|
294
|
+
warning(false, 'usage', '`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode.');
|
|
295
|
+
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
296
|
+
}
|
|
297
|
+
return mergedData;
|
|
298
|
+
}
|
|
299
|
+
return mergedData.slice((current - 1) * pageSize, current * pageSize);
|
|
300
|
+
}, [!!pagination, mergedData, mergedPagination && mergedPagination.current, mergedPagination && mergedPagination.pageSize, mergedPagination && mergedPagination.total]);
|
|
301
|
+
|
|
302
|
+
// ========================== Selections ==========================
|
|
303
|
+
var _useSelection = useSelection(rowSelection, {
|
|
304
|
+
prefixCls: prefixCls,
|
|
305
|
+
data: mergedData,
|
|
306
|
+
pageData: pageData,
|
|
307
|
+
getRowKey: getRowKey,
|
|
308
|
+
getRecordByKey: getRecordByKey,
|
|
309
|
+
expandType: expandType,
|
|
310
|
+
childrenColumnName: childrenColumnName,
|
|
311
|
+
locale: tableLocale,
|
|
312
|
+
getPopupContainer: getPopupContainer
|
|
313
|
+
}),
|
|
314
|
+
_useSelection2 = _slicedToArray(_useSelection, 2),
|
|
315
|
+
transformSelectionColumns = _useSelection2[0],
|
|
316
|
+
selectedKeySet = _useSelection2[1];
|
|
317
|
+
var internalRowClassName = function internalRowClassName(record, index, indent) {
|
|
318
|
+
var mergedRowClassName;
|
|
319
|
+
if (typeof rowClassName === 'function') {
|
|
320
|
+
mergedRowClassName = clsx(rowClassName(record, index, indent));
|
|
321
|
+
} else {
|
|
322
|
+
mergedRowClassName = clsx(rowClassName);
|
|
323
|
+
}
|
|
324
|
+
return clsx(_defineProperty({}, "".concat(prefixCls, "-row-selected"), selectedKeySet.has(getRowKey(record, index))), mergedRowClassName);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
// ========================== Expandable ==========================
|
|
328
|
+
|
|
329
|
+
// Pass origin render status into `rc-table`, this can be removed when refactor with `rc-table`
|
|
330
|
+
mergedExpandable.__PARENT_RENDER_ICON__ = mergedExpandable.expandIcon;
|
|
331
|
+
|
|
332
|
+
// Customize expandable icon
|
|
333
|
+
mergedExpandable.expandIcon = mergedExpandable.expandIcon || expandIcon || renderExpandIcon(tableLocale);
|
|
334
|
+
|
|
335
|
+
// Adjust expand icon index, no overwrite expandIconColumnIndex if set.
|
|
336
|
+
if (expandType === 'nest' && mergedExpandable.expandIconColumnIndex === undefined) {
|
|
337
|
+
mergedExpandable.expandIconColumnIndex = rowSelection ? 1 : 0;
|
|
338
|
+
} else if (mergedExpandable.expandIconColumnIndex > 0 && rowSelection) {
|
|
339
|
+
mergedExpandable.expandIconColumnIndex -= 1;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// Indent size
|
|
343
|
+
if (typeof mergedExpandable.indentSize !== 'number') {
|
|
344
|
+
mergedExpandable.indentSize = typeof indentSize === 'number' ? indentSize : 15;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// ============================ Render ============================
|
|
348
|
+
var transformColumns = React.useCallback(function (innerColumns) {
|
|
349
|
+
return transformTitleColumns(transformSelectionColumns(transformFilterColumns(transformSorterColumns(innerColumns))));
|
|
350
|
+
}, [transformSorterColumns, transformFilterColumns, transformSelectionColumns]);
|
|
351
|
+
var topPaginationNode;
|
|
352
|
+
var bottomPaginationNode;
|
|
353
|
+
if (pagination !== false && mergedPagination !== null && mergedPagination !== void 0 && mergedPagination.total) {
|
|
354
|
+
var paginationSize;
|
|
355
|
+
if (mergedPagination.size) {
|
|
356
|
+
paginationSize = mergedPagination.size;
|
|
357
|
+
} else {
|
|
358
|
+
paginationSize = mergedSize === 'small' || mergedSize === 'middle' ? 'small' : undefined;
|
|
359
|
+
}
|
|
360
|
+
var renderPagination = function renderPagination(position) {
|
|
361
|
+
return /*#__PURE__*/React.createElement(Pagination, _extends({}, mergedPagination, {
|
|
362
|
+
className: clsx("".concat(prefixCls, "-pagination ").concat(prefixCls, "-pagination-").concat(position), mergedPagination.className),
|
|
363
|
+
size: paginationSize
|
|
364
|
+
}));
|
|
365
|
+
};
|
|
366
|
+
var defaultPosition = direction === 'rtl' ? 'left' : 'right';
|
|
367
|
+
var position = mergedPagination.position;
|
|
368
|
+
if (position !== null && Array.isArray(position)) {
|
|
369
|
+
var topPos = position.find(function (p) {
|
|
370
|
+
return p.includes('top');
|
|
371
|
+
});
|
|
372
|
+
var bottomPos = position.find(function (p) {
|
|
373
|
+
return p.includes('bottom');
|
|
374
|
+
});
|
|
375
|
+
var isDisable = position.every(function (p) {
|
|
376
|
+
return "".concat(p) === 'none';
|
|
377
|
+
});
|
|
378
|
+
if (!topPos && !bottomPos && !isDisable) {
|
|
379
|
+
bottomPaginationNode = renderPagination(defaultPosition);
|
|
380
|
+
}
|
|
381
|
+
if (topPos) {
|
|
382
|
+
topPaginationNode = renderPagination(topPos.toLowerCase().replace('top', ''));
|
|
383
|
+
}
|
|
384
|
+
if (bottomPos) {
|
|
385
|
+
bottomPaginationNode = renderPagination(bottomPos.toLowerCase().replace('bottom', ''));
|
|
386
|
+
}
|
|
387
|
+
} else {
|
|
388
|
+
bottomPaginationNode = renderPagination(defaultPosition);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// >>>>>>>>> Spinning
|
|
393
|
+
var spinProps;
|
|
394
|
+
if (typeof loading === 'boolean') {
|
|
395
|
+
spinProps = {
|
|
396
|
+
spinning: loading
|
|
397
|
+
};
|
|
398
|
+
} else if (_typeof(loading) === 'object') {
|
|
399
|
+
spinProps = _objectSpread({
|
|
400
|
+
spinning: true
|
|
401
|
+
}, loading);
|
|
402
|
+
}
|
|
403
|
+
var wrapperClassNames = clsx("".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-wrapper-rtl"), direction === 'rtl'), className);
|
|
404
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
405
|
+
ref: rootRef,
|
|
406
|
+
className: wrapperClassNames,
|
|
407
|
+
style: style
|
|
408
|
+
}, /*#__PURE__*/React.createElement(Spin, _extends({
|
|
409
|
+
spinning: false
|
|
410
|
+
}, spinProps), topPaginationNode, /*#__PURE__*/React.createElement(TableComponent, _extends({}, tableProps, {
|
|
411
|
+
ref: tblRef,
|
|
412
|
+
columns: mergedColumns,
|
|
413
|
+
direction: direction,
|
|
414
|
+
expandable: mergedExpandable,
|
|
415
|
+
prefixCls: prefixCls,
|
|
416
|
+
className: clsx(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-middle"), mergedSize === 'middle'), "".concat(prefixCls, "-small"), mergedSize === 'small'), "".concat(prefixCls, "-bordered"), bordered), "".concat(prefixCls, "-empty"), rawData.length === 0)),
|
|
417
|
+
data: pageData,
|
|
418
|
+
rowKey: getRowKey,
|
|
419
|
+
rowClassName: internalRowClassName,
|
|
420
|
+
emptyText: locale && locale.emptyText || (renderEmpty || defaultRenderEmpty)('Table')
|
|
421
|
+
// Internal
|
|
422
|
+
,
|
|
423
|
+
internalHooks: INTERNAL_HOOKS,
|
|
424
|
+
internalRefs: internalRefs,
|
|
425
|
+
transformColumns: transformColumns,
|
|
426
|
+
getContainerWidth: getContainerWidth
|
|
427
|
+
})), bottomPaginationNode));
|
|
428
|
+
};
|
|
429
|
+
export default /*#__PURE__*/React.forwardRef(InternalTable);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { genVirtualTable } from '@rc-component/table';
|
|
2
|
+
var RcVirtualTable = genVirtualTable(function (prev, next) {
|
|
3
|
+
var _ref = prev,
|
|
4
|
+
prevRenderTimes = _ref._renderTimes;
|
|
5
|
+
var _ref2 = next,
|
|
6
|
+
nextRenderTimes = _ref2._renderTimes;
|
|
7
|
+
return prevRenderTimes !== nextRenderTimes;
|
|
8
|
+
});
|
|
9
|
+
export default RcVirtualTable;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { genTable } from '@rc-component/table';
|
|
2
|
+
var RcTable = genTable(function (prev, next) {
|
|
3
|
+
var _ref = prev,
|
|
4
|
+
prevRenderTimes = _ref._renderTimes;
|
|
5
|
+
var _ref2 = next,
|
|
6
|
+
nextRenderTimes = _ref2._renderTimes;
|
|
7
|
+
return prevRenderTimes !== nextRenderTimes;
|
|
8
|
+
});
|
|
9
|
+
export default RcTable;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { EXPAND_COLUMN, Summary } from '@rc-component/table';
|
|
4
|
+
import Column from 'antd/lib/table/Column';
|
|
5
|
+
import ColumnGroup from 'antd/lib/table/ColumnGroup';
|
|
6
|
+
import { SELECTION_ALL, SELECTION_COLUMN, SELECTION_INVERT, SELECTION_NONE } from 'antd/lib/table/hooks/useSelection';
|
|
7
|
+
import InternalTable from "./InternalTable";
|
|
8
|
+
var Table = function Table(props, ref) {
|
|
9
|
+
var renderTimesRef = React.useRef(0);
|
|
10
|
+
renderTimesRef.current += 1;
|
|
11
|
+
return /*#__PURE__*/React.createElement(InternalTable, _extends({}, props, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
_renderTimes: renderTimesRef.current
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
var ForwardTable = /*#__PURE__*/React.forwardRef(Table);
|
|
17
|
+
ForwardTable.SELECTION_COLUMN = SELECTION_COLUMN;
|
|
18
|
+
ForwardTable.EXPAND_COLUMN = EXPAND_COLUMN;
|
|
19
|
+
ForwardTable.SELECTION_ALL = SELECTION_ALL;
|
|
20
|
+
ForwardTable.SELECTION_INVERT = SELECTION_INVERT;
|
|
21
|
+
ForwardTable.SELECTION_NONE = SELECTION_NONE;
|
|
22
|
+
ForwardTable.Column = Column;
|
|
23
|
+
ForwardTable.ColumnGroup = ColumnGroup;
|
|
24
|
+
ForwardTable.Summary = Summary;
|
|
25
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
26
|
+
ForwardTable.displayName = 'Table';
|
|
27
|
+
}
|
|
28
|
+
export default ForwardTable;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default function useContainerWidth(prefixCls) {
|
|
2
|
+
var getContainerWidth = function getContainerWidth(ele, width) {
|
|
3
|
+
var container = ele.querySelector(".".concat(prefixCls, "-container"));
|
|
4
|
+
var returnWidth = width;
|
|
5
|
+
if (container) {
|
|
6
|
+
var style = getComputedStyle(container);
|
|
7
|
+
var borderLeft = Number.parseInt(style.borderLeftWidth, 10);
|
|
8
|
+
var borderRight = Number.parseInt(style.borderRightWidth, 10);
|
|
9
|
+
returnWidth = width - borderLeft - borderRight;
|
|
10
|
+
}
|
|
11
|
+
return returnWidth;
|
|
12
|
+
};
|
|
13
|
+
return getContainerWidth;
|
|
14
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
@import '../../style/themes/index.less';
|
|
2
|
+
|
|
3
|
+
@table-prefix-cls: ~'@{ant-prefix}-table';
|
|
4
|
+
|
|
5
|
+
.@{table-prefix-cls}-wrapper {
|
|
6
|
+
.@{table-prefix-cls}.@{table-prefix-cls}-bordered {
|
|
7
|
+
// ============================ Title 标题 =============================
|
|
8
|
+
> .@{table-prefix-cls}-title {
|
|
9
|
+
border: @border-width-base @border-style-base @border-color-base;
|
|
10
|
+
border-bottom: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// ============================ Content 内容容器 ============================
|
|
14
|
+
> .@{table-prefix-cls}-container {
|
|
15
|
+
border-left: @border-width-base @border-style-base @border-color-base;
|
|
16
|
+
border-top: @border-width-base @border-style-base @border-color-base;
|
|
17
|
+
|
|
18
|
+
> .@{table-prefix-cls}-content,
|
|
19
|
+
> .@{table-prefix-cls}-header,
|
|
20
|
+
> .@{table-prefix-cls}-body,
|
|
21
|
+
> .@{table-prefix-cls}-summary {
|
|
22
|
+
> table {
|
|
23
|
+
// ============================= Cell 单元格 =============================
|
|
24
|
+
> thead > tr > th,
|
|
25
|
+
> thead > tr > td,
|
|
26
|
+
> tbody > tr > th,
|
|
27
|
+
> tbody > tr > td,
|
|
28
|
+
> tfoot > tr > th,
|
|
29
|
+
> tfoot > tr > td {
|
|
30
|
+
border-right: @border-width-base @border-style-base @border-color-base;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// ============================ Header 表头 ============================
|
|
34
|
+
> thead {
|
|
35
|
+
> tr:not(:last-child) > th {
|
|
36
|
+
border-bottom: @border-width-base @border-style-base @border-color-base;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
> tr > th::before {
|
|
40
|
+
background-color: transparent !important;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
> thead > tr,
|
|
45
|
+
> tbody > tr,
|
|
46
|
+
> tfoot > tr {
|
|
47
|
+
> .@{table-prefix-cls}-cell-fix-right-first::after {
|
|
48
|
+
border-right: @border-width-base @border-style-base @border-color-base;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ========================== Expandable 展开行 ==========================
|
|
53
|
+
> tbody > tr > th,
|
|
54
|
+
> tbody > tr > td {
|
|
55
|
+
> .@{table-prefix-cls}-expanded-row-fixed {
|
|
56
|
+
// margin: calc(-@table-cell-padding-vertical)
|
|
57
|
+
// calc(-(@table-cell-padding-horizontal + @border-width-base));
|
|
58
|
+
&::after {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 0;
|
|
61
|
+
right: @border-width-base;
|
|
62
|
+
bottom: 0;
|
|
63
|
+
border-right: @border-width-base @border-style-base @border-color-base;
|
|
64
|
+
content: '';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ============================ Scroll 水平滚动 ============================
|
|
73
|
+
&.@{table-prefix-cls}-scroll-horizontal {
|
|
74
|
+
> .@{table-prefix-cls}-container > .@{table-prefix-cls}-body {
|
|
75
|
+
> table > tbody {
|
|
76
|
+
> tr.@{table-prefix-cls}-expanded-row,
|
|
77
|
+
> tr.@{table-prefix-cls}-placeholder {
|
|
78
|
+
> th,
|
|
79
|
+
> td {
|
|
80
|
+
border-right: 0;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ============================ Size 尺寸样式(middle/small) ============================
|
|
88
|
+
&.@{table-prefix-cls}-middle {
|
|
89
|
+
> .@{table-prefix-cls}-container {
|
|
90
|
+
> .@{table-prefix-cls}-content,
|
|
91
|
+
> .@{table-prefix-cls}-body {
|
|
92
|
+
> table > tbody > tr > th,
|
|
93
|
+
> table > tbody > tr > td {
|
|
94
|
+
> .@{table-prefix-cls}-expanded-row-fixed {
|
|
95
|
+
// margin: calc(-@table-cell-padding-vertical-middle)
|
|
96
|
+
// calc(-(@table-cell-padding-horizontal-middle + @border-width-base));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// small尺寸(对应原getSizeBorderStyle('small'))
|
|
104
|
+
&.@{table-prefix-cls}-small {
|
|
105
|
+
> .@{table-prefix-cls}-container {
|
|
106
|
+
> .@{table-prefix-cls}-content,
|
|
107
|
+
> .@{table-prefix-cls}-body {
|
|
108
|
+
> table > tbody > tr > th,
|
|
109
|
+
> table > tbody > tr > td {
|
|
110
|
+
> .@{table-prefix-cls}-expanded-row-fixed {
|
|
111
|
+
// margin: calc(-@table-cell-padding-vertical-small)
|
|
112
|
+
// calc(-(@table-cell-padding-horizontal-small + @border-width-base));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ============================ Footer 页脚 ============================
|
|
120
|
+
> .@{table-prefix-cls}-footer {
|
|
121
|
+
border: @border-width-base @border-style-base @border-color-base;
|
|
122
|
+
border-top: 0;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ============================ Nested 嵌套表格 ============================
|
|
127
|
+
.@{table-prefix-cls}-cell {
|
|
128
|
+
> .@{table-prefix-cls}-container:first-child {
|
|
129
|
+
border-top: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&-scrollbar:not([rowspan]) {
|
|
133
|
+
// box-shadow: 0 @border-width-base 0 @border-width-base @table-header-background;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 边框表格滚动条右侧边框
|
|
138
|
+
.@{table-prefix-cls}-bordered .@{table-prefix-cls}-cell-scrollbar {
|
|
139
|
+
border-right: @border-width-base @border-style-base @border-color-base;
|
|
140
|
+
}
|
|
141
|
+
}
|