@kdcloudjs/table 1.1.3-canary.8 → 1.1.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/dist/@kdcloudjs/table.css +1 -1
- package/dist/@kdcloudjs/table.js +103 -340
- package/dist/@kdcloudjs/table.js.map +1 -1
- package/dist/@kdcloudjs/table.min.css +1 -1
- package/dist/@kdcloudjs/table.min.js +6 -6
- package/dist/@kdcloudjs/table.min.js.map +1 -1
- package/es/table/base/html-table.js +1 -1
- package/es/table/base/styles.d.ts +0 -2
- package/es/table/base/styles.js +1 -3
- package/es/table/base/table.js +3 -4
- package/es/table/pipeline/features/columnFilter.d.ts +1 -1
- package/es/table/pipeline/features/columnFilter.js +15 -35
- package/es/table/pipeline/features/filter/util.js +4 -4
- package/es/table/pipeline/features/index.d.ts +0 -1
- package/es/table/pipeline/features/index.js +1 -2
- package/es/table/pipeline/features/multiSelect.js +2 -7
- package/es/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/es/table/pipeline/features/rangeSelection.js +28 -156
- package/es/table/pipeline/features/singleSelect.js +0 -4
- package/es/table/pipeline/features/treeMode.d.ts +0 -2
- package/es/table/pipeline/features/treeMode.js +20 -18
- package/es/table/pipeline/pipeline.d.ts +1 -5
- package/es/table/pipeline/pipeline.js +10 -11
- package/lib/table/base/html-table.js +1 -1
- package/lib/table/base/styles.d.ts +0 -2
- package/lib/table/base/styles.js +1 -3
- package/lib/table/base/table.js +3 -4
- package/lib/table/pipeline/features/columnFilter.d.ts +1 -1
- package/lib/table/pipeline/features/columnFilter.js +15 -33
- package/lib/table/pipeline/features/filter/util.js +4 -4
- package/lib/table/pipeline/features/index.d.ts +0 -1
- package/lib/table/pipeline/features/index.js +1 -15
- package/lib/table/pipeline/features/multiSelect.js +1 -6
- package/lib/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/lib/table/pipeline/features/rangeSelection.js +30 -158
- package/lib/table/pipeline/features/singleSelect.js +0 -4
- package/lib/table/pipeline/features/treeMode.d.ts +0 -2
- package/lib/table/pipeline/features/treeMode.js +22 -19
- package/lib/table/pipeline/pipeline.d.ts +1 -5
- package/lib/table/pipeline/pipeline.js +10 -12
- package/package.json +3 -3
- package/es/table/pipeline/features/footerDataSource.d.ts +0 -9
- package/es/table/pipeline/features/footerDataSource.js +0 -25
- package/lib/table/pipeline/features/footerDataSource.d.ts +0 -9
- package/lib/table/pipeline/features/footerDataSource.js +0 -41
|
@@ -124,7 +124,7 @@ export function HtmlTable(_ref) {
|
|
|
124
124
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
125
125
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
126
126
|
positionStyle.position = 'sticky';
|
|
127
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) -
|
|
127
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - stickyRightOffset;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
return /*#__PURE__*/React.createElement('td', _extends(_extends(_extends(_extends({
|
|
@@ -40,8 +40,6 @@ export declare const Classes: {
|
|
|
40
40
|
readonly button: string;
|
|
41
41
|
readonly buttonPrimary: string;
|
|
42
42
|
readonly filterIcon: string;
|
|
43
|
-
readonly rangeSelection: string;
|
|
44
|
-
readonly tableCellRangeSingleCell: string;
|
|
45
43
|
readonly tableCellRangeSelected: string;
|
|
46
44
|
readonly tableCellRangeTop: string;
|
|
47
45
|
readonly tableCellRangeLeft: string;
|
package/es/table/base/styles.js
CHANGED
|
@@ -53,8 +53,6 @@ export var Classes = {
|
|
|
53
53
|
button: "".concat(prefix, "btn"),
|
|
54
54
|
buttonPrimary: "".concat(prefix, "btn-primary"),
|
|
55
55
|
filterIcon: "".concat(prefix, "filter-icon"),
|
|
56
|
-
rangeSelection: "".concat(prefix, "range-selection"),
|
|
57
|
-
tableCellRangeSingleCell: "".concat(prefix, "table-cell-range-single-cell"),
|
|
58
56
|
tableCellRangeSelected: "".concat(prefix, "table-cell-range-selected"),
|
|
59
57
|
tableCellRangeTop: "".concat(prefix, "table-cell-range-top"),
|
|
60
58
|
tableCellRangeLeft: "".concat(prefix, "table-cell-range-left"),
|
|
@@ -122,7 +120,7 @@ export var defaultCSSVariables = {
|
|
|
122
120
|
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
123
121
|
};
|
|
124
122
|
export var variableConst = getCssVariableText(defaultCSSVariables);
|
|
125
|
-
export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", "
|
|
123
|
+
export var StyledArtTableWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n :root {\n ", "\n }\n ", "\n\n box-sizing: border-box;\n * {\n box-sizing: border-box;\n }\n cursor: default;\n color: var(--color);\n font-size: var(--font-size);\n line-height: var(--line-height);\n position: relative;\n\n // \u8868\u683C\u5916\u8FB9\u6846\u7531 art-table-wrapper \u63D0\u4F9B\uFF0C\u800C\u4E0D\u662F\u7531\u5355\u5143\u683C\u63D0\u4F9B\n &.use-outer-border {\n ", ";\n }\n\n .no-scrollbar {\n ::-webkit-scrollbar {\n display: none;\n }\n }\n\n .", " {\n overflow: auto;\n flex-shrink: 1;\n flex-grow: 1;\n display: flex;\n flex-direction: column;\n user-select:none;\n }\n\n .", " {\n overflow: hidden;\n background: var(--header-bgcolor);\n display: flex;\n flex-shrink: 0;\n border-bottom: var(--header-cell-border-horizontal);\n }\n\n .", " {\n display: flex;\n // justify-content: flex-start;\n align-items: center;\n height: inherit;\n }\n\n .", " {\n overflow-x:auto;\n flex-shrink: 0;\n flex-grow: 0;\n scrollbar-width: none; // \u517C\u5BB9\u706B\u72D0\n & {\n ::-webkit-scrollbar {\n display:none;\n }\n }\n }\n\n .", " {\n display: flex;\n flex: none;\n }\n .", ", .", " {\n background: var(--bgcolor);\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n position:relative;\n &.empty {\n position: relative;\n }\n }\n\n .", " {\n position: relative;\n }\n .", " {\n .", "{\n background-color: #e6effb !important;\n }\n .", "{\n border-top: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-left: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-bottom: 1px solid #0E5FD8 !important;\n }\n .", "{\n border-right: 1px solid #0E5FD8 !important;\n }\n }\n\n\n &.sticky-header .", " {\n position: sticky;\n top: 0;\n z-index: ", ";\n }\n\n &.sticky-footer .", " {\n position: sticky;\n bottom: 0;\n z-index: ", ";\n }\n\n table {\n width: 0;\n table-layout: fixed;\n border-collapse: separate;\n border-spacing: 0;\n display: table;\n margin: 0;\n padding: 0;\n flex-shrink: 0;\n flex-grow: 0;\n position:relative;\n }\n\n // \u5728 tr \u4E0A\u8BBE\u7F6E .no-hover \u53EF\u4EE5\u7981\u7528\u9F20\u6807\u60AC\u505C\u6548\u679C\n tr:not(.no-hover):hover > td {\n background: var(--hover-bgcolor);\n }\n // \u4F7F\u7528 js \u6DFB\u52A0\u60AC\u6D6E\u6548\u679C\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n // \u5728 tr \u8BBE\u7F6E highlight \u53EF\u4EE5\u4E3A\u5E95\u4E0B\u7684 td \u8BBE\u7F6E\u4E3A\u9AD8\u4EAE\u8272\n // \u800C\u8BBE\u7F6E .no-highlight \u7684\u8BDD\u5219\u53EF\u4EE5\u7981\u7528\u9AD8\u4EAE\u6548\u679C\uFF1B\n tr:not(.no-highlight).highlight > td {\n background: var(--highlight-bgcolor);\n }\n\n th {\n font-weight: normal;\n text-align: left;\n padding: var(--cell-padding);\n height: var(--header-row-height);\n color: var(--header-color);\n background: var(--header-bgcolor);\n border:1px solid transparent;\n border-right: var(--header-cell-border-vertical);\n border-bottom: var(--header-cell-border-horizontal);\n position: relative;\n }\n\n th.resizeable{\n border-right:none\n }\n\n th.", " {\n border-right: none;\n border-bottom: none;\n }\n\n tr.", " th {\n border-top: var(--header-cell-border-horizontal);\n }\n th.", " {\n border-left: var(--header-cell-border-vertical);\n }\n\n td {\n padding: var(--cell-padding);\n background: var(--bgcolor);\n height: var(--row-height);\n border:1px solid transparent;\n border-right: var(--cell-border-vertical);\n border-bottom: var(--cell-border-horizontal);\n word-break: break-all;\n }\n td.", " {\n border-left: var(--cell-border-vertical);\n }\n tr.", " td {\n border-top: var(--cell-border-horizontal);\n }\n &.has-header tbody tr.", " td {\n border-top: none;\n }\n &.has-footer tbody tr.", " td {\n border-bottom: none;\n }\n\n .", ",\n .", " {\n z-index: ", ";\n }\n\n //#region \u9501\u5217\u9634\u5F71\n .", " {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: ", ";\n pointer-events: none;\n overflow: hidden;\n\n .", " {\n height: 100%;\n }\n\n .", " {\n margin-right: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-right: var(--cell-border-vertical);\n }\n }\n\n .", " {\n margin-left: ", "px;\n box-shadow: none;\n\n &.show-shadow {\n box-shadow: var(--lock-shadow);\n border-left: var(--cell-border-vertical);\n }\n }\n }\n //#endregion\n\n //#region \u7A7A\u8868\u683C\u5C55\u73B0\n .", " {\n pointer-events: none;\n color: #99a3b3;\n font-size: 12px;\n text-align: center;\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n\n .empty-image {\n width: 50px;\n height: 50px;\n }\n\n .empty-tips {\n margin-top: 16px;\n line-height: 1.5;\n }\n }\n //#endregion\n\n //#region IE\u517C\u5BB9\n &.ie-polyfill-wrapper {\n //\u9501\u5B9A\u5217\u517C\u5BB9 \u4EC5\u5728\u9501\u5B9A\u5217\u7684\u60C5\u51B5\u4E0B\u751F\u6548\n .", " {\n overflow-x: hidden;\n }\n .", ", .", " {\n position:relative;\n }\n .", " {\n overflow: hidden;\n }\n .", " {\n position: relative;\n }\n\n .", " {\n overflow: auto;\n overflow-x: hidden;\n overflow-anchor: none;\n }\n\n .", ", .", "{\n position: absolute;\n z-index: ", ";\n top: 0;\n }\n .", "{\n left:0;\n }\n .", "{\n right:0;\n }\n\n .", "{\n .", "{\n position: absolute;\n top: 0;\n width: 100%;\n z-index: ", ";\n }\n }\n\n tr:not(.no-hover).row-hover > td {\n background: var(--hover-bgcolor);\n }\n }\n //#endregion\n\n //#region \u7C98\u6027\u6EDA\u52A8\u6761\n .", " {\n overflow-y: hidden;\n overflow-x: auto;\n z-index: ", ";\n flex-shrink: 0;\n flex-grow: 0;\n border-top: 1px solid var(--border-color);\n background: var(--bgcolor);\n }\n\n .", " {\n // \u5FC5\u987B\u6709\u9AD8\u5EA6\u624D\u80FD\u51FA\u73B0\u6EDA\u52A8\u6761\n height: 1px;\n visibility: hidden;\n }\n //#endregion\n\n //#region \u52A0\u8F7D\u6837\u5F0F\n .", " {\n position: relative;\n width: 100%;\n height: 100%;\n overflow: auto;\n\n .", " {\n filter: none;\n width: 100%;\n height: 100%;\n overflow: auto;\n display: flex;\n position: relative;\n flex-direction: column;\n }\n\n .", " {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n }\n\n .", " {\n position: sticky;\n z-index: ", ";\n transform: translateY(-50%);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u8FC7\u6EE4\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u8868\u683C\u6392\u5E8F\n .", " {\n color:var(--icon-color);\n &.active{\n color:var(--primary-color);\n }\n }\n //#endregion\n\n //#region \u6EDA\u52A8\u6761\u5360\u4F4D\n .", " {\n visibility: hidden;\n flex-shrink: 0;\n }\n .", " .", " {\n border-top: var(--cell-border-horizontal);\n }\n //#endregion\n "])), variableConst, variableConst, outerBorderStyleMixin, Classes.artTable, Classes.tableHeader, Classes.tableHeaderCellContent, Classes.virtual, Classes.tableFooter, Classes.tableBody, Classes.tableFooter, Classes.tableRow, Classes.tableBody, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.tableHeader, Z.header, Classes.tableFooter, Z.footer, Classes.leaf, Classes.first, Classes.first, Classes.first, Classes.first, Classes.first, Classes.last, Classes.lockLeft, Classes.lockRight, Z.lock, Classes.lockShadowMask, Z.lockShadow, Classes.lockShadow, Classes.leftLockShadow, LOCK_SHADOW_PADDING, Classes.rightLockShadow, LOCK_SHADOW_PADDING, Classes.emptyWrapper, Classes.virtual, Classes.tableBody, Classes.tableFooter, Classes.tableHeaderMain, Classes.tableHeader, Classes.tableFooterMain, Classes.fixedLeft, Classes.fixedRight, Z.lock, Classes.fixedLeft, Classes.fixedRight, Classes.rowDetailContainer, Classes.rowDetailItem, Z.rowDetail, Classes.stickyScroll, Z.scrollItem, Classes.stickyScrollItem, Classes.loadingWrapper, Classes.loadingContentWrapper, Classes.loadingIndicatorWrapper, Classes.loadingIndicator, Z.loadingIndicator, Classes.tableFilterTrigger, Classes.tableSortIcon, Classes.verticalScrollPlaceholder, Classes.tableFooter, Classes.verticalScrollPlaceholder);
|
|
126
124
|
export var ButtonCSS = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n //#region \u6309\u94AE\n .", "{\n color: var(--color);\n background:#ffffff;\n border:1px solid var(--strong-border-color);\n border-radius: 2px;\n cursor: pointer;\n &:hover{\n color: var(--primary-color);\n border:1px solid var(--primary-color);\n }\n }\n .", " {\n color:#ffffff;\n background-color: var(--primary-color);\n border:none;\n &:hover{\n color:#ffffff;\n background-color: var(--primary-color-level2);\n border:none;\n }\n }\n//#endregion\n"])), variableConst, Classes.button, Classes.buttonPrimary);
|
|
127
125
|
|
|
128
126
|
function getCssVariableText(obj) {
|
package/es/table/base/table.js
CHANGED
|
@@ -509,14 +509,13 @@ export var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
509
509
|
style: style
|
|
510
510
|
}, STYLED_REF_PROP, this.artTableWrapperRef);
|
|
511
511
|
|
|
512
|
-
var tableProps = getTableProps() || {};
|
|
513
512
|
return /*#__PURE__*/React.createElement(StyledArtTableWrapper, _extends({}, artTableWrapperProps), /*#__PURE__*/React.createElement(Loading, {
|
|
514
513
|
visible: isLoading,
|
|
515
514
|
LoadingIcon: components.LoadingIcon,
|
|
516
515
|
LoadingContentWrapper: components.LoadingContentWrapper
|
|
517
|
-
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
518
|
-
className:
|
|
519
|
-
}), this.renderTableHeader(info), this.renderTableBody(info), this.renderTableFooter(info), this.renderLockShadows(info)), this.renderStickyScroll(info)));
|
|
516
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
517
|
+
className: Classes.artTable
|
|
518
|
+
}, getTableProps()), this.renderTableHeader(info), this.renderTableBody(info), this.renderTableFooter(info), this.renderLockShadows(info)), this.renderStickyScroll(info)));
|
|
520
519
|
}
|
|
521
520
|
}, {
|
|
522
521
|
key: "componentDidMount",
|
|
@@ -12,7 +12,7 @@ export interface FilterFeatureOptions {
|
|
|
12
12
|
keepDataSource?: boolean;
|
|
13
13
|
/** 过滤模式。单列过滤 single,多列过滤 multiple,默认为多选 */
|
|
14
14
|
mode?: 'single' | 'multiple';
|
|
15
|
-
|
|
15
|
+
/**过滤图标 */
|
|
16
16
|
filterIcon?: ReactNode;
|
|
17
17
|
/** 是否对触发弹出过滤面板 的 click 事件调用 event.stopPropagation() */
|
|
18
18
|
stopClickEventPropagation?: boolean;
|
|
@@ -39,7 +39,7 @@ export function filter() {
|
|
|
39
39
|
return _mapInstanceProperty(columns).call(columns, dfs);
|
|
40
40
|
|
|
41
41
|
function dfs(col) {
|
|
42
|
-
var _a, _b, _c, _d, _e
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
43
|
|
|
44
44
|
var result = _extends({}, col);
|
|
45
45
|
|
|
@@ -81,13 +81,12 @@ export function filter() {
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
var filterPanel = (_d = col.features) === null || _d === void 0 ? void 0 : _d.filterPanel;
|
|
84
|
-
|
|
85
|
-
result.title = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(_concatInstanceProperty(_context2 = []).call(_context2, (_g = result.title) !== null && _g !== void 0 ? _g : [internals.safeRenderHeader(_extends(_extends({}, col), {
|
|
84
|
+
result.title = _concatInstanceProperty(_context = []).call(_context, _toConsumableArray(_concatInstanceProperty(_context2 = []).call(_context2, (_e = result.title) !== null && _e !== void 0 ? _e : [internals.safeRenderHeader(_extends(_extends({}, col), {
|
|
86
85
|
title: null
|
|
87
86
|
}))])), [/*#__PURE__*/React.createElement(Filter, {
|
|
88
87
|
key: "filter",
|
|
89
88
|
FilterPanelContent: filterPanel,
|
|
90
|
-
filterIcon:
|
|
89
|
+
filterIcon: filterIcon,
|
|
91
90
|
filterModel: inputFiltersMap.get(col.code),
|
|
92
91
|
setFilterModel: handleFilterChanged,
|
|
93
92
|
setFilter: setFilter,
|
|
@@ -135,8 +134,8 @@ export function filter() {
|
|
|
135
134
|
return [item.key, _extends({}, item)];
|
|
136
135
|
}));
|
|
137
136
|
|
|
138
|
-
function isMatchedFilterCondition(record) {
|
|
139
|
-
return filtersKeys.
|
|
137
|
+
function isMatchedFilterCondition(record, rowIndex) {
|
|
138
|
+
return !filtersKeys.some(function (key) {
|
|
140
139
|
var _a, _b;
|
|
141
140
|
|
|
142
141
|
var filterItem = inputFiltersMap.get(key);
|
|
@@ -150,43 +149,24 @@ export function filter() {
|
|
|
150
149
|
} else {
|
|
151
150
|
console.warn("\u5217[".concat(key, "]\u672A\u914D\u7F6E\u7B5B\u9009\u51FD\u6570\uFF0C\u8BF7\u8BBE\u7F6E column.features.filterable \u6765\u4F5C\u4E3A\u8BE5\u5217\u7684\u7B5B\u9009\u51FD\u6570, \u76EE\u524D\u4F7F\u7528\u9ED8\u8BA4\u5305\u542B\u7B5B\u9009\u51FD\u6570"));
|
|
152
151
|
comparisonFn = _filterInstanceProperty(defaultFilterOptionsMap.get('contain'));
|
|
153
|
-
}
|
|
152
|
+
} // 不符合过滤条件,退出循环
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
|
|
155
|
+
return !comparisonFn(_filterInstanceProperty(filterItem), filterItem)(internals.safeGetValue(columnsMap.get(key), record, rowIndex), record);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
return
|
|
159
|
+
return dataSource.reduce(function (pre, record, rowIndex) {
|
|
160
|
+
if (isMatchedFilterCondition(record, rowIndex)) {
|
|
161
|
+
return _concatInstanceProperty(pre).call(pre, [record]);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return pre;
|
|
165
|
+
}, []);
|
|
160
166
|
}
|
|
161
167
|
|
|
162
168
|
pipeline.dataSource(processDataSource(dataSource));
|
|
163
169
|
pipeline.columns(processColumns(columns));
|
|
164
170
|
return pipeline;
|
|
165
171
|
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function layeredFilter(array, matchFn) {
|
|
169
|
-
return dfs(array);
|
|
170
|
-
|
|
171
|
-
function dfs(rows) {
|
|
172
|
-
var _context6;
|
|
173
|
-
|
|
174
|
-
var parentMatched = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
175
|
-
return _filterInstanceProperty(_context6 = _mapInstanceProperty(rows).call(rows, function (row) {
|
|
176
|
-
var currentMatched = matchFn(row);
|
|
177
|
-
|
|
178
|
-
if (isLeafNode(row)) {
|
|
179
|
-
return (parentMatched || currentMatched) && _extends({}, row);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var children = row.children;
|
|
183
|
-
|
|
184
|
-
var rowAfterFilterChildren = _extends(_extends({}, row), {
|
|
185
|
-
children: dfs(children, parentMatched || currentMatched)
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
var matchedByChildren = !isLeafNode(rowAfterFilterChildren);
|
|
189
|
-
return (parentMatched || currentMatched || matchedByChildren) && rowAfterFilterChildren;
|
|
190
|
-
})).call(_context6, Boolean);
|
|
191
|
-
}
|
|
192
172
|
}
|
|
@@ -12,7 +12,7 @@ var DEFAULT_FILTER_OPTIONS = [{
|
|
|
12
12
|
data = data + '';
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
return _includesInstanceProperty(data).call(data, value
|
|
15
|
+
return _includesInstanceProperty(data).call(data, value);
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
}, {
|
|
@@ -28,7 +28,7 @@ var DEFAULT_FILTER_OPTIONS = [{
|
|
|
28
28
|
data = data + '';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
return !_includesInstanceProperty(data).call(data, value
|
|
31
|
+
return !_includesInstanceProperty(data).call(data, value);
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
}, {
|
|
@@ -36,7 +36,7 @@ var DEFAULT_FILTER_OPTIONS = [{
|
|
|
36
36
|
key: 'equal',
|
|
37
37
|
filter: function filter(value) {
|
|
38
38
|
return function (data) {
|
|
39
|
-
return value
|
|
39
|
+
return value !== data;
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
}, {
|
|
@@ -44,7 +44,7 @@ var DEFAULT_FILTER_OPTIONS = [{
|
|
|
44
44
|
key: 'notEqual',
|
|
45
45
|
filter: function filter(value) {
|
|
46
46
|
return function (data) {
|
|
47
|
-
return value
|
|
47
|
+
return value !== data;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
}, {
|
|
@@ -16,4 +16,3 @@ export { contextMenu, ContextMenuFeatureOptions } from './contextMenu';
|
|
|
16
16
|
export { filter, FilterFeatureOptions } from './columnFilter';
|
|
17
17
|
export { rangeSelection, RangeSelectionFeatureOptions } from './rangeSelection';
|
|
18
18
|
export { mergeCellHover } from './mergeCellHover';
|
|
19
|
-
export { footerDataSource, FooterDataSourceFeatureOptions, footerRowMetaSymbol } from './footerDataSource';
|
|
@@ -15,5 +15,4 @@ export { columnResize } from './columnResizeWidth';
|
|
|
15
15
|
export { contextMenu } from './contextMenu';
|
|
16
16
|
export { filter } from './columnFilter';
|
|
17
17
|
export { rangeSelection } from './rangeSelection';
|
|
18
|
-
export { mergeCellHover } from './mergeCellHover';
|
|
19
|
-
export { footerDataSource, footerRowMetaSymbol } from './footerDataSource';
|
|
18
|
+
export { mergeCellHover } from './mergeCellHover';
|
|
@@ -5,7 +5,7 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instan
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { internals } from '../../internals';
|
|
7
7
|
import { always, arrayUtils } from '../../utils/others';
|
|
8
|
-
import {
|
|
8
|
+
import { mergeCellProps } from '../../utils';
|
|
9
9
|
export function multiSelect() {
|
|
10
10
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
11
|
return function multiSelectStep(pipeline) {
|
|
@@ -44,8 +44,7 @@ export function multiSelect() {
|
|
|
44
44
|
/** 所有有效的 keys(disable 状态为 false) */
|
|
45
45
|
|
|
46
46
|
var allKeys = [];
|
|
47
|
-
|
|
48
|
-
flatDataSource.forEach(function (row, rowIndex) {
|
|
47
|
+
dataSource.forEach(function (row, rowIndex) {
|
|
49
48
|
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
50
49
|
fullKeySet.add(rowKey); // 在 allKeys 中排除被禁用的 key
|
|
51
50
|
|
|
@@ -111,10 +110,6 @@ export function multiSelect() {
|
|
|
111
110
|
return mergeCellProps(preCellProps, checkboxCellProps);
|
|
112
111
|
},
|
|
113
112
|
render: function render(_, row, rowIndex) {
|
|
114
|
-
if (row[pipeline.getFeatureOptions('footerRowMetaKey')]) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
113
|
var key = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
119
114
|
var checked = set.has(key);
|
|
120
115
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -6,5 +6,5 @@ export interface RangeSelectionFeatureOptions {
|
|
|
6
6
|
preventkDefaultOfKeyDownEvent?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare const rangeSelectionKey = "rangeSelection";
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const lastClickCell = "lastClickCell";
|
|
10
10
|
export declare function rangeSelection(opts: RangeSelectionFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
@@ -10,42 +10,40 @@ import { map, takeUntil } from 'rxjs/operators';
|
|
|
10
10
|
import { Classes } from '../../base/styles';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
export var rangeSelectionKey = 'rangeSelection';
|
|
13
|
-
export var
|
|
13
|
+
export var lastClickCell = 'lastClickCell';
|
|
14
14
|
export function rangeSelection(opts) {
|
|
15
15
|
return function step(pipeline) {
|
|
16
16
|
var SCROLL_SIZE = 30;
|
|
17
17
|
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
18
|
-
var tableFooter = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableFooter;
|
|
19
18
|
|
|
20
19
|
if (!tableBody) {
|
|
21
20
|
return pipeline;
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
var columns = pipeline.getColumns();
|
|
25
|
-
var dataSource = pipeline.getDataSource();
|
|
26
24
|
|
|
27
25
|
var rangeSelectedChange = function rangeSelectedChange(rangeSelection) {
|
|
28
26
|
var _a;
|
|
29
27
|
|
|
30
28
|
pipeline.setStateAtKey(rangeSelectionKey, rangeSelection);
|
|
31
29
|
(_a = opts === null || opts === void 0 ? void 0 : opts.rangeSelectedChange) === null || _a === void 0 ? void 0 : _a.call(opts, rangeSelection);
|
|
32
|
-
};
|
|
30
|
+
}; // if (!pipeline.getFeatureOptions(rangeSelectionKey)) {
|
|
31
|
+
// pipeline.setFeatureOptions(rangeSelectionKey, {
|
|
32
|
+
// optionKey: rangeSelectionKey,
|
|
33
|
+
// rangeSelectedChange: rangeSelectedChange
|
|
34
|
+
// })
|
|
35
|
+
// }
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
var setRangeSelection = function setRangeSelection(startDragCell, draggingCell) {
|
|
35
|
-
if (!startDragCell || !draggingCell) return;
|
|
39
|
+
if (!startDragCell || !draggingCell || isSameCell(startDragCell, draggingCell)) return;
|
|
36
40
|
var rangeColumns = getRangeColumns(startDragCell, draggingCell, columns);
|
|
37
|
-
|
|
38
|
-
var _getRangeSelectionRow = getRangeSelectionRowInfo(startDragCell, draggingCell, dataSource),
|
|
39
|
-
startRow = _getRangeSelectionRow.startRow,
|
|
40
|
-
endRow = _getRangeSelectionRow.endRow,
|
|
41
|
-
footerRowRange = _getRangeSelectionRow.footerRowRange;
|
|
42
|
-
|
|
41
|
+
var isTopToBottom = startDragCell.rowIndex <= draggingCell.rowIndex;
|
|
43
42
|
var rangeSelection = {
|
|
44
|
-
startRow:
|
|
45
|
-
endRow:
|
|
43
|
+
startRow: isTopToBottom ? startDragCell.rowIndex : startDragCell.rowIndex + startDragCell.rowSpan - 1,
|
|
44
|
+
endRow: isTopToBottom ? draggingCell.rowIndex + draggingCell.rowSpan - 1 : draggingCell.rowIndex,
|
|
46
45
|
columns: rangeColumns,
|
|
47
|
-
startColumn: startDragCell.column
|
|
48
|
-
footerRowRange: footerRowRange
|
|
46
|
+
startColumn: startDragCell.column
|
|
49
47
|
};
|
|
50
48
|
rangeSelectedChange(rangeSelection);
|
|
51
49
|
};
|
|
@@ -56,23 +54,23 @@ export function rangeSelection(opts) {
|
|
|
56
54
|
|
|
57
55
|
if (clickCell) {
|
|
58
56
|
if (event.shiftKey) {
|
|
59
|
-
var _lastClickCell = pipeline.getStateAtKey(
|
|
57
|
+
var _lastClickCell = pipeline.getStateAtKey(lastClickCell);
|
|
60
58
|
|
|
61
59
|
if (_lastClickCell) {
|
|
62
60
|
setRangeSelection(_lastClickCell, clickCell);
|
|
63
61
|
} else {
|
|
64
62
|
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
65
|
-
pipeline.setStateAtKey(
|
|
63
|
+
pipeline.setStateAtKey(lastClickCell, clickCell);
|
|
66
64
|
}
|
|
67
65
|
} else {
|
|
68
|
-
pipeline.setStateAtKey(
|
|
69
|
-
|
|
66
|
+
pipeline.setStateAtKey(lastClickCell, clickCell);
|
|
67
|
+
rangeSelectedChange(null);
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
70
|
};
|
|
73
71
|
|
|
74
72
|
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
75
|
-
if (mouseDownEvent.button !== 0 || !
|
|
73
|
+
if (mouseDownEvent.button !== 0 || !isElementInEventPath(tableBody, mouseDownEvent.nativeEvent)) return; // mouseDownEvent.preventDefault()
|
|
76
74
|
// shift + 点击选中
|
|
77
75
|
|
|
78
76
|
shiftKeySelect(mouseDownEvent);
|
|
@@ -128,11 +126,10 @@ export function rangeSelection(opts) {
|
|
|
128
126
|
};
|
|
129
127
|
|
|
130
128
|
var onKeyDown = function onKeyDown(e) {
|
|
131
|
-
if (!
|
|
129
|
+
if (!isElementInEventPath(tableBody, e.nativeEvent)) return;
|
|
132
130
|
|
|
133
131
|
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
|
134
132
|
var rowLen = pipeline.getDataSource().length;
|
|
135
|
-
var footerDataSource = pipeline.getFooterDataSource() || [];
|
|
136
133
|
|
|
137
134
|
if (columns.length && rowLen) {
|
|
138
135
|
opts.preventkDefaultOfKeyDownEvent !== false && e.preventDefault();
|
|
@@ -140,11 +137,7 @@ export function rangeSelection(opts) {
|
|
|
140
137
|
startRow: 0,
|
|
141
138
|
endRow: rowLen - 1,
|
|
142
139
|
columns: columns,
|
|
143
|
-
startColumn: columns[0]
|
|
144
|
-
footerRowRange: footerDataSource.length > 0 ? {
|
|
145
|
-
startRow: 0,
|
|
146
|
-
endRow: footerDataSource.length - 1
|
|
147
|
-
} : null
|
|
140
|
+
startColumn: columns[0]
|
|
148
141
|
});
|
|
149
142
|
}
|
|
150
143
|
}
|
|
@@ -153,8 +146,7 @@ export function rangeSelection(opts) {
|
|
|
153
146
|
pipeline.addTableProps({
|
|
154
147
|
onMouseDown: onMouseDown,
|
|
155
148
|
onKeyDown: onKeyDown,
|
|
156
|
-
tabIndex: -1
|
|
157
|
-
className: cx([Classes.rangeSelection])
|
|
149
|
+
tabIndex: -1
|
|
158
150
|
}); // todo: 后面可以把mousedown放到一个流里面
|
|
159
151
|
|
|
160
152
|
return pipeline.mapColumns(makeRecursiveMapper(function (col) {
|
|
@@ -170,29 +162,15 @@ export function rangeSelection(opts) {
|
|
|
170
162
|
var _cx;
|
|
171
163
|
|
|
172
164
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
173
|
-
var isInFooter = record[pipeline.getFeatureOptions('footerRowMetaKey')];
|
|
174
165
|
var startRow = rangeSelection.startRow,
|
|
175
166
|
endRow = rangeSelection.endRow,
|
|
176
|
-
columns = rangeSelection.columns
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
var _getRowIndex = getRowIndex(startRow, endRow),
|
|
180
|
-
startRowIndex = _getRowIndex.startRowIndex,
|
|
181
|
-
endRowIndex = _getRowIndex.endRowIndex;
|
|
182
|
-
|
|
183
|
-
var _getFooterRowIndex = getFooterRowIndex(footerRowRange),
|
|
184
|
-
footerStartRowIndex = _getFooterRowIndex.startRowIndex,
|
|
185
|
-
footerEndRowIndex = _getFooterRowIndex.endRowIndex;
|
|
186
|
-
|
|
167
|
+
columns = rangeSelection.columns;
|
|
168
|
+
var startIndex = startRow < endRow ? startRow : endRow;
|
|
169
|
+
var endIndex = startRow < endRow ? endRow : startRow;
|
|
187
170
|
var startCol = columns[0];
|
|
188
171
|
var endCol = columns[columns.length - 1];
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var match = footerMatch || bodyMatch;
|
|
192
|
-
var matchSingleCell = match && isCellRangeSingleCell(rangeSelection); // 单个范围选中单元格不显示样式
|
|
193
|
-
|
|
194
|
-
var showCellRangeStyle = match && !matchSingleCell;
|
|
195
|
-
var className = cx((_cx = {}, _defineProperty(_cx, Classes.tableCellRangeSingleCell, matchSingleCell), _defineProperty(_cx, Classes.tableCellRangeSelected, showCellRangeStyle), _defineProperty(_cx, Classes.tableCellRangeTop, showCellRangeStyle && (isInFooter ? startRowIndex !== -1 ? false : rowIndex === footerStartRowIndex : rowIndex === startRowIndex)), _defineProperty(_cx, Classes.tableCellRangeLeft, showCellRangeStyle && col.code === startCol.code), _defineProperty(_cx, Classes.tableCellRangeBottom, showCellRangeStyle && (isInFooter ? rowIndex === footerEndRowIndex : footerRowRange ? false : rowIndex === endRowIndex)), _defineProperty(_cx, Classes.tableCellRangeRight, showCellRangeStyle && col.code === endCol.code), _cx));
|
|
172
|
+
var match = rowIndex >= startIndex && rowIndex <= endIndex;
|
|
173
|
+
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));
|
|
196
174
|
return mergeCellProps(prevCellProps, {
|
|
197
175
|
className: className
|
|
198
176
|
});
|
|
@@ -218,8 +196,7 @@ function getTargetCell(target, columns) {
|
|
|
218
196
|
rowIndex: parseInt(target.getAttribute('data-rowindex')),
|
|
219
197
|
rowSpan: parseInt(target.getAttribute('rowspan') || 1),
|
|
220
198
|
code: columnCode,
|
|
221
|
-
column: column
|
|
222
|
-
isInFooter: isEleInFooter(target)
|
|
199
|
+
column: column
|
|
223
200
|
}
|
|
224
201
|
};
|
|
225
202
|
}();
|
|
@@ -234,19 +211,7 @@ function getTargetCell(target, columns) {
|
|
|
234
211
|
}
|
|
235
212
|
|
|
236
213
|
function isSameCell(cell1, cell2) {
|
|
237
|
-
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function isEleInFooter(target) {
|
|
241
|
-
while (target && !target.classList.contains(Classes.artTable)) {
|
|
242
|
-
if (target.classList.contains(Classes.tableFooter)) {
|
|
243
|
-
return true;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
target = target.parentElement;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
return false;
|
|
214
|
+
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code;
|
|
250
215
|
}
|
|
251
216
|
|
|
252
217
|
function getRangeColumns(startCell, endCell, columns) {
|
|
@@ -265,97 +230,4 @@ function getRangeColumns(startCell, endCell, columns) {
|
|
|
265
230
|
} else {
|
|
266
231
|
return _sliceInstanceProperty(flatColumns).call(flatColumns, endIndex, startIndex + 1);
|
|
267
232
|
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
function getRangeSelectionRowInfo(startCell, endCell, dataSource) {
|
|
271
|
-
var footerRowRange = null;
|
|
272
|
-
var startRow = -1;
|
|
273
|
-
var endRow = -1;
|
|
274
|
-
|
|
275
|
-
var _getCellRangeRow = getCellRangeRow(startCell, endCell),
|
|
276
|
-
_startRow = _getCellRangeRow.startRow,
|
|
277
|
-
_endRow = _getCellRangeRow.endRow; // 两个单元格都在表体
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (!startCell.isInFooter && !endCell.isInFooter) {
|
|
281
|
-
startRow = _startRow;
|
|
282
|
-
endRow = _endRow;
|
|
283
|
-
} else if (startCell.isInFooter && endCell.isInFooter) {
|
|
284
|
-
// 两个单元格都在表底
|
|
285
|
-
footerRowRange = {
|
|
286
|
-
startRow: _startRow,
|
|
287
|
-
endRow: _endRow
|
|
288
|
-
};
|
|
289
|
-
} else {
|
|
290
|
-
// 一个单元格在表体,一个在表底
|
|
291
|
-
if (startCell.isInFooter) {
|
|
292
|
-
startRow = dataSource.length - 1;
|
|
293
|
-
endRow = endCell.rowIndex;
|
|
294
|
-
footerRowRange = {
|
|
295
|
-
startRow: startCell.rowIndex,
|
|
296
|
-
endRow: 0
|
|
297
|
-
};
|
|
298
|
-
} else {
|
|
299
|
-
startRow = startCell.rowIndex;
|
|
300
|
-
endRow = dataSource.length - 1;
|
|
301
|
-
footerRowRange = {
|
|
302
|
-
startRow: 0,
|
|
303
|
-
endRow: endCell.rowIndex
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
return {
|
|
309
|
-
startRow: startRow,
|
|
310
|
-
endRow: endRow,
|
|
311
|
-
footerRowRange: footerRowRange
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
function getCellRangeRow(startCell, endCell) {
|
|
316
|
-
if (isSameCell(startCell, endCell)) {
|
|
317
|
-
return {
|
|
318
|
-
startRow: startCell.rowIndex,
|
|
319
|
-
endRow: startCell.rowIndex
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
var isTopToBottom = startCell.rowIndex <= endCell.rowIndex;
|
|
324
|
-
var startRow = isTopToBottom ? startCell.rowIndex : startCell.rowIndex + startCell.rowSpan - 1;
|
|
325
|
-
var endRow = isTopToBottom ? endCell.rowIndex + endCell.rowSpan - 1 : endCell.rowIndex;
|
|
326
|
-
return {
|
|
327
|
-
startRow: startRow,
|
|
328
|
-
endRow: endRow
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function isCellRangeSingleCell(rangeSelection) {
|
|
333
|
-
var startRow = rangeSelection.startRow,
|
|
334
|
-
endRow = rangeSelection.endRow,
|
|
335
|
-
columns = rangeSelection.columns,
|
|
336
|
-
footerRowRange = rangeSelection.footerRowRange;
|
|
337
|
-
var isBodySingleCell = !footerRowRange && startRow === endRow && columns.length === 1;
|
|
338
|
-
var isFooterSingleCell = startRow === -1 && footerRowRange.startRow === footerRowRange.endRow && columns.length === 1;
|
|
339
|
-
return isBodySingleCell || isFooterSingleCell;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function getRowIndex(startRow, endRow) {
|
|
343
|
-
var isReverse = startRow > endRow;
|
|
344
|
-
var startRowIndex = isReverse ? endRow : startRow;
|
|
345
|
-
var endRowIndex = isReverse ? startRow : endRow;
|
|
346
|
-
return {
|
|
347
|
-
startRowIndex: startRowIndex,
|
|
348
|
-
endRowIndex: endRowIndex
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
function getFooterRowIndex(footerRowRange) {
|
|
353
|
-
if (footerRowRange) {
|
|
354
|
-
return getRowIndex(footerRowRange.startRow, footerRowRange.endRow);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
return {
|
|
358
|
-
startRowIndex: -1,
|
|
359
|
-
endRowIndex: -1
|
|
360
|
-
};
|
|
361
233
|
}
|
|
@@ -60,10 +60,6 @@ export function singleSelect() {
|
|
|
60
60
|
return preCellProps;
|
|
61
61
|
},
|
|
62
62
|
render: function render(_, row, rowIndex) {
|
|
63
|
-
if (row[pipeline.getFeatureOptions('footerRowMetaKey')]) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
63
|
var rowKey = internals.safeGetRowKey(primaryKey, row, rowIndex);
|
|
68
64
|
return /*#__PURE__*/React.createElement(Radio, {
|
|
69
65
|
checked: value === rowKey,
|
|
@@ -32,8 +32,6 @@ export interface TreeModeFeatureOptions {
|
|
|
32
32
|
stopClickEventPropagation?: boolean;
|
|
33
33
|
/** 指定表格每一行元信息的记录字段 */
|
|
34
34
|
treeMetaKey?: string | symbol;
|
|
35
|
-
/** 指定展开列 */
|
|
36
|
-
expandColCode?: string;
|
|
37
35
|
}
|
|
38
36
|
export declare function treeMode(opts?: TreeModeFeatureOptions): (pipeline: TablePipeline) => TablePipeline;
|
|
39
37
|
export {};
|