@kdcloudjs/table 1.2.1-canary.6 → 1.2.2-canary.3
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/LICENSE +568 -568
- package/README.md +111 -111
- package/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +5480 -6087
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +18 -16
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/dist/kd-ui-complete.less +777 -777
- package/es/_utils/arrayUtil.js +0 -3
- package/es/_utils/devwarning.js +0 -1
- package/es/_utils/formatUtil.js +36 -101
- package/es/_utils/hooks.js +21 -45
- package/es/_utils/index.js +0 -2
- package/es/_utils/numberUtil.js +32 -55
- package/es/_utils/omit.js +0 -2
- package/es/_utils/type.js +0 -2
- package/es/_utils/usePopper.js +81 -144
- package/es/config-provider/compDefaultProps.js +0 -1
- package/es/config-provider/configProvider.js +2 -7
- package/es/config-provider/defaultConfig.js +0 -1
- package/es/index.js +0 -2
- package/es/locale/locale.js +11 -50
- package/es/style/color/colors.less +1 -1
- package/es/style/core/index.less +1 -1
- package/es/style/core/motion/other.less +27 -27
- package/es/style/core/motion/slide.less +53 -53
- package/es/style/core/motion.less +1 -1
- package/es/style/core/reset.less +185 -185
- package/es/style/index.less +1 -1
- package/es/style/mixins/index.less +18 -18
- package/es/style/mixins/overlay.less +21 -21
- package/es/style/mixins/reset.less +12 -12
- package/es/style/themes/default.less +445 -445
- package/es/table/base/calculations.js +25 -75
- package/es/table/base/colgroup.js +0 -1
- package/es/table/base/empty.js +6 -6
- package/es/table/base/globalStyleComponent.d.ts +4 -0
- package/es/table/base/globalStyleComponent.js +24 -0
- package/es/table/base/header.js +21 -76
- package/es/table/base/helpers/SpanManager.js +4 -11
- package/es/table/base/helpers/TableDOMUtils.js +9 -34
- package/es/table/base/helpers/__test__/SpanManager.test.js +2 -2
- package/es/table/base/helpers/__test__/TableDOMUtils.test.js +0 -1
- package/es/table/base/helpers/getRichVisibleRectsStream.js +13 -45
- package/es/table/base/helpers/rowHeightManager.js +0 -28
- package/es/table/base/html-table.js +17 -39
- package/es/table/base/loading.js +8 -10
- package/es/table/base/renderTemplates.js +42 -60
- package/es/table/base/styles.d.ts +10 -0
- package/es/table/base/styles.js +17 -16
- package/es/table/base/table.js +113 -201
- package/es/table/base/utils.js +17 -57
- package/es/table/common-views.js +0 -7
- package/es/table/interfaces.d.ts +38 -0
- package/es/table/internals.js +0 -13
- package/es/table/pipeline/const.d.ts +3 -0
- package/es/table/pipeline/const.js +3 -0
- package/es/table/pipeline/features/autoFill.js +11 -40
- package/es/table/pipeline/features/autoRowSpan.js +1 -14
- package/es/table/pipeline/features/colGroupExtendable.js +4 -19
- package/es/table/pipeline/features/columnDrag.js +41 -97
- package/es/table/pipeline/features/columnFilter.js +12 -51
- package/es/table/pipeline/features/columnHover.js +1 -7
- package/es/table/pipeline/features/columnRangeHover.js +1 -8
- package/es/table/pipeline/features/columnResizeWidth.js +13 -39
- package/es/table/pipeline/features/contextMenu.js +22 -95
- package/es/table/pipeline/features/featureApi/RowDragApi.d.ts +15 -0
- package/es/table/pipeline/features/featureApi/RowDragApi.js +66 -0
- package/es/table/pipeline/features/featureApi/utils.d.ts +2 -0
- package/es/table/pipeline/features/featureApi/utils.js +10 -0
- package/es/table/pipeline/features/filter/DefaultFilterContent.js +14 -30
- package/es/table/pipeline/features/filter/DefaultFilterIcon.js +1 -1
- package/es/table/pipeline/features/filter/Filter.js +27 -51
- package/es/table/pipeline/features/filter/FilterPanel.js +11 -25
- package/es/table/pipeline/features/filter/util.js +0 -4
- package/es/table/pipeline/features/footerDataSource.js +0 -3
- package/es/table/pipeline/features/mergeCellHover.js +0 -1
- package/es/table/pipeline/features/multiSelect.js +15 -57
- package/es/table/pipeline/features/rangeSelection.js +73 -152
- package/es/table/pipeline/features/rowDetail.js +4 -43
- package/es/table/pipeline/features/rowDrag.d.ts +10 -12
- package/es/table/pipeline/features/rowDrag.js +491 -236
- package/es/table/pipeline/features/rowGrouping.js +4 -37
- package/es/table/pipeline/features/singleSelect.js +0 -24
- package/es/table/pipeline/features/sort.js +38 -96
- package/es/table/pipeline/features/tips.js +4 -10
- package/es/table/pipeline/features/treeMode.d.ts +1 -0
- package/es/table/pipeline/features/treeMode.js +38 -57
- package/es/table/pipeline/features/treeSelect.js +2 -28
- package/es/table/pipeline/pipeline.d.ts +3 -0
- package/es/table/pipeline/pipeline.js +35 -54
- package/es/table/pivot/cross-table/buildCrossTable.js +21 -72
- package/es/table/pivot/cross-table/cross-table.js +23 -31
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -57
- package/es/table/pivot/cross-tree-table/cross-tree-table.js +36 -61
- package/es/table/pivot/pivot-utils/buildDrillTree.js +10 -23
- package/es/table/pivot/pivot-utils/builders.js +34 -74
- package/es/table/pivot/pivot-utils/convert-utils.js +16 -42
- package/es/table/pivot/pivot-utils/simpleEncode.js +0 -1
- package/es/table/style/index.less +1 -1
- package/es/table/transforms/autoRowSpan.js +1 -15
- package/es/table/transforms/autoWidth.js +13 -35
- package/es/table/transforms/buildTree.js +1 -2
- package/es/table/transforms/columnHover.js +9 -15
- package/es/table/transforms/columnRangeHover.js +12 -19
- package/es/table/transforms/columnResize.js +18 -42
- package/es/table/transforms/flatten.js +0 -3
- package/es/table/transforms/orderField.js +0 -3
- package/es/table/transforms/sort.js +42 -101
- package/es/table/transforms/tips.js +5 -10
- package/es/table/transforms/treeMode.js +36 -77
- package/es/table/transforms/visible.js +0 -2
- package/es/table/use/useResizeObserver.js +1 -4
- package/es/table/utils/applyTransforms.js +0 -1
- package/es/table/utils/browserType.js +12 -19
- package/es/table/utils/buildTree.js +7 -22
- package/es/table/utils/collectNodes.js +4 -13
- package/es/table/utils/console.js +0 -14
- package/es/table/utils/copyToClipboard.js +0 -4
- package/es/table/utils/element.js +14 -41
- package/es/table/utils/exportTableAsExcel.js +7 -43
- package/es/table/utils/getTreeDepth.js +4 -12
- package/es/table/utils/groupBy.js +4 -13
- package/es/table/utils/layeredFilter.js +0 -4
- package/es/table/utils/layeredSort.js +0 -5
- package/es/table/utils/makeRecursiveMapper.js +4 -15
- package/es/table/utils/mergeCellProps.js +6 -14
- package/es/table/utils/others.js +6 -19
- package/es/table/utils/proto.js +2 -30
- package/es/table/utils/smartCompare.js +4 -12
- package/es/table/utils/traverseColumn.js +5 -18
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +8 -30
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +19 -74
- package/es/table/utils/uiDegrade.js +0 -5
- package/lib/_utils/arrayUtil.js +2 -8
- package/lib/_utils/devwarning.js +0 -5
- package/lib/_utils/formatUtil.js +36 -105
- package/lib/_utils/hooks.js +21 -56
- package/lib/_utils/index.js +2 -9
- package/lib/_utils/numberUtil.js +32 -63
- package/lib/_utils/omit.js +0 -5
- package/lib/_utils/react-children.js +0 -5
- package/lib/_utils/type.js +3 -11
- package/lib/_utils/usePopper.js +86 -173
- package/lib/config-provider/ConfigContext.js +2 -6
- package/lib/config-provider/compDefaultProps.js +1 -3
- package/lib/config-provider/configProvider.js +6 -22
- package/lib/config-provider/defaultConfig.js +1 -7
- package/lib/config-provider/index.js +1 -8
- package/lib/index.js +2 -8
- package/lib/locale/index.js +3 -11
- package/lib/locale/locale.js +15 -71
- package/lib/locale/zh-CN.js +1 -2
- package/lib/style/color/colors.less +1 -1
- package/lib/style/components.less +1 -1
- package/lib/style/core/index.less +1 -1
- package/lib/style/core/motion/other.less +27 -27
- package/lib/style/core/motion/slide.less +53 -53
- package/lib/style/core/motion.less +1 -1
- package/lib/style/core/reset.less +185 -185
- package/lib/style/index.less +1 -1
- package/lib/style/mixins/index.less +18 -18
- package/lib/style/mixins/overlay.less +21 -21
- package/lib/style/mixins/reset.less +12 -12
- package/lib/style/themes/default.less +445 -445
- package/lib/table/base/calculations.js +25 -86
- package/lib/table/base/colgroup.js +0 -5
- package/lib/table/base/empty.js +8 -20
- package/lib/table/base/globalStyleComponent.d.ts +4 -0
- package/lib/table/base/globalStyleComponent.js +35 -0
- package/lib/table/base/header.js +21 -86
- package/lib/table/base/helpers/SpanManager.js +6 -16
- package/lib/table/base/helpers/TableDOMUtils.js +9 -37
- package/lib/table/base/helpers/__test__/SpanManager.test.js +2 -4
- package/lib/table/base/helpers/__test__/TableDOMUtils.test.js +0 -5
- package/lib/table/base/helpers/__test__/rowHeightManager.test.js +0 -1
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +15 -65
- package/lib/table/base/helpers/rowHeightManager.js +0 -33
- package/lib/table/base/html-table.js +17 -49
- package/lib/table/base/index.js +0 -2
- package/lib/table/base/loading.js +8 -14
- package/lib/table/base/renderTemplates.js +45 -76
- package/lib/table/base/styles.d.ts +10 -0
- package/lib/table/base/styles.js +24 -42
- package/lib/table/base/table.js +125 -245
- package/lib/table/base/utils.js +27 -109
- package/lib/table/common-views.js +4 -24
- package/lib/table/index.js +0 -13
- package/lib/table/interfaces.d.ts +38 -0
- package/lib/table/internals.js +2 -17
- package/lib/table/pipeline/const.d.ts +3 -0
- package/lib/table/pipeline/const.js +9 -0
- package/lib/table/pipeline/features/autoFill.js +14 -53
- package/lib/table/pipeline/features/autoRowSpan.js +1 -19
- package/lib/table/pipeline/features/buildTree.js +0 -2
- package/lib/table/pipeline/features/colGroupExtendable.js +6 -35
- package/lib/table/pipeline/features/columnDrag.js +41 -103
- package/lib/table/pipeline/features/columnFilter.js +12 -65
- package/lib/table/pipeline/features/columnHover.js +1 -11
- package/lib/table/pipeline/features/columnRangeHover.js +1 -13
- package/lib/table/pipeline/features/columnResizeWidth.js +18 -63
- package/lib/table/pipeline/features/contextMenu.js +24 -121
- package/lib/table/pipeline/features/featureApi/RowDragApi.d.ts +15 -0
- package/lib/table/pipeline/features/featureApi/RowDragApi.js +72 -0
- package/lib/table/pipeline/features/featureApi/utils.d.ts +2 -0
- package/lib/table/pipeline/features/featureApi/utils.js +17 -0
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +17 -52
- package/lib/table/pipeline/features/filter/DefaultFilterIcon.js +1 -4
- package/lib/table/pipeline/features/filter/Filter.js +30 -77
- package/lib/table/pipeline/features/filter/FilterPanel.js +14 -44
- package/lib/table/pipeline/features/filter/index.js +0 -5
- package/lib/table/pipeline/features/filter/util.js +2 -10
- package/lib/table/pipeline/features/footerDataSource.js +1 -12
- package/lib/table/pipeline/features/index.js +0 -23
- package/lib/table/pipeline/features/mergeCellHover.js +0 -5
- package/lib/table/pipeline/features/multiSelect.js +15 -71
- package/lib/table/pipeline/features/rangeSelection.js +75 -173
- package/lib/table/pipeline/features/rowDetail.js +4 -67
- package/lib/table/pipeline/features/rowDrag.d.ts +10 -12
- package/lib/table/pipeline/features/rowDrag.js +494 -252
- package/lib/table/pipeline/features/rowGrouping.js +4 -57
- package/lib/table/pipeline/features/singleSelect.js +0 -34
- package/lib/table/pipeline/features/sort.js +37 -115
- package/lib/table/pipeline/features/tips.js +4 -19
- package/lib/table/pipeline/features/treeMode.d.ts +1 -0
- package/lib/table/pipeline/features/treeMode.js +40 -80
- package/lib/table/pipeline/features/treeSelect.js +2 -36
- package/lib/table/pipeline/index.js +2 -10
- package/lib/table/pipeline/pipeline.d.ts +3 -0
- package/lib/table/pipeline/pipeline.js +36 -65
- package/lib/table/pivot/cross-table/buildCrossTable.js +21 -83
- package/lib/table/pivot/cross-table/constants.js +1 -2
- package/lib/table/pivot/cross-table/cross-table.js +25 -42
- package/lib/table/pivot/cross-table/index.js +0 -4
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +22 -70
- package/lib/table/pivot/cross-tree-table/cross-tree-table.js +37 -73
- package/lib/table/pivot/cross-tree-table/index.js +0 -3
- package/lib/table/pivot/pivot-utils/buildDrillTree.js +10 -29
- package/lib/table/pivot/pivot-utils/builders.js +34 -85
- package/lib/table/pivot/pivot-utils/convert-utils.js +16 -60
- package/lib/table/pivot/pivot-utils/index.js +0 -7
- package/lib/table/pivot/pivot-utils/simpleEncode.js +0 -2
- package/lib/table/style/css.js +0 -1
- package/lib/table/style/index.js +0 -1
- package/lib/table/style/index.less +1 -1
- package/lib/table/transforms/autoRowSpan.js +1 -21
- package/lib/table/transforms/autoWidth.js +15 -58
- package/lib/table/transforms/buildTree.js +1 -4
- package/lib/table/transforms/columnHover.js +9 -22
- package/lib/table/transforms/columnRangeHover.js +12 -27
- package/lib/table/transforms/columnResize.js +20 -63
- package/lib/table/transforms/flatten.js +0 -5
- package/lib/table/transforms/index.js +0 -12
- package/lib/table/transforms/orderField.js +0 -7
- package/lib/table/transforms/sort.js +44 -127
- package/lib/table/transforms/tips.js +5 -20
- package/lib/table/transforms/treeMode.js +38 -106
- package/lib/table/transforms/visible.js +0 -7
- package/lib/table/transforms/warnTransformsDeprecated.js +0 -4
- package/lib/table/use/useResizeObserver.js +2 -10
- package/lib/table/utils/applyTransforms.js +0 -2
- package/lib/table/utils/browserType.js +14 -23
- package/lib/table/utils/buildTree.js +7 -33
- package/lib/table/utils/collectNodes.js +4 -18
- package/lib/table/utils/console.js +2 -19
- package/lib/table/utils/copyToClipboard.js +1 -8
- package/lib/table/utils/element.js +14 -46
- package/lib/table/utils/exportTableAsExcel.js +7 -52
- package/lib/table/utils/getTreeDepth.js +4 -17
- package/lib/table/utils/groupBy.js +4 -17
- package/lib/table/utils/index.js +0 -22
- package/lib/table/utils/isGroupColumn.js +0 -3
- package/lib/table/utils/isLeafNode.js +0 -1
- package/lib/table/utils/keyCode.js +1 -2
- package/lib/table/utils/layeredFilter.js +0 -10
- package/lib/table/utils/layeredSort.js +0 -10
- package/lib/table/utils/makeRecursiveMapper.js +4 -24
- package/lib/table/utils/mergeCellProps.js +6 -18
- package/lib/table/utils/others.js +7 -36
- package/lib/table/utils/proto.js +3 -35
- package/lib/table/utils/selectColumn.js +2 -5
- package/lib/table/utils/smartCompare.js +4 -13
- package/lib/table/utils/traverseColumn.js +5 -25
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +10 -41
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +21 -90
- package/lib/table/utils/uiDegrade.js +1 -8
- package/package.json +218 -218
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 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); }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
4
|
+
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; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context4; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context4 = {}.toString.call(r)).call(_context4, 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; } }
|
|
6
|
+
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; }
|
|
11
7
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
12
8
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
9
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
14
10
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
15
11
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
16
12
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
17
|
-
|
|
18
13
|
var __rest = this && this.__rest || function (s, e) {
|
|
19
14
|
var t = {};
|
|
20
|
-
|
|
21
|
-
for (var p in s) {
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
25
16
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
17
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
27
18
|
}
|
|
28
19
|
return t;
|
|
29
20
|
};
|
|
30
|
-
|
|
31
21
|
import { getTreeDepth, isLeafNode } from '../../utils';
|
|
32
22
|
import { ROW_KEY } from './constants';
|
|
33
23
|
export default function buildCrossTable(options) {
|
|
34
24
|
var _a, _b, _c;
|
|
35
|
-
|
|
36
25
|
var leftTotalNode = options.leftTotalNode,
|
|
37
|
-
|
|
26
|
+
topTotalNode = options.topTotalNode;
|
|
27
|
+
// 有的时候 leftTree/topTree 是通过 node.children 传入的
|
|
38
28
|
// 此时 leftTree/topTree 等于 null 和等于空数组是等价的
|
|
39
29
|
// 故在这里兼容 leftTree/topTree 为空的情况
|
|
40
|
-
|
|
41
30
|
var leftTree = (_a = options.leftTree) !== null && _a !== void 0 ? _a : [];
|
|
42
31
|
var topTree = (_b = options.topTree) !== null && _b !== void 0 ? _b : [];
|
|
43
32
|
var leftMetaColumns = (_c = options.leftMetaColumns) !== null && _c !== void 0 ? _c : [];
|
|
@@ -47,24 +36,17 @@ export default function buildCrossTable(options) {
|
|
|
47
36
|
dataSource: getDataSource()
|
|
48
37
|
};
|
|
49
38
|
/** 获取表格的列配置 */
|
|
50
|
-
|
|
51
39
|
function getColumns() {
|
|
52
40
|
var _context;
|
|
53
|
-
|
|
54
41
|
return _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(getLeftPartColumns()), _toConsumableArray(getDataPartColumns()));
|
|
55
|
-
|
|
56
42
|
function getLeftPartColumns() {
|
|
57
43
|
var _a;
|
|
58
|
-
|
|
59
44
|
var leftPartColumns = [];
|
|
60
|
-
|
|
61
45
|
for (var index = 0; index < leftHeaderWidth; index++) {
|
|
62
46
|
var metaCol = (_a = leftMetaColumns[index]) !== null && _a !== void 0 ? _a : {};
|
|
63
|
-
|
|
64
47
|
var getCellProps = metaCol.getCellProps,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
48
|
+
render = metaCol.render,
|
|
49
|
+
staticMetaColConfig = __rest(metaCol, ["getCellProps", "render"]);
|
|
68
50
|
leftPartColumns.push(_extends(_extends({
|
|
69
51
|
columnType: 'left',
|
|
70
52
|
lock: true
|
|
@@ -75,48 +57,37 @@ export default function buildCrossTable(options) {
|
|
|
75
57
|
render: leftHeaderRenderFactory(metaCol, index)
|
|
76
58
|
}));
|
|
77
59
|
}
|
|
78
|
-
|
|
79
60
|
return leftPartColumns;
|
|
80
|
-
|
|
81
61
|
function leftHeaderGetCellPropsFactory(metaCol, colIndex) {
|
|
82
62
|
return function (_value, row, rowIndex) {
|
|
83
63
|
var _a;
|
|
84
|
-
|
|
85
64
|
var node = row.nodes[colIndex];
|
|
86
65
|
return (_a = metaCol.getCellProps) === null || _a === void 0 ? void 0 : _a.call(metaCol, node, colIndex);
|
|
87
66
|
};
|
|
88
67
|
}
|
|
89
|
-
|
|
90
68
|
function leftHeaderGetSpanRectFactory(metaCol, colIndex) {
|
|
91
69
|
return function (_value, row) {
|
|
92
70
|
return row.rects[colIndex];
|
|
93
71
|
};
|
|
94
72
|
}
|
|
95
|
-
|
|
96
73
|
function leftHeaderGetValueFactory(metaCol, colIndex) {
|
|
97
74
|
return function (row, rowIndex) {
|
|
98
75
|
var node = row.nodes[colIndex];
|
|
99
76
|
return node.value;
|
|
100
77
|
};
|
|
101
78
|
}
|
|
102
|
-
|
|
103
79
|
function leftHeaderRenderFactory(metaCol, colIndex) {
|
|
104
80
|
return function (v, row, rowIndex) {
|
|
105
81
|
var _a;
|
|
106
|
-
|
|
107
82
|
var node = row.nodes[colIndex];
|
|
108
|
-
|
|
109
83
|
if (metaCol.render) {
|
|
110
84
|
return metaCol.render(node, colIndex);
|
|
111
85
|
}
|
|
112
|
-
|
|
113
86
|
return (_a = node.title) !== null && _a !== void 0 ? _a : node.value;
|
|
114
87
|
};
|
|
115
88
|
}
|
|
116
89
|
}
|
|
117
90
|
/** 获取表格数据部分的列配置 */
|
|
118
|
-
|
|
119
|
-
|
|
120
91
|
function getDataPartColumns() {
|
|
121
92
|
if (topTree.length > 0) {
|
|
122
93
|
return dfs(topTree, {
|
|
@@ -131,29 +102,25 @@ export default function buildCrossTable(options) {
|
|
|
131
102
|
} else {
|
|
132
103
|
return [];
|
|
133
104
|
}
|
|
134
|
-
|
|
135
105
|
function dfs(nodes, ctx) {
|
|
136
106
|
var result = [];
|
|
137
|
-
|
|
138
107
|
var _iterator = _createForOfIteratorHelper(nodes),
|
|
139
|
-
|
|
140
|
-
|
|
108
|
+
_step;
|
|
141
109
|
try {
|
|
142
110
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
143
111
|
var node = _step.value;
|
|
144
112
|
ctx.valuePath.push(node.value);
|
|
145
|
-
|
|
146
113
|
if (isLeafNode(node)) {
|
|
147
114
|
// 叶子节点
|
|
148
115
|
result.push(getDataColumn(node, ctx.depth));
|
|
149
116
|
} else {
|
|
150
117
|
var key = node.key,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
118
|
+
value = node.value,
|
|
119
|
+
children = node.children,
|
|
120
|
+
others = __rest(node
|
|
121
|
+
// 强制展开的节点
|
|
122
|
+
, ["key", "value", "children"]);
|
|
123
|
+
// 强制展开的节点
|
|
157
124
|
result.push(_extends(_extends({
|
|
158
125
|
columnType: 'data-parent'
|
|
159
126
|
}, others), {
|
|
@@ -164,7 +131,6 @@ export default function buildCrossTable(options) {
|
|
|
164
131
|
})
|
|
165
132
|
}));
|
|
166
133
|
}
|
|
167
|
-
|
|
168
134
|
ctx.valuePath.pop();
|
|
169
135
|
}
|
|
170
136
|
} catch (err) {
|
|
@@ -172,23 +138,19 @@ export default function buildCrossTable(options) {
|
|
|
172
138
|
} finally {
|
|
173
139
|
_iterator.f();
|
|
174
140
|
}
|
|
175
|
-
|
|
176
141
|
return result;
|
|
177
142
|
}
|
|
178
143
|
}
|
|
179
|
-
|
|
180
144
|
function getDataColumn(topNode, topDepth) {
|
|
181
145
|
var columnGetValue = function columnGetValue(row) {
|
|
182
146
|
var leftDepth = row.nodes.length - 1;
|
|
183
147
|
var leftNode = row.nodes[leftDepth];
|
|
184
148
|
return options.getValue(leftNode, topNode, leftDepth, topDepth);
|
|
185
149
|
};
|
|
186
|
-
|
|
187
150
|
var key = topNode.key,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
151
|
+
value = topNode.value,
|
|
152
|
+
children = topNode.children,
|
|
153
|
+
others = __rest(topNode, ["key", "value", "children"]);
|
|
192
154
|
return _extends(_extends({
|
|
193
155
|
columnType: 'data'
|
|
194
156
|
}, others), {
|
|
@@ -201,7 +163,6 @@ export default function buildCrossTable(options) {
|
|
|
201
163
|
var leftNode = row.nodes[leftDepth];
|
|
202
164
|
return options.render(value, leftNode, topNode, leftDepth, topDepth);
|
|
203
165
|
}
|
|
204
|
-
|
|
205
166
|
return value;
|
|
206
167
|
},
|
|
207
168
|
getCellProps: function getCellProps(value, row) {
|
|
@@ -214,7 +175,6 @@ export default function buildCrossTable(options) {
|
|
|
214
175
|
});
|
|
215
176
|
}
|
|
216
177
|
}
|
|
217
|
-
|
|
218
178
|
function getDataSource() {
|
|
219
179
|
var flatRows = [];
|
|
220
180
|
var ctx = {
|
|
@@ -223,41 +183,31 @@ export default function buildCrossTable(options) {
|
|
|
223
183
|
rects: [],
|
|
224
184
|
rowIndex: 0
|
|
225
185
|
};
|
|
226
|
-
|
|
227
186
|
if (leftTree.length > 0) {
|
|
228
187
|
dfs(leftTree, ctx);
|
|
229
188
|
} else if (leftTotalNode) {
|
|
230
189
|
dfs([leftTotalNode], ctx);
|
|
231
190
|
} // else 表格没有行,展示空表格
|
|
232
|
-
|
|
233
|
-
|
|
234
191
|
return flatRows;
|
|
235
|
-
|
|
236
192
|
function dfs(nodes, ctx) {
|
|
237
193
|
var count = 0;
|
|
238
|
-
|
|
239
194
|
var _iterator2 = _createForOfIteratorHelper(nodes),
|
|
240
|
-
|
|
241
|
-
|
|
195
|
+
_step2;
|
|
242
196
|
try {
|
|
243
197
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
244
|
-
var _context2, _context3
|
|
245
|
-
|
|
198
|
+
var _context2, _context3;
|
|
246
199
|
var node = _step2.value;
|
|
247
|
-
|
|
248
200
|
if (node.hidden) {
|
|
249
201
|
// 跳过被隐藏的节点
|
|
250
202
|
continue;
|
|
251
203
|
}
|
|
252
|
-
|
|
253
204
|
var rect = {
|
|
254
205
|
top: ctx.rowIndex + count,
|
|
255
206
|
bottom: -1,
|
|
256
207
|
left: ctx.depth,
|
|
257
208
|
right: -1
|
|
258
209
|
};
|
|
259
|
-
var row = (
|
|
260
|
-
|
|
210
|
+
var row = _defineProperty(_defineProperty(_defineProperty({}, ROW_KEY, node.key), "rects", _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(ctx.rects), [rect])), "nodes", _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(ctx.nodes), [node]));
|
|
261
211
|
if (isLeafNode(node)) {
|
|
262
212
|
rect.right = leftHeaderWidth;
|
|
263
213
|
rect.bottom = rect.top + 1;
|
|
@@ -284,7 +234,6 @@ export default function buildCrossTable(options) {
|
|
|
284
234
|
} finally {
|
|
285
235
|
_iterator2.f();
|
|
286
236
|
}
|
|
287
|
-
|
|
288
237
|
return {
|
|
289
238
|
count: count
|
|
290
239
|
};
|
|
@@ -1,50 +1,42 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
-
|
|
4
3
|
var __rest = this && this.__rest || function (s, e) {
|
|
5
4
|
var t = {};
|
|
6
|
-
|
|
7
|
-
for (var p in s) {
|
|
8
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11
6
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
12
7
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
13
8
|
}
|
|
14
9
|
return t;
|
|
15
10
|
};
|
|
16
|
-
|
|
17
11
|
import React from 'react';
|
|
18
12
|
import { Table } from '../../base';
|
|
19
13
|
import buildCrossTable from './buildCrossTable';
|
|
20
14
|
import { ROW_KEY } from './constants';
|
|
21
15
|
export default (function CrossTable(_a) {
|
|
22
16
|
var _a$BaseTableComponent = _a.BaseTableComponent,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
BaseTableComponent = _a$BaseTableComponent === void 0 ? Table : _a$BaseTableComponent,
|
|
18
|
+
leftTree = _a.leftTree,
|
|
19
|
+
leftTotalNode = _a.leftTotalNode,
|
|
20
|
+
topTree = _a.topTree,
|
|
21
|
+
topTotalNode = _a.topTotalNode,
|
|
22
|
+
getValue = _a.getValue,
|
|
23
|
+
getCellProps = _a.getCellProps,
|
|
24
|
+
leftMetaColumns = _a.leftMetaColumns,
|
|
25
|
+
render = _a.render,
|
|
26
|
+
baseTableRef = _a.baseTableRef,
|
|
27
|
+
others = __rest(_a, ["BaseTableComponent", "leftTree", "leftTotalNode", "topTree", "topTotalNode", "getValue", "getCellProps", "leftMetaColumns", "render", "baseTableRef"]);
|
|
35
28
|
var _buildCrossTable = buildCrossTable({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
29
|
+
leftTree: leftTree,
|
|
30
|
+
topTree: topTree,
|
|
31
|
+
leftTotalNode: leftTotalNode,
|
|
32
|
+
topTotalNode: topTotalNode,
|
|
33
|
+
getValue: getValue,
|
|
34
|
+
getCellProps: getCellProps,
|
|
35
|
+
render: render,
|
|
36
|
+
leftMetaColumns: leftMetaColumns
|
|
37
|
+
}),
|
|
38
|
+
dataSource = _buildCrossTable.dataSource,
|
|
39
|
+
columns = _buildCrossTable.columns;
|
|
48
40
|
return /*#__PURE__*/React.createElement(BaseTableComponent, _extends({
|
|
49
41
|
ref: baseTableRef
|
|
50
42
|
}, others, {
|
|
@@ -1,49 +1,38 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
3
3
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { var _context4; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 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); }
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
4
|
+
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; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(r, a) { if (r) { var _context4; if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = _sliceInstanceProperty(_context4 = {}.toString.call(r)).call(_context4, 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; } }
|
|
6
|
+
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; }
|
|
11
7
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
12
8
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
13
9
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
14
10
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
15
11
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
16
12
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
17
|
-
|
|
18
13
|
var __rest = this && this.__rest || function (s, e) {
|
|
19
14
|
var t = {};
|
|
20
|
-
|
|
21
|
-
for (var p in s) {
|
|
22
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
25
16
|
if (s != null && typeof _Object$getOwnPropertySymbols === "function") for (var i = 0, p = _Object$getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
17
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
27
18
|
}
|
|
28
19
|
return t;
|
|
29
20
|
};
|
|
30
|
-
|
|
31
21
|
import { noop } from 'rxjs';
|
|
32
22
|
import { features, TablePipeline } from '../../pipeline';
|
|
33
23
|
import { isLeafNode as standardIsLeafNode } from '../../utils';
|
|
34
24
|
import { ROW_KEY } from '../cross-table';
|
|
35
25
|
export default function buildCrossTreeTable(options) {
|
|
36
26
|
var _a, _b;
|
|
37
|
-
|
|
38
27
|
var primaryColumn = options.primaryColumn,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
openKeys = options.openKeys,
|
|
29
|
+
onChangeOpenKeys = options.onChangeOpenKeys,
|
|
30
|
+
indentSize = options.indentSize,
|
|
31
|
+
_options$isLeafNode = options.isLeafNode,
|
|
32
|
+
isLeafNodeOpt = _options$isLeafNode === void 0 ? standardIsLeafNode : _options$isLeafNode;
|
|
33
|
+
// 有的时候 leftTree/topTree 是通过 node.children 传入的
|
|
44
34
|
// 此时 leftTree/topTree 等于 null 和等于空数组是等价的
|
|
45
35
|
// 故在这里兼容 leftTree/topTree 为空的情况
|
|
46
|
-
|
|
47
36
|
var leftTree = (_a = options.leftTree) !== null && _a !== void 0 ? _a : [];
|
|
48
37
|
var topTree = (_b = options.topTree) !== null && _b !== void 0 ? _b : [];
|
|
49
38
|
var pipeline = new TablePipeline({
|
|
@@ -71,10 +60,8 @@ export default function buildCrossTreeTable(options) {
|
|
|
71
60
|
columns: pipeline.getColumns()
|
|
72
61
|
};
|
|
73
62
|
/** 获取表格的列配置 */
|
|
74
|
-
|
|
75
63
|
function getColumns() {
|
|
76
64
|
var _context;
|
|
77
|
-
|
|
78
65
|
return _concatInstanceProperty(_context = [_extends(_extends({}, primaryColumn), {
|
|
79
66
|
getValue: function getValue(row) {
|
|
80
67
|
return row.node.value;
|
|
@@ -88,35 +75,28 @@ export default function buildCrossTreeTable(options) {
|
|
|
88
75
|
if (primaryColumn.render) {
|
|
89
76
|
return primaryColumn.render(row.node, row.nodes.length - 1);
|
|
90
77
|
}
|
|
91
|
-
|
|
92
78
|
return value;
|
|
93
79
|
}
|
|
94
80
|
})]).call(_context, _toConsumableArray(getDataPartColumns()));
|
|
95
81
|
/** 获取表格数据部分的列配置 */
|
|
96
|
-
|
|
97
82
|
function getDataPartColumns() {
|
|
98
83
|
return dfs(topTree, {
|
|
99
84
|
depth: 0
|
|
100
85
|
});
|
|
101
|
-
|
|
102
86
|
function dfs(nodes, ctx) {
|
|
103
87
|
var result = [];
|
|
104
|
-
|
|
105
88
|
var _iterator = _createForOfIteratorHelper(nodes),
|
|
106
|
-
|
|
107
|
-
|
|
89
|
+
_step;
|
|
108
90
|
try {
|
|
109
91
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
110
92
|
var node = _step.value;
|
|
111
|
-
|
|
112
93
|
if (standardIsLeafNode(node)) {
|
|
113
94
|
result.push(getDataColumn(node, ctx.depth));
|
|
114
95
|
} else {
|
|
115
96
|
var key = node.key,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
97
|
+
value = node.value,
|
|
98
|
+
children = node.children,
|
|
99
|
+
others = __rest(node, ["key", "value", "children"]);
|
|
120
100
|
result.push(_extends(_extends({}, others), {
|
|
121
101
|
name: value,
|
|
122
102
|
children: dfs(children, {
|
|
@@ -130,23 +110,19 @@ export default function buildCrossTreeTable(options) {
|
|
|
130
110
|
} finally {
|
|
131
111
|
_iterator.f();
|
|
132
112
|
}
|
|
133
|
-
|
|
134
113
|
return result;
|
|
135
114
|
}
|
|
136
115
|
}
|
|
137
|
-
|
|
138
116
|
function getDataColumn(topNode, topDepth) {
|
|
139
117
|
var columnGetValue = function columnGetValue(row) {
|
|
140
118
|
var leftDepth = row.nodes.length - 1;
|
|
141
119
|
var leftNode = row.node;
|
|
142
120
|
return options.getValue(leftNode, topNode, leftDepth, topDepth);
|
|
143
121
|
};
|
|
144
|
-
|
|
145
122
|
var key = topNode.key,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
123
|
+
value = topNode.value,
|
|
124
|
+
children = topNode.children,
|
|
125
|
+
others = __rest(topNode, ["key", "value", "children"]);
|
|
150
126
|
return _extends(_extends({}, others), {
|
|
151
127
|
getValue: columnGetValue,
|
|
152
128
|
name: value,
|
|
@@ -157,7 +133,6 @@ export default function buildCrossTreeTable(options) {
|
|
|
157
133
|
var leftNode = row.node;
|
|
158
134
|
return options.render(value, leftNode, topNode, leftDepth, topDepth);
|
|
159
135
|
}
|
|
160
|
-
|
|
161
136
|
return value;
|
|
162
137
|
},
|
|
163
138
|
getCellProps: function getCellProps(value, row) {
|
|
@@ -170,39 +145,30 @@ export default function buildCrossTreeTable(options) {
|
|
|
170
145
|
});
|
|
171
146
|
}
|
|
172
147
|
}
|
|
173
|
-
|
|
174
148
|
function getDataSource() {
|
|
175
149
|
return dfs(leftTree, {
|
|
176
150
|
nodes: []
|
|
177
151
|
});
|
|
178
|
-
|
|
179
152
|
function dfs(nodes, ctx) {
|
|
180
153
|
var result = [];
|
|
181
|
-
|
|
182
154
|
var _iterator2 = _createForOfIteratorHelper(nodes),
|
|
183
|
-
|
|
184
|
-
|
|
155
|
+
_step2;
|
|
185
156
|
try {
|
|
186
157
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
187
158
|
var node = _step2.value;
|
|
188
|
-
|
|
189
159
|
if (node.hidden) {
|
|
190
160
|
// 跳过被隐藏的节点
|
|
191
161
|
continue;
|
|
192
162
|
}
|
|
193
|
-
|
|
194
163
|
if (standardIsLeafNode(node)) {
|
|
195
|
-
var _context2
|
|
196
|
-
|
|
197
|
-
result.push((_result$push = {}, _defineProperty(_result$push, ROW_KEY, node.key), _defineProperty(_result$push, "node", node), _defineProperty(_result$push, "nodes", _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(ctx.nodes), [node])), _result$push));
|
|
164
|
+
var _context2;
|
|
165
|
+
result.push(_defineProperty(_defineProperty(_defineProperty({}, ROW_KEY, node.key), "node", node), "nodes", _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(ctx.nodes), [node])));
|
|
198
166
|
} else {
|
|
199
|
-
var _context3
|
|
200
|
-
|
|
167
|
+
var _context3;
|
|
201
168
|
var _nodes = _concatInstanceProperty(_context3 = []).call(_context3, _toConsumableArray(ctx.nodes), [node]);
|
|
202
|
-
|
|
203
169
|
ctx.nodes.push(node);
|
|
204
170
|
var children = dfs(node.children, ctx);
|
|
205
|
-
result.push((
|
|
171
|
+
result.push(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ROW_KEY, node.key), "node", node), "nodes", _nodes), "children", children));
|
|
206
172
|
ctx.nodes.pop();
|
|
207
173
|
}
|
|
208
174
|
}
|
|
@@ -211,7 +177,6 @@ export default function buildCrossTreeTable(options) {
|
|
|
211
177
|
} finally {
|
|
212
178
|
_iterator2.f();
|
|
213
179
|
}
|
|
214
|
-
|
|
215
180
|
return result;
|
|
216
181
|
}
|
|
217
182
|
}
|