@kdcloudjs/kdesign 1.7.6 → 1.7.7
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/CHANGELOG.md +37 -0
- package/dist/kdesign.css +1 -1
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +298 -140
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +1 -1
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/package.json +2 -2
package/dist/kdesign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* @kdcloudjs/kdesign v1.7.
|
|
3
|
+
* @kdcloudjs/kdesign v1.7.6
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -39451,6 +39451,17 @@ module.exports = __webpack_require__(/*! core-js-pure/stable/map */ "./node_modu
|
|
|
39451
39451
|
|
|
39452
39452
|
/***/ }),
|
|
39453
39453
|
|
|
39454
|
+
/***/ "./node_modules/@babel/runtime-corejs3/core-js-stable/number/max-safe-integer.js":
|
|
39455
|
+
/*!***************************************************************************************!*\
|
|
39456
|
+
!*** ./node_modules/@babel/runtime-corejs3/core-js-stable/number/max-safe-integer.js ***!
|
|
39457
|
+
\***************************************************************************************/
|
|
39458
|
+
/*! no static exports found */
|
|
39459
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
39460
|
+
|
|
39461
|
+
module.exports = __webpack_require__(/*! core-js-pure/stable/number/max-safe-integer */ "./node_modules/core-js-pure/stable/number/max-safe-integer.js");
|
|
39462
|
+
|
|
39463
|
+
/***/ }),
|
|
39464
|
+
|
|
39454
39465
|
/***/ "./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js":
|
|
39455
39466
|
/*!***********************************************************************************************!*\
|
|
39456
39467
|
!*** ./node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js ***!
|
|
@@ -44752,7 +44763,7 @@ var defaultCSSVariables = {
|
|
|
44752
44763
|
'--row-height': '48px',
|
|
44753
44764
|
'--color': '#333',
|
|
44754
44765
|
'--bgcolor': 'white',
|
|
44755
|
-
'--hover-bgcolor': 'var(--hover-color, #
|
|
44766
|
+
'--hover-bgcolor': 'var(--hover-color, #f5f5f5)',
|
|
44756
44767
|
'--highlight-bgcolor': '#eee',
|
|
44757
44768
|
'--primary-color': '#5582F3',
|
|
44758
44769
|
'--primary-color-level1': 'rgb(242, 248, 255)',
|
|
@@ -46047,7 +46058,7 @@ var icons = {
|
|
|
46047
46058
|
CaretRight: CaretRightIcon,
|
|
46048
46059
|
Info: InfoIcon
|
|
46049
46060
|
};
|
|
46050
|
-
var ContextMenuStyleWrap = styled_components__WEBPACK_IMPORTED_MODULE_3__["default"].div(_templateObject3 || (_templateObject3 = _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1___default()(["\n &.", "{\n border: 1px solid #e9ecf1;\n border-radius: 2px;\n background-color: #Fff;\n box-shadow: 0px 0px 5px 0px rgb(154 154 154 / 50%);\n cursor: default;\n font-size:
|
|
46061
|
+
var ContextMenuStyleWrap = styled_components__WEBPACK_IMPORTED_MODULE_3__["default"].div(_templateObject3 || (_templateObject3 = _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1___default()(["\n &.", "{\n border: 1px solid #e9ecf1;\n border-radius: 2px;\n background-color: #Fff;\n box-shadow: 0px 0px 5px 0px rgb(154 154 154 / 50%);\n cursor: default;\n font-size: 12px;\n position:absolute;\n z-index: 1050;\n max-width: 600px;\n padding: 8px 0;\n }\n\n .", "{\n width:100%;\n display: table;\n }\n\n .", " .", "{\n display: table-row;\n color: #212121;\n }\n\n .", " .", "{\n background-color: var(--hover-bgcolor);\n }\n\n .", " .", " .", "{\n display: table-cell;\n padding: 8px 12px;\n max-width: 576px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n line-height: 16px;\n }\n .", " .", ".", "{\n opacity: .5;\n }\n\n"])), _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menu, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuList, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuList, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOption, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuList, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOptionActive, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuList, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOption, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOptionText, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuList, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOption, _base_styles__WEBPACK_IMPORTED_MODULE_4__["MenuClasses"].menuOptionDisable);
|
|
46051
46062
|
|
|
46052
46063
|
/***/ }),
|
|
46053
46064
|
|
|
@@ -46265,15 +46276,26 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46265
46276
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FILL_COLUMN_CODE", function() { return FILL_COLUMN_CODE; });
|
|
46266
46277
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tableWidthKey", function() { return tableWidthKey; });
|
|
46267
46278
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "autoFillTableWidth", function() { return autoFillTableWidth; });
|
|
46268
|
-
/* harmony import */ var
|
|
46269
|
-
/* harmony import */ var
|
|
46270
|
-
/* harmony import */ var
|
|
46271
|
-
/* harmony import */ var
|
|
46272
|
-
/* harmony import */ var
|
|
46273
|
-
/* harmony import */ var
|
|
46274
|
-
/* harmony import */ var
|
|
46275
|
-
/* harmony import */ var
|
|
46276
|
-
/* harmony import */ var
|
|
46279
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_symbol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/symbol */ "./node_modules/@babel/runtime-corejs3/core-js-stable/symbol.js");
|
|
46280
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_symbol__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_symbol__WEBPACK_IMPORTED_MODULE_0__);
|
|
46281
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_number_max_safe_integer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/number/max-safe-integer */ "./node_modules/@babel/runtime-corejs3/core-js-stable/number/max-safe-integer.js");
|
|
46282
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_number_max_safe_integer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_number_max_safe_integer__WEBPACK_IMPORTED_MODULE_1__);
|
|
46283
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/find */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js");
|
|
46284
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_find__WEBPACK_IMPORTED_MODULE_2__);
|
|
46285
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/slice */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js");
|
|
46286
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_3__);
|
|
46287
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_splice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/splice */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/splice.js");
|
|
46288
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_splice__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_splice__WEBPACK_IMPORTED_MODULE_4__);
|
|
46289
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/map */ "./node_modules/@babel/runtime-corejs3/core-js-stable/map.js");
|
|
46290
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_5__);
|
|
46291
|
+
/* harmony import */ var _base_calculations__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../base/calculations */ "./node_modules/@kdcloudjs/table/es/table/base/calculations.js");
|
|
46292
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils */ "./node_modules/@kdcloudjs/table/es/table/utils/index.js");
|
|
46293
|
+
/* harmony import */ var _base_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../base/styles */ "./node_modules/@kdcloudjs/table/es/table/base/styles.js");
|
|
46294
|
+
/* harmony import */ var _columnResizeWidth__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./columnResizeWidth */ "./node_modules/@kdcloudjs/table/es/table/pipeline/features/columnResizeWidth.js");
|
|
46295
|
+
|
|
46296
|
+
|
|
46297
|
+
|
|
46298
|
+
|
|
46277
46299
|
|
|
46278
46300
|
|
|
46279
46301
|
|
|
@@ -46282,67 +46304,146 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46282
46304
|
|
|
46283
46305
|
var FILL_COLUMN_CODE = '$_fill_column_&';
|
|
46284
46306
|
var tableWidthKey = 'tableWidth';
|
|
46285
|
-
|
|
46307
|
+
|
|
46308
|
+
var FLEX_COLUMN_COUNT = _babel_runtime_corejs3_core_js_stable_symbol__WEBPACK_IMPORTED_MODULE_0___default()('flexCount');
|
|
46309
|
+
|
|
46286
46310
|
var autoFillTableWidth = function autoFillTableWidth() {
|
|
46287
46311
|
return function (pipeline) {
|
|
46288
|
-
var
|
|
46289
|
-
var
|
|
46290
|
-
|
|
46291
|
-
|
|
46292
|
-
|
|
46293
|
-
|
|
46312
|
+
var flexColumnResult = findFlexColumns(pipeline);
|
|
46313
|
+
var flexCount = flexColumnResult.get(FLEX_COLUMN_COUNT);
|
|
46314
|
+
|
|
46315
|
+
if (flexCount) {
|
|
46316
|
+
// 设置了flex宽度,flex列平分剩余宽度
|
|
46317
|
+
var remainingWidth = getTableRemainingWidth(pipeline) || 0;
|
|
46318
|
+
|
|
46319
|
+
if (remainingWidth > 0) {
|
|
46320
|
+
// 保存剩余的flex总和和剩余宽度总和宽度
|
|
46321
|
+
var residualFlexCount = flexCount;
|
|
46322
|
+
var residualFlexWidth = remainingWidth;
|
|
46323
|
+
var columnSize = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_9__["COLUMN_SIZE_KEY"]) || {};
|
|
46324
|
+
pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_7__["makeRecursiveMapper"])(function (col, recursiveFlatMapInfo) {
|
|
46325
|
+
var isLeaf = recursiveFlatMapInfo.isLeaf;
|
|
46326
|
+
|
|
46327
|
+
if (isLeaf && isValidFlexColumn(col, pipeline)) {
|
|
46328
|
+
var code = col.code,
|
|
46329
|
+
_col$features = col.features,
|
|
46330
|
+
features = _col$features === void 0 ? {} : _col$features;
|
|
46331
|
+
var flex = features.flex,
|
|
46332
|
+
_features$minWidth = features.minWidth,
|
|
46333
|
+
minWidth = _features$minWidth === void 0 ? 0 : _features$minWidth,
|
|
46334
|
+
_features$maxWidth = features.maxWidth,
|
|
46335
|
+
maxWidth = _features$maxWidth === void 0 ? _babel_runtime_corejs3_core_js_stable_number_max_safe_integer__WEBPACK_IMPORTED_MODULE_1___default.a : _features$maxWidth;
|
|
46336
|
+
var usedRemainingWidth = Math.floor(remainingWidth * flex / flexCount);
|
|
46337
|
+
var preColWidth = col.width; // 如果当前已经是最后一个flex列,将剩余的宽度添加到该列,其他计算相应的列
|
|
46338
|
+
|
|
46339
|
+
col.width = clamp(minWidth, preColWidth + (residualFlexCount === flex ? residualFlexWidth : usedRemainingWidth), maxWidth);
|
|
46340
|
+
residualFlexCount -= flex;
|
|
46341
|
+
residualFlexWidth -= col.width - preColWidth;
|
|
46342
|
+
columnSize[code] = col.width;
|
|
46343
|
+
}
|
|
46294
46344
|
|
|
46295
|
-
|
|
46296
|
-
|
|
46345
|
+
return col;
|
|
46346
|
+
}));
|
|
46347
|
+
pipeline.setFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_9__["COLUMN_SIZE_KEY"], columnSize);
|
|
46348
|
+
}
|
|
46297
46349
|
} else {
|
|
46298
|
-
|
|
46299
|
-
var
|
|
46300
|
-
|
|
46301
|
-
|
|
46302
|
-
code
|
|
46303
|
-
|
|
46304
|
-
|
|
46305
|
-
|
|
46306
|
-
|
|
46307
|
-
|
|
46308
|
-
|
|
46309
|
-
|
|
46310
|
-
|
|
46311
|
-
|
|
46312
|
-
|
|
46350
|
+
// 未设置了flex宽度,创建占位列
|
|
46351
|
+
var columns = pipeline.getColumns();
|
|
46352
|
+
|
|
46353
|
+
var fillColumns = _babel_runtime_corejs3_core_js_stable_instance_find__WEBPACK_IMPORTED_MODULE_2___default()(columns).call(columns, function (col) {
|
|
46354
|
+
return col.code === FILL_COLUMN_CODE;
|
|
46355
|
+
});
|
|
46356
|
+
|
|
46357
|
+
var width = getTableRemainingWidth(pipeline) || 0;
|
|
46358
|
+
|
|
46359
|
+
if (fillColumns) {
|
|
46360
|
+
fillColumns.width = width;
|
|
46361
|
+
} else {
|
|
46362
|
+
var rightNestedLockCount = Object(_base_calculations__WEBPACK_IMPORTED_MODULE_6__["getLeftNestedLockCount"])(_babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_3___default()(columns).call(columns).reverse());
|
|
46363
|
+
var spliceIndex = columns.length - rightNestedLockCount;
|
|
46364
|
+
var _fillColumns = {
|
|
46365
|
+
name: '',
|
|
46366
|
+
code: FILL_COLUMN_CODE,
|
|
46367
|
+
width: width,
|
|
46368
|
+
features: {
|
|
46369
|
+
resizeable: false
|
|
46370
|
+
},
|
|
46371
|
+
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
46372
|
+
return {
|
|
46373
|
+
className: _base_styles__WEBPACK_IMPORTED_MODULE_8__["Classes"].emptyColCell
|
|
46374
|
+
};
|
|
46375
|
+
}
|
|
46376
|
+
};
|
|
46377
|
+
|
|
46378
|
+
_babel_runtime_corejs3_core_js_stable_instance_splice__WEBPACK_IMPORTED_MODULE_4___default()(columns).call(columns, spliceIndex || columns.length, 0, _fillColumns);
|
|
46379
|
+
}
|
|
46313
46380
|
|
|
46314
|
-
|
|
46381
|
+
pipeline.columns(columns);
|
|
46315
46382
|
}
|
|
46316
46383
|
|
|
46317
|
-
pipeline.columns(columns);
|
|
46318
|
-
setAutoFillWidth(pipeline);
|
|
46319
46384
|
return pipeline;
|
|
46385
|
+
|
|
46386
|
+
function findFlexColumns(pipeline) {
|
|
46387
|
+
var result = new _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_5___default.a([[FLEX_COLUMN_COUNT, 0]]);
|
|
46388
|
+
dfs(pipeline.getColumns(), result);
|
|
46389
|
+
return result;
|
|
46390
|
+
|
|
46391
|
+
function dfs(columns, result) {
|
|
46392
|
+
columns.forEach(function (col) {
|
|
46393
|
+
if (Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isLeafNode"])(col)) {
|
|
46394
|
+
if (isValidFlexColumn(col, pipeline)) {
|
|
46395
|
+
result.set(FLEX_COLUMN_COUNT, result.get(FLEX_COLUMN_COUNT) + col.features.flex);
|
|
46396
|
+
}
|
|
46397
|
+
} else {
|
|
46398
|
+
dfs(col.children, result);
|
|
46399
|
+
}
|
|
46400
|
+
});
|
|
46401
|
+
}
|
|
46402
|
+
}
|
|
46320
46403
|
};
|
|
46321
46404
|
};
|
|
46322
46405
|
|
|
46323
|
-
|
|
46406
|
+
function getColumnWidthSum(pipeline) {
|
|
46407
|
+
return dfs(pipeline.getColumns());
|
|
46408
|
+
|
|
46409
|
+
function dfs(columns) {
|
|
46410
|
+
return columns.reduce(function (acc, col) {
|
|
46411
|
+
var width = col.width,
|
|
46412
|
+
code = col.code;
|
|
46413
|
+
|
|
46414
|
+
if (Object(_utils__WEBPACK_IMPORTED_MODULE_7__["isLeafNode"])(col) && code !== FILL_COLUMN_CODE) {
|
|
46415
|
+
var resizeColumn = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_9__["COLUMN_SIZE_KEY"]);
|
|
46416
|
+
return acc + (resizeColumn && resizeColumn[code]) || width;
|
|
46417
|
+
} else {
|
|
46418
|
+
return acc + dfs(col.children);
|
|
46419
|
+
}
|
|
46420
|
+
}, 0);
|
|
46421
|
+
}
|
|
46422
|
+
}
|
|
46423
|
+
|
|
46424
|
+
function getTableRemainingWidth(pipeline) {
|
|
46324
46425
|
var tableWidth = pipeline.getStateAtKey(tableWidthKey);
|
|
46325
46426
|
if (!tableWidth) return;
|
|
46326
|
-
var
|
|
46327
|
-
|
|
46328
|
-
|
|
46329
|
-
code = col.code;
|
|
46427
|
+
var remainingWidth = Math.floor(tableWidth - getColumnWidthSum(pipeline));
|
|
46428
|
+
return remainingWidth > 0 ? remainingWidth : 0;
|
|
46429
|
+
}
|
|
46330
46430
|
|
|
46331
|
-
|
|
46332
|
-
|
|
46333
|
-
columnWidthSum += resizeColumn && resizeColumn[code] || width;
|
|
46334
|
-
}
|
|
46431
|
+
function isValidFlexColumn(col, pipeline) {
|
|
46432
|
+
var _a;
|
|
46335
46433
|
|
|
46336
|
-
|
|
46337
|
-
}));
|
|
46338
|
-
var fillColumnWidth = Math.floor(tableWidth - columnWidthSum);
|
|
46339
|
-
fillColumnWidth = fillColumnWidth > 0 ? fillColumnWidth : 0;
|
|
46340
|
-
var preWidth = pipeline.getStateAtKey(fillColumnWidthKey, 0);
|
|
46434
|
+
var resizeColumn = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_9__["RESIZED_COLUMN_KEY"]); // 拖拽列自动禁止flex
|
|
46341
46435
|
|
|
46342
|
-
if (
|
|
46343
|
-
|
|
46436
|
+
if (resizeColumn === null || resizeColumn === void 0 ? void 0 : resizeColumn.has(col.code)) {
|
|
46437
|
+
return false;
|
|
46344
46438
|
}
|
|
46345
|
-
|
|
46439
|
+
|
|
46440
|
+
var flex = (_a = col.features) === null || _a === void 0 ? void 0 : _a.flex;
|
|
46441
|
+
return typeof flex === 'number' && flex > 0;
|
|
46442
|
+
}
|
|
46443
|
+
|
|
46444
|
+
function clamp(min, x, max) {
|
|
46445
|
+
return Math.max(min, Math.min(max, x));
|
|
46446
|
+
}
|
|
46346
46447
|
|
|
46347
46448
|
/***/ }),
|
|
46348
46449
|
|
|
@@ -47407,28 +47508,32 @@ function columnRangeHover() {
|
|
|
47407
47508
|
/*!***************************************************************************************!*\
|
|
47408
47509
|
!*** ./node_modules/@kdcloudjs/table/es/table/pipeline/features/columnResizeWidth.js ***!
|
|
47409
47510
|
\***************************************************************************************/
|
|
47410
|
-
/*! exports provided: columnResize */
|
|
47511
|
+
/*! exports provided: COLUMN_SIZE_KEY, RESIZED_COLUMN_KEY, columnResize */
|
|
47411
47512
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
47412
47513
|
|
|
47413
47514
|
"use strict";
|
|
47414
47515
|
__webpack_require__.r(__webpack_exports__);
|
|
47516
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COLUMN_SIZE_KEY", function() { return COLUMN_SIZE_KEY; });
|
|
47517
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESIZED_COLUMN_KEY", function() { return RESIZED_COLUMN_KEY; });
|
|
47415
47518
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "columnResize", function() { return columnResize; });
|
|
47416
47519
|
/* harmony import */ var _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/extends */ "./node_modules/@babel/runtime-corejs3/helpers/extends.js");
|
|
47417
47520
|
/* harmony import */ var _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
47418
47521
|
/* harmony import */ var _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/taggedTemplateLiteral */ "./node_modules/@babel/runtime-corejs3/helpers/taggedTemplateLiteral.js");
|
|
47419
47522
|
/* harmony import */ var _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1__);
|
|
47420
|
-
/* harmony import */ var
|
|
47421
|
-
/* harmony import */ var
|
|
47523
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set */ "./node_modules/@babel/runtime-corejs3/core-js-stable/set.js");
|
|
47524
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2__);
|
|
47422
47525
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ "./node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js");
|
|
47423
47526
|
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_3__);
|
|
47424
|
-
/* harmony import */ var
|
|
47425
|
-
/* harmony import */ var
|
|
47426
|
-
/* harmony import */ var
|
|
47427
|
-
/* harmony import */ var
|
|
47428
|
-
/* harmony import */ var
|
|
47429
|
-
/* harmony import */ var
|
|
47430
|
-
/* harmony import */ var
|
|
47431
|
-
/* harmony import */ var
|
|
47527
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/map */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js");
|
|
47528
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_4__);
|
|
47529
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react */ "react");
|
|
47530
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_5__);
|
|
47531
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! styled-components */ "./node_modules/styled-components/dist/styled-components.browser.esm.js");
|
|
47532
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
|
|
47533
|
+
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
|
|
47534
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils */ "./node_modules/@kdcloudjs/table/es/table/utils/index.js");
|
|
47535
|
+
/* harmony import */ var _internals__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../internals */ "./node_modules/@kdcloudjs/table/es/table/internals.js");
|
|
47536
|
+
/* harmony import */ var _base_styles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../base/styles */ "./node_modules/@kdcloudjs/table/es/table/base/styles.js");
|
|
47432
47537
|
|
|
47433
47538
|
|
|
47434
47539
|
|
|
@@ -47443,8 +47548,9 @@ var _templateObject, _templateObject2;
|
|
|
47443
47548
|
|
|
47444
47549
|
|
|
47445
47550
|
|
|
47446
|
-
|
|
47447
|
-
var
|
|
47551
|
+
|
|
47552
|
+
var TableHeaderCellResize = styled_components__WEBPACK_IMPORTED_MODULE_6__["default"].div(_templateObject || (_templateObject = _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1___default()(["\n position: absolute;\n top: 0;\n right: -5px;\n height: 100%;\n width: 10px;\n cursor: ew-resize;\n display: flex;\n flex-direction: column;\n align-items: center;\n z-index:1;\n\n &:after {\n content: \"\";\n position: absolute;\n display: block;\n left: calc(50% - 1px);\n width: 1px;\n height: calc(100% - 14px);\n top: 7px;\n }\n"])));
|
|
47553
|
+
var TableHeaderGroupCellResize = Object(styled_components__WEBPACK_IMPORTED_MODULE_6__["default"])(TableHeaderCellResize)(_templateObject2 || (_templateObject2 = _babel_runtime_corejs3_helpers_taggedTemplateLiteral__WEBPACK_IMPORTED_MODULE_1___default()(["\n &:after {\n height: 100%;\n top: 0;\n }\n"])));
|
|
47448
47554
|
|
|
47449
47555
|
function clamp(min, x, max) {
|
|
47450
47556
|
return Math.max(min, Math.min(max, x));
|
|
@@ -47454,20 +47560,22 @@ function disableSelect(event) {
|
|
|
47454
47560
|
event.preventDefault();
|
|
47455
47561
|
}
|
|
47456
47562
|
|
|
47563
|
+
var stateKey = 'columnResize';
|
|
47564
|
+
var COLUMN_SIZE_KEY = 'columnResize';
|
|
47565
|
+
var RESIZED_COLUMN_KEY = 'resizedColumn';
|
|
47457
47566
|
function columnResize() {
|
|
47458
47567
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47459
47568
|
|
|
47460
47569
|
var _a, _b, _c;
|
|
47461
47570
|
|
|
47462
|
-
var stateKey = 'columnResize';
|
|
47463
47571
|
var minSize = (_a = opts.minSize) !== null && _a !== void 0 ? _a : 60;
|
|
47464
47572
|
var fallbackSize = (_b = opts.fallbackSize) !== null && _b !== void 0 ? _b : 150;
|
|
47465
47573
|
var maxSize = (_c = opts.maxSize) !== null && _c !== void 0 ? _c : 1000;
|
|
47466
47574
|
return function columnResizeFeature(pipeline) {
|
|
47467
|
-
var _a, _b
|
|
47575
|
+
var _a, _b;
|
|
47468
47576
|
|
|
47469
47577
|
var columnSize = (_b = (_a = opts.columnSize) !== null && _a !== void 0 ? _a : pipeline.getStateAtKey(stateKey)) !== null && _b !== void 0 ? _b : {};
|
|
47470
|
-
var leafColumns = Object(
|
|
47578
|
+
var leafColumns = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["collectNodes"])(pipeline.getColumns(), 'leaf-only');
|
|
47471
47579
|
leafColumns.forEach(function (_ref) {
|
|
47472
47580
|
var code = _ref.code,
|
|
47473
47581
|
width = _ref.width;
|
|
@@ -47479,15 +47587,10 @@ function columnResize() {
|
|
|
47479
47587
|
columnSize[code] = fallbackSize;
|
|
47480
47588
|
}
|
|
47481
47589
|
}
|
|
47482
|
-
}); //
|
|
47483
|
-
|
|
47484
|
-
if (!pipeline.getStateAtKey(stateKey) || ((_c = pipeline.ref) === null || _c === void 0 ? void 0 : _c.current.lastOptColumnSize) !== opts.columnSize) {
|
|
47485
|
-
pipeline.setStateAtKey(stateKey, columnSize);
|
|
47486
|
-
}
|
|
47590
|
+
}); // 实时存储一份最新的columnSize,与autoFill共用一份数据
|
|
47591
|
+
// 存在state里可能存到取不到最新的
|
|
47487
47592
|
|
|
47488
|
-
|
|
47489
|
-
pipeline.ref.current.lastOptColumnSize = opts.columnSize;
|
|
47490
|
-
}
|
|
47593
|
+
pipeline.setFeatureOptions(COLUMN_SIZE_KEY, columnSize);
|
|
47491
47594
|
|
|
47492
47595
|
var onChangeSize = function onChangeSize(nextColumnSize) {
|
|
47493
47596
|
window.requestAnimationFrame(function () {
|
|
@@ -47495,17 +47598,13 @@ function columnResize() {
|
|
|
47495
47598
|
|
|
47496
47599
|
pipeline.setStateAtKey(stateKey, nextColumnSize);
|
|
47497
47600
|
(_a = opts === null || opts === void 0 ? void 0 : opts.onChangeSize) === null || _a === void 0 ? void 0 : _a.call(opts, nextColumnSize);
|
|
47498
|
-
|
|
47499
|
-
if (opts.columnSize) {
|
|
47500
|
-
if (pipeline.ref) {
|
|
47501
|
-
pipeline.ref.current.lastOptColumnSize = nextColumnSize; // 这里记录由列宽拖拽导致的opts.columnSize变化,避免重复渲染
|
|
47502
|
-
}
|
|
47503
|
-
}
|
|
47504
47601
|
});
|
|
47505
47602
|
};
|
|
47506
47603
|
|
|
47507
47604
|
var handleDoubleClick = function handleDoubleClick(e, col) {
|
|
47508
|
-
|
|
47605
|
+
var _a;
|
|
47606
|
+
|
|
47607
|
+
(_a = opts.doubleClickCallback) === null || _a === void 0 ? void 0 : _a.call(opts, e, col);
|
|
47509
47608
|
};
|
|
47510
47609
|
|
|
47511
47610
|
var handleMouseDown = function handleMouseDown(e, col) {
|
|
@@ -47513,10 +47612,17 @@ function columnResize() {
|
|
|
47513
47612
|
var changedColumnSize = {};
|
|
47514
47613
|
var startX = e.clientX;
|
|
47515
47614
|
var children = col.children,
|
|
47516
|
-
code = col.code
|
|
47615
|
+
code = col.code,
|
|
47616
|
+
_col$features = col.features,
|
|
47617
|
+
features = _col$features === void 0 ? {} : _col$features;
|
|
47618
|
+
var minWidth = features.minWidth,
|
|
47619
|
+
maxWidth = features.maxWidth;
|
|
47620
|
+
var realMinSize = typeof minWidth === 'number' ? minWidth : minSize;
|
|
47621
|
+
var realMaxSize = typeof maxWidth === 'number' ? maxWidth : maxSize;
|
|
47622
|
+
var columnSize = pipeline.getFeatureOptions(COLUMN_SIZE_KEY);
|
|
47517
47623
|
var recordColumnSize = columnSize;
|
|
47518
47624
|
e.stopPropagation();
|
|
47519
|
-
var nextSize$ = Object(
|
|
47625
|
+
var nextSize$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["fromEvent"])(window, 'mousemove').pipe(rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["takeUntil"](Object(rxjs__WEBPACK_IMPORTED_MODULE_7__["fromEvent"])(window, 'mouseup')), rxjs_operators__WEBPACK_IMPORTED_MODULE_8__["map"](function (e) {
|
|
47520
47626
|
var movingX = e.clientX;
|
|
47521
47627
|
|
|
47522
47628
|
var nextColumnSize = _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, columnSize);
|
|
@@ -47525,7 +47631,7 @@ function columnResize() {
|
|
|
47525
47631
|
var deltaRemaining = deltaSum;
|
|
47526
47632
|
|
|
47527
47633
|
if ((children === null || children === void 0 ? void 0 : children.length) > 0) {
|
|
47528
|
-
var leafChildColumns = Object(
|
|
47634
|
+
var leafChildColumns = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["collectNodes"])(children, 'leaf-only');
|
|
47529
47635
|
var childrenWidthSum = leafChildColumns.reduce(function (sum, _ref2) {
|
|
47530
47636
|
var code = _ref2.code;
|
|
47531
47637
|
return sum + columnSize[code];
|
|
@@ -47536,17 +47642,17 @@ function columnResize() {
|
|
|
47536
47642
|
var currentDeltaWidth = Math.round(deltaSum * startSize / childrenWidthSum);
|
|
47537
47643
|
|
|
47538
47644
|
if (index < leafChildColumns.length - 1) {
|
|
47539
|
-
nextColumnSize[code] = clamp(
|
|
47645
|
+
nextColumnSize[code] = clamp(realMinSize, startSize + currentDeltaWidth, realMaxSize);
|
|
47540
47646
|
changedColumnSize[code] = nextColumnSize[code];
|
|
47541
47647
|
deltaRemaining -= currentDeltaWidth;
|
|
47542
47648
|
} else {
|
|
47543
|
-
nextColumnSize[code] = clamp(
|
|
47649
|
+
nextColumnSize[code] = clamp(realMinSize, startSize + deltaRemaining, realMaxSize);
|
|
47544
47650
|
changedColumnSize[code] = nextColumnSize[code];
|
|
47545
47651
|
}
|
|
47546
47652
|
});
|
|
47547
47653
|
} else {
|
|
47548
47654
|
var startSize = columnSize[code];
|
|
47549
|
-
nextColumnSize[code] = clamp(
|
|
47655
|
+
nextColumnSize[code] = clamp(realMinSize, startSize + deltaSum, realMaxSize);
|
|
47550
47656
|
changedColumnSize[code] = nextColumnSize[code];
|
|
47551
47657
|
}
|
|
47552
47658
|
|
|
@@ -47554,11 +47660,21 @@ function columnResize() {
|
|
|
47554
47660
|
return nextColumnSize;
|
|
47555
47661
|
}));
|
|
47556
47662
|
nextSize$.subscribe({
|
|
47557
|
-
next:
|
|
47663
|
+
next: function next(nextColumnSize) {
|
|
47664
|
+
onChangeSize(nextColumnSize); // 由于COLUMN_RESIZE_KEY记录的是全量的列宽,此处记录被改变过的列宽
|
|
47665
|
+
|
|
47666
|
+
var resizedColumnSet = pipeline.getFeatureOptions(RESIZED_COLUMN_KEY) || new _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2___default.a();
|
|
47667
|
+
|
|
47668
|
+
_babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(changedColumnSize).forEach(function (code) {
|
|
47669
|
+
resizedColumnSet.add(code, changedColumnSize[code]);
|
|
47670
|
+
});
|
|
47671
|
+
|
|
47672
|
+
pipeline.setFeatureOptions(RESIZED_COLUMN_KEY, resizedColumnSet);
|
|
47673
|
+
},
|
|
47558
47674
|
complete: function complete() {
|
|
47559
47675
|
var _context;
|
|
47560
47676
|
|
|
47561
|
-
var changedColumnSizes =
|
|
47677
|
+
var changedColumnSizes = _babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_4___default()(_context = _babel_runtime_corejs3_core_js_stable_object_keys__WEBPACK_IMPORTED_MODULE_3___default()(changedColumnSize)).call(_context, function (code) {
|
|
47562
47678
|
return {
|
|
47563
47679
|
code: code,
|
|
47564
47680
|
width: changedColumnSize[code]
|
|
@@ -47575,26 +47691,26 @@ function columnResize() {
|
|
|
47575
47691
|
});
|
|
47576
47692
|
};
|
|
47577
47693
|
|
|
47578
|
-
var isGroup = Object(
|
|
47579
|
-
return pipeline.mapColumns(Object(
|
|
47694
|
+
var isGroup = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["isGroupColumn"])(pipeline.getColumns());
|
|
47695
|
+
return pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_9__["makeRecursiveMapper"])(function (col) {
|
|
47580
47696
|
var _a;
|
|
47581
47697
|
|
|
47582
|
-
var prevTitle =
|
|
47698
|
+
var prevTitle = _internals__WEBPACK_IMPORTED_MODULE_10__["internals"].safeRenderHeader(col);
|
|
47583
47699
|
var code = col.code,
|
|
47584
47700
|
features = col.features,
|
|
47585
47701
|
width = col.width;
|
|
47586
47702
|
return _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()(_babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, col), {
|
|
47587
47703
|
width: (_a = columnSize[code]) !== null && _a !== void 0 ? _a : width,
|
|
47588
|
-
title: /*#__PURE__*/
|
|
47589
|
-
className:
|
|
47704
|
+
title: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_5___default.a.Fragment, null, prevTitle, (features === null || features === void 0 ? void 0 : features.resizeable) !== false && (isGroup ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(TableHeaderGroupCellResize, {
|
|
47705
|
+
className: _base_styles__WEBPACK_IMPORTED_MODULE_11__["Classes"].tableHeaderCellResize,
|
|
47590
47706
|
onDoubleClick: function onDoubleClick(e) {
|
|
47591
47707
|
return handleDoubleClick(e, col);
|
|
47592
47708
|
},
|
|
47593
47709
|
onMouseDown: function onMouseDown(e) {
|
|
47594
47710
|
return handleMouseDown(e, col);
|
|
47595
47711
|
}
|
|
47596
|
-
}) : /*#__PURE__*/
|
|
47597
|
-
className:
|
|
47712
|
+
}) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(TableHeaderCellResize, {
|
|
47713
|
+
className: _base_styles__WEBPACK_IMPORTED_MODULE_11__["Classes"].tableHeaderCellResize,
|
|
47598
47714
|
onDoubleClick: function onDoubleClick(e) {
|
|
47599
47715
|
return handleDoubleClick(e, col);
|
|
47600
47716
|
},
|
|
@@ -47602,7 +47718,7 @@ function columnResize() {
|
|
|
47602
47718
|
return handleMouseDown(e, col);
|
|
47603
47719
|
}
|
|
47604
47720
|
}))),
|
|
47605
|
-
headerCellProps: Object(
|
|
47721
|
+
headerCellProps: Object(_utils__WEBPACK_IMPORTED_MODULE_9__["mergeCellProps"])(col.headerCellProps, {
|
|
47606
47722
|
className: 'resizeable'
|
|
47607
47723
|
})
|
|
47608
47724
|
});
|
|
@@ -47656,7 +47772,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
47656
47772
|
|
|
47657
47773
|
|
|
47658
47774
|
|
|
47659
|
-
var stateKey = 'contextMenu';
|
|
47660
47775
|
function contextMenu() {
|
|
47661
47776
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47662
47777
|
return function step(pipeline) {
|
|
@@ -47694,13 +47809,11 @@ function contextMenu() {
|
|
|
47694
47809
|
};
|
|
47695
47810
|
|
|
47696
47811
|
var onContextMenu = function onContextMenu(e) {
|
|
47697
|
-
if (
|
|
47698
|
-
|
|
47812
|
+
if (canShowContextMenu(e, pipeline)) {
|
|
47813
|
+
e.preventDefault();
|
|
47814
|
+
e.stopPropagation();
|
|
47815
|
+
showContextMenu(e);
|
|
47699
47816
|
}
|
|
47700
|
-
|
|
47701
|
-
e.preventDefault();
|
|
47702
|
-
e.stopPropagation();
|
|
47703
|
-
showContextMenu(e);
|
|
47704
47817
|
};
|
|
47705
47818
|
|
|
47706
47819
|
pipeline.addTableProps({
|
|
@@ -48037,24 +48150,12 @@ function isElementInsideTheFooter(ele) {
|
|
|
48037
48150
|
}
|
|
48038
48151
|
|
|
48039
48152
|
return false;
|
|
48040
|
-
}
|
|
48041
|
-
|
|
48042
|
-
|
|
48043
|
-
function suppressShowContextMenu(e) {
|
|
48044
|
-
var path = Object(_utils__WEBPACK_IMPORTED_MODULE_9__["getEventPath"])(e.nativeEvent);
|
|
48045
|
-
var pointIndex = 0;
|
|
48046
|
-
|
|
48047
|
-
while (pointIndex < path.length) {
|
|
48048
|
-
var ele = path[pointIndex];
|
|
48049
|
-
|
|
48050
|
-
if (ele.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableBody) || ele.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableFooter)) {
|
|
48051
|
-
return false;
|
|
48052
|
-
}
|
|
48153
|
+
}
|
|
48053
48154
|
|
|
48054
|
-
|
|
48055
|
-
|
|
48155
|
+
function canShowContextMenu(e, pipeline) {
|
|
48156
|
+
var _a, _b;
|
|
48056
48157
|
|
|
48057
|
-
return
|
|
48158
|
+
return ((_a = pipeline.ref.current.domHelper) === null || _a === void 0 ? void 0 : _a.tableBody.contains(e.target)) || ((_b = pipeline.ref.current.domHelper) === null || _b === void 0 ? void 0 : _b.tableFooter.contains(e.target));
|
|
48058
48159
|
} // 默认选项
|
|
48059
48160
|
|
|
48060
48161
|
|
|
@@ -48948,28 +49049,34 @@ function multiSelect() {
|
|
|
48948
49049
|
/** 所有有效的 keys(disable 状态为 false) */
|
|
48949
49050
|
|
|
48950
49051
|
var allKeys = [];
|
|
49052
|
+
var set = new _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2___default.a(value);
|
|
49053
|
+
var isAllChecked = set.size !== 0; // 当前不存在选中则默认为false
|
|
49054
|
+
|
|
49055
|
+
var isAnyChecked = false;
|
|
48951
49056
|
var flatDataSource = Object(_utils__WEBPACK_IMPORTED_MODULE_7__["collectNodes"])(dataSource);
|
|
48952
49057
|
flatDataSource.forEach(function (row, rowIndex) {
|
|
48953
49058
|
var rowKey = _internals__WEBPACK_IMPORTED_MODULE_5__["internals"].safeGetRowKey(primaryKey, row, rowIndex);
|
|
48954
49059
|
fullKeySet.add(rowKey); // 在 allKeys 中排除被禁用的 key
|
|
48955
49060
|
|
|
48956
49061
|
if (!isDisabled(row, rowIndex)) {
|
|
48957
|
-
allKeys.push(rowKey);
|
|
49062
|
+
allKeys.push(rowKey); // 存在一个非选中,则不再进行判断
|
|
49063
|
+
|
|
49064
|
+
if (isAllChecked) {
|
|
49065
|
+
isAllChecked = set.has(rowKey);
|
|
49066
|
+
} // 存在一个选中,则不再进行判断
|
|
49067
|
+
|
|
49068
|
+
|
|
49069
|
+
if (!isAnyChecked) {
|
|
49070
|
+
isAnyChecked = set.has(rowKey);
|
|
49071
|
+
}
|
|
48958
49072
|
}
|
|
48959
|
-
});
|
|
48960
|
-
var set = new _babel_runtime_corejs3_core_js_stable_set__WEBPACK_IMPORTED_MODULE_2___default.a(value); // todo: 暂使用hidden隐藏选择列 后续增加配置
|
|
49073
|
+
}); // todo: 暂使用hidden隐藏选择列 后续增加配置
|
|
48961
49074
|
|
|
48962
49075
|
var hiddenSelectColumn = opts.checkboxColumn && opts.checkboxColumn.hidden === true;
|
|
48963
49076
|
|
|
48964
49077
|
if (!hiddenSelectColumn) {
|
|
48965
49078
|
var _context;
|
|
48966
49079
|
|
|
48967
|
-
var isAllChecked = allKeys.length > 0 && allKeys.every(function (key) {
|
|
48968
|
-
return set.has(key);
|
|
48969
|
-
});
|
|
48970
|
-
var isAnyChecked = allKeys.some(function (key) {
|
|
48971
|
-
return set.has(key);
|
|
48972
|
-
});
|
|
48973
49080
|
var defaultCheckboxColumnTitle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement(Checkbox, {
|
|
48974
49081
|
checked: isAllChecked,
|
|
48975
49082
|
indeterminate: !isAllChecked && isAnyChecked,
|
|
@@ -49222,16 +49329,16 @@ function rangeSelection(opts) {
|
|
|
49222
49329
|
|
|
49223
49330
|
if (clickCell) {
|
|
49224
49331
|
if (event.shiftKey) {
|
|
49225
|
-
var _lastClickCell = pipeline.
|
|
49332
|
+
var _lastClickCell = pipeline.getFeatureOptions(lastClickCellKey);
|
|
49226
49333
|
|
|
49227
49334
|
if (_lastClickCell) {
|
|
49228
49335
|
setRangeSelection(_lastClickCell, clickCell);
|
|
49229
49336
|
} else {
|
|
49230
49337
|
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
49231
|
-
pipeline.
|
|
49338
|
+
pipeline.setFeatureOptions(lastClickCellKey, clickCell);
|
|
49232
49339
|
}
|
|
49233
49340
|
} else {
|
|
49234
|
-
pipeline.
|
|
49341
|
+
pipeline.setFeatureOptions(lastClickCellKey, clickCell);
|
|
49235
49342
|
setRangeSelection(clickCell, clickCell);
|
|
49236
49343
|
}
|
|
49237
49344
|
}
|
|
@@ -50473,6 +50580,10 @@ function sort() {
|
|
|
50473
50580
|
return dataSource;
|
|
50474
50581
|
}
|
|
50475
50582
|
|
|
50583
|
+
if (sortMap.size === 0) {
|
|
50584
|
+
return dataSource;
|
|
50585
|
+
}
|
|
50586
|
+
|
|
50476
50587
|
var sortColumnsMap = new _babel_runtime_corejs3_core_js_stable_map__WEBPACK_IMPORTED_MODULE_8___default.a(_babel_runtime_corejs3_core_js_stable_instance_map__WEBPACK_IMPORTED_MODULE_9___default()(_context = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_6___default()(_context2 = Object(_utils__WEBPACK_IMPORTED_MODULE_16__["collectNodes"])(columns, 'leaf-only')).call(_context2, function (col) {
|
|
50477
50588
|
var _a, _b;
|
|
50478
50589
|
|
|
@@ -51522,8 +51633,9 @@ function useTablePipeline(ctx) {
|
|
|
51522
51633
|
state = _useState2[0],
|
|
51523
51634
|
setState = _useState2[1];
|
|
51524
51635
|
|
|
51525
|
-
var ref = Object(react__WEBPACK_IMPORTED_MODULE_7__["useRef"])({
|
|
51526
|
-
|
|
51636
|
+
var ref = Object(react__WEBPACK_IMPORTED_MODULE_7__["useRef"])({
|
|
51637
|
+
featureOptions: {}
|
|
51638
|
+
});
|
|
51527
51639
|
return new TablePipeline({
|
|
51528
51640
|
state: state,
|
|
51529
51641
|
setState: setState,
|
|
@@ -60957,6 +61069,20 @@ var path = __webpack_require__(/*! ../../internals/path */ "./node_modules/core-
|
|
|
60957
61069
|
module.exports = path.Map;
|
|
60958
61070
|
|
|
60959
61071
|
|
|
61072
|
+
/***/ }),
|
|
61073
|
+
|
|
61074
|
+
/***/ "./node_modules/core-js-pure/es/number/max-safe-integer.js":
|
|
61075
|
+
/*!*****************************************************************!*\
|
|
61076
|
+
!*** ./node_modules/core-js-pure/es/number/max-safe-integer.js ***!
|
|
61077
|
+
\*****************************************************************/
|
|
61078
|
+
/*! no static exports found */
|
|
61079
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
61080
|
+
|
|
61081
|
+
__webpack_require__(/*! ../../modules/es.number.max-safe-integer */ "./node_modules/core-js-pure/modules/es.number.max-safe-integer.js");
|
|
61082
|
+
|
|
61083
|
+
module.exports = 0x1FFFFFFFFFFFFF;
|
|
61084
|
+
|
|
61085
|
+
|
|
60960
61086
|
/***/ }),
|
|
60961
61087
|
|
|
60962
61088
|
/***/ "./node_modules/core-js-pure/es/object/assign.js":
|
|
@@ -66730,6 +66856,24 @@ __webpack_require__(/*! ../modules/es.map.constructor */ "./node_modules/core-js
|
|
|
66730
66856
|
// empty
|
|
66731
66857
|
|
|
66732
66858
|
|
|
66859
|
+
/***/ }),
|
|
66860
|
+
|
|
66861
|
+
/***/ "./node_modules/core-js-pure/modules/es.number.max-safe-integer.js":
|
|
66862
|
+
/*!*************************************************************************!*\
|
|
66863
|
+
!*** ./node_modules/core-js-pure/modules/es.number.max-safe-integer.js ***!
|
|
66864
|
+
\*************************************************************************/
|
|
66865
|
+
/*! no static exports found */
|
|
66866
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
66867
|
+
|
|
66868
|
+
var $ = __webpack_require__(/*! ../internals/export */ "./node_modules/core-js-pure/internals/export.js");
|
|
66869
|
+
|
|
66870
|
+
// `Number.MAX_SAFE_INTEGER` constant
|
|
66871
|
+
// https://tc39.es/ecma262/#sec-number.max_safe_integer
|
|
66872
|
+
$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, {
|
|
66873
|
+
MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF
|
|
66874
|
+
});
|
|
66875
|
+
|
|
66876
|
+
|
|
66733
66877
|
/***/ }),
|
|
66734
66878
|
|
|
66735
66879
|
/***/ "./node_modules/core-js-pure/modules/es.object.assign.js":
|
|
@@ -68239,6 +68383,20 @@ __webpack_require__(/*! ../../modules/web.dom-collections.iterator */ "./node_mo
|
|
|
68239
68383
|
module.exports = parent;
|
|
68240
68384
|
|
|
68241
68385
|
|
|
68386
|
+
/***/ }),
|
|
68387
|
+
|
|
68388
|
+
/***/ "./node_modules/core-js-pure/stable/number/max-safe-integer.js":
|
|
68389
|
+
/*!*********************************************************************!*\
|
|
68390
|
+
!*** ./node_modules/core-js-pure/stable/number/max-safe-integer.js ***!
|
|
68391
|
+
\*********************************************************************/
|
|
68392
|
+
/*! no static exports found */
|
|
68393
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
68394
|
+
|
|
68395
|
+
var parent = __webpack_require__(/*! ../../es/number/max-safe-integer */ "./node_modules/core-js-pure/es/number/max-safe-integer.js");
|
|
68396
|
+
|
|
68397
|
+
module.exports = parent;
|
|
68398
|
+
|
|
68399
|
+
|
|
68242
68400
|
/***/ }),
|
|
68243
68401
|
|
|
68244
68402
|
/***/ "./node_modules/core-js-pure/stable/object/assign.js":
|