@kdcloudjs/table 1.2.2-canary.17 → 1.2.2-canary.19
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/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +3628 -3146
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +11 -19
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/_utils/formatUtil.js +1 -5
- package/es/_utils/hooks.js +3 -3
- package/es/_utils/usePopper.js +26 -26
- package/es/locale/locale.js +6 -7
- package/es/table/base/calculations.js +3 -3
- package/es/table/base/empty.js +2 -2
- package/es/table/base/globalStyleComponent.js +6 -8
- package/es/table/base/header.js +15 -13
- package/es/table/base/helpers/FastScrollManager.js +1 -2
- package/es/table/base/helpers/SpanManager.js +1 -2
- package/es/table/base/helpers/TableDOMUtils.js +5 -6
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +2 -2
- package/es/table/base/html-table.js +16 -8
- package/es/table/base/loading.js +2 -2
- package/es/table/base/renderTemplates.js +17 -19
- package/es/table/base/styles.js +8 -4
- package/es/table/base/table.d.ts +1 -0
- package/es/table/base/table.js +22 -23
- package/es/table/base/utils.js +3 -3
- package/es/table/interfaces.d.ts +19 -0
- package/es/table/internals.d.ts +2 -1
- package/es/table/pipeline/features/columnDrag.js +21 -2
- package/es/table/pipeline/features/columnFilter.js +1 -3
- package/es/table/pipeline/features/columnHover.js +16 -11
- package/es/table/pipeline/features/columnRangeHover.js +18 -17
- package/es/table/pipeline/features/columnResizeWidth.js +2 -2
- package/es/table/pipeline/features/contextMenu.js +4 -6
- package/es/table/pipeline/features/featureApi/RowDragApi.js +1 -2
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +4 -5
- package/es/table/pipeline/features/filter/Filter.js +2 -3
- package/es/table/pipeline/features/mergeCellHover.js +21 -15
- package/es/table/pipeline/features/multiSelect.d.ts +3 -1
- package/es/table/pipeline/features/multiSelect.js +38 -15
- package/es/table/pipeline/features/rangeSelection.js +12 -10
- package/es/table/pipeline/features/rowDetail.js +5 -3
- package/es/table/pipeline/features/rowDrag.js +2 -3
- package/es/table/pipeline/features/rowGrouping.js +9 -8
- package/es/table/pipeline/features/singleSelect.d.ts +3 -1
- package/es/table/pipeline/features/singleSelect.js +35 -11
- package/es/table/pipeline/features/sort.js +6 -7
- package/es/table/pipeline/features/tips.js +4 -4
- package/es/table/pipeline/features/treeMode.js +5 -5
- package/es/table/pipeline/features/treeSelect.js +2 -2
- package/es/table/pipeline/pipeline.js +1 -2
- package/es/table/pivot/cross-table/buildCrossTable.js +6 -8
- package/es/table/pivot/cross-table/cross-table.js +1 -3
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +8 -10
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +8 -11
- package/es/table/pivot/pivot-utils/builders.js +3 -3
- package/es/table/pivot/pivot-utils/convert-utils.js +3 -3
- package/es/table/transforms/autoWidth.js +3 -3
- package/es/table/transforms/columnResize.js +3 -5
- package/es/table/transforms/sort.js +6 -8
- package/es/table/transforms/tips.js +4 -4
- package/es/table/transforms/treeMode.js +10 -12
- package/es/table/utils/buildTree.js +3 -3
- package/es/table/utils/collectNodes.js +3 -3
- package/es/table/utils/exportTableAsExcel.js +3 -3
- package/es/table/utils/getTreeDepth.js +7 -4
- package/es/table/utils/groupBy.js +3 -3
- package/es/table/utils/makeRecursiveMapper.js +3 -3
- package/es/table/utils/mergeCellProps.js +0 -1
- package/es/table/utils/others.js +3 -3
- package/es/table/utils/traverseColumn.js +3 -3
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +7 -8
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +4 -5
- package/lib/_utils/arrayUtil.js +2 -3
- package/lib/_utils/formatUtil.js +1 -5
- package/lib/_utils/hooks.js +3 -3
- package/lib/_utils/index.js +2 -3
- package/lib/_utils/type.js +3 -5
- package/lib/_utils/usePopper.js +30 -34
- package/lib/config-provider/ConfigContext.js +1 -2
- package/lib/config-provider/compDefaultProps.js +1 -2
- package/lib/config-provider/configProvider.js +2 -4
- package/lib/config-provider/defaultConfig.js +1 -2
- package/lib/config-provider/index.js +1 -2
- package/lib/locale/index.js +2 -4
- package/lib/locale/locale.js +10 -14
- package/lib/locale/zh-CN.js +1 -2
- package/lib/table/base/BlankComponent.js +4 -7
- package/lib/table/base/calculations.js +3 -3
- package/lib/table/base/empty.js +3 -4
- package/lib/table/base/globalStyleComponent.js +9 -13
- package/lib/table/base/header.js +15 -13
- package/lib/table/base/helpers/FastScrollManager.js +3 -5
- package/lib/table/base/helpers/SpanManager.js +3 -5
- package/lib/table/base/helpers/TableDOMUtils.js +7 -9
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +2 -2
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +1 -2
- package/lib/table/base/html-table.js +16 -8
- package/lib/table/base/loading.js +2 -2
- package/lib/table/base/renderTemplates.js +18 -21
- package/lib/table/base/styles.js +16 -21
- package/lib/table/base/table.d.ts +1 -0
- package/lib/table/base/table.js +33 -34
- package/lib/table/base/utils.js +13 -22
- package/lib/table/common-views.js +4 -8
- package/lib/table/interfaces.d.ts +19 -0
- package/lib/table/internals.d.ts +2 -1
- package/lib/table/internals.js +2 -3
- package/lib/table/pipeline/const.js +2 -3
- package/lib/table/pipeline/features/autoFill.js +3 -6
- package/lib/table/pipeline/features/colGroupExtendable.js +2 -3
- package/lib/table/pipeline/features/columnDrag.js +21 -2
- package/lib/table/pipeline/features/columnFilter.js +1 -3
- package/lib/table/pipeline/features/columnHover.js +16 -11
- package/lib/table/pipeline/features/columnRangeHover.js +18 -17
- package/lib/table/pipeline/features/columnResizeWidth.js +6 -10
- package/lib/table/pipeline/features/contextMenu.js +5 -8
- package/lib/table/pipeline/features/featureApi/RowDragApi.js +3 -5
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +6 -9
- package/lib/table/pipeline/features/filter/Filter.js +4 -7
- package/lib/table/pipeline/features/filter/FilterPanel.js +2 -4
- package/lib/table/pipeline/features/filter/util.js +2 -3
- package/lib/table/pipeline/features/footerDataSource.js +1 -2
- package/lib/table/pipeline/features/mergeCellHover.js +21 -15
- package/lib/table/pipeline/features/multiSelect.d.ts +3 -1
- package/lib/table/pipeline/features/multiSelect.js +38 -15
- package/lib/table/pipeline/features/rangeSelection.js +14 -14
- package/lib/table/pipeline/features/rowDetail.js +5 -3
- package/lib/table/pipeline/features/rowDrag.js +5 -9
- package/lib/table/pipeline/features/rowGrouping.js +9 -8
- package/lib/table/pipeline/features/singleSelect.d.ts +3 -1
- package/lib/table/pipeline/features/singleSelect.js +35 -11
- package/lib/table/pipeline/features/sort.js +6 -7
- package/lib/table/pipeline/features/tips.js +4 -4
- package/lib/table/pipeline/features/treeMode.js +7 -9
- package/lib/table/pipeline/features/treeSelect.js +2 -2
- package/lib/table/pipeline/index.js +1 -2
- package/lib/table/pipeline/pipeline.js +2 -4
- package/lib/table/pivot/cross-table/buildCrossTable.js +6 -8
- package/lib/table/pivot/cross-table/constants.js +1 -2
- package/lib/table/pivot/cross-table/cross-table.js +3 -6
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +8 -10
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +9 -13
- package/lib/table/pivot/pivot-utils/builders.js +3 -3
- package/lib/table/pivot/pivot-utils/convert-utils.js +3 -3
- package/lib/table/transforms/autoWidth.js +4 -5
- package/lib/table/transforms/columnResize.js +4 -7
- package/lib/table/transforms/sort.js +7 -10
- package/lib/table/transforms/tips.js +4 -4
- package/lib/table/transforms/treeMode.js +11 -14
- package/lib/table/use/useResizeObserver.js +1 -2
- package/lib/table/utils/browserType.js +2 -4
- package/lib/table/utils/buildTree.js +3 -3
- package/lib/table/utils/collectNodes.js +3 -3
- package/lib/table/utils/console.js +2 -3
- package/lib/table/utils/copyToClipboard.js +1 -2
- package/lib/table/utils/exportTableAsExcel.js +3 -3
- package/lib/table/utils/getTreeDepth.js +7 -4
- package/lib/table/utils/groupBy.js +3 -3
- package/lib/table/utils/keyCode.js +1 -2
- package/lib/table/utils/makeRecursiveMapper.js +3 -3
- package/lib/table/utils/mergeCellProps.js +0 -1
- package/lib/table/utils/others.js +4 -5
- package/lib/table/utils/proto.js +1 -2
- package/lib/table/utils/selectColumn.js +2 -4
- package/lib/table/utils/traverseColumn.js +3 -3
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +9 -11
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +6 -8
- package/package.json +1 -1
- package/CHANGELOG.md +0 -0
package/es/_utils/formatUtil.js
CHANGED
|
@@ -5,9 +5,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
5
5
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
6
6
|
var __rest = this && this.__rest || function (s, e) {
|
|
7
7
|
var t = {};
|
|
8
|
-
for (var p in s)
|
|
9
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10
|
-
}
|
|
8
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11
9
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
12
10
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
13
11
|
}
|
|
@@ -107,7 +105,6 @@ export function formatNumber(num, formatParams) {
|
|
|
107
105
|
floatNum = Math.abs(floatNum);
|
|
108
106
|
numInfo.numStr = _sliceInstanceProperty(_context3 = numInfo.numStr).call(_context3, 1); // 去除第一个负号
|
|
109
107
|
}
|
|
110
|
-
|
|
111
108
|
var numStrArr = numInfo.numStr.split('.');
|
|
112
109
|
numInfo.intStr = numStrArr[0];
|
|
113
110
|
numInfo.decimalStr = numStrArr[1] || '';
|
|
@@ -180,7 +177,6 @@ export function formatEditNumber(num, _ref) {
|
|
|
180
177
|
floatNum = Math.abs(floatNum);
|
|
181
178
|
numInfo.numStr = _sliceInstanceProperty(_context4 = numInfo.numStr).call(_context4, 1); // 去除第一个负号
|
|
182
179
|
}
|
|
183
|
-
|
|
184
180
|
var numStrArr = numInfo.numStr.split('.');
|
|
185
181
|
numInfo.intStr = numStrArr[0];
|
|
186
182
|
numInfo.decimalStr = numStrArr[1] || '';
|
package/es/_utils/hooks.js
CHANGED
|
@@ -4,9 +4,9 @@ import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
6
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
7
|
-
function _createForOfIteratorHelper(
|
|
8
|
-
function _unsupportedIterableToArray(
|
|
9
|
-
function _arrayLikeToArray(
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context = {}.toString.call(r)).call(_context, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
10
|
import { useEffect, useState, useRef } from 'react';
|
|
11
11
|
import ResizeObserver from 'resize-observer-polyfill';
|
|
12
12
|
import devWarning from './devwarning';
|
package/es/_utils/usePopper.js
CHANGED
|
@@ -13,25 +13,25 @@ import devWarning from '../_utils/devwarning';
|
|
|
13
13
|
import { useResizeObserver } from '../_utils/hooks';
|
|
14
14
|
export var Placements = tuple('top', 'left', 'right', 'bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight', 'leftTop', 'leftBottom', 'rightTop', 'rightBottom');
|
|
15
15
|
export var Triggers = tuple('hover', 'focus', 'click', 'contextMenu');
|
|
16
|
-
var
|
|
16
|
+
var _getOffsetPos = function getOffsetPos(el) {
|
|
17
17
|
var elPos = {
|
|
18
18
|
top: el.offsetTop,
|
|
19
19
|
left: el.offsetLeft
|
|
20
20
|
};
|
|
21
21
|
if (el.offsetParent) {
|
|
22
|
-
var parentPos =
|
|
22
|
+
var parentPos = _getOffsetPos(el.offsetParent);
|
|
23
23
|
elPos.top += parentPos.top;
|
|
24
24
|
elPos.left += parentPos.left;
|
|
25
25
|
}
|
|
26
26
|
return elPos;
|
|
27
27
|
};
|
|
28
|
-
var
|
|
28
|
+
var _getScrollDist = function getScrollDist(el) {
|
|
29
29
|
var elScroll = {
|
|
30
30
|
top: el.scrollTop,
|
|
31
31
|
left: el.scrollLeft
|
|
32
32
|
};
|
|
33
33
|
if (el.parentElement && el.parentElement !== document.body) {
|
|
34
|
-
var parentScroll =
|
|
34
|
+
var parentScroll = _getScrollDist(el.parentElement);
|
|
35
35
|
elScroll.top += parentScroll.top;
|
|
36
36
|
elScroll.left += parentScroll.left;
|
|
37
37
|
}
|
|
@@ -128,21 +128,21 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
128
128
|
setVisible(!!props.visible);
|
|
129
129
|
}, [props.visible]);
|
|
130
130
|
var _useState9 = useState(''),
|
|
131
|
-
|
|
132
|
-
evType =
|
|
133
|
-
setEvType =
|
|
134
|
-
var
|
|
131
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
132
|
+
evType = _useState0[0],
|
|
133
|
+
setEvType = _useState0[1];
|
|
134
|
+
var _useState1 = useState(!!props.visible || defaultVisible),
|
|
135
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
136
|
+
canAlign = _useState10[0],
|
|
137
|
+
setCanAlign = _useState10[1];
|
|
138
|
+
var _useState11 = useState(initAlign),
|
|
135
139
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _useState13 = useState(
|
|
140
|
+
align = _useState12[0],
|
|
141
|
+
setAlign = _useState12[1];
|
|
142
|
+
var _useState13 = useState(placement),
|
|
139
143
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
var _useState15 = useState(placement),
|
|
143
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
144
|
-
currentPlacement = _useState16[0],
|
|
145
|
-
setCurrentPlacement = _useState16[1];
|
|
144
|
+
currentPlacement = _useState14[0],
|
|
145
|
+
setCurrentPlacement = _useState14[1];
|
|
146
146
|
var alignPopper = useCallback(function () {
|
|
147
147
|
if ((locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current) && (popperRef === null || popperRef === void 0 ? void 0 : popperRef.current) && evType) {
|
|
148
148
|
var _popperRef$current$ge = popperRef.current.getBoundingClientRect(),
|
|
@@ -155,15 +155,15 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
155
155
|
right = _locatorRef$current$g.right,
|
|
156
156
|
height = _locatorRef$current$g.height,
|
|
157
157
|
width = _locatorRef$current$g.width;
|
|
158
|
-
var
|
|
159
|
-
containerTop =
|
|
160
|
-
containerLeft =
|
|
161
|
-
var
|
|
162
|
-
locatorTop =
|
|
163
|
-
locatorLeft =
|
|
164
|
-
var
|
|
165
|
-
scrollTop =
|
|
166
|
-
scrollLeft =
|
|
158
|
+
var _getOffsetPos2 = _getOffsetPos(container),
|
|
159
|
+
containerTop = _getOffsetPos2.top,
|
|
160
|
+
containerLeft = _getOffsetPos2.left;
|
|
161
|
+
var _getOffsetPos3 = _getOffsetPos(locatorRef.current),
|
|
162
|
+
locatorTop = _getOffsetPos3.top,
|
|
163
|
+
locatorLeft = _getOffsetPos3.left;
|
|
164
|
+
var _getScrollDist2 = _getScrollDist(locatorRef.current),
|
|
165
|
+
scrollTop = _getScrollDist2.top,
|
|
166
|
+
scrollLeft = _getScrollDist2.left;
|
|
167
167
|
var locatorPos = {
|
|
168
168
|
width: width,
|
|
169
169
|
height: height,
|
package/es/locale/locale.js
CHANGED
|
@@ -2,9 +2,9 @@ import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
3
3
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
4
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
-
function _createForOfIteratorHelper(
|
|
6
|
-
function _unsupportedIterableToArray(
|
|
7
|
-
function _arrayLikeToArray(
|
|
5
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
6
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context2; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context2 = {}.toString.call(r)).call(_context2, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
8
8
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
9
9
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
10
10
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
@@ -23,7 +23,7 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
23
23
|
* @param {LocaleDataType | string} localeData 语言数据集合 | 语言类型
|
|
24
24
|
* @returns 设置后的语言对应的语言包
|
|
25
25
|
*/
|
|
26
|
-
_createClass(LocaleCache, [{
|
|
26
|
+
return _createClass(LocaleCache, [{
|
|
27
27
|
key: "setLocalesData",
|
|
28
28
|
value: function setLocalesData(locale, localeData) {
|
|
29
29
|
var newLocaleData = localeData || this.localesData[locale];
|
|
@@ -60,7 +60,6 @@ var LocaleCache = /*#__PURE__*/function () {
|
|
|
60
60
|
return this.localesData;
|
|
61
61
|
}
|
|
62
62
|
}]);
|
|
63
|
-
return LocaleCache;
|
|
64
63
|
}();
|
|
65
64
|
var localeCacher = new LocaleCache(_defineProperty({}, zhCNData.locale, zhCNData));
|
|
66
65
|
export default localeCacher;
|
|
@@ -174,11 +173,11 @@ function formatElement(msg, variables) {
|
|
|
174
173
|
var t = item.t,
|
|
175
174
|
v = item.v;
|
|
176
175
|
if (t === 0 && v !== '') {
|
|
177
|
-
elements.push(
|
|
176
|
+
elements.push(/*#__PURE__*/React.createElement("span", {
|
|
178
177
|
key: index
|
|
179
178
|
}, v));
|
|
180
179
|
} else if (t === 1) {
|
|
181
|
-
elements.push(
|
|
180
|
+
elements.push(/*#__PURE__*/React.cloneElement(variables[v], {
|
|
182
181
|
key: index
|
|
183
182
|
}));
|
|
184
183
|
}
|
|
@@ -10,9 +10,9 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
10
10
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
11
11
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
12
12
|
import _Map from "@babel/runtime-corejs3/core-js-stable/map";
|
|
13
|
-
function _createForOfIteratorHelper(
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context0; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context0 = {}.toString.call(r)).call(_context0, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
16
|
import { collectNodes, isLeafNode, console } from '../utils';
|
|
17
17
|
import { AUTO_VIRTUAL_THRESHOLD, OVERSCAN_SIZE, sum } from './utils';
|
|
18
18
|
function resolveVirtualEnabled(virtualEnum, defaultValue) {
|
package/es/table/base/empty.js
CHANGED
|
@@ -31,8 +31,8 @@ export function EmptyHtmlTable(_ref) {
|
|
|
31
31
|
style: {
|
|
32
32
|
height: emptyCellHeight !== null && emptyCellHeight !== void 0 ? emptyCellHeight : 200
|
|
33
33
|
}
|
|
34
|
-
})))), show && /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
})))), show && (/*#__PURE__*/React.createElement("div", {
|
|
35
35
|
className: Classes.emptyWrapper,
|
|
36
36
|
key: "empty"
|
|
37
|
-
}, /*#__PURE__*/React.createElement(EmptyContent, null)));
|
|
37
|
+
}, /*#__PURE__*/React.createElement(EmptyContent, null))));
|
|
38
38
|
}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
2
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
5
4
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
6
5
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
7
|
-
|
|
8
|
-
function
|
|
6
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React, { PureComponent } from 'react';
|
|
10
10
|
import { GlobalStyle } from './styles';
|
|
11
11
|
var GlobalStyleComponent = /*#__PURE__*/function (_PureComponent) {
|
|
12
|
-
_inherits(GlobalStyleComponent, _PureComponent);
|
|
13
|
-
var _super = _createSuper(GlobalStyleComponent);
|
|
14
12
|
function GlobalStyleComponent() {
|
|
15
13
|
_classCallCheck(this, GlobalStyleComponent);
|
|
16
|
-
return
|
|
14
|
+
return _callSuper(this, GlobalStyleComponent, arguments);
|
|
17
15
|
}
|
|
18
|
-
|
|
16
|
+
_inherits(GlobalStyleComponent, _PureComponent);
|
|
17
|
+
return _createClass(GlobalStyleComponent, [{
|
|
19
18
|
key: "render",
|
|
20
19
|
value: function render() {
|
|
21
20
|
return /*#__PURE__*/React.createElement(GlobalStyle, {
|
|
@@ -23,6 +22,5 @@ var GlobalStyleComponent = /*#__PURE__*/function (_PureComponent) {
|
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
24
|
}]);
|
|
26
|
-
return GlobalStyleComponent;
|
|
27
25
|
}(PureComponent);
|
|
28
26
|
export { GlobalStyleComponent as default };
|
package/es/table/base/header.js
CHANGED
|
@@ -8,9 +8,9 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
8
8
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
9
9
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
10
10
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
11
|
-
function _createForOfIteratorHelper(
|
|
12
|
-
function _unsupportedIterableToArray(
|
|
13
|
-
function _arrayLikeToArray(
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context6; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context6 = {}.toString.call(r)).call(_context6, 8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
14
|
import cx from 'classnames';
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { getTreeDepth, isLeafNode } from '../utils';
|
|
@@ -72,12 +72,13 @@ function calculateLeveledAndFlat(inputNested, rowCount) {
|
|
|
72
72
|
leveled.push([]);
|
|
73
73
|
}
|
|
74
74
|
var flat = [];
|
|
75
|
-
dfs(inputNested, 0);
|
|
75
|
+
dfs(inputNested, 0, false);
|
|
76
76
|
return {
|
|
77
77
|
flat: flat,
|
|
78
78
|
leveled: leveled
|
|
79
79
|
};
|
|
80
|
-
function dfs(input, depth) {
|
|
80
|
+
function dfs(input, depth, suppressLeveled) {
|
|
81
|
+
var _a;
|
|
81
82
|
var leafCount = 0;
|
|
82
83
|
for (var i = 0; i < input.length; i++) {
|
|
83
84
|
var indexedCol = input[i];
|
|
@@ -91,12 +92,15 @@ function calculateLeveledAndFlat(inputNested, rowCount) {
|
|
|
91
92
|
colSpan: 1,
|
|
92
93
|
isLeaf: true
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
+
if (!suppressLeveled) {
|
|
96
|
+
leveled[depth].push(wrapped);
|
|
97
|
+
}
|
|
95
98
|
flat.push(wrapped);
|
|
96
99
|
} else {
|
|
97
|
-
var
|
|
100
|
+
var mergeHeader = Boolean((_a = indexedCol.col) === null || _a === void 0 ? void 0 : _a.isHeaderMerge);
|
|
101
|
+
var dfsRes = dfs(indexedCol.children, depth + 1, suppressLeveled || mergeHeader);
|
|
98
102
|
leafCount += dfsRes.leafCount;
|
|
99
|
-
if (dfsRes.leafCount > 0) {
|
|
103
|
+
if (dfsRes.leafCount > 0 && !suppressLeveled) {
|
|
100
104
|
leveled[depth].push({
|
|
101
105
|
type: 'normal',
|
|
102
106
|
width: indexedCol.col.width,
|
|
@@ -201,7 +205,6 @@ export default function TableHeader(_ref2) {
|
|
|
201
205
|
var leftFlatCount = flat.left.length;
|
|
202
206
|
var rightFlatCount = flat.right.length;
|
|
203
207
|
var thead = _mapInstanceProperty(_context4 = headerRenderInfo.leveled).call(_context4, function (wrappedCols, level) {
|
|
204
|
-
var _cx2;
|
|
205
208
|
var _wrappedCols = _concatInstanceProperty(wrappedCols).call(wrappedCols);
|
|
206
209
|
// 左中右区域渲染,分组列可能单独位于一个区域,此时其他区域也需要适配分组的高度
|
|
207
210
|
// rowspan 需要空白的列头去占位, 需要补充额外的空白列头
|
|
@@ -216,7 +219,6 @@ export default function TableHeader(_ref2) {
|
|
|
216
219
|
var headerCells = _mapInstanceProperty(_wrappedCols).call(_wrappedCols, function (wrapped, index) {
|
|
217
220
|
var _a, _b, _c;
|
|
218
221
|
if (wrapped.type === 'normal') {
|
|
219
|
-
var _cx;
|
|
220
222
|
var colIndex = wrapped.colIndex,
|
|
221
223
|
colSpan = wrapped.colSpan,
|
|
222
224
|
isLeaf = wrapped.isLeaf,
|
|
@@ -243,9 +245,9 @@ export default function TableHeader(_ref2) {
|
|
|
243
245
|
var cell = /*#__PURE__*/React.createElement("th", _extends({
|
|
244
246
|
key: colIndex
|
|
245
247
|
}, headerCellProps, {
|
|
246
|
-
className: cx(Classes.tableHeaderCell, headerCellProps.className, (
|
|
248
|
+
className: cx(Classes.tableHeaderCell, headerCellProps.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Classes.first, colIndex === 0), Classes.last, colIndex + colSpan === fullFlatCount), Classes.lockLeft, colIndex < leftFlatCount || theaderPosition === 'left'), Classes.lockRight, colIndex >= fullFlatCount - rightFlatCount || theaderPosition === 'right'), Classes.leaf, wrapped.isLeaf || col.isHeaderMerge)),
|
|
247
249
|
colSpan: colSpan,
|
|
248
|
-
rowSpan: isLeaf ? rowCount - level : undefined,
|
|
250
|
+
rowSpan: isLeaf || col.isHeaderMerge ? rowCount - level : undefined,
|
|
249
251
|
style: _extends(_extends({
|
|
250
252
|
textAlign: col.align,
|
|
251
253
|
verticalAlign: (_b = col.verticalAlign) !== null && _b !== void 0 ? _b : 'middle'
|
|
@@ -273,7 +275,7 @@ export default function TableHeader(_ref2) {
|
|
|
273
275
|
});
|
|
274
276
|
return /*#__PURE__*/React.createElement("tr", {
|
|
275
277
|
key: level,
|
|
276
|
-
className: cx(Classes.tableHeaderRow, (
|
|
278
|
+
className: cx(Classes.tableHeaderRow, _defineProperty(_defineProperty({}, Classes.first, level === 0), Classes.last, level === rowCount - 1))
|
|
277
279
|
}, headerCells);
|
|
278
280
|
});
|
|
279
281
|
var colgroup = _mapInstanceProperty(_context5 = _flatInstanceProperty(headerRenderInfo)).call(_context5, function (wrapped) {
|
|
@@ -31,7 +31,7 @@ export var FastScrollManager = /*#__PURE__*/function () {
|
|
|
31
31
|
/**
|
|
32
32
|
* 检测是否接近底部(剩余滚动距离少于两屏)
|
|
33
33
|
*/
|
|
34
|
-
_createClass(FastScrollManager, [{
|
|
34
|
+
return _createClass(FastScrollManager, [{
|
|
35
35
|
key: "isNearBottom",
|
|
36
36
|
value: function isNearBottom(currentScrollTop, maxRenderHeight, totalScrollHeight) {
|
|
37
37
|
var remainingScrollDistance = totalScrollHeight - currentScrollTop - maxRenderHeight;
|
|
@@ -163,5 +163,4 @@ export var FastScrollManager = /*#__PURE__*/function () {
|
|
|
163
163
|
return _extends({}, this.config);
|
|
164
164
|
}
|
|
165
165
|
}]);
|
|
166
|
-
return FastScrollManager;
|
|
167
166
|
}();
|
|
@@ -9,7 +9,7 @@ var SpanManager = /*#__PURE__*/function () {
|
|
|
9
9
|
_classCallCheck(this, SpanManager);
|
|
10
10
|
this.rects = [];
|
|
11
11
|
}
|
|
12
|
-
_createClass(SpanManager, [{
|
|
12
|
+
return _createClass(SpanManager, [{
|
|
13
13
|
key: "testSkip",
|
|
14
14
|
value: function testSkip(rowIndex, colIndex) {
|
|
15
15
|
return this.rects.some(function (_ref) {
|
|
@@ -39,6 +39,5 @@ var SpanManager = /*#__PURE__*/function () {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}]);
|
|
42
|
-
return SpanManager;
|
|
43
42
|
}();
|
|
44
43
|
export { SpanManager as default };
|
|
@@ -59,17 +59,17 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
59
59
|
this.getInRangeRowByCellEvent = function (e) {
|
|
60
60
|
var _context;
|
|
61
61
|
var _a;
|
|
62
|
-
var
|
|
62
|
+
var _getParentNode = function getParentNode(ele, target) {
|
|
63
63
|
if (ele.parentNode.nodeName === target) {
|
|
64
64
|
return ele.parentNode;
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return _getParentNode(ele.parentNode, target);
|
|
67
67
|
};
|
|
68
68
|
e = e instanceof Array ? e[0] : e;
|
|
69
69
|
var curCell = e === null || e === void 0 ? void 0 : e.currentTarget;
|
|
70
|
-
var curRow =
|
|
70
|
+
var curRow = _getParentNode(curCell, 'TR');
|
|
71
71
|
var curRowSpan = parseInt(e.currentTarget.getAttribute('rowspan')) || 1;
|
|
72
|
-
var rows = (_a =
|
|
72
|
+
var rows = (_a = _getParentNode(curCell, 'TABLE')) === null || _a === void 0 ? void 0 : _a.rows;
|
|
73
73
|
return _sliceInstanceProperty(_context = _Array$from(rows)).call(_context, curRow.rowIndex, curRow.rowIndex + curRowSpan);
|
|
74
74
|
};
|
|
75
75
|
this.artTableWrapper = artTableWrapper;
|
|
@@ -86,7 +86,7 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
86
86
|
this.stickyScroll = stickyScrolls[stickyScrolls.length - 1]; // 当嵌套多层表格时,需要查找最后一个,否则会查找到父表格内嵌套的子表格的
|
|
87
87
|
this.stickyScrollItem = this.stickyScroll.querySelector(".".concat(Classes.stickyScrollItem));
|
|
88
88
|
}
|
|
89
|
-
_createClass(TableDOMHelper, [{
|
|
89
|
+
return _createClass(TableDOMHelper, [{
|
|
90
90
|
key: "getVirtualTop",
|
|
91
91
|
value: function getVirtualTop() {
|
|
92
92
|
return this.tableBody.querySelector(".".concat(Classes.virtualBlank, ".top"));
|
|
@@ -137,5 +137,4 @@ export var TableDOMHelper = /*#__PURE__*/function () {
|
|
|
137
137
|
return rowOffsetTop + tableOffsetTop;
|
|
138
138
|
}
|
|
139
139
|
}]);
|
|
140
|
-
return TableDOMHelper;
|
|
141
140
|
}();
|
|
@@ -6,9 +6,9 @@ describe("".concat(NAME), function () {
|
|
|
6
6
|
var tableDOMHelper;
|
|
7
7
|
var container;
|
|
8
8
|
beforeAll(function () {
|
|
9
|
-
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15
|
|
9
|
+
var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context0, _context1, _context10, _context11, _context12, _context13, _context14, _context15;
|
|
10
10
|
container = document.createElement('div');
|
|
11
|
-
container.innerHTML = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = _concatInstanceProperty(_context9 = _concatInstanceProperty(
|
|
11
|
+
container.innerHTML = _concatInstanceProperty(_context = _concatInstanceProperty(_context2 = _concatInstanceProperty(_context3 = _concatInstanceProperty(_context4 = _concatInstanceProperty(_context5 = _concatInstanceProperty(_context6 = _concatInstanceProperty(_context7 = _concatInstanceProperty(_context8 = _concatInstanceProperty(_context9 = _concatInstanceProperty(_context0 = _concatInstanceProperty(_context1 = _concatInstanceProperty(_context10 = _concatInstanceProperty(_context11 = _concatInstanceProperty(_context12 = _concatInstanceProperty(_context13 = _concatInstanceProperty(_context14 = _concatInstanceProperty(_context15 = "<div class='".concat(Classes.artTableWrapper, "'>\n <div class='")).call(_context15, Classes.loadingWrapper, "'>\n <div class='")).call(_context14, Classes.loadingIndicatorWrapper, "'>\n <div class='")).call(_context13, Classes.loadingIndicator, "'></div>\n </div> \n <div class='")).call(_context12, Classes.loadingContentWrapper, "'>\n <div class='")).call(_context11, Classes.artTable, "'>\n <div class='")).call(_context10, Classes.tableHeader, "'>\n \n </div>\n <div class='")).call(_context1, Classes.tableBody, "'>\n <div class='")).call(_context0, Classes.virtual, "'>\n <div class='")).call(_context9, Classes.virtualBlank, " top'></div>\n <table></table>\n <div class='")).call(_context8, Classes.virtualBlank, " bottom'></div>\n </div> \n </div>\n <div class='")).call(_context7, Classes.tableFooter, "'>\n </div>\n <div class='")).call(_context6, Classes.lockShadowMask, "'>\n <div class='")).call(_context5, Classes.leftLockShadow, "'></div>\n </div>\n <div class='")).call(_context4, Classes.lockShadowMask, "'>\n <div class='")).call(_context3, Classes.rightLockShadow, "'></div>\n </div>\n </div>\n <div class='")).call(_context2, Classes.stickyScroll, "'>\n <div class='")).call(_context, Classes.stickyScrollItem, "'></div>\n </div>\n </div> \n </div> \n </div>");
|
|
12
12
|
tableDOMHelper = new TableDOMHelper(container.querySelector(".".concat(Classes.artTableWrapper)));
|
|
13
13
|
});
|
|
14
14
|
afterAll(function () {
|
|
@@ -29,11 +29,11 @@ export function HtmlTable(_ref) {
|
|
|
29
29
|
descriptors: hozInfo.visible
|
|
30
30
|
}), /*#__PURE__*/React.createElement(tbodyHtmlTag, null, _mapInstanceProperty(data).call(data, renderRow)));
|
|
31
31
|
function renderRow(record, i) {
|
|
32
|
-
var
|
|
32
|
+
var _context, _context2;
|
|
33
33
|
var rowIndex = verInfo.offset + i;
|
|
34
34
|
spanManager.stripUpwards(rowIndex);
|
|
35
35
|
var rowProps = getRowProps(record, rowIndex);
|
|
36
|
-
var rowClass = cx(Classes.tableRow, (
|
|
36
|
+
var rowClass = cx(Classes.tableRow, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Classes.first, rowIndex === verInfo.first), Classes.last, rowIndex === verInfo.last), Classes.even, rowIndex % 2 === 0), Classes.odd, rowIndex % 2 === 1), rowProps === null || rowProps === void 0 ? void 0 : rowProps.className);
|
|
37
37
|
var visibleColumnDescriptor = _concatInstanceProperty(_context = hozInfo.visible).call(_context);
|
|
38
38
|
// 左中右区域渲染,存在融合单元格时需要适配rowspan属性
|
|
39
39
|
// 如果固定的列均存在融合单元格,需空白一列做占位,否则融合的单元格不会渲染,导致显示异常
|
|
@@ -46,12 +46,21 @@ export function HtmlTable(_ref) {
|
|
|
46
46
|
isPlacehoder: true
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
// detail 行跳过水平虚拟化,渲染所有列,确保 column 0 的 getSpanRect 能正确执行
|
|
50
|
+
var isDetailRow = (rowProps === null || rowProps === void 0 ? void 0 : rowProps['data-row-detail-key']) != null;
|
|
51
|
+
var rowDescriptors = isDetailRow ? _mapInstanceProperty(_context2 = flat.full).call(_context2, function (col, i) {
|
|
52
|
+
return {
|
|
53
|
+
type: 'normal',
|
|
54
|
+
col: col,
|
|
55
|
+
colIndex: i
|
|
56
|
+
};
|
|
57
|
+
}) : visibleColumnDescriptor;
|
|
49
58
|
return /*#__PURE__*/React.createElement("tr", _extends({}, rowProps, {
|
|
50
59
|
className: rowClass,
|
|
51
60
|
key: (rowProps === null || rowProps === void 0 ? void 0 : rowProps['data-row-detail-key']) ? rowProps['data-row-detail-key'] : internals.safeGetRowKey(primaryKey, record, rowIndex),
|
|
52
61
|
"data-rowindex": rowIndex,
|
|
53
62
|
"data-role": 'table-row'
|
|
54
|
-
}), _mapInstanceProperty(
|
|
63
|
+
}), _mapInstanceProperty(rowDescriptors).call(rowDescriptors, function (descriptor) {
|
|
55
64
|
if (descriptor.type === 'blank') {
|
|
56
65
|
return /*#__PURE__*/React.createElement("td", {
|
|
57
66
|
key: descriptor.blankSide,
|
|
@@ -60,11 +69,10 @@ export function HtmlTable(_ref) {
|
|
|
60
69
|
}
|
|
61
70
|
});
|
|
62
71
|
}
|
|
63
|
-
return renderBodyCell(record, rowIndex, descriptor.col, descriptor.colIndex);
|
|
72
|
+
return renderBodyCell(record, rowIndex, descriptor.col, descriptor.colIndex, isDetailRow ? fullFlatCount : undefined);
|
|
64
73
|
}));
|
|
65
74
|
}
|
|
66
|
-
function renderBodyCell(record, rowIndex, column, colIndex) {
|
|
67
|
-
var _cx2;
|
|
75
|
+
function renderBodyCell(record, rowIndex, column, colIndex, colSpanLimit) {
|
|
68
76
|
var _a, _b, _c;
|
|
69
77
|
if (spanManager.testSkip(rowIndex, colIndex)) {
|
|
70
78
|
return null;
|
|
@@ -95,7 +103,7 @@ export function HtmlTable(_ref) {
|
|
|
95
103
|
}
|
|
96
104
|
// rowSpan/colSpan 不能过大,避免 rowSpan/colSpan 影响因虚拟滚动而未渲染的单元格
|
|
97
105
|
rowSpan = Math.min(rowSpan, verInfo.limit - rowIndex);
|
|
98
|
-
colSpan = Math.min(colSpan, hozInfo.visible.length - colIndex);
|
|
106
|
+
colSpan = Math.min(colSpan, (colSpanLimit !== null && colSpanLimit !== void 0 ? colSpanLimit : hozInfo.visible.length) - colIndex);
|
|
99
107
|
// todo: 右侧有列固定的情况下colSpan计算不对,这里先限制一下
|
|
100
108
|
rowSpan = Math.max(rowSpan, 1);
|
|
101
109
|
colSpan = Math.max(colSpan, 1);
|
|
@@ -119,7 +127,7 @@ export function HtmlTable(_ref) {
|
|
|
119
127
|
return /*#__PURE__*/React.createElement('td', _extends(_extends(_extends(_extends({
|
|
120
128
|
key: colIndex
|
|
121
129
|
}, cellProps), {
|
|
122
|
-
className: cx(Classes.tableCell, cellProps.className, (
|
|
130
|
+
className: cx(Classes.tableCell, cellProps.className, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Classes.first, colIndex === 0), Classes.last, colIndex + colSpan === fullFlatCount), Classes.lockLeft, colIndex < leftFlatCount || tbodyPosition === 'left'), Classes.lockRight, colIndex >= fullFlatCount - rightFlatCount), Classes.rowSpan, rowSpan > 1))
|
|
123
131
|
}), hasSpan ? {
|
|
124
132
|
colSpan: colSpan,
|
|
125
133
|
rowSpan: rowSpan
|
package/es/table/base/loading.js
CHANGED
|
@@ -47,11 +47,11 @@ export default function Loading(_ref2) {
|
|
|
47
47
|
LoadingIcon = _ref2$LoadingIcon === void 0 ? DefaultLoadingIcon : _ref2$LoadingIcon;
|
|
48
48
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
49
|
className: Classes.loadingWrapper
|
|
50
|
-
}, visible && /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
}, visible && (/*#__PURE__*/React.createElement("div", {
|
|
51
51
|
className: Classes.loadingIndicatorWrapper
|
|
52
52
|
}, /*#__PURE__*/React.createElement("div", {
|
|
53
53
|
className: Classes.loadingIndicator
|
|
54
|
-
}, /*#__PURE__*/React.createElement(LoadingIcon, null))), /*#__PURE__*/React.createElement(LoadingContentWrapper, {
|
|
54
|
+
}, /*#__PURE__*/React.createElement(LoadingIcon, null)))), /*#__PURE__*/React.createElement(LoadingContentWrapper, {
|
|
55
55
|
visible: visible,
|
|
56
56
|
children: children
|
|
57
57
|
}));
|