@kdcloudjs/table 1.1.3-canary.7 → 1.1.3-canary.8
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 +266 -47
- 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 +2 -0
- package/es/table/base/styles.js +3 -1
- package/es/table/base/table.js +4 -3
- package/es/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/es/table/pipeline/features/footerDataSource.js +25 -0
- package/es/table/pipeline/features/index.d.ts +1 -0
- package/es/table/pipeline/features/index.js +2 -1
- package/es/table/pipeline/features/multiSelect.js +4 -0
- package/es/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/es/table/pipeline/features/rangeSelection.js +156 -28
- package/es/table/pipeline/features/singleSelect.js +4 -0
- package/es/table/pipeline/pipeline.d.ts +5 -1
- package/es/table/pipeline/pipeline.js +11 -10
- package/lib/table/base/html-table.js +1 -1
- package/lib/table/base/styles.d.ts +2 -0
- package/lib/table/base/styles.js +3 -1
- package/lib/table/base/table.js +4 -3
- package/lib/table/pipeline/features/footerDataSource.d.ts +9 -0
- package/lib/table/pipeline/features/footerDataSource.js +41 -0
- package/lib/table/pipeline/features/index.d.ts +1 -0
- package/lib/table/pipeline/features/index.js +15 -1
- package/lib/table/pipeline/features/multiSelect.js +4 -0
- package/lib/table/pipeline/features/rangeSelection.d.ts +1 -1
- package/lib/table/pipeline/features/rangeSelection.js +158 -30
- package/lib/table/pipeline/features/singleSelect.js +4 -0
- package/lib/table/pipeline/pipeline.d.ts +5 -1
- package/lib/table/pipeline/pipeline.js +12 -10
- package/package.json +1 -1
package/dist/@kdcloudjs/table.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @kdcloudjs/table v1.1.3-canary.
|
|
3
|
+
* @kdcloudjs/table v1.1.3-canary.7
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -2664,7 +2664,7 @@ function HtmlTable(_ref) {
|
|
|
2664
2664
|
positionStyle.left = hozInfo.stickyLeftMap.get(colIndex);
|
|
2665
2665
|
} else if (colIndex >= fullFlatCount - rightFlatCount) {
|
|
2666
2666
|
positionStyle.position = 'sticky';
|
|
2667
|
-
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - stickyRightOffset;
|
|
2667
|
+
positionStyle.right = hozInfo.stickyRightMap.get(colIndex) - (typeof stickyRightOffset === 'number' ? stickyRightOffset : 0);
|
|
2668
2668
|
}
|
|
2669
2669
|
|
|
2670
2670
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement('td', _objectSpread(_objectSpread(_objectSpread({
|
|
@@ -3289,6 +3289,8 @@ var Classes = {
|
|
|
3289
3289
|
button: "".concat(prefix, "btn"),
|
|
3290
3290
|
buttonPrimary: "".concat(prefix, "btn-primary"),
|
|
3291
3291
|
filterIcon: "".concat(prefix, "filter-icon"),
|
|
3292
|
+
rangeSelection: "".concat(prefix, "range-selection"),
|
|
3293
|
+
tableCellRangeSingleCell: "".concat(prefix, "table-cell-range-single-cell"),
|
|
3292
3294
|
tableCellRangeSelected: "".concat(prefix, "table-cell-range-selected"),
|
|
3293
3295
|
tableCellRangeTop: "".concat(prefix, "table-cell-range-top"),
|
|
3294
3296
|
tableCellRangeLeft: "".concat(prefix, "table-cell-range-left"),
|
|
@@ -3356,7 +3358,7 @@ var defaultCSSVariables = {
|
|
|
3356
3358
|
'--header-cell-border-horizontal': '1px solid #dfe3e8'
|
|
3357
3359
|
};
|
|
3358
3360
|
var variableConst = getCssVariableText(defaultCSSVariables);
|
|
3359
|
-
var StyledArtTableWrapper = styled_components__WEBPACK_IMPORTED_MODULE_4__["default"].div(_templateObject2 || (_templateObject2 = _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default()(["\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
|
|
3361
|
+
var StyledArtTableWrapper = styled_components__WEBPACK_IMPORTED_MODULE_4__["default"].div(_templateObject2 || (_templateObject2 = _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default()(["\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 .", ", .", " {\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 user-select:none;\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: hidden;//\u5217\u5168\u90E8\u56FA\u5B9A\u65F6\uFF0C\u5B58\u5728\u53CC\u6A2A\u5411\u6EDA\u52A8\u6761\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.tableFooter, Classes.tableCellRangeSelected, Classes.tableCellRangeTop, Classes.tableCellRangeLeft, Classes.tableCellRangeBottom, Classes.tableCellRangeRight, Classes.rangeSelection, 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);
|
|
3360
3362
|
var ButtonCSS = Object(styled_components__WEBPACK_IMPORTED_MODULE_4__["css"])(_templateObject3 || (_templateObject3 = _babel_runtime_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_0___default()(["\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);
|
|
3361
3363
|
|
|
3362
3364
|
function getCssVariableText(obj) {
|
|
@@ -3984,13 +3986,14 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
3984
3986
|
style: style
|
|
3985
3987
|
}, _utils__WEBPACK_IMPORTED_MODULE_39__["STYLED_REF_PROP"], this.artTableWrapperRef);
|
|
3986
3988
|
|
|
3989
|
+
var tableProps = getTableProps() || {};
|
|
3987
3990
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement(_styles__WEBPACK_IMPORTED_MODULE_38__["StyledArtTableWrapper"], artTableWrapperProps, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement(_loading__WEBPACK_IMPORTED_MODULE_37__["default"], {
|
|
3988
3991
|
visible: isLoading,
|
|
3989
3992
|
LoadingIcon: components.LoadingIcon,
|
|
3990
3993
|
LoadingContentWrapper: components.LoadingContentWrapper
|
|
3991
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement("div", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_18___default()({
|
|
3992
|
-
className: _styles__WEBPACK_IMPORTED_MODULE_38__["Classes"].artTable
|
|
3993
|
-
}
|
|
3994
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_27___default.a.createElement("div", _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_18___default()({}, tableProps, {
|
|
3995
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_26___default()(_styles__WEBPACK_IMPORTED_MODULE_38__["Classes"].artTable, tableProps.className)
|
|
3996
|
+
}), this.renderTableHeader(info), this.renderTableBody(info), this.renderTableFooter(info), this.renderLockShadows(info)), this.renderStickyScroll(info)));
|
|
3994
3997
|
}
|
|
3995
3998
|
}, {
|
|
3996
3999
|
key: "componentDidMount",
|
|
@@ -7250,13 +7253,83 @@ var DEFAULT_FILTER_OPTIONS = [{
|
|
|
7250
7253
|
}];
|
|
7251
7254
|
|
|
7252
7255
|
|
|
7256
|
+
/***/ }),
|
|
7257
|
+
|
|
7258
|
+
/***/ "./components/table/pipeline/features/footerDataSource.ts":
|
|
7259
|
+
/*!****************************************************************!*\
|
|
7260
|
+
!*** ./components/table/pipeline/features/footerDataSource.ts ***!
|
|
7261
|
+
\****************************************************************/
|
|
7262
|
+
/*! exports provided: footerRowMetaSymbol, footerDataSource */
|
|
7263
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7264
|
+
|
|
7265
|
+
"use strict";
|
|
7266
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7267
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "footerRowMetaSymbol", function() { return footerRowMetaSymbol; });
|
|
7268
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "footerDataSource", function() { return footerDataSource; });
|
|
7269
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "./node_modules/@babel/runtime/helpers/defineProperty.js");
|
|
7270
|
+
/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
|
7271
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js");
|
|
7272
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
7273
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js");
|
|
7274
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
7275
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
|
|
7276
|
+
/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
7277
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
|
|
7278
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
7279
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js");
|
|
7280
|
+
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
7281
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
|
|
7282
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
7283
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
|
|
7284
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_7__);
|
|
7285
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js");
|
|
7286
|
+
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_8__);
|
|
7287
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js");
|
|
7288
|
+
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_9__);
|
|
7289
|
+
|
|
7290
|
+
|
|
7291
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7292
|
+
|
|
7293
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7294
|
+
|
|
7295
|
+
|
|
7296
|
+
|
|
7297
|
+
|
|
7298
|
+
|
|
7299
|
+
|
|
7300
|
+
|
|
7301
|
+
|
|
7302
|
+
|
|
7303
|
+
|
|
7304
|
+
var footerRowMetaSymbol = Symbol('footer-row');
|
|
7305
|
+
function footerDataSource() {
|
|
7306
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7307
|
+
return function footerDataSourceStep(pipeline) {
|
|
7308
|
+
var _opts$dataSource, _opts$footerRowMetaKe;
|
|
7309
|
+
|
|
7310
|
+
var footerDataSource = (_opts$dataSource = opts.dataSource) !== null && _opts$dataSource !== void 0 ? _opts$dataSource : pipeline.getFooterDataSource();
|
|
7311
|
+
var footerRowMetaKey = (_opts$footerRowMetaKe = opts.footerRowMetaKey) !== null && _opts$footerRowMetaKe !== void 0 ? _opts$footerRowMetaKe : footerRowMetaSymbol;
|
|
7312
|
+
pipeline.setFeatureOptions('footerRowMetaKey', footerRowMetaKey);
|
|
7313
|
+
|
|
7314
|
+
if (footerDataSource) {
|
|
7315
|
+
pipeline.footerDataSource(footerDataSource.map(function (row) {
|
|
7316
|
+
return _objectSpread(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, footerRowMetaKey, true), row);
|
|
7317
|
+
}));
|
|
7318
|
+
} else {
|
|
7319
|
+
console.warn('调用 pipeline.use(features.footerDataSource()) 前请先设置页脚数据源,设置方法有:pipeline.use(features.footerDataSource({dataSource:any[]})) 或者 pipeline.footerDataSource(any[])');
|
|
7320
|
+
}
|
|
7321
|
+
|
|
7322
|
+
return pipeline;
|
|
7323
|
+
};
|
|
7324
|
+
}
|
|
7325
|
+
|
|
7253
7326
|
/***/ }),
|
|
7254
7327
|
|
|
7255
7328
|
/***/ "./components/table/pipeline/features/index.ts":
|
|
7256
7329
|
/*!*****************************************************!*\
|
|
7257
7330
|
!*** ./components/table/pipeline/features/index.ts ***!
|
|
7258
7331
|
\*****************************************************/
|
|
7259
|
-
/*! exports provided: autoRowSpan, buildTree, columnHover, ColumnHoverFeatureOptions, columnRangeHover, ColumnRangeHoverFeatureOptions, multiSelect, MultiSelectFeatureOptions, rowDetail, RowDetailFeatureOptions, rowGrouping, RowGroupingFeatureOptions, singleSelect, SingleSelectFeatureOptions, sort, SortFeatureOptions, tips, treeMode, TreeModeFeatureOptions, treeMetaSymbol, treeSelect, TreeSelectFeatureOptions, columnDrag, ColumnDragOptions, columnResize, ColumnResizeOptions, contextMenu, ContextMenuFeatureOptions, filter, FilterFeatureOptions, rangeSelection, RangeSelectionFeatureOptions, mergeCellHover */
|
|
7332
|
+
/*! exports provided: autoRowSpan, buildTree, columnHover, ColumnHoverFeatureOptions, columnRangeHover, ColumnRangeHoverFeatureOptions, multiSelect, MultiSelectFeatureOptions, rowDetail, RowDetailFeatureOptions, rowGrouping, RowGroupingFeatureOptions, singleSelect, SingleSelectFeatureOptions, sort, SortFeatureOptions, tips, treeMode, TreeModeFeatureOptions, treeMetaSymbol, treeSelect, TreeSelectFeatureOptions, columnDrag, ColumnDragOptions, columnResize, ColumnResizeOptions, contextMenu, ContextMenuFeatureOptions, filter, FilterFeatureOptions, rangeSelection, RangeSelectionFeatureOptions, mergeCellHover, footerDataSource, FooterDataSourceFeatureOptions, footerRowMetaSymbol */
|
|
7260
7333
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7261
7334
|
|
|
7262
7335
|
"use strict";
|
|
@@ -7345,6 +7418,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
7345
7418
|
/* harmony import */ var _mergeCellHover__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./mergeCellHover */ "./components/table/pipeline/features/mergeCellHover.tsx");
|
|
7346
7419
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "mergeCellHover", function() { return _mergeCellHover__WEBPACK_IMPORTED_MODULE_17__["mergeCellHover"]; });
|
|
7347
7420
|
|
|
7421
|
+
/* harmony import */ var _footerDataSource__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./footerDataSource */ "./components/table/pipeline/features/footerDataSource.ts");
|
|
7422
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "footerDataSource", function() { return _footerDataSource__WEBPACK_IMPORTED_MODULE_18__["footerDataSource"]; });
|
|
7423
|
+
|
|
7424
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "FooterDataSourceFeatureOptions", function() { return _footerDataSource__WEBPACK_IMPORTED_MODULE_18__["FooterDataSourceFeatureOptions"]; });
|
|
7425
|
+
|
|
7426
|
+
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "footerRowMetaSymbol", function() { return _footerDataSource__WEBPACK_IMPORTED_MODULE_18__["footerRowMetaSymbol"]; });
|
|
7427
|
+
|
|
7428
|
+
|
|
7348
7429
|
|
|
7349
7430
|
|
|
7350
7431
|
|
|
@@ -7611,6 +7692,10 @@ function multiSelect() {
|
|
|
7611
7692
|
return Object(_utils__WEBPACK_IMPORTED_MODULE_17__["mergeCellProps"])(preCellProps, checkboxCellProps);
|
|
7612
7693
|
},
|
|
7613
7694
|
render: function render(_, row, rowIndex) {
|
|
7695
|
+
if (row[pipeline.getFeatureOptions('footerRowMetaKey')]) {
|
|
7696
|
+
return null;
|
|
7697
|
+
}
|
|
7698
|
+
|
|
7614
7699
|
var key = _internals__WEBPACK_IMPORTED_MODULE_15__["internals"].safeGetRowKey(primaryKey, row, rowIndex);
|
|
7615
7700
|
var checked = set.has(key);
|
|
7616
7701
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_14___default.a.createElement(Checkbox, {
|
|
@@ -7719,13 +7804,13 @@ function multiSelect() {
|
|
|
7719
7804
|
/*!***************************************************************!*\
|
|
7720
7805
|
!*** ./components/table/pipeline/features/rangeSelection.tsx ***!
|
|
7721
7806
|
\***************************************************************/
|
|
7722
|
-
/*! exports provided: rangeSelectionKey,
|
|
7807
|
+
/*! exports provided: rangeSelectionKey, lastClickCellKey, rangeSelection */
|
|
7723
7808
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7724
7809
|
|
|
7725
7810
|
"use strict";
|
|
7726
7811
|
__webpack_require__.r(__webpack_exports__);
|
|
7727
7812
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rangeSelectionKey", function() { return rangeSelectionKey; });
|
|
7728
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "
|
|
7813
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastClickCellKey", function() { return lastClickCellKey; });
|
|
7729
7814
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rangeSelection", function() { return rangeSelection; });
|
|
7730
7815
|
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js");
|
|
7731
7816
|
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
@@ -7779,40 +7864,42 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
7779
7864
|
|
|
7780
7865
|
|
|
7781
7866
|
var rangeSelectionKey = 'rangeSelection';
|
|
7782
|
-
var
|
|
7867
|
+
var lastClickCellKey = 'lastClickCell';
|
|
7783
7868
|
function rangeSelection(opts) {
|
|
7784
7869
|
return function step(pipeline) {
|
|
7785
7870
|
var SCROLL_SIZE = 30;
|
|
7786
7871
|
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
7872
|
+
var tableFooter = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableFooter;
|
|
7787
7873
|
|
|
7788
7874
|
if (!tableBody) {
|
|
7789
7875
|
return pipeline;
|
|
7790
7876
|
}
|
|
7791
7877
|
|
|
7792
7878
|
var columns = pipeline.getColumns();
|
|
7879
|
+
var dataSource = pipeline.getDataSource();
|
|
7793
7880
|
|
|
7794
7881
|
var rangeSelectedChange = function rangeSelectedChange(rangeSelection) {
|
|
7795
7882
|
var _opts$rangeSelectedCh;
|
|
7796
7883
|
|
|
7797
7884
|
pipeline.setStateAtKey(rangeSelectionKey, rangeSelection);
|
|
7798
7885
|
opts === null || opts === void 0 ? void 0 : (_opts$rangeSelectedCh = opts.rangeSelectedChange) === null || _opts$rangeSelectedCh === void 0 ? void 0 : _opts$rangeSelectedCh.call(opts, rangeSelection);
|
|
7799
|
-
};
|
|
7800
|
-
// pipeline.setFeatureOptions(rangeSelectionKey, {
|
|
7801
|
-
// optionKey: rangeSelectionKey,
|
|
7802
|
-
// rangeSelectedChange: rangeSelectedChange
|
|
7803
|
-
// })
|
|
7804
|
-
// }
|
|
7805
|
-
|
|
7886
|
+
};
|
|
7806
7887
|
|
|
7807
7888
|
var setRangeSelection = function setRangeSelection(startDragCell, draggingCell) {
|
|
7808
|
-
if (!startDragCell || !draggingCell
|
|
7889
|
+
if (!startDragCell || !draggingCell) return;
|
|
7809
7890
|
var rangeColumns = getRangeColumns(startDragCell, draggingCell, columns);
|
|
7810
|
-
|
|
7891
|
+
|
|
7892
|
+
var _getRangeSelectionRow = getRangeSelectionRowInfo(startDragCell, draggingCell, dataSource),
|
|
7893
|
+
startRow = _getRangeSelectionRow.startRow,
|
|
7894
|
+
endRow = _getRangeSelectionRow.endRow,
|
|
7895
|
+
footerRowRange = _getRangeSelectionRow.footerRowRange;
|
|
7896
|
+
|
|
7811
7897
|
var rangeSelection = {
|
|
7812
|
-
startRow:
|
|
7813
|
-
endRow:
|
|
7898
|
+
startRow: startRow,
|
|
7899
|
+
endRow: endRow,
|
|
7814
7900
|
columns: rangeColumns,
|
|
7815
|
-
startColumn: startDragCell.column
|
|
7901
|
+
startColumn: startDragCell.column,
|
|
7902
|
+
footerRowRange: footerRowRange
|
|
7816
7903
|
};
|
|
7817
7904
|
rangeSelectedChange(rangeSelection);
|
|
7818
7905
|
};
|
|
@@ -7823,23 +7910,23 @@ function rangeSelection(opts) {
|
|
|
7823
7910
|
|
|
7824
7911
|
if (clickCell) {
|
|
7825
7912
|
if (event.shiftKey) {
|
|
7826
|
-
var _lastClickCell = pipeline.getStateAtKey(
|
|
7913
|
+
var _lastClickCell = pipeline.getStateAtKey(lastClickCellKey);
|
|
7827
7914
|
|
|
7828
7915
|
if (_lastClickCell) {
|
|
7829
7916
|
setRangeSelection(_lastClickCell, clickCell);
|
|
7830
7917
|
} else {
|
|
7831
7918
|
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
7832
|
-
pipeline.setStateAtKey(
|
|
7919
|
+
pipeline.setStateAtKey(lastClickCellKey, clickCell);
|
|
7833
7920
|
}
|
|
7834
7921
|
} else {
|
|
7835
|
-
pipeline.setStateAtKey(
|
|
7836
|
-
|
|
7922
|
+
pipeline.setStateAtKey(lastClickCellKey, clickCell);
|
|
7923
|
+
setRangeSelection(clickCell, clickCell);
|
|
7837
7924
|
}
|
|
7838
7925
|
}
|
|
7839
7926
|
};
|
|
7840
7927
|
|
|
7841
7928
|
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
7842
|
-
if (mouseDownEvent.button !== 0 || !Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableBody, mouseDownEvent.nativeEvent)) return; // mouseDownEvent.preventDefault()
|
|
7929
|
+
if (mouseDownEvent.button !== 0 || !(Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableBody, mouseDownEvent.nativeEvent) || Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableFooter, mouseDownEvent.nativeEvent))) return; // mouseDownEvent.preventDefault()
|
|
7843
7930
|
// shift + 点击选中
|
|
7844
7931
|
|
|
7845
7932
|
shiftKeySelect(mouseDownEvent);
|
|
@@ -7895,10 +7982,11 @@ function rangeSelection(opts) {
|
|
|
7895
7982
|
};
|
|
7896
7983
|
|
|
7897
7984
|
var onKeyDown = function onKeyDown(e) {
|
|
7898
|
-
if (!Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableBody, e.nativeEvent)) return;
|
|
7985
|
+
if (!(Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableBody, e.nativeEvent) || Object(_utils__WEBPACK_IMPORTED_MODULE_11__["isElementInEventPath"])(tableFooter, e.nativeEvent))) return;
|
|
7899
7986
|
|
|
7900
7987
|
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
|
7901
7988
|
var rowLen = pipeline.getDataSource().length;
|
|
7989
|
+
var footerDataSource = pipeline.getFooterDataSource() || [];
|
|
7902
7990
|
|
|
7903
7991
|
if (columns.length && rowLen) {
|
|
7904
7992
|
opts.preventkDefaultOfKeyDownEvent !== false && e.preventDefault();
|
|
@@ -7906,7 +7994,11 @@ function rangeSelection(opts) {
|
|
|
7906
7994
|
startRow: 0,
|
|
7907
7995
|
endRow: rowLen - 1,
|
|
7908
7996
|
columns: columns,
|
|
7909
|
-
startColumn: columns[0]
|
|
7997
|
+
startColumn: columns[0],
|
|
7998
|
+
footerRowRange: footerDataSource.length > 0 ? {
|
|
7999
|
+
startRow: 0,
|
|
8000
|
+
endRow: footerDataSource.length - 1
|
|
8001
|
+
} : null
|
|
7910
8002
|
});
|
|
7911
8003
|
}
|
|
7912
8004
|
}
|
|
@@ -7915,7 +8007,8 @@ function rangeSelection(opts) {
|
|
|
7915
8007
|
pipeline.addTableProps({
|
|
7916
8008
|
onMouseDown: onMouseDown,
|
|
7917
8009
|
onKeyDown: onKeyDown,
|
|
7918
|
-
tabIndex: -1
|
|
8010
|
+
tabIndex: -1,
|
|
8011
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_16___default()([_base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].rangeSelection])
|
|
7919
8012
|
}); // todo: 后面可以把mousedown放到一个流里面
|
|
7920
8013
|
|
|
7921
8014
|
return pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_11__["makeRecursiveMapper"])(function (col) {
|
|
@@ -7929,15 +8022,29 @@ function rangeSelection(opts) {
|
|
|
7929
8022
|
var _cx;
|
|
7930
8023
|
|
|
7931
8024
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
8025
|
+
var isInFooter = record[pipeline.getFeatureOptions('footerRowMetaKey')];
|
|
7932
8026
|
var startRow = rangeSelection.startRow,
|
|
7933
8027
|
endRow = rangeSelection.endRow,
|
|
7934
|
-
columns = rangeSelection.columns
|
|
7935
|
-
|
|
7936
|
-
|
|
8028
|
+
columns = rangeSelection.columns,
|
|
8029
|
+
footerRowRange = rangeSelection.footerRowRange;
|
|
8030
|
+
|
|
8031
|
+
var _getRowIndex = getRowIndex(startRow, endRow),
|
|
8032
|
+
startRowIndex = _getRowIndex.startRowIndex,
|
|
8033
|
+
endRowIndex = _getRowIndex.endRowIndex;
|
|
8034
|
+
|
|
8035
|
+
var _getFooterRowIndex = getFooterRowIndex(footerRowRange),
|
|
8036
|
+
footerStartRowIndex = _getFooterRowIndex.startRowIndex,
|
|
8037
|
+
footerEndRowIndex = _getFooterRowIndex.endRowIndex;
|
|
8038
|
+
|
|
7937
8039
|
var startCol = columns[0];
|
|
7938
8040
|
var endCol = columns[columns.length - 1];
|
|
7939
|
-
var
|
|
7940
|
-
var
|
|
8041
|
+
var bodyMatch = !isInFooter && rowIndex >= startRowIndex && rowIndex <= endRowIndex;
|
|
8042
|
+
var footerMatch = isInFooter && footerRowRange && rowIndex >= footerStartRowIndex && rowIndex <= footerEndRowIndex;
|
|
8043
|
+
var match = footerMatch || bodyMatch;
|
|
8044
|
+
var matchSingleCell = match && isCellRangeSingleCell(rangeSelection); // 单个范围选中单元格不显示样式
|
|
8045
|
+
|
|
8046
|
+
var showCellRangeStyle = match && !matchSingleCell;
|
|
8047
|
+
var className = classnames__WEBPACK_IMPORTED_MODULE_16___default()((_cx = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeSingleCell, matchSingleCell), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeSelected, showCellRangeStyle), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeTop, showCellRangeStyle && (isInFooter ? startRowIndex !== -1 ? false : rowIndex === footerStartRowIndex : rowIndex === startRowIndex)), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeLeft, showCellRangeStyle && col.code === startCol.code), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeBottom, showCellRangeStyle && (isInFooter ? rowIndex === footerEndRowIndex : footerRowRange ? false : rowIndex === endRowIndex)), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_8___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableCellRangeRight, showCellRangeStyle && col.code === endCol.code), _cx));
|
|
7941
8048
|
return Object(_utils__WEBPACK_IMPORTED_MODULE_11__["mergeCellProps"])(prevCellProps, {
|
|
7942
8049
|
className: className
|
|
7943
8050
|
});
|
|
@@ -7963,7 +8070,8 @@ function getTargetCell(target, columns) {
|
|
|
7963
8070
|
rowIndex: parseInt(target.getAttribute('data-rowindex')),
|
|
7964
8071
|
rowSpan: parseInt(target.getAttribute('rowspan') || 1),
|
|
7965
8072
|
code: columnCode,
|
|
7966
|
-
column: column
|
|
8073
|
+
column: column,
|
|
8074
|
+
isInFooter: isEleInFooter(target)
|
|
7967
8075
|
}
|
|
7968
8076
|
};
|
|
7969
8077
|
}();
|
|
@@ -7978,7 +8086,19 @@ function getTargetCell(target, columns) {
|
|
|
7978
8086
|
}
|
|
7979
8087
|
|
|
7980
8088
|
function isSameCell(cell1, cell2) {
|
|
7981
|
-
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code;
|
|
8089
|
+
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code && cell1.isInFooter === cell2.isInFooter;
|
|
8090
|
+
}
|
|
8091
|
+
|
|
8092
|
+
function isEleInFooter(target) {
|
|
8093
|
+
while (target && !target.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].artTable)) {
|
|
8094
|
+
if (target.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_15__["Classes"].tableFooter)) {
|
|
8095
|
+
return true;
|
|
8096
|
+
}
|
|
8097
|
+
|
|
8098
|
+
target = target.parentElement;
|
|
8099
|
+
}
|
|
8100
|
+
|
|
8101
|
+
return false;
|
|
7982
8102
|
}
|
|
7983
8103
|
|
|
7984
8104
|
function getRangeColumns(startCell, endCell, columns) {
|
|
@@ -7997,6 +8117,99 @@ function getRangeColumns(startCell, endCell, columns) {
|
|
|
7997
8117
|
}
|
|
7998
8118
|
}
|
|
7999
8119
|
|
|
8120
|
+
function getRangeSelectionRowInfo(startCell, endCell, dataSource) {
|
|
8121
|
+
var footerRowRange = null;
|
|
8122
|
+
var startRow = -1;
|
|
8123
|
+
var endRow = -1;
|
|
8124
|
+
|
|
8125
|
+
var _getCellRangeRow = getCellRangeRow(startCell, endCell),
|
|
8126
|
+
_startRow = _getCellRangeRow.startRow,
|
|
8127
|
+
_endRow = _getCellRangeRow.endRow; // 两个单元格都在表体
|
|
8128
|
+
|
|
8129
|
+
|
|
8130
|
+
if (!startCell.isInFooter && !endCell.isInFooter) {
|
|
8131
|
+
startRow = _startRow;
|
|
8132
|
+
endRow = _endRow;
|
|
8133
|
+
} else if (startCell.isInFooter && endCell.isInFooter) {
|
|
8134
|
+
// 两个单元格都在表底
|
|
8135
|
+
footerRowRange = {
|
|
8136
|
+
startRow: _startRow,
|
|
8137
|
+
endRow: _endRow
|
|
8138
|
+
};
|
|
8139
|
+
} else {
|
|
8140
|
+
// 一个单元格在表体,一个在表底
|
|
8141
|
+
if (startCell.isInFooter) {
|
|
8142
|
+
startRow = dataSource.length - 1;
|
|
8143
|
+
endRow = endCell.rowIndex;
|
|
8144
|
+
footerRowRange = {
|
|
8145
|
+
startRow: startCell.rowIndex,
|
|
8146
|
+
endRow: 0
|
|
8147
|
+
};
|
|
8148
|
+
} else {
|
|
8149
|
+
startRow = startCell.rowIndex;
|
|
8150
|
+
endRow = dataSource.length - 1;
|
|
8151
|
+
footerRowRange = {
|
|
8152
|
+
startRow: 0,
|
|
8153
|
+
endRow: endCell.rowIndex
|
|
8154
|
+
};
|
|
8155
|
+
}
|
|
8156
|
+
}
|
|
8157
|
+
|
|
8158
|
+
return {
|
|
8159
|
+
startRow: startRow,
|
|
8160
|
+
endRow: endRow,
|
|
8161
|
+
footerRowRange: footerRowRange
|
|
8162
|
+
};
|
|
8163
|
+
}
|
|
8164
|
+
|
|
8165
|
+
function getCellRangeRow(startCell, endCell) {
|
|
8166
|
+
if (isSameCell(startCell, endCell)) {
|
|
8167
|
+
return {
|
|
8168
|
+
startRow: startCell.rowIndex,
|
|
8169
|
+
endRow: startCell.rowIndex
|
|
8170
|
+
};
|
|
8171
|
+
}
|
|
8172
|
+
|
|
8173
|
+
var isTopToBottom = startCell.rowIndex <= endCell.rowIndex;
|
|
8174
|
+
var startRow = isTopToBottom ? startCell.rowIndex : startCell.rowIndex + startCell.rowSpan - 1;
|
|
8175
|
+
var endRow = isTopToBottom ? endCell.rowIndex + endCell.rowSpan - 1 : endCell.rowIndex;
|
|
8176
|
+
return {
|
|
8177
|
+
startRow: startRow,
|
|
8178
|
+
endRow: endRow
|
|
8179
|
+
};
|
|
8180
|
+
}
|
|
8181
|
+
|
|
8182
|
+
function isCellRangeSingleCell(rangeSelection) {
|
|
8183
|
+
var startRow = rangeSelection.startRow,
|
|
8184
|
+
endRow = rangeSelection.endRow,
|
|
8185
|
+
columns = rangeSelection.columns,
|
|
8186
|
+
footerRowRange = rangeSelection.footerRowRange;
|
|
8187
|
+
var isBodySingleCell = !footerRowRange && startRow === endRow && columns.length === 1;
|
|
8188
|
+
var isFooterSingleCell = startRow === -1 && footerRowRange.startRow === footerRowRange.endRow && columns.length === 1;
|
|
8189
|
+
return isBodySingleCell || isFooterSingleCell;
|
|
8190
|
+
}
|
|
8191
|
+
|
|
8192
|
+
function getRowIndex(startRow, endRow) {
|
|
8193
|
+
var isReverse = startRow > endRow;
|
|
8194
|
+
var startRowIndex = isReverse ? endRow : startRow;
|
|
8195
|
+
var endRowIndex = isReverse ? startRow : endRow;
|
|
8196
|
+
return {
|
|
8197
|
+
startRowIndex: startRowIndex,
|
|
8198
|
+
endRowIndex: endRowIndex
|
|
8199
|
+
};
|
|
8200
|
+
}
|
|
8201
|
+
|
|
8202
|
+
function getFooterRowIndex(footerRowRange) {
|
|
8203
|
+
if (footerRowRange) {
|
|
8204
|
+
return getRowIndex(footerRowRange.startRow, footerRowRange.endRow);
|
|
8205
|
+
}
|
|
8206
|
+
|
|
8207
|
+
return {
|
|
8208
|
+
startRowIndex: -1,
|
|
8209
|
+
endRowIndex: -1
|
|
8210
|
+
};
|
|
8211
|
+
}
|
|
8212
|
+
|
|
8000
8213
|
/***/ }),
|
|
8001
8214
|
|
|
8002
8215
|
/***/ "./components/table/pipeline/features/rowDetail.tsx":
|
|
@@ -8721,6 +8934,10 @@ function singleSelect() {
|
|
|
8721
8934
|
return preCellProps;
|
|
8722
8935
|
},
|
|
8723
8936
|
render: function render(_, row, rowIndex) {
|
|
8937
|
+
if (row[pipeline.getFeatureOptions('footerRowMetaKey')]) {
|
|
8938
|
+
return null;
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8724
8941
|
var rowKey = _internals__WEBPACK_IMPORTED_MODULE_10__["internals"].safeGetRowKey(primaryKey, row, rowIndex);
|
|
8725
8942
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_9___default.a.createElement(Radio, {
|
|
8726
8943
|
checked: value === rowKey,
|
|
@@ -9870,6 +10087,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9870
10087
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_15__);
|
|
9871
10088
|
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../utils */ "./components/table/utils/index.tsx");
|
|
9872
10089
|
/* harmony import */ var _features_autoFill__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./features/autoFill */ "./components/table/pipeline/features/autoFill.tsx");
|
|
10090
|
+
/* harmony import */ var _features_rangeSelection__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./features/rangeSelection */ "./components/table/pipeline/features/rangeSelection.tsx");
|
|
9873
10091
|
|
|
9874
10092
|
|
|
9875
10093
|
|
|
@@ -9894,6 +10112,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9894
10112
|
|
|
9895
10113
|
|
|
9896
10114
|
|
|
10115
|
+
|
|
9897
10116
|
/**
|
|
9898
10117
|
* 表格数据处理流水线。TablePipeline 提供了表格数据处理过程中的一些上下方与工具方法,包括……
|
|
9899
10118
|
*
|
|
@@ -10174,19 +10393,19 @@ var TablePipeline = /*#__PURE__*/function () {
|
|
|
10174
10393
|
|
|
10175
10394
|
result.setTableDomHelper = function (domHelper) {
|
|
10176
10395
|
_this2.ref.current.domHelper = domHelper;
|
|
10177
|
-
};
|
|
10178
|
-
// result.clearRangeSelectionStatus = () => {
|
|
10179
|
-
// const { rangeSelectedChange } = this.getFeatureOptions(rangeSelectionKey)
|
|
10180
|
-
// const rangeSelection = this.getStateAtKey(rangeSelectionKey)
|
|
10181
|
-
// if (rangeSelection) {
|
|
10182
|
-
// rangeSelectedChange?.(null)
|
|
10183
|
-
// }
|
|
10184
|
-
// }
|
|
10185
|
-
// }
|
|
10186
|
-
|
|
10396
|
+
};
|
|
10187
10397
|
|
|
10188
10398
|
return result;
|
|
10189
10399
|
}
|
|
10400
|
+
/**
|
|
10401
|
+
* 清除范围选中内容
|
|
10402
|
+
*/
|
|
10403
|
+
|
|
10404
|
+
}, {
|
|
10405
|
+
key: "clearRangeSelection",
|
|
10406
|
+
value: function clearRangeSelection() {
|
|
10407
|
+
this.setStateAtKey(_features_rangeSelection__WEBPACK_IMPORTED_MODULE_18__["rangeSelectionKey"], null);
|
|
10408
|
+
}
|
|
10190
10409
|
}]);
|
|
10191
10410
|
|
|
10192
10411
|
return TablePipeline;
|