@kdcloudjs/table 1.0.1 → 1.0.2
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 +1 -1
- package/README.md +34 -33
- package/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.css.map +1 -1
- package/dist/@kdcloudjs/table.js +6323 -3240
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +32 -24
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/_utils/hooks.js +1 -2
- package/es/_utils/numberUtil.js +3 -4
- package/es/locale/locale.js +1 -2
- package/es/table/base/calculations.js +2 -3
- package/es/table/base/header.d.ts +6 -2
- package/es/table/base/header.js +36 -13
- package/es/table/base/helpers/SpanManager.js +1 -1
- package/es/table/base/helpers/TableDOMUtils.d.ts +3 -0
- package/es/table/base/helpers/TableDOMUtils.js +23 -5
- package/es/table/base/helpers/getRichVisibleRectsStream.d.ts +23 -0
- package/es/table/base/helpers/getRichVisibleRectsStream.js +216 -0
- package/es/table/base/html-table.d.ts +3 -1
- package/es/table/base/html-table.js +34 -8
- package/es/table/base/interfaces.d.ts +1 -0
- package/es/table/base/renderTemplates.d.ts +1 -0
- package/es/table/base/renderTemplates.js +344 -0
- package/es/table/base/styles.d.ts +14 -0
- package/es/table/base/styles.js +20 -8
- package/es/table/base/table.d.ts +12 -4
- package/es/table/base/table.js +183 -136
- package/es/table/base/utils.d.ts +6 -3
- package/es/table/base/utils.js +27 -6
- package/es/table/common-views.js +1 -1
- package/es/table/pipeline/features/autoFill.js +7 -1
- package/es/table/pipeline/features/columnDrag.js +109 -41
- package/es/table/pipeline/features/columnFilter.js +7 -9
- package/es/table/pipeline/features/columnResizeWidth.d.ts +3 -0
- package/es/table/pipeline/features/columnResizeWidth.js +11 -4
- package/es/table/pipeline/features/contextMenu.js +42 -10
- package/es/table/pipeline/features/filter/Filter.js +74 -37
- package/es/table/pipeline/features/index.d.ts +1 -0
- package/es/table/pipeline/features/index.js +2 -1
- package/es/table/pipeline/features/rangeSelection.d.ts +10 -0
- package/es/table/pipeline/features/rangeSelection.js +231 -0
- package/es/table/pipeline/features/rowDetail.js +37 -15
- package/es/table/pipeline/features/singleSelect.js +4 -1
- package/es/table/pipeline/features/sort.js +2 -3
- package/es/table/pipeline/features/treeMode.js +1 -2
- package/es/table/pipeline/pipeline.d.ts +4 -0
- package/es/table/pipeline/pipeline.js +32 -5
- package/es/table/pivot/cross-table/buildCrossTable.js +1 -2
- package/es/table/pivot/cross-tree-table/buildCrossTreeTable.js +1 -2
- package/es/table/pivot/pivot-utils/builders.js +1 -2
- package/es/table/pivot/pivot-utils/convert-utils.js +1 -2
- package/es/table/transforms/autoWidth.js +1 -2
- package/es/table/transforms/sort.js +1 -2
- package/es/table/transforms/treeMode.js +1 -2
- package/es/table/utils/applyTransforms.js +1 -3
- package/es/table/utils/browserType.d.ts +6 -0
- package/es/table/utils/browserType.js +6 -0
- package/es/table/utils/buildTree.js +4 -5
- package/es/table/utils/collectNodes.js +1 -2
- package/es/table/utils/exportTableAsExcel.js +1 -2
- package/es/table/utils/getTreeDepth.js +1 -2
- package/es/table/utils/groupBy.js +1 -2
- package/es/table/utils/index.d.ts +1 -0
- package/es/table/utils/index.js +2 -1
- package/es/table/utils/layeredSort.js +5 -2
- package/es/table/utils/makeRecursiveMapper.js +4 -5
- package/es/table/utils/others.d.ts +1 -1
- package/es/table/utils/others.js +20 -14
- package/es/table/utils/traverseColumn.js +1 -2
- package/es/table/utils/tree-data-helpers/StrictTreeDataHelper.js +4 -5
- package/es/table/utils/tree-data-helpers/TreeDataHelper.js +4 -5
- package/lib/_utils/formatUtil.js +1 -1
- package/lib/_utils/hooks.js +2 -4
- package/lib/_utils/numberUtil.js +7 -9
- package/lib/_utils/usePopper.js +9 -1
- package/lib/config-provider/configProvider.js +9 -1
- package/lib/config-provider/index.js +5 -5
- package/lib/locale/index.js +14 -6
- package/lib/locale/locale.js +2 -4
- package/lib/table/base/calculations.js +3 -5
- package/lib/table/base/empty.js +9 -1
- package/lib/table/base/header.d.ts +6 -2
- package/lib/table/base/header.js +33 -10
- package/lib/table/base/helpers/SpanManager.js +1 -1
- package/lib/table/base/helpers/TableDOMUtils.d.ts +3 -0
- package/lib/table/base/helpers/TableDOMUtils.js +21 -5
- package/lib/table/base/helpers/getRichVisibleRectsStream.d.ts +23 -0
- package/lib/table/base/helpers/getRichVisibleRectsStream.js +246 -0
- package/lib/table/base/html-table.d.ts +3 -1
- package/lib/table/base/html-table.js +34 -8
- package/lib/table/base/index.js +4 -4
- package/lib/table/base/interfaces.d.ts +1 -0
- package/lib/table/base/renderTemplates.d.ts +1 -0
- package/lib/table/base/renderTemplates.js +370 -0
- package/lib/table/base/styles.d.ts +14 -0
- package/lib/table/base/styles.js +31 -12
- package/lib/table/base/table.d.ts +12 -4
- package/lib/table/base/table.js +191 -137
- package/lib/table/base/utils.d.ts +6 -3
- package/lib/table/base/utils.js +47 -10
- package/lib/table/common-views.js +2 -2
- package/lib/table/pipeline/features/__test__/sort.test.js +5 -3
- package/lib/table/pipeline/features/autoFill.js +9 -2
- package/lib/table/pipeline/features/columnDrag.js +108 -40
- package/lib/table/pipeline/features/columnFilter.js +6 -9
- package/lib/table/pipeline/features/columnResizeWidth.d.ts +3 -0
- package/lib/table/pipeline/features/columnResizeWidth.js +21 -5
- package/lib/table/pipeline/features/contextMenu.js +53 -11
- package/lib/table/pipeline/features/filter/DefaultFilterContent.js +10 -2
- package/lib/table/pipeline/features/filter/Filter.js +88 -37
- package/lib/table/pipeline/features/filter/FilterPanel.js +10 -2
- package/lib/table/pipeline/features/filter/index.js +4 -4
- package/lib/table/pipeline/features/index.d.ts +1 -0
- package/lib/table/pipeline/features/index.js +37 -27
- package/lib/table/pipeline/features/rangeSelection.d.ts +10 -0
- package/lib/table/pipeline/features/rangeSelection.js +256 -0
- package/lib/table/pipeline/features/rowDetail.js +39 -15
- package/lib/table/pipeline/features/singleSelect.js +4 -1
- package/lib/table/pipeline/features/sort.js +2 -4
- package/lib/table/pipeline/features/treeMode.js +2 -4
- package/lib/table/pipeline/index.js +11 -3
- package/lib/table/pipeline/pipeline.d.ts +4 -0
- package/lib/table/pipeline/pipeline.js +33 -7
- package/lib/table/pivot/cross-table/buildCrossTable.js +1 -3
- package/lib/table/pivot/cross-table/index.js +4 -4
- package/lib/table/pivot/cross-tree-table/buildCrossTreeTable.js +1 -3
- package/lib/table/pivot/pivot-utils/builders.js +2 -4
- package/lib/table/pivot/pivot-utils/convert-utils.js +1 -3
- package/lib/table/pivot/pivot-utils/index.js +4 -4
- package/lib/table/transforms/autoWidth.js +10 -4
- package/lib/table/transforms/columnResize.js +10 -2
- package/lib/table/transforms/index.js +32 -32
- package/lib/table/transforms/sort.js +10 -4
- package/lib/table/transforms/treeMode.js +9 -3
- package/lib/table/utils/applyTransforms.js +1 -5
- package/lib/table/utils/browserType.d.ts +6 -0
- package/lib/table/utils/browserType.js +13 -0
- package/lib/table/utils/buildTree.js +1 -3
- package/lib/table/utils/collectNodes.js +1 -3
- package/lib/table/utils/copyToClipboard.js +1 -1
- package/lib/table/utils/element.js +3 -3
- package/lib/table/utils/exportTableAsExcel.js +1 -3
- package/lib/table/utils/getTreeDepth.js +1 -3
- package/lib/table/utils/groupBy.js +1 -3
- package/lib/table/utils/index.d.ts +1 -0
- package/lib/table/utils/index.js +57 -49
- package/lib/table/utils/layeredSort.js +6 -2
- package/lib/table/utils/makeRecursiveMapper.js +1 -3
- package/lib/table/utils/others.d.ts +1 -1
- package/lib/table/utils/others.js +23 -18
- package/lib/table/utils/traverseColumn.js +1 -3
- package/lib/table/utils/tree-data-helpers/StrictTreeDataHelper.js +5 -7
- package/lib/table/utils/tree-data-helpers/TreeDataHelper.js +5 -7
- package/package.json +6 -2
- package/dist/kd-table.css +0 -422
- package/dist/kd-table.css.map +0 -1
- package/dist/kd-table.js +0 -38578
- package/dist/kd-table.js.map +0 -1
- package/dist/kd-table.min.css +0 -9
- package/dist/kd-table.min.js +0 -208
- package/dist/kd-table.min.js.map +0 -1
- package/es/table/base/helpers/__test__/visible-part.test.d.ts +0 -1
- package/es/table/base/helpers/__test__/visible-part.test.js +0 -28
- package/es/table/base/helpers/visible-part.d.ts +0 -23
- package/es/table/base/helpers/visible-part.js +0 -58
- package/lib/table/base/helpers/__test__/visible-part.test.d.ts +0 -1
- package/lib/table/base/helpers/__test__/visible-part.test.js +0 -31
- package/lib/table/base/helpers/visible-part.d.ts +0 -23
- package/lib/table/base/helpers/visible-part.js +0 -72
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime-corejs3/helpers/typeof";
|
|
2
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
3
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
4
|
+
import _findIndexInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find-index";
|
|
5
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
6
|
+
import { mergeCellProps, makeRecursiveMapper, isElementInEventPath, collectNodes } from '../../utils';
|
|
7
|
+
import { findByTree } from '../../utils/others';
|
|
8
|
+
import { fromEvent } from 'rxjs';
|
|
9
|
+
import { map, takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { Classes } from '../../base/styles';
|
|
11
|
+
import cx from 'classnames';
|
|
12
|
+
export var rangeSelectionKey = 'rangeSelection';
|
|
13
|
+
export var lastClickCell = 'lastClickCell';
|
|
14
|
+
export function rangeSelection(opts) {
|
|
15
|
+
return function step(pipeline) {
|
|
16
|
+
var SCROLL_SIZE = 30;
|
|
17
|
+
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
18
|
+
|
|
19
|
+
if (!tableBody) {
|
|
20
|
+
return pipeline;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var columns = pipeline.getColumns();
|
|
24
|
+
|
|
25
|
+
var rangeSelectedChange = function rangeSelectedChange(rangeSelection) {
|
|
26
|
+
var _a;
|
|
27
|
+
|
|
28
|
+
pipeline.setStateAtKey(rangeSelectionKey, rangeSelection);
|
|
29
|
+
(_a = opts === null || opts === void 0 ? void 0 : opts.rangeSelectedChange) === null || _a === void 0 ? void 0 : _a.call(opts, rangeSelection);
|
|
30
|
+
}; // if (!pipeline.getFeatureOptions(rangeSelectionKey)) {
|
|
31
|
+
// pipeline.setFeatureOptions(rangeSelectionKey, {
|
|
32
|
+
// optionKey: rangeSelectionKey,
|
|
33
|
+
// rangeSelectedChange: rangeSelectedChange
|
|
34
|
+
// })
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
var setRangeSelection = function setRangeSelection(startDragCell, draggingCell) {
|
|
39
|
+
if (!startDragCell || !draggingCell || isSameCell(startDragCell, draggingCell)) return;
|
|
40
|
+
var rangeColumns = getRangeColumns(startDragCell, draggingCell, columns);
|
|
41
|
+
var isTopToBottom = startDragCell.rowIndex <= draggingCell.rowIndex;
|
|
42
|
+
var rangeSelection = {
|
|
43
|
+
startRow: isTopToBottom ? startDragCell.rowIndex : startDragCell.rowIndex + startDragCell.rowSpan - 1,
|
|
44
|
+
endRow: isTopToBottom ? draggingCell.rowIndex + draggingCell.rowSpan - 1 : draggingCell.rowIndex,
|
|
45
|
+
columns: rangeColumns,
|
|
46
|
+
startColumn: startDragCell.column
|
|
47
|
+
};
|
|
48
|
+
rangeSelectedChange(rangeSelection);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var shiftKeySelect = function shiftKeySelect(event) {
|
|
52
|
+
var target = event.target;
|
|
53
|
+
var clickCell = getTargetCell(target, columns);
|
|
54
|
+
|
|
55
|
+
if (clickCell) {
|
|
56
|
+
if (event.shiftKey) {
|
|
57
|
+
var _lastClickCell = pipeline.getStateAtKey(lastClickCell);
|
|
58
|
+
|
|
59
|
+
if (_lastClickCell) {
|
|
60
|
+
setRangeSelection(_lastClickCell, clickCell);
|
|
61
|
+
} else {
|
|
62
|
+
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
63
|
+
pipeline.setStateAtKey(lastClickCell, clickCell);
|
|
64
|
+
}
|
|
65
|
+
} else {
|
|
66
|
+
pipeline.setStateAtKey(lastClickCell, clickCell);
|
|
67
|
+
rangeSelectedChange(null);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
73
|
+
if (mouseDownEvent.button !== 0 || !isElementInEventPath(tableBody, mouseDownEvent.nativeEvent)) return; // mouseDownEvent.preventDefault()
|
|
74
|
+
// shift + 点击选中
|
|
75
|
+
|
|
76
|
+
shiftKeySelect(mouseDownEvent);
|
|
77
|
+
var target = mouseDownEvent.target;
|
|
78
|
+
var startDragCell = getTargetCell(target, columns);
|
|
79
|
+
var mousemove$ = fromEvent(window, 'mousemove');
|
|
80
|
+
var mouseup$ = fromEvent(window, 'mouseup');
|
|
81
|
+
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
82
|
+
|
|
83
|
+
var updateScrollPosition = function updateScrollPosition(client) {
|
|
84
|
+
var clientX = client.clientX,
|
|
85
|
+
clientY = client.clientY;
|
|
86
|
+
var left = tableBodyClientRect.left,
|
|
87
|
+
top = tableBodyClientRect.top,
|
|
88
|
+
height = tableBodyClientRect.height,
|
|
89
|
+
width = tableBodyClientRect.width;
|
|
90
|
+
|
|
91
|
+
if (clientX + SCROLL_SIZE >= left + width) {
|
|
92
|
+
pipeline.ref.current.domHelper.virtual.scrollLeft += SCROLL_SIZE;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (clientX - SCROLL_SIZE <= left) {
|
|
96
|
+
pipeline.ref.current.domHelper.virtual.scrollLeft -= SCROLL_SIZE;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (clientY + SCROLL_SIZE >= top + height) {
|
|
100
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop += SCROLL_SIZE;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (clientY + SCROLL_SIZE <= top) {
|
|
104
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop -= SCROLL_SIZE;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var rangeSelected$ = mousemove$.pipe(map(function (mouseMoveEvent) {
|
|
109
|
+
var target = mouseMoveEvent.target || mouseMoveEvent.srcElement;
|
|
110
|
+
var draggingCell = getTargetCell(target, columns);
|
|
111
|
+
var client = {
|
|
112
|
+
clientX: mouseMoveEvent.clientX,
|
|
113
|
+
clientY: mouseMoveEvent.clientY
|
|
114
|
+
};
|
|
115
|
+
updateScrollPosition(client);
|
|
116
|
+
return {
|
|
117
|
+
startDragCell: startDragCell,
|
|
118
|
+
draggingCell: draggingCell
|
|
119
|
+
};
|
|
120
|
+
}), takeUntil(mouseup$));
|
|
121
|
+
rangeSelected$.subscribe(function (_ref) {
|
|
122
|
+
var startDragCell = _ref.startDragCell,
|
|
123
|
+
draggingCell = _ref.draggingCell;
|
|
124
|
+
setRangeSelection(startDragCell, draggingCell);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
var onKeyDown = function onKeyDown(e) {
|
|
129
|
+
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
|
130
|
+
var rowLen = pipeline.getDataSource().length;
|
|
131
|
+
|
|
132
|
+
if (columns.length && rowLen) {
|
|
133
|
+
opts.preventkDefaultOfKeyDownEvent !== false && e.preventDefault();
|
|
134
|
+
rangeSelectedChange({
|
|
135
|
+
startRow: 0,
|
|
136
|
+
endRow: rowLen - 1,
|
|
137
|
+
columns: columns,
|
|
138
|
+
startColumn: columns[0]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
pipeline.addTableProps({
|
|
145
|
+
onMouseDown: onMouseDown,
|
|
146
|
+
onKeyDown: onKeyDown,
|
|
147
|
+
tabIndex: -1
|
|
148
|
+
}); // todo: 后面可以把mousedown放到一个流里面
|
|
149
|
+
|
|
150
|
+
return pipeline.mapColumns(makeRecursiveMapper(function (col) {
|
|
151
|
+
var _context;
|
|
152
|
+
|
|
153
|
+
var rangeSelection = pipeline.getStateAtKey(rangeSelectionKey);
|
|
154
|
+
if (!rangeSelection || _findIndexInstanceProperty(_context = rangeSelection.columns).call(_context, function (selectedCol) {
|
|
155
|
+
return selectedCol.code === col.code;
|
|
156
|
+
}) === -1) return col;
|
|
157
|
+
var prevGetCellProps = col.getCellProps;
|
|
158
|
+
return _extends(_extends({}, col), {
|
|
159
|
+
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
160
|
+
var _cx;
|
|
161
|
+
|
|
162
|
+
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
163
|
+
var startRow = rangeSelection.startRow,
|
|
164
|
+
endRow = rangeSelection.endRow,
|
|
165
|
+
columns = rangeSelection.columns;
|
|
166
|
+
var startIndex = startRow < endRow ? startRow : endRow;
|
|
167
|
+
var endIndex = startRow < endRow ? endRow : startRow;
|
|
168
|
+
var startCol = columns[0];
|
|
169
|
+
var endCol = columns[columns.length - 1];
|
|
170
|
+
var match = rowIndex >= startIndex && rowIndex <= endIndex;
|
|
171
|
+
var className = cx((_cx = {}, _defineProperty(_cx, Classes.tableCellRangeSelected, match), _defineProperty(_cx, Classes.tableCellRangeTop, rowIndex === startIndex), _defineProperty(_cx, Classes.tableCellRangeLeft, col.code === startCol.code && match), _defineProperty(_cx, Classes.tableCellRangeBottom, rowIndex === endIndex), _defineProperty(_cx, Classes.tableCellRangeRight, col.code === endCol.code && match), _cx));
|
|
172
|
+
return mergeCellProps(prevCellProps, {
|
|
173
|
+
className: className
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}));
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function getTargetCell(target, columns) {
|
|
182
|
+
while (target) {
|
|
183
|
+
if (target.getAttribute('data-role') === 'table-cell') {
|
|
184
|
+
var _ret = function () {
|
|
185
|
+
var columnCode = target.getAttribute('data-code');
|
|
186
|
+
var column = findByTree(columns, function (item, index) {
|
|
187
|
+
return item.code === columnCode;
|
|
188
|
+
});
|
|
189
|
+
if (!column) return {
|
|
190
|
+
v: null
|
|
191
|
+
};
|
|
192
|
+
return {
|
|
193
|
+
v: {
|
|
194
|
+
rowIndex: parseInt(target.getAttribute('data-rowindex')),
|
|
195
|
+
rowSpan: parseInt(target.getAttribute('rowspan') || 1),
|
|
196
|
+
code: columnCode,
|
|
197
|
+
column: column
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}();
|
|
201
|
+
|
|
202
|
+
if (_typeof(_ret) === "object") return _ret.v;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
target = target.parentElement;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function isSameCell(cell1, cell2) {
|
|
212
|
+
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function getRangeColumns(startCell, endCell, columns) {
|
|
216
|
+
var flatColumns = collectNodes(columns, 'leaf-only');
|
|
217
|
+
|
|
218
|
+
var startIndex = _findIndexInstanceProperty(flatColumns).call(flatColumns, function (col) {
|
|
219
|
+
return col.code === startCell.code;
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
var endIndex = _findIndexInstanceProperty(flatColumns).call(flatColumns, function (col) {
|
|
223
|
+
return col.code === endCell.code;
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
if (startIndex < endIndex) {
|
|
227
|
+
return _sliceInstanceProperty(flatColumns).call(flatColumns, startIndex, endIndex + 1);
|
|
228
|
+
} else {
|
|
229
|
+
return _sliceInstanceProperty(flatColumns).call(flatColumns, endIndex, startIndex + 1);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -16,6 +16,7 @@ import { internals } from '../../internals';
|
|
|
16
16
|
import { collectNodes, mergeCellProps } from '../../utils';
|
|
17
17
|
import { always, flatMap } from '../../utils/others';
|
|
18
18
|
import console from '../../utils/console';
|
|
19
|
+
import getTableRenderTemplate from '../../base/renderTemplates';
|
|
19
20
|
|
|
20
21
|
var rowDetailSymbol = _Symbol('row-detail');
|
|
21
22
|
|
|
@@ -39,23 +40,18 @@ export function rowDetail() {
|
|
|
39
40
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
40
41
|
|
|
41
42
|
var stateKey = 'rowDetail';
|
|
42
|
-
var primaryKey = pipeline.ensurePrimaryKey('rowDetail');
|
|
43
|
-
|
|
44
|
-
if (typeof primaryKey !== 'string') {
|
|
45
|
-
throw new Error('rowDetail 仅支持字符串作为 primaryKey');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
var rowDetailMetaKey = (_a = opts.rowDetailMetaKey) !== null && _a !== void 0 ? _a : rowDetailSymbol;
|
|
44
|
+
var primaryKey = pipeline.ensurePrimaryKey('rowDetail');
|
|
49
45
|
var indents = pipeline.ctx.indents;
|
|
50
46
|
var textOffset = indents.iconIndent + indents.iconWidth + indents.iconGap;
|
|
51
47
|
var clickArea = (_b = opts.clickArea) !== null && _b !== void 0 ? _b : 'cell';
|
|
52
|
-
var getDetailKey = (_c = opts.getDetailKey) !== null && _c !== void 0 ? _c : function (row) {
|
|
53
|
-
return
|
|
48
|
+
var getDetailKey = (_c = opts.getDetailKey) !== null && _c !== void 0 ? _c : function (row, rowIndex) {
|
|
49
|
+
return internals.safeGetRowKey(primaryKey, row, rowIndex) + '_detail';
|
|
54
50
|
};
|
|
55
51
|
var renderDetail = (_d = opts.renderDetail) !== null && _d !== void 0 ? _d : fallbackRenderDetail;
|
|
56
52
|
var hasDetail = (_e = opts.hasDetail) !== null && _e !== void 0 ? _e : always(true);
|
|
57
|
-
var openKeys = (_h = (_g = (_f = opts.openKeys) !== null && _f !== void 0 ? _f : pipeline.getStateAtKey(stateKey)) !== null && _g !== void 0 ? _g : opts.defaultOpenAll ? _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = pipeline.getDataSource()).call(_context2, hasDetail)).call(_context, function (row) {
|
|
58
|
-
return row
|
|
53
|
+
var openKeys = (_h = (_g = (_f = opts.openKeys) !== null && _f !== void 0 ? _f : pipeline.getStateAtKey(stateKey)) !== null && _g !== void 0 ? _g : opts.defaultOpenAll ? _mapInstanceProperty(_context = _filterInstanceProperty(_context2 = pipeline.getDataSource()).call(_context2, hasDetail)).call(_context, function (row, rowIndex) {
|
|
54
|
+
return internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
59
55
|
}) : opts.defaultOpenKeys) !== null && _h !== void 0 ? _h : [];
|
|
60
56
|
|
|
61
57
|
var onChangeOpenKeys = function onChangeOpenKeys(nextKeys, key, action) {
|
|
@@ -84,16 +80,18 @@ export function rowDetail() {
|
|
|
84
80
|
}
|
|
85
81
|
};
|
|
86
82
|
|
|
83
|
+
var detailPrimaryKey = typeof primaryKey === 'string' ? primaryKey : rowDetailMetaKey.toString() + 'PrimaryKey';
|
|
87
84
|
return pipeline.dataSource(flatMap(pipeline.getDataSource(), function (row, rowIndex) {
|
|
88
|
-
if (openKeySet.has(row
|
|
89
|
-
return [row, _extends(_extends(_defineProperty({}, rowDetailMetaKey, true), row), _defineProperty({},
|
|
85
|
+
if (openKeySet.has(internals.safeGetRowKey(primaryKey, row, rowIndex))) {
|
|
86
|
+
return [row, _extends(_extends(_defineProperty({}, rowDetailMetaKey, true), row), _defineProperty({}, detailPrimaryKey, getDetailKey(row, rowIndex)))];
|
|
90
87
|
} else {
|
|
91
88
|
return [row];
|
|
92
89
|
}
|
|
93
90
|
})).columns(processColumns(pipeline.getColumns())).appendRowPropsGetter(function (row) {
|
|
94
91
|
if (row[rowDetailMetaKey]) {
|
|
95
92
|
return {
|
|
96
|
-
className: 'no-hover'
|
|
93
|
+
className: 'no-hover',
|
|
94
|
+
'data-row-detail-key': row[detailPrimaryKey]
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
97
|
});
|
|
@@ -122,6 +120,19 @@ export function rowDetail() {
|
|
|
122
120
|
|
|
123
121
|
var render = function render(value, row, rowIndex) {
|
|
124
122
|
if (row[rowDetailMetaKey]) {
|
|
123
|
+
// 第一列内容已经渲染
|
|
124
|
+
if (expandColumnIndex !== 0) return;
|
|
125
|
+
var renderRowDetail = getTableRenderTemplate('rowDetail');
|
|
126
|
+
|
|
127
|
+
if (typeof renderRowDetail === 'function') {
|
|
128
|
+
return renderRowDetail({
|
|
129
|
+
row: row,
|
|
130
|
+
rowIndex: rowIndex,
|
|
131
|
+
domHelper: pipeline.ref.current.domHelper,
|
|
132
|
+
renderDetail: renderDetail
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
125
136
|
return renderDetail(row, rowIndex);
|
|
126
137
|
}
|
|
127
138
|
|
|
@@ -135,7 +146,7 @@ export function rowDetail() {
|
|
|
135
146
|
}, content);
|
|
136
147
|
}
|
|
137
148
|
|
|
138
|
-
var rowKey = row
|
|
149
|
+
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
139
150
|
var expanded = openKeySet.has(rowKey);
|
|
140
151
|
|
|
141
152
|
var onClick = function onClick(e) {
|
|
@@ -192,7 +203,7 @@ export function rowDetail() {
|
|
|
192
203
|
e.stopPropagation();
|
|
193
204
|
}
|
|
194
205
|
|
|
195
|
-
toggle(row
|
|
206
|
+
toggle(internals.safeGetRowKey(primaryKey, row, rowIndex));
|
|
196
207
|
},
|
|
197
208
|
style: {
|
|
198
209
|
cursor: 'pointer'
|
|
@@ -206,6 +217,17 @@ export function rowDetail() {
|
|
|
206
217
|
|
|
207
218
|
var firstColRender = function firstColRender(value, row, rowIndex) {
|
|
208
219
|
if (row[rowDetailMetaKey]) {
|
|
220
|
+
var renderRowDetail = getTableRenderTemplate('rowDetail');
|
|
221
|
+
|
|
222
|
+
if (typeof renderRowDetail === 'function') {
|
|
223
|
+
return renderRowDetail({
|
|
224
|
+
row: row,
|
|
225
|
+
rowIndex: rowIndex,
|
|
226
|
+
domHelper: pipeline.ref.current.domHelper,
|
|
227
|
+
renderDetail: renderDetail
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
209
231
|
return renderDetail(row, rowIndex);
|
|
210
232
|
}
|
|
211
233
|
|
|
@@ -38,10 +38,11 @@ export function singleSelect() {
|
|
|
38
38
|
getCellProps: function getCellProps(value, row, rowIndex) {
|
|
39
39
|
var _a, _b;
|
|
40
40
|
|
|
41
|
+
var preCellProps = (_b = (_a = opts.radioColumn) === null || _a === void 0 ? void 0 : _a.getCellProps) === null || _b === void 0 ? void 0 : _b.call(_a, value, row, rowIndex);
|
|
42
|
+
|
|
41
43
|
if (clickArea === 'cell') {
|
|
42
44
|
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
43
45
|
var disabled = isDisabled(row, rowIndex);
|
|
44
|
-
var preCellProps = (_b = (_a = opts.radioColumn) === null || _a === void 0 ? void 0 : _a.getCellProps) === null || _b === void 0 ? void 0 : _b.call(_a, value, row, rowIndex);
|
|
45
46
|
return mergeCellProps(preCellProps, {
|
|
46
47
|
style: {
|
|
47
48
|
cursor: disabled ? 'not-allowed' : 'pointer'
|
|
@@ -55,6 +56,8 @@ export function singleSelect() {
|
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
}
|
|
59
|
+
|
|
60
|
+
return preCellProps;
|
|
58
61
|
},
|
|
59
62
|
render: function render(_, row, rowIndex) {
|
|
60
63
|
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
2
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
3
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
4
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
5
4
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
5
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
7
6
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
8
7
|
|
|
9
8
|
var _templateObject;
|
|
10
9
|
|
|
11
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
10
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
11
|
|
|
13
12
|
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); }
|
|
14
13
|
|
|
@@ -99,7 +98,7 @@ function hasAnySortableColumns(cols) {
|
|
|
99
98
|
});
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
var TableHeaderCell = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n align-items: center;\n"])));
|
|
101
|
+
var TableHeaderCell = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n display: flex;\n align-items: center;\n // flex: auto;\n"])));
|
|
103
102
|
var stateKey = 'sort';
|
|
104
103
|
export function sort() {
|
|
105
104
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
2
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
3
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
4
3
|
import _toArray from "@babel/runtime-corejs3/helpers/toArray";
|
|
5
4
|
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
6
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
7
6
|
import _toConsumableArray from "@babel/runtime-corejs3/helpers/toConsumableArray";
|
|
8
7
|
|
|
9
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
8
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
9
|
|
|
11
10
|
function _unsupportedIterableToArray(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 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); }
|
|
12
11
|
|
|
@@ -78,6 +78,10 @@ export declare class TablePipeline {
|
|
|
78
78
|
mapDataSource(mapper: Transform<any[]>): this;
|
|
79
79
|
/** 转换 columns */
|
|
80
80
|
mapColumns(mapper: Transform<ArtColumn[]>): this;
|
|
81
|
+
/** 获取featureOptions 内容 */
|
|
82
|
+
getFeatureOptions(optionKey: string): any;
|
|
83
|
+
/** 设置pipelineOptions 内容 */
|
|
84
|
+
setFeatureOptions(optionKey: string, value: any): void;
|
|
81
85
|
/** 获取 BaseTable 的 props,结果中包含 dataSource/columns/primaryKey/getRowProps 四个字段 */
|
|
82
86
|
getProps(this: TablePipeline): TableProps;
|
|
83
87
|
}
|
|
@@ -5,7 +5,6 @@ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
|
5
5
|
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
6
6
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
|
7
7
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
8
|
-
import _reduceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reduce";
|
|
9
8
|
import { useState, useRef } from 'react';
|
|
10
9
|
import { mergeCellProps } from '../utils';
|
|
11
10
|
import { autoFillTableWidth, tableWidthKey } from './features/autoFill';
|
|
@@ -66,7 +65,7 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
66
65
|
}, {
|
|
67
66
|
key: "addTableProps",
|
|
68
67
|
value: function addTableProps(props) {
|
|
69
|
-
this._tableProps =
|
|
68
|
+
this._tableProps = mergeCellProps(this._tableProps, props);
|
|
70
69
|
}
|
|
71
70
|
}, {
|
|
72
71
|
key: "getDataSource",
|
|
@@ -205,6 +204,22 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
205
204
|
value: function mapColumns(mapper) {
|
|
206
205
|
return this.columns(mapper(this.getColumns()));
|
|
207
206
|
}
|
|
207
|
+
/** 获取featureOptions 内容 */
|
|
208
|
+
|
|
209
|
+
}, {
|
|
210
|
+
key: "getFeatureOptions",
|
|
211
|
+
value: function getFeatureOptions(optionKey) {
|
|
212
|
+
var _a;
|
|
213
|
+
|
|
214
|
+
return (_a = this.ref.current.featureOptions) === null || _a === void 0 ? void 0 : _a[optionKey];
|
|
215
|
+
}
|
|
216
|
+
/** 设置pipelineOptions 内容 */
|
|
217
|
+
|
|
218
|
+
}, {
|
|
219
|
+
key: "setFeatureOptions",
|
|
220
|
+
value: function setFeatureOptions(optionKey, value) {
|
|
221
|
+
this.ref.current.featureOptions[optionKey] = value;
|
|
222
|
+
}
|
|
208
223
|
/** 获取 BaseTable 的 props,结果中包含 dataSource/columns/primaryKey/getRowProps 四个字段 */
|
|
209
224
|
|
|
210
225
|
}, {
|
|
@@ -224,9 +239,7 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
224
239
|
|
|
225
240
|
if (this._rowPropsGetters.length > 0) {
|
|
226
241
|
result.getRowProps = function (row, rowIndex) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return _reduceInstanceProperty(_context3 = _this2._rowPropsGetters).call(_context3, function (res, get) {
|
|
242
|
+
return _this2._rowPropsGetters.reduce(function (res, get) {
|
|
230
243
|
return mergeCellProps(res, get(row, rowIndex));
|
|
231
244
|
}, {});
|
|
232
245
|
};
|
|
@@ -244,6 +257,19 @@ export var TablePipeline = /*#__PURE__*/function () {
|
|
|
244
257
|
}
|
|
245
258
|
};
|
|
246
259
|
|
|
260
|
+
result.setTableDomHelper = function (domHelper) {
|
|
261
|
+
_this2.ref.current.domHelper = domHelper;
|
|
262
|
+
}; // if (this.getFeatureOptions(rangeSelectionKey)) {
|
|
263
|
+
// result.clearRangeSelectionStatus = () => {
|
|
264
|
+
// const { rangeSelectedChange } = this.getFeatureOptions(rangeSelectionKey)
|
|
265
|
+
// const rangeSelection = this.getStateAtKey(rangeSelectionKey)
|
|
266
|
+
// if (rangeSelection) {
|
|
267
|
+
// rangeSelectedChange?.(null)
|
|
268
|
+
// }
|
|
269
|
+
// }
|
|
270
|
+
// }
|
|
271
|
+
|
|
272
|
+
|
|
247
273
|
return result;
|
|
248
274
|
}
|
|
249
275
|
}]);
|
|
@@ -263,6 +289,7 @@ export function useTablePipeline(ctx) {
|
|
|
263
289
|
setState = _useState2[1];
|
|
264
290
|
|
|
265
291
|
var ref = useRef({});
|
|
292
|
+
ref.current.featureOptions = {};
|
|
266
293
|
return new TablePipeline({
|
|
267
294
|
state: state,
|
|
268
295
|
setState: setState,
|
|
@@ -2,7 +2,7 @@ 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
4
|
|
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
6
|
|
|
7
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
8
|
|
|
@@ -14,7 +14,6 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
14
14
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
15
15
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
16
16
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
17
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
18
17
|
|
|
19
18
|
var __rest = this && this.__rest || function (s, e) {
|
|
20
19
|
var t = {};
|
|
@@ -2,7 +2,7 @@ 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
4
|
|
|
5
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
5
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
6
6
|
|
|
7
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
8
|
|
|
@@ -14,7 +14,6 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
14
14
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
15
15
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
16
16
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
17
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
18
17
|
|
|
19
18
|
var __rest = this && this.__rest || function (s, e) {
|
|
20
19
|
var t = {};
|
|
@@ -2,10 +2,9 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
2
2
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
3
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
6
5
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
7
6
|
|
|
8
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
7
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
8
|
|
|
10
9
|
function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context5 = Object.prototype.toString.call(o)).call(_context5, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
10
|
|
|
@@ -2,13 +2,12 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
2
2
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
3
3
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
6
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
7
6
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
8
7
|
|
|
9
8
|
var _templateObject;
|
|
10
9
|
|
|
11
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
10
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
11
|
|
|
13
12
|
function _unsupportedIterableToArray(o, minLen) { var _context3; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
13
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
2
2
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
3
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
4
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
5
4
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
6
5
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
7
6
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
8
7
|
|
|
9
8
|
var _templateObject;
|
|
10
9
|
|
|
11
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
10
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
11
|
|
|
13
12
|
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
13
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
2
2
|
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
3
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
4
|
-
import _getIterator from "@babel/runtime-corejs3/core-js/get-iterator";
|
|
5
4
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/slicedToArray";
|
|
6
5
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
7
6
|
import _taggedTemplateLiteral from "@babel/runtime-corejs3/helpers/taggedTemplateLiteral";
|
|
8
7
|
|
|
9
8
|
var _templateObject;
|
|
10
9
|
|
|
11
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it
|
|
10
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
12
11
|
|
|
13
12
|
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); }
|
|
14
13
|
|