@kdcloudjs/table 1.2.2-canary.18 → 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 +3533 -3108
- 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 +5 -7
- 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 +16 -16
- package/es/table/base/table.js +17 -21
- package/es/table/base/utils.js +3 -3
- 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/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/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 +3 -3
- 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 +5 -7
- 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 +17 -18
- package/lib/table/base/styles.js +9 -18
- package/lib/table/base/table.js +28 -32
- package/lib/table/base/utils.js +13 -22
- package/lib/table/common-views.js +4 -8
- 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/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/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 +3 -3
- 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/es/table/base/table.js
CHANGED
|
@@ -7,17 +7,17 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
8
8
|
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
9
9
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
10
|
-
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
11
10
|
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
12
11
|
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
function
|
|
12
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
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 _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; } }
|
|
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 _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
17
17
|
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/flat";
|
|
18
18
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
19
|
-
function
|
|
20
|
-
function _isNativeReflectConstruct() {
|
|
19
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
20
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
21
|
import cx from 'classnames';
|
|
22
22
|
import React from 'react';
|
|
23
23
|
import { BehaviorSubject, combineLatest, noop, Subscription, Subject, from } from 'rxjs';
|
|
@@ -45,12 +45,10 @@ function warnPropsDotEmptyContentIsDeprecated() {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
48
|
-
_inherits(BaseTable, _React$Component);
|
|
49
|
-
var _super = _createSuper(BaseTable);
|
|
50
48
|
function BaseTable(props) {
|
|
51
49
|
var _this;
|
|
52
50
|
_classCallCheck(this, BaseTable);
|
|
53
|
-
_this =
|
|
51
|
+
_this = _callSuper(this, BaseTable, [props]);
|
|
54
52
|
_this.rowHeightManager = makeRowHeightManager(_this.props.dataSource.length, _this.props.estimatedRowHeight);
|
|
55
53
|
_this.artTableWrapperRef = /*#__PURE__*/React.createRef();
|
|
56
54
|
_this.hasScrollY = false;
|
|
@@ -182,7 +180,8 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
182
180
|
return _this;
|
|
183
181
|
}
|
|
184
182
|
/** @deprecated BaseTable.getDoms() 已经过时,请勿调用 */
|
|
185
|
-
|
|
183
|
+
_inherits(BaseTable, _React$Component);
|
|
184
|
+
return _createClass(BaseTable, [{
|
|
186
185
|
key: "getDoms",
|
|
187
186
|
value: function getDoms() {
|
|
188
187
|
console.warn('[kd-table] BaseTable.getDoms() 已经过时');
|
|
@@ -395,19 +394,18 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
395
394
|
}, {
|
|
396
395
|
key: "renderLockShadows",
|
|
397
396
|
value: function renderLockShadows(info) {
|
|
398
|
-
var _style, _style2;
|
|
399
397
|
var stickyRightOffset = this.hasScrollY ? this.getScrollBarWidth() : 0;
|
|
400
398
|
// console.log('render LockShadows')
|
|
401
399
|
var leftLockShadowWidth = info.leftLockTotalWidth + LOCK_SHADOW_PADDING;
|
|
402
400
|
var rightLockShadownWidth = info.rightLockTotalWidth + LOCK_SHADOW_PADDING + stickyRightOffset;
|
|
403
401
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
404
402
|
className: Classes.lockShadowMask,
|
|
405
|
-
style: (
|
|
403
|
+
style: _defineProperty(_defineProperty({}, swapRTLDirection(info.direction, 'left'), 0), "width", leftLockShadowWidth)
|
|
406
404
|
}, /*#__PURE__*/React.createElement("div", {
|
|
407
405
|
className: cx(Classes.lockShadow, Classes.leftLockShadow)
|
|
408
406
|
})), /*#__PURE__*/React.createElement("div", {
|
|
409
407
|
className: Classes.lockShadowMask,
|
|
410
|
-
style: (
|
|
408
|
+
style: _defineProperty(_defineProperty({}, swapRTLDirection(info.direction, 'right'), 0), "width", rightLockShadownWidth)
|
|
411
409
|
}, /*#__PURE__*/React.createElement("div", {
|
|
412
410
|
className: cx(Classes.lockShadow, Classes.rightLockShadow)
|
|
413
411
|
})));
|
|
@@ -471,7 +469,6 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
471
469
|
}, {
|
|
472
470
|
key: "render",
|
|
473
471
|
value: function render() {
|
|
474
|
-
var _cx;
|
|
475
472
|
// console.log('render table')
|
|
476
473
|
var info = calculateRenderInfo(this);
|
|
477
474
|
this.lastInfo = info;
|
|
@@ -493,7 +490,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
493
490
|
_prefixCls = _this$props8.prefixCls;
|
|
494
491
|
var prefixCls = _prefixCls === 'kd' || !_prefixCls ? undefined : _prefixCls; // 不生效上层传的prefix为kd,只有传除'kd'外的前缀才生效,kui默认传kd,避免对之前的样式层级有影响
|
|
495
492
|
info.direction = direction;
|
|
496
|
-
var artTableWrapperClassName = cx(Classes.artTableWrapper, (
|
|
493
|
+
var artTableWrapperClassName = cx(Classes.artTableWrapper, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
497
494
|
'use-outer-border': useOuterBorder,
|
|
498
495
|
empty: dataSource.length === 0,
|
|
499
496
|
lock: info.hasLockColumn,
|
|
@@ -501,7 +498,7 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
501
498
|
'sticky-header': isStickyHeader !== null && isStickyHeader !== void 0 ? isStickyHeader : isStickyHead,
|
|
502
499
|
'has-footer': footerDataSource.length > 0,
|
|
503
500
|
'sticky-footer': isStickyFooter
|
|
504
|
-
},
|
|
501
|
+
}, Classes.artTableBordered, bordered), 'ie-polyfill-wrapper', browserType.isIE), 'sticky-polyfill-wrapper', isStickyUIDegrade()), "".concat(prefixCls, "-table"), prefixCls), className);
|
|
505
502
|
var artTableWrapperProps = _defineProperty({
|
|
506
503
|
className: artTableWrapperClassName,
|
|
507
504
|
style: _extends(_extends({}, style), {
|
|
@@ -551,10 +548,10 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
551
548
|
value: function componentDidUpdate(prevProps, prevState) {
|
|
552
549
|
var _a;
|
|
553
550
|
// console.log('did update start')
|
|
554
|
-
var _this$
|
|
555
|
-
cssVariables = _this$
|
|
556
|
-
enableCSSVariables = _this$
|
|
557
|
-
bordered = _this$
|
|
551
|
+
var _this$props0 = this.props,
|
|
552
|
+
cssVariables = _this$props0.cssVariables,
|
|
553
|
+
enableCSSVariables = _this$props0.enableCSSVariables,
|
|
554
|
+
bordered = _this$props0.bordered;
|
|
558
555
|
if (!shallowEqual(prevProps === null || prevProps === void 0 ? void 0 : prevProps.cssVariables, (_a = this.props) === null || _a === void 0 ? void 0 : _a.cssVariables)) {
|
|
559
556
|
cssPolifill({
|
|
560
557
|
variables: cssVariables || {},
|
|
@@ -816,7 +813,6 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
816
813
|
}
|
|
817
814
|
}
|
|
818
815
|
}]);
|
|
819
|
-
return BaseTable;
|
|
820
816
|
}(React.Component);
|
|
821
817
|
BaseTable.defaultProps = {
|
|
822
818
|
hasHeader: true,
|
package/es/table/base/utils.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 _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
6
6
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
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 _Set from "@babel/runtime-corejs3/core-js-stable/set";
|
|
11
11
|
import _Object$is from "@babel/runtime-corejs3/core-js-stable/object/is";
|
|
12
12
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
package/es/table/internals.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ArtColumn } from './interfaces';
|
|
2
|
-
declare function safeRenderHeader(column: ArtColumn):
|
|
3
|
+
declare function safeRenderHeader(column: ArtColumn): number | boolean | import("react").ReactElement<any, string | ((props: any) => import("react").ReactElement<any, any>) | (new (props: any) => import("react").Component<any, any, any>)> | import("react").ReactFragment;
|
|
3
4
|
declare function safeGetValue(column: ArtColumn, record: any, rowIndex: number): any;
|
|
4
5
|
declare function safeGetRowKey(primaryKey: string | ((record: any) => string), record: any, rowIndex: number): string;
|
|
5
6
|
declare function safeGetCellProps(column: ArtColumn, record: any, rowIndex: number): import("./interfaces").CellProps;
|
|
@@ -51,13 +51,33 @@ export function columnDrag() {
|
|
|
51
51
|
var style = cloumnsTranslateData ? {
|
|
52
52
|
transition: '.3s',
|
|
53
53
|
transform: "translate3d(".concat(cloumnsTranslateData[col.code], "px, 0px, 0px)")
|
|
54
|
-
} :
|
|
54
|
+
} : null;
|
|
55
55
|
var prevGetCellProps = col.getCellProps;
|
|
56
56
|
// !col.code: 选择列 col.lock: 固定列 不允许拖拽
|
|
57
57
|
if (col.lock || !col.code) return col;
|
|
58
|
+
// 没有拖拽进行时,不包装 getCellProps,避免每个 cell 多一层函数调用
|
|
59
|
+
if (style == null) {
|
|
60
|
+
return _extends(_extends({}, col), {
|
|
61
|
+
headerCellProps: mergeCellProps(col.headerCellProps, _extends({}, isLeaf && path.length === 1 ? {
|
|
62
|
+
onMouseDown: function onMouseDown(e) {
|
|
63
|
+
if (e.button !== 0 || !e.currentTarget.contains(e.target)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
handlePointerDown(e.nativeEvent, false, e.currentTarget);
|
|
67
|
+
},
|
|
68
|
+
onTouchStart: function onTouchStart(e) {
|
|
69
|
+
if (e.cancelable) {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
handlePointerDown(e.nativeEvent, true, e.currentTarget);
|
|
73
|
+
}
|
|
74
|
+
} : {}))
|
|
75
|
+
});
|
|
76
|
+
}
|
|
58
77
|
return _extends(_extends({}, col), {
|
|
59
78
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
60
79
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
80
|
+
if (style == null) return prevCellProps;
|
|
61
81
|
return mergeCellProps(prevCellProps, {
|
|
62
82
|
style: style
|
|
63
83
|
});
|
|
@@ -220,7 +240,6 @@ export function columnDrag() {
|
|
|
220
240
|
e.stopPropagation(); // 存在移动就阻止冒泡
|
|
221
241
|
currentTarget.addEventListener('click', stopClickPropagation); // 阻止列头点击事件,防止拖动后触发列头过滤事件
|
|
222
242
|
}
|
|
223
|
-
|
|
224
243
|
window.requestAnimationFrame(function () {
|
|
225
244
|
// 取消阻止列头点击事件
|
|
226
245
|
currentTarget.removeEventListener('click', stopClickPropagation);
|
|
@@ -45,7 +45,6 @@ export function filter() {
|
|
|
45
45
|
var filterable = col.code && ((_a = col.features) === null || _a === void 0 ? void 0 : _a.filterable);
|
|
46
46
|
var filterActive = !!(filterable && (inputFiltersMap === null || inputFiltersMap === void 0 ? void 0 : inputFiltersMap.get(col.code)));
|
|
47
47
|
if (filterable) {
|
|
48
|
-
var _cx;
|
|
49
48
|
var handleFilterChanged = function handleFilterChanged(filterItem) {
|
|
50
49
|
var nextFiltersMap = new _Map(inputFiltersMap);
|
|
51
50
|
var currentFilter = _extends({
|
|
@@ -80,7 +79,7 @@ export function filter() {
|
|
|
80
79
|
setFilterModel: handleFilterChanged,
|
|
81
80
|
setFilter: setFilter,
|
|
82
81
|
isFilterActive: filterActive,
|
|
83
|
-
className: cx((
|
|
82
|
+
className: cx(_defineProperty(_defineProperty({}, Classes.tableFilterTrigger, true), "active", filterActive)),
|
|
84
83
|
stopClickEventPropagation: stopClickEventPropagation,
|
|
85
84
|
stopESCKeyDownEventPropagation: stopESCKeyDownEventPropagation,
|
|
86
85
|
hideFilterPopupHeader: hideFilterPopupHeader,
|
|
@@ -100,7 +99,6 @@ export function filter() {
|
|
|
100
99
|
// }
|
|
101
100
|
// })
|
|
102
101
|
}
|
|
103
|
-
|
|
104
102
|
if (!isLeafNode(col)) {
|
|
105
103
|
var _context3;
|
|
106
104
|
result.children = _mapInstanceProperty(_context3 = col.children).call(_context3, dfs);
|
|
@@ -24,20 +24,25 @@ export function columnHover() {
|
|
|
24
24
|
}
|
|
25
25
|
var colIndexMatched = range.start <= hoverColIndex && hoverColIndex < range.end;
|
|
26
26
|
var prevGetCellProps = col.getCellProps;
|
|
27
|
+
// 预构建 merge 用的 extra 对象,避免在每个 cell 里重复创建
|
|
28
|
+
var onMouseEnter = function onMouseEnter() {
|
|
29
|
+
onChangeHoverColIndex(range.start);
|
|
30
|
+
};
|
|
31
|
+
var onMouseLeave = function onMouseLeave() {
|
|
32
|
+
onChangeHoverColIndex(-1);
|
|
33
|
+
};
|
|
34
|
+
var cellExtra = {
|
|
35
|
+
style: {
|
|
36
|
+
'--bgcolor': colIndexMatched ? hoverColor : undefined
|
|
37
|
+
},
|
|
38
|
+
onMouseEnter: onMouseEnter,
|
|
39
|
+
onMouseLeave: onMouseLeave
|
|
40
|
+
};
|
|
27
41
|
return _extends(_extends({}, col), {
|
|
28
42
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
29
43
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'--bgcolor': colIndexMatched ? hoverColor : undefined
|
|
33
|
-
},
|
|
34
|
-
onMouseEnter: function onMouseEnter() {
|
|
35
|
-
onChangeHoverColIndex(range.start);
|
|
36
|
-
},
|
|
37
|
-
onMouseLeave: function onMouseLeave() {
|
|
38
|
-
onChangeHoverColIndex(-1);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
44
|
+
if (!prevCellProps) return cellExtra;
|
|
45
|
+
return mergeCellProps(prevCellProps, cellExtra);
|
|
41
46
|
}
|
|
42
47
|
});
|
|
43
48
|
}));
|
|
@@ -44,31 +44,32 @@ export function columnRangeHover() {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
var prevGetCellProps = col.getCellProps;
|
|
47
|
+
// 预构建 merge 用的 extra 对象,避免在每个 cell 里重复创建
|
|
48
|
+
var onMouseEnter = function onMouseEnter() {
|
|
49
|
+
onChangeHoverRange(colRange);
|
|
50
|
+
};
|
|
51
|
+
var onMouseLeave = function onMouseLeave() {
|
|
52
|
+
onChangeHoverRange(EMPTY_RANGE);
|
|
53
|
+
};
|
|
54
|
+
var cellExtra = {
|
|
55
|
+
onMouseEnter: onMouseEnter,
|
|
56
|
+
onMouseLeave: onMouseLeave,
|
|
57
|
+
style: {
|
|
58
|
+
'--bgcolor': match ? hoverColor : undefined
|
|
59
|
+
}
|
|
60
|
+
};
|
|
47
61
|
return _extends(_extends({}, col), {
|
|
48
62
|
headerCellProps: mergeCellProps(col.headerCellProps, {
|
|
49
|
-
onMouseEnter:
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
onMouseLeave: function onMouseLeave() {
|
|
53
|
-
onChangeHoverRange(EMPTY_RANGE);
|
|
54
|
-
},
|
|
63
|
+
onMouseEnter: onMouseEnter,
|
|
64
|
+
onMouseLeave: onMouseLeave,
|
|
55
65
|
style: {
|
|
56
66
|
'--header-bgcolor': match ? headerHoverColor : undefined
|
|
57
67
|
}
|
|
58
68
|
}),
|
|
59
69
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
60
70
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onChangeHoverRange(colRange);
|
|
64
|
-
},
|
|
65
|
-
onMouseLeave: function onMouseLeave() {
|
|
66
|
-
onChangeHoverRange(EMPTY_RANGE);
|
|
67
|
-
},
|
|
68
|
-
style: {
|
|
69
|
-
'--bgcolor': match ? hoverColor : undefined
|
|
70
|
-
}
|
|
71
|
-
});
|
|
71
|
+
if (!prevCellProps) return cellExtra;
|
|
72
|
+
return mergeCellProps(prevCellProps, cellExtra);
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
}));
|
|
@@ -177,7 +177,7 @@ export function columnResize() {
|
|
|
177
177
|
width = col.width;
|
|
178
178
|
return _extends(_extends({}, col), {
|
|
179
179
|
width: (_a = columnSize[code]) !== null && _a !== void 0 ? _a : width,
|
|
180
|
-
title: /*#__PURE__*/React.createElement(React.Fragment, null, prevTitle, (features === null || features === void 0 ? void 0 : features.resizeable) !== false && (isGroup ? /*#__PURE__*/React.createElement(TableHeaderGroupCellResize, {
|
|
180
|
+
title: (/*#__PURE__*/React.createElement(React.Fragment, null, prevTitle, (features === null || features === void 0 ? void 0 : features.resizeable) !== false && (isGroup ? /*#__PURE__*/React.createElement(TableHeaderGroupCellResize, {
|
|
181
181
|
direction: pipeline.ctx.direction,
|
|
182
182
|
className: Classes.tableHeaderCellResize,
|
|
183
183
|
onDoubleClick: function onDoubleClick(e) {
|
|
@@ -201,7 +201,7 @@ export function columnResize() {
|
|
|
201
201
|
onTouchStart: function onTouchStart(e) {
|
|
202
202
|
return handleTouchStart(e, col);
|
|
203
203
|
}
|
|
204
|
-
}))),
|
|
204
|
+
})))),
|
|
205
205
|
headerCellProps: mergeCellProps(col.headerCellProps, {
|
|
206
206
|
className: 'resizeable'
|
|
207
207
|
})
|
|
@@ -23,24 +23,24 @@ export function contextMenu() {
|
|
|
23
23
|
popupParent.appendChild(ePopupDiv);
|
|
24
24
|
var popupHidden = false;
|
|
25
25
|
var eventList = ['mousedown', 'contextmenu'];
|
|
26
|
-
var
|
|
26
|
+
var _hidePopup2 = function hidePopup(event) {
|
|
27
27
|
if (isEventFromCurrentPopup(event, ePopupDiv) || popupHidden) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
popupHidden = true;
|
|
31
31
|
popupParent.removeChild(ePopupDiv);
|
|
32
32
|
eventList.forEach(function (eventType) {
|
|
33
|
-
window.removeEventListener(eventType,
|
|
33
|
+
window.removeEventListener(eventType, _hidePopup2, true);
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
ReactDOM.render(menu, ePopupDiv, function () {
|
|
37
37
|
setTimeout(function () {
|
|
38
38
|
eventList.forEach(function (eventType) {
|
|
39
|
-
window.addEventListener(eventType,
|
|
39
|
+
window.addEventListener(eventType, _hidePopup2, true);
|
|
40
40
|
});
|
|
41
41
|
}, 0);
|
|
42
42
|
});
|
|
43
|
-
return
|
|
43
|
+
return _hidePopup2;
|
|
44
44
|
};
|
|
45
45
|
var onContextMenu = function onContextMenu(e) {
|
|
46
46
|
if (canShowContextMenu(e, pipeline)) {
|
|
@@ -289,12 +289,10 @@ function keepWithinBounds(popupParent, ePopup, x, y) {
|
|
|
289
289
|
var maxX = parentWidth - minWidth;
|
|
290
290
|
x = Math.min(Math.max(x, 0), Math.abs(maxX)); // 目前位置,最大支持的位置
|
|
291
291
|
}
|
|
292
|
-
|
|
293
292
|
if (y) {
|
|
294
293
|
var maxY = parentHeight - ePopupRect.height;
|
|
295
294
|
y = Math.min(Math.max(y, 0), Math.abs(maxY)); // 目前位置,最大支持的位置
|
|
296
295
|
}
|
|
297
|
-
|
|
298
296
|
return {
|
|
299
297
|
x: x,
|
|
300
298
|
y: y
|
|
@@ -10,7 +10,7 @@ var RowDragApi = /*#__PURE__*/function () {
|
|
|
10
10
|
this.rowDropZones = [];
|
|
11
11
|
this.dragStatus = 'finished';
|
|
12
12
|
}
|
|
13
|
-
_createClass(RowDragApi, [{
|
|
13
|
+
return _createClass(RowDragApi, [{
|
|
14
14
|
key: "getRowDropZoneParams",
|
|
15
15
|
value: function getRowDropZoneParams() {
|
|
16
16
|
return this.rowDropZoneParams;
|
|
@@ -62,6 +62,5 @@ var RowDragApi = /*#__PURE__*/function () {
|
|
|
62
62
|
return this.dragStatus;
|
|
63
63
|
}
|
|
64
64
|
}]);
|
|
65
|
-
return RowDragApi;
|
|
66
65
|
}();
|
|
67
66
|
export { RowDragApi as default };
|
|
@@ -12,7 +12,6 @@ import { Classes, ButtonCSS } from '../../../base/styles';
|
|
|
12
12
|
import KeyCode from '../../../utils/keyCode';
|
|
13
13
|
var DefaultFilterContentStyle = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n background-color: #ffffff;\n border-radius: 2px;\n width: 100%;\n\n ", "\n .filter-option-list {\n display: flex;\n flex-direction: column;\n margin-top: 8px;\n ul {\n margin: 0;\n padding: 0;\n li {\n display: flex;\n position: relative;\n flex-shrink: 0;\n height: 32px;\n align-items: center;\n border-radius: 2px;\n font-size: 12px;\n color: var(--color);\n padding: 0 12px;\n overflow: hidden;\n cursor: pointer;\n &:hover{\n background-color: var(--primary-color-level1);\n }\n }\n li.active{\n background-color: var(--primary-color-level1);\n }\n }\n }\n\n .filter-search {\n display: flex;\n padding: 6px 12px;\n\n .filter-search-inner {\n width: 100%;\n font-size: 12px;\n color: #333333;\n height: 28px;\n line-height: 28px;\n padding: 0 8px;\n outline: none;\n background-color: #FAFAFA;\n border-radius: 2px;\n border: 1px solid var(--strong-border-color);\n &:hover{\n border-color: var(--primary-color)\n } \n &:focus{\n border-color: var(--primary-color)\n } \n }\n }\n\n .filter-footer {\n display: flex;\n flex-direction: row;\n padding: 8px 12px;\n justify-content: space-between;\n\n .filter-btn {\n text-align: center;\n font-size: 12px;\n width: 60px;\n height: 24px;\n line-height: 24px;\n }\n \n }\n"])), ButtonCSS);
|
|
14
14
|
function DefaultFilterContent(_ref) {
|
|
15
|
-
var _cx2;
|
|
16
15
|
var setFilterModel = _ref.setFilterModel,
|
|
17
16
|
filterModel = _ref.filterModel,
|
|
18
17
|
hidePanel = _ref.hidePanel,
|
|
@@ -75,7 +74,7 @@ function DefaultFilterContent(_ref) {
|
|
|
75
74
|
}
|
|
76
75
|
}, (_a = localeText[option.key]) !== null && _a !== void 0 ? _a : option.title)
|
|
77
76
|
);
|
|
78
|
-
}))), selectedValue !== 'notIsNull' && selectedValue !== 'isNull' && /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
}))), selectedValue !== 'notIsNull' && selectedValue !== 'isNull' && (/*#__PURE__*/React.createElement("div", {
|
|
79
78
|
className: 'filter-search'
|
|
80
79
|
}, /*#__PURE__*/React.createElement("input", {
|
|
81
80
|
className: 'filter-search-inner',
|
|
@@ -85,7 +84,7 @@ function DefaultFilterContent(_ref) {
|
|
|
85
84
|
},
|
|
86
85
|
onKeyDown: handleKeyDown,
|
|
87
86
|
ref: inputRef
|
|
88
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
89
88
|
className: 'filter-footer'
|
|
90
89
|
}, /*#__PURE__*/React.createElement("button", {
|
|
91
90
|
className: cx(_defineProperty({
|
|
@@ -93,9 +92,9 @@ function DefaultFilterContent(_ref) {
|
|
|
93
92
|
}, Classes.button, true)),
|
|
94
93
|
onClick: reset
|
|
95
94
|
}, (_a = localeText.resetFilter) !== null && _a !== void 0 ? _a : '重置'), /*#__PURE__*/React.createElement("button", {
|
|
96
|
-
className: cx((
|
|
95
|
+
className: cx(_defineProperty(_defineProperty({
|
|
97
96
|
'filter-btn': true
|
|
98
|
-
},
|
|
97
|
+
}, Classes.button, true), Classes.buttonPrimary, true)),
|
|
99
98
|
onClick: confirm
|
|
100
99
|
}, (_b = localeText.confirmFilter) !== null && _b !== void 0 ? _b : '确定')));
|
|
101
100
|
}
|
|
@@ -54,7 +54,6 @@ function Panel(_ref) {
|
|
|
54
54
|
}, renderPanelContent()));
|
|
55
55
|
}
|
|
56
56
|
function Filter(_ref2) {
|
|
57
|
-
var _cx;
|
|
58
57
|
var _ref2$size = _ref2.size,
|
|
59
58
|
size = _ref2$size === void 0 ? 12 : _ref2$size,
|
|
60
59
|
style = _ref2.style,
|
|
@@ -118,7 +117,7 @@ function Filter(_ref2) {
|
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
};
|
|
121
|
-
var iconClassName = cx((
|
|
120
|
+
var iconClassName = cx(_defineProperty(_defineProperty({}, className, true), 'filter-panel-open', showPanel));
|
|
122
121
|
var displayFilterIcon = typeof filterIcon === 'function' ? filterIcon(isFilterActive) : filterIcon;
|
|
123
122
|
var popupParent = (getPopupParent === null || getPopupParent === void 0 ? void 0 : getPopupParent(iconWrapRef.current)) || document.body;
|
|
124
123
|
return /*#__PURE__*/React.createElement(FilterIconSpanStyle, {
|
|
@@ -134,7 +133,7 @@ function Filter(_ref2) {
|
|
|
134
133
|
}, displayFilterIcon || /*#__PURE__*/React.createElement(DefaultFilterIcon, {
|
|
135
134
|
width: size,
|
|
136
135
|
height: size
|
|
137
|
-
})), showPanel && /*#__PURE__*/createPortal(
|
|
136
|
+
})), showPanel && /*#__PURE__*/createPortal(/*#__PURE__*/React.createElement(Panel, {
|
|
138
137
|
ele: hideFilterPopupHeader ? iconWrapRef.current : iconRef.current,
|
|
139
138
|
filterIcon: displayFilterIcon,
|
|
140
139
|
hidePanel: hidePanel,
|
|
@@ -2,6 +2,22 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
2
2
|
import { isLeafNode, makeRecursiveMapper, mergeCellProps } from '../../utils';
|
|
3
3
|
export function mergeCellHover() {
|
|
4
4
|
return function (pipeline) {
|
|
5
|
+
var onMouseEnter = function onMouseEnter(e) {
|
|
6
|
+
var InRangeRow = pipeline.ref.current.domHelper.getInRangeRowByCellEvent(e);
|
|
7
|
+
InRangeRow.forEach(function (row) {
|
|
8
|
+
row.classList.add('row-hover');
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var onMouseLeave = function onMouseLeave(e) {
|
|
12
|
+
var InRangeRow = pipeline.ref.current.domHelper.getInRangeRowByCellEvent(e);
|
|
13
|
+
InRangeRow.forEach(function (row) {
|
|
14
|
+
row.classList.remove('row-hover');
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var hoverHandlers = {
|
|
18
|
+
onMouseEnter: onMouseEnter,
|
|
19
|
+
onMouseLeave: onMouseLeave
|
|
20
|
+
};
|
|
5
21
|
return pipeline.mapColumns(makeRecursiveMapper(function (col) {
|
|
6
22
|
if (!isLeafNode(col)) {
|
|
7
23
|
return col;
|
|
@@ -9,21 +25,11 @@ export function mergeCellHover() {
|
|
|
9
25
|
var prevGetCellProps = col.getCellProps;
|
|
10
26
|
return _extends(_extends({}, col), {
|
|
11
27
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
row.classList.add('row-hover');
|
|
18
|
-
});
|
|
19
|
-
},
|
|
20
|
-
onMouseLeave: function onMouseLeave(e) {
|
|
21
|
-
var InRangeRow = pipeline.ref.current.domHelper.getInRangeRowByCellEvent(e);
|
|
22
|
-
InRangeRow.forEach(function (row) {
|
|
23
|
-
row.classList.remove('row-hover');
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
28
|
+
// 大多数列没有自定义 getCellProps,直接返回静态 handlers 避免 mergeCellProps 开销
|
|
29
|
+
if (!prevGetCellProps) return hoverHandlers;
|
|
30
|
+
var prevCellProps = prevGetCellProps(value, record, rowIndex);
|
|
31
|
+
if (!prevCellProps) return hoverHandlers;
|
|
32
|
+
return mergeCellProps(prevCellProps, hoverHandlers);
|
|
27
33
|
}
|
|
28
34
|
});
|
|
29
35
|
}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
|
-
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
3
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
4
3
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
5
4
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -187,6 +186,8 @@ export function rangeSelection(opts) {
|
|
|
187
186
|
}); // todo: 后面可以把mousedown放到一个流里面
|
|
188
187
|
return pipeline.mapColumns(makeRecursiveMapper(function (col) {
|
|
189
188
|
var cellRanges = pipeline.getStateAtKey(rangeSelectionKey) || [];
|
|
189
|
+
// 没有选区时,不包装 getCellProps,避免每个 cell 多一层函数调用和 isCellInRange 检查
|
|
190
|
+
if (cellRanges.length === 0) return col;
|
|
190
191
|
var prevGetCellProps = col.getCellProps;
|
|
191
192
|
return _extends(_extends({}, col), {
|
|
192
193
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
@@ -210,9 +211,8 @@ export function rangeSelection(opts) {
|
|
|
210
211
|
};
|
|
211
212
|
}
|
|
212
213
|
function getTargetCell(target, columns) {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
var _ret = function () {
|
|
214
|
+
var _loop = function _loop() {
|
|
215
|
+
if (target.getAttribute('data-role') === 'table-cell') {
|
|
216
216
|
var columnCode = target.getAttribute('data-code');
|
|
217
217
|
var column = findByTree(columns, function (item, index) {
|
|
218
218
|
return item.code === columnCode;
|
|
@@ -229,10 +229,13 @@ function getTargetCell(target, columns) {
|
|
|
229
229
|
isFooterCell: isEleInFooter(target)
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
232
|
+
}
|
|
233
|
+
target = target.parentElement;
|
|
234
|
+
},
|
|
235
|
+
_ret;
|
|
236
|
+
while (target) {
|
|
237
|
+
_ret = _loop();
|
|
238
|
+
if (_ret) return _ret.v;
|
|
236
239
|
}
|
|
237
240
|
return null;
|
|
238
241
|
}
|
|
@@ -421,7 +424,6 @@ export function getCellRangeId(cellRange) {
|
|
|
421
424
|
* @returns
|
|
422
425
|
*/
|
|
423
426
|
function getCellRangesClassName(cellRanges, _ref2) {
|
|
424
|
-
var _cx;
|
|
425
427
|
var isFooterCell = _ref2.isFooterCell,
|
|
426
428
|
rowIndex = _ref2.rowIndex,
|
|
427
429
|
col = _ref2.col,
|
|
@@ -437,7 +439,7 @@ function getCellRangesClassName(cellRanges, _ref2) {
|
|
|
437
439
|
matchCellRangeBottom = _getMatchBorderStyle.matchCellRangeBottom,
|
|
438
440
|
matchCellRangeRight = _getMatchBorderStyle.matchCellRangeRight;
|
|
439
441
|
var isSingleCell = isCellRangeSingleCell(cellRanges);
|
|
440
|
-
var className = cx((
|
|
442
|
+
var className = cx(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Classes.tableCellRangeSingleCell, isSingleCell), Classes.tableCellRangeSelected, !isSingleCell), Classes.tableCellRangeTop, !isSingleCell && matchCellRangeTop), Classes.tableCellRangeLeft, !isSingleCell && matchCellRangeLeft), Classes.tableCellRangeBottom, !isSingleCell && matchCellRangeBottom), Classes.tableCellRangeRight, !isSingleCell && matchCellRangeRight));
|
|
441
443
|
return className;
|
|
442
444
|
}
|
|
443
445
|
function getMatchBorderStyle(cellRanges, _ref3) {
|
|
@@ -2,6 +2,7 @@ import _toArray from "@babel/runtime-corejs3/helpers/toArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
3
3
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
4
4
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
5
|
+
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; }
|
|
5
6
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
6
7
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
8
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -85,6 +86,7 @@ export function rowDetail() {
|
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
function processColumns(columns) {
|
|
89
|
+
var _context4;
|
|
88
90
|
if (columns.length === 0) {
|
|
89
91
|
return columns;
|
|
90
92
|
}
|
|
@@ -180,7 +182,7 @@ export function rowDetail() {
|
|
|
180
182
|
};
|
|
181
183
|
var _tableColumns = _toArray(tableColumns),
|
|
182
184
|
firstCol = _tableColumns[0],
|
|
183
|
-
others = _sliceInstanceProperty(_tableColumns).call(
|
|
185
|
+
others = _sliceInstanceProperty(_context4 = _arrayLikeToArray(_tableColumns)).call(_context4, 1);
|
|
184
186
|
var firstColRender = function firstColRender(value, row, rowIndex) {
|
|
185
187
|
if (row[rowDetailMetaKey]) {
|
|
186
188
|
var renderRowDetail = getTableRenderTemplate('rowDetail');
|
|
@@ -212,12 +214,12 @@ export function rowDetail() {
|
|
|
212
214
|
}
|
|
213
215
|
});
|
|
214
216
|
tableColumns[expandColumnIndex] = _extends(_extends({}, expandCol), {
|
|
215
|
-
title: /*#__PURE__*/React.createElement("div", {
|
|
217
|
+
title: (/*#__PURE__*/React.createElement("div", {
|
|
216
218
|
style: {
|
|
217
219
|
display: 'inline-block',
|
|
218
220
|
marginLeft: textOffset
|
|
219
221
|
}
|
|
220
|
-
}, internals.safeRenderHeader(expandCol)),
|
|
222
|
+
}, internals.safeRenderHeader(expandCol))),
|
|
221
223
|
render: render,
|
|
222
224
|
getCellProps: clickArea === 'cell' ? getCellProps : expandCol.getCellProps,
|
|
223
225
|
getSpanRect: function getSpanRect(value, row, rowIndex) {
|