@kdcloudjs/kdesign 1.7.23 → 1.7.24
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 +41 -0
- package/dist/kdesign-complete.less +18 -7
- package/dist/kdesign.css +46 -8
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +425 -180
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +4 -4
- package/dist/kdesign.min.js +8 -8
- package/dist/kdesign.min.js.map +1 -1
- package/es/_utils/usePopper.js +36 -19
- package/es/city-picker/city-picker.js +6 -3
- package/es/city-picker/interface.d.ts +1 -0
- package/es/city-picker/style/index.css +2 -0
- package/es/city-picker/style/index.less +1 -0
- package/es/input-number/inputNumber.js +5 -2
- package/es/radio/style/index.css +1 -0
- package/es/radio/style/index.less +1 -0
- package/es/search/search.js +2 -1
- package/es/select/select.js +3 -2
- package/es/select/style/index.css +6 -3
- package/es/select/style/index.less +10 -4
- package/es/select/style/token.less +1 -1
- package/es/style/core/motion/slide.less +5 -2
- package/es/style/index.css +36 -4
- package/es/table/api.js +19 -3
- package/lib/_utils/usePopper.js +36 -19
- package/lib/city-picker/city-picker.js +6 -3
- package/lib/city-picker/interface.d.ts +1 -0
- package/lib/city-picker/style/index.css +2 -0
- package/lib/city-picker/style/index.less +1 -0
- package/lib/input-number/inputNumber.js +5 -2
- package/lib/radio/style/index.css +1 -0
- package/lib/radio/style/index.less +1 -0
- package/lib/search/search.js +2 -1
- package/lib/select/select.js +3 -2
- package/lib/select/style/index.css +6 -3
- package/lib/select/style/index.less +10 -4
- package/lib/select/style/token.less +1 -1
- package/lib/style/core/motion/slide.less +5 -2
- package/lib/style/index.css +36 -4
- package/lib/table/api.js +19 -3
- 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.23
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2020-present, Kingdee, Inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -2192,6 +2192,19 @@ var getScrollDist = function getScrollDist(el, container) {
|
|
|
2192
2192
|
}
|
|
2193
2193
|
return elScroll;
|
|
2194
2194
|
};
|
|
2195
|
+
var getRealDom = function getRealDom(locatorRef, locatorElement) {
|
|
2196
|
+
var _locatorElement$type;
|
|
2197
|
+
if (!locatorRef.current) return locatorRef.current;
|
|
2198
|
+
var REF_NAME_OBJ = {
|
|
2199
|
+
Input: 'input',
|
|
2200
|
+
InputNumber: 'input',
|
|
2201
|
+
Select: 'select',
|
|
2202
|
+
Upload: 'input'
|
|
2203
|
+
};
|
|
2204
|
+
if (locatorRef.current.tagName) return locatorRef.current;
|
|
2205
|
+
var name = REF_NAME_OBJ[locatorElement === null || locatorElement === void 0 ? void 0 : (_locatorElement$type = locatorElement.type) === null || _locatorElement$type === void 0 ? void 0 : _locatorElement$type.displayName];
|
|
2206
|
+
return locatorRef === null || locatorRef === void 0 ? void 0 : locatorRef.current[name];
|
|
2207
|
+
};
|
|
2195
2208
|
function usePopper(locatorElement, popperElement, props) {
|
|
2196
2209
|
var _arrowStyle;
|
|
2197
2210
|
var prefixCls = props.prefixCls,
|
|
@@ -2244,10 +2257,11 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
2244
2257
|
var popperEl = Object(react__WEBPACK_IMPORTED_MODULE_18__["useRef"])();
|
|
2245
2258
|
var locatorRef = locatorElement.ref || locatorEl;
|
|
2246
2259
|
var popperRef = popperElement.ref || popperEl;
|
|
2247
|
-
var container = getPopupContainer(locatorRef
|
|
2260
|
+
var container = getPopupContainer(getRealDom(locatorRef, locatorElement) || document.body);
|
|
2248
2261
|
Promise.resolve().then(function () {
|
|
2249
|
-
var
|
|
2250
|
-
var
|
|
2262
|
+
var realDom = getRealDom(locatorRef, locatorElement);
|
|
2263
|
+
var triggerNode = getTriggerElement(realDom);
|
|
2264
|
+
var container = getPopupContainer(realDom);
|
|
2251
2265
|
Object(_utils_devwarning__WEBPACK_IMPORTED_MODULE_23__["default"])(!triggerNode, componentName, "getTriggerElement() must return a HTMLElement, but now it does not return anything");
|
|
2252
2266
|
Object(_utils_devwarning__WEBPACK_IMPORTED_MODULE_23__["default"])(!container, componentName, "getPopupContainer() must return a HTMLElement, but now it does not return anything");
|
|
2253
2267
|
});
|
|
@@ -2310,30 +2324,31 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
2310
2324
|
nextPlacement = _useState18[0],
|
|
2311
2325
|
setNextPlacement = _useState18[1];
|
|
2312
2326
|
var alignPopper = Object(react__WEBPACK_IMPORTED_MODULE_18__["useCallback"])(function () {
|
|
2313
|
-
|
|
2327
|
+
var realDom = getRealDom(locatorRef, locatorElement);
|
|
2328
|
+
if (realDom && popperRef !== null && popperRef !== void 0 && popperRef.current) {
|
|
2314
2329
|
var _popperRef$current$ge = popperRef.current.getBoundingClientRect(),
|
|
2315
2330
|
popperWidth = _popperRef$current$ge.width,
|
|
2316
2331
|
popperHeight = _popperRef$current$ge.height;
|
|
2317
|
-
var
|
|
2318
|
-
top =
|
|
2319
|
-
bottom =
|
|
2320
|
-
left =
|
|
2321
|
-
right =
|
|
2322
|
-
height =
|
|
2323
|
-
width =
|
|
2332
|
+
var _realDom$getBoundingC = realDom.getBoundingClientRect(),
|
|
2333
|
+
top = _realDom$getBoundingC.top,
|
|
2334
|
+
bottom = _realDom$getBoundingC.bottom,
|
|
2335
|
+
left = _realDom$getBoundingC.left,
|
|
2336
|
+
right = _realDom$getBoundingC.right,
|
|
2337
|
+
height = _realDom$getBoundingC.height,
|
|
2338
|
+
width = _realDom$getBoundingC.width;
|
|
2324
2339
|
var _getOffsetPos = getOffsetPos(container),
|
|
2325
2340
|
containerTop = _getOffsetPos.top,
|
|
2326
2341
|
containerLeft = _getOffsetPos.left;
|
|
2327
|
-
var _getOffsetPos2 = getOffsetPos(
|
|
2342
|
+
var _getOffsetPos2 = getOffsetPos(realDom),
|
|
2328
2343
|
locatorTop = _getOffsetPos2.top,
|
|
2329
2344
|
locatorLeft = _getOffsetPos2.left;
|
|
2330
|
-
var _getTranslatePos = getTranslatePos(
|
|
2345
|
+
var _getTranslatePos = getTranslatePos(realDom),
|
|
2331
2346
|
translateTop = _getTranslatePos.top,
|
|
2332
2347
|
translateLeft = _getTranslatePos.left;
|
|
2333
|
-
var _getBorderWidth = getBorderWidth(
|
|
2348
|
+
var _getBorderWidth = getBorderWidth(realDom),
|
|
2334
2349
|
borderTop = _getBorderWidth.top,
|
|
2335
2350
|
borderLeft = _getBorderWidth.left;
|
|
2336
|
-
var _getScrollDist = getScrollDist(
|
|
2351
|
+
var _getScrollDist = getScrollDist(realDom.parentElement, container),
|
|
2337
2352
|
scrollTop = _getScrollDist.top,
|
|
2338
2353
|
scrollLeft = _getScrollDist.left;
|
|
2339
2354
|
var locatorPos = {
|
|
@@ -2518,7 +2533,7 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
2518
2533
|
}, "".concat(nextPlacement, "-active"), active))
|
|
2519
2534
|
};
|
|
2520
2535
|
var popperNode = popperRef.current;
|
|
2521
|
-
var locatorNode = locatorRef
|
|
2536
|
+
var locatorNode = getRealDom(locatorRef, locatorElement);
|
|
2522
2537
|
Object(_hooks__WEBPACK_IMPORTED_MODULE_24__["useResizeObserver"])(popperNode || document.body, alignPopper);
|
|
2523
2538
|
Object(_hooks__WEBPACK_IMPORTED_MODULE_24__["useResizeObserver"])(locatorNode || document.body, alignPopper);
|
|
2524
2539
|
var showPopper = Object(react__WEBPACK_IMPORTED_MODULE_18__["useCallback"])(function (evType) {
|
|
@@ -2549,7 +2564,8 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
2549
2564
|
Object(react__WEBPACK_IMPORTED_MODULE_18__["useEffect"])(function () {
|
|
2550
2565
|
if (exist && visible) {
|
|
2551
2566
|
var mouseleaveTimer;
|
|
2552
|
-
var
|
|
2567
|
+
var realDom = getRealDom(locatorRef, locatorElement);
|
|
2568
|
+
var triggerNode = getTriggerElement(realDom);
|
|
2553
2569
|
var handleHidePopper = function handleHidePopper(e) {
|
|
2554
2570
|
var triggerRect = triggerNode.getBoundingClientRect();
|
|
2555
2571
|
var popperRect = popperRef.current.getBoundingClientRect();
|
|
@@ -2623,8 +2639,9 @@ function usePopper(locatorElement, popperElement, props) {
|
|
|
2623
2639
|
};
|
|
2624
2640
|
}
|
|
2625
2641
|
}, [alignPopper, exist, onVisibleChange, popperNode, props.visible, scrollHidden, locatorNode, visible, popperRef]);
|
|
2626
|
-
|
|
2627
|
-
var
|
|
2642
|
+
Object(react__WEBPACK_IMPORTED_MODULE_18__["useEffect"])(function () {
|
|
2643
|
+
var realDom = getRealDom(locatorRef, locatorElement);
|
|
2644
|
+
var triggerNode = getTriggerElement(realDom);
|
|
2628
2645
|
if (triggerNode) {
|
|
2629
2646
|
var mouseenterTimer;
|
|
2630
2647
|
var clearMouseLeave = function clearMouseLeave() {
|
|
@@ -7543,7 +7560,8 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
7543
7560
|
domesticList = _selectProps$domestic === void 0 ? [] : _selectProps$domestic,
|
|
7544
7561
|
_selectProps$foreignL = selectProps.foreignList,
|
|
7545
7562
|
foreignList = _selectProps$foreignL === void 0 ? [] : _selectProps$foreignL,
|
|
7546
|
-
itemRender = selectProps.itemRender
|
|
7563
|
+
itemRender = selectProps.itemRender,
|
|
7564
|
+
onTabPaneChange = selectProps.onTabPaneChange;
|
|
7547
7565
|
var _useMergedState = Object(_utils_hooks__WEBPACK_IMPORTED_MODULE_21__["useMergedState"])(undefined, {
|
|
7548
7566
|
value: value,
|
|
7549
7567
|
defaultValue: defaultValue
|
|
@@ -7731,6 +7749,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
7731
7749
|
};
|
|
7732
7750
|
var toggleTabPane = function toggleTabPane(type) {
|
|
7733
7751
|
setTabsValue(type);
|
|
7752
|
+
onTabPaneChange === null || onTabPaneChange === void 0 ? void 0 : onTabPaneChange(type);
|
|
7734
7753
|
};
|
|
7735
7754
|
|
|
7736
7755
|
// 渲染下拉列表框
|
|
@@ -7753,11 +7772,12 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
7753
7772
|
var symbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ', ';
|
|
7754
7773
|
if (!data) return null;
|
|
7755
7774
|
if (isDomestic(type)) {
|
|
7756
|
-
|
|
7775
|
+
var curVal = tabsValue === 'domestic' ? data === null || data === void 0 ? void 0 : data.province : data === null || data === void 0 ? void 0 : data.country;
|
|
7776
|
+
return "".concat(flag && curVal ? symbol : '').concat(curVal);
|
|
7757
7777
|
} else {
|
|
7758
7778
|
return "".concat(flag && data !== null && data !== void 0 && data.province ? symbol : '').concat(data === null || data === void 0 ? void 0 : data.province).concat(data !== null && data !== void 0 && data.country ? symbol : '').concat(data === null || data === void 0 ? void 0 : data.country);
|
|
7759
7779
|
}
|
|
7760
|
-
}, [type]);
|
|
7780
|
+
}, [type, tabsValue]);
|
|
7761
7781
|
var renderSingle = function renderSingle() {
|
|
7762
7782
|
var hiddenStyle = !!searchValue || (initValue !== null && initValue !== void 0 ? initValue : '') !== '' ? {
|
|
7763
7783
|
visibility: 'hidden'
|
|
@@ -20382,7 +20402,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
20382
20402
|
|
|
20383
20403
|
|
|
20384
20404
|
|
|
20385
|
-
var _excluded = ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className"];
|
|
20405
|
+
var _excluded = ["value", "defaultValue", "mustInScope", "decimalLength", "mustInPrecisionScope", "digitLength", "onChange", "symbol", "zeroShow", "showDecimalTailZero", "code", "roundMethod", "mask", "stepOption", "min", "minMark", "max", "maxMark", "numberMode", "prefix", "suffix", "formatter", "className", "onKeyDown"];
|
|
20386
20406
|
|
|
20387
20407
|
|
|
20388
20408
|
|
|
@@ -20429,6 +20449,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
20429
20449
|
suffix = inputNumberProps.suffix,
|
|
20430
20450
|
formatter = inputNumberProps.formatter,
|
|
20431
20451
|
className = inputNumberProps.className,
|
|
20452
|
+
onKeyDown = inputNumberProps.onKeyDown,
|
|
20432
20453
|
others = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2___default()(inputNumberProps, _excluded);
|
|
20433
20454
|
var initVal = value === undefined ? defaultValue : value;
|
|
20434
20455
|
var _useState = Object(react__WEBPACK_IMPORTED_MODULE_11__["useState"])(Object(_utils_numberUtil__WEBPACK_IMPORTED_MODULE_15__["serialization"])(initVal !== undefined ? initVal + '' : '')),
|
|
@@ -20551,12 +20572,13 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
20551
20572
|
return resultNumerical;
|
|
20552
20573
|
};
|
|
20553
20574
|
var handleStepChang = function handleStepChang(type) {
|
|
20575
|
+
var _inputNumberRef$curre, _inputNumberRef$curre2;
|
|
20554
20576
|
var step = stepOption.step === undefined ? 1 : parseFloat(stepOption.step);
|
|
20555
20577
|
if (typeof step !== 'number') {
|
|
20556
20578
|
Object(_utils_devwarning__WEBPACK_IMPORTED_MODULE_17__["default"])(true, 'inputNumber', "stepOption.step\u5FC5\u987B\u4E3A\u4E00\u4E2A\u6570\u503C");
|
|
20557
20579
|
return false;
|
|
20558
20580
|
}
|
|
20559
|
-
var startingNumber = parseFloat(inputNumberRef.current.value) || 0;
|
|
20581
|
+
var startingNumber = parseFloat((_inputNumberRef$curre = inputNumberRef.current) === null || _inputNumberRef$curre === void 0 ? void 0 : (_inputNumberRef$curre2 = _inputNumberRef$curre.input) === null || _inputNumberRef$curre2 === void 0 ? void 0 : _inputNumberRef$curre2.value) || 0;
|
|
20560
20582
|
var calculationResults = new big_js__WEBPACK_IMPORTED_MODULE_18___default.a(startingNumber)[type](step).valueOf();
|
|
20561
20583
|
var legalNumber = verifiValue(calculationResults);
|
|
20562
20584
|
if (legalNumber === false) {
|
|
@@ -20570,6 +20592,7 @@ var InternalInputNumber = function InternalInputNumber(props, ref) {
|
|
|
20570
20592
|
});
|
|
20571
20593
|
};
|
|
20572
20594
|
var handleKeyDown = function handleKeyDown(event) {
|
|
20595
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
|
|
20573
20596
|
if (!stepOption || props.disabled || props.readOnly) {
|
|
20574
20597
|
return;
|
|
20575
20598
|
}
|
|
@@ -27964,7 +27987,8 @@ var InternalSearch = function InternalSearch(props, ref) {
|
|
|
27964
27987
|
onSearch && (onSearch === null || onSearch === void 0 ? void 0 : onSearch(event));
|
|
27965
27988
|
}, [onSearch]);
|
|
27966
27989
|
var handlePressEnter = Object(react__WEBPACK_IMPORTED_MODULE_5__["useCallback"])(function (_, event) {
|
|
27967
|
-
|
|
27990
|
+
var _searchRef$current, _searchRef$current$in;
|
|
27991
|
+
onPressEnter && (onPressEnter === null || onPressEnter === void 0 ? void 0 : onPressEnter((_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : (_searchRef$current$in = _searchRef$current.input) === null || _searchRef$current$in === void 0 ? void 0 : _searchRef$current$in.value, event));
|
|
27968
27992
|
}, [onPressEnter, searchRef]);
|
|
27969
27993
|
var handleFocus = Object(react__WEBPACK_IMPORTED_MODULE_5__["useCallback"])(function (event) {
|
|
27970
27994
|
setFocused(true);
|
|
@@ -29103,6 +29127,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
29103
29127
|
} else if (which === _utils_KeyCode__WEBPACK_IMPORTED_MODULE_30__["default"].ENTER) {
|
|
29104
29128
|
var _item$props, _item$props2;
|
|
29105
29129
|
var item = filledOptions[activeIndex];
|
|
29130
|
+
if (!item) return;
|
|
29106
29131
|
var key = ((_item$props = item.props) === null || _item$props === void 0 ? void 0 : _item$props.value) || item.value;
|
|
29107
29132
|
var label = ((_item$props2 = item.props) === null || _item$props2 === void 0 ? void 0 : _item$props2.children) || item.label;
|
|
29108
29133
|
handleOption(key, label, true);
|
|
@@ -29178,7 +29203,7 @@ var InternalSelect = function InternalSelect(props, ref) {
|
|
|
29178
29203
|
}
|
|
29179
29204
|
};
|
|
29180
29205
|
var popperProps = _objectSpread(_objectSpread({}, selectProps), {}, {
|
|
29181
|
-
prefixCls: selectPrefixCls,
|
|
29206
|
+
prefixCls: "".concat(selectPrefixCls, "-dropdown-panel").concat(isMultiple ? " ".concat(selectPrefixCls, "-multiple-dropdown-panel") : ''),
|
|
29182
29207
|
placement: 'bottomLeft',
|
|
29183
29208
|
popperStyle: catchStyle(),
|
|
29184
29209
|
defaultVisible: optionShow,
|
|
@@ -31604,6 +31629,24 @@ function getApi(pipelineRef) {
|
|
|
31604
31629
|
var colLeft = columnNodes.slice(0, index).reduce(function (acc, col) {
|
|
31605
31630
|
return acc + col.width;
|
|
31606
31631
|
}, 0);
|
|
31632
|
+
var lockColumnLeft = 0;
|
|
31633
|
+
var lockColumnRight = 0;
|
|
31634
|
+
for (var i = 0; i < columnNodes.length; i++) {
|
|
31635
|
+
var _columnNodes$i;
|
|
31636
|
+
if ((_columnNodes$i = columnNodes[i]) !== null && _columnNodes$i !== void 0 && _columnNodes$i.lock) {
|
|
31637
|
+
lockColumnLeft += columnNodes[i].width;
|
|
31638
|
+
} else {
|
|
31639
|
+
break;
|
|
31640
|
+
}
|
|
31641
|
+
}
|
|
31642
|
+
for (var _i = columnNodes.length - 1; _i >= 0; _i--) {
|
|
31643
|
+
var _columnNodes$_i;
|
|
31644
|
+
if ((_columnNodes$_i = columnNodes[_i]) !== null && _columnNodes$_i !== void 0 && _columnNodes$_i.lock) {
|
|
31645
|
+
lockColumnRight += columnNodes[_i].width;
|
|
31646
|
+
} else {
|
|
31647
|
+
break;
|
|
31648
|
+
}
|
|
31649
|
+
}
|
|
31607
31650
|
var colLeftPixel = colLeft; // 目标列前面列宽总和
|
|
31608
31651
|
var colRightPixel = colLeftPixel + column.width;
|
|
31609
31652
|
var viewportWidth = tableBodyContainer.clientWidth; // 表体容器的宽度
|
|
@@ -31611,8 +31654,8 @@ function getApi(pipelineRef) {
|
|
|
31611
31654
|
|
|
31612
31655
|
var vScrollLeft = scrollPosition;
|
|
31613
31656
|
var vScrollRight = scrollPosition + viewportWidth;
|
|
31614
|
-
var pxLeft = colLeftPixel;
|
|
31615
|
-
var pxRight = colRightPixel - viewportWidth;
|
|
31657
|
+
var pxLeft = colLeftPixel - lockColumnLeft;
|
|
31658
|
+
var pxRight = colRightPixel - viewportWidth + lockColumnRight;
|
|
31616
31659
|
var colBeforeViewport = vScrollLeft > colLeftPixel; // 滚动距离大于目标列前面列宽总和,说明目标列在视口之前
|
|
31617
31660
|
var colPastViewport = vScrollRight < colRightPixel; // 目标列是视口之后
|
|
31618
31661
|
|
|
@@ -45465,13 +45508,13 @@ var BaseTable = /*#__PURE__*/function (_React$Component) {
|
|
|
45465
45508
|
last: footerDataSource.length - 1,
|
|
45466
45509
|
limit: Infinity
|
|
45467
45510
|
}
|
|
45468
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_16___default.a.createElement("div", {
|
|
45511
|
+
}), footerDataSource.length > 0 ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_16___default.a.createElement("div", {
|
|
45469
45512
|
className: _styles__WEBPACK_IMPORTED_MODULE_27__["Classes"].verticalScrollPlaceholder,
|
|
45470
45513
|
style: this.hasScrollY ? {
|
|
45471
45514
|
width: this.getScrollBarWidth(),
|
|
45472
45515
|
visibility: 'initial'
|
|
45473
45516
|
} : undefined
|
|
45474
|
-
}));
|
|
45517
|
+
}) : null);
|
|
45475
45518
|
}
|
|
45476
45519
|
}, {
|
|
45477
45520
|
key: "renderLockShadows",
|
|
@@ -46494,10 +46537,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
46494
46537
|
/* 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__);
|
|
46495
46538
|
/* 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");
|
|
46496
46539
|
/* 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__);
|
|
46497
|
-
/* harmony import */ var
|
|
46498
|
-
/* harmony import */ var
|
|
46499
|
-
/* harmony import */ var
|
|
46500
|
-
/* harmony import */ var
|
|
46540
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/find-index */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find-index.js");
|
|
46541
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_6__);
|
|
46542
|
+
/* harmony import */ var _base_calculations__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../base/calculations */ "./node_modules/@kdcloudjs/table/es/table/base/calculations.js");
|
|
46543
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./node_modules/@kdcloudjs/table/es/table/utils/index.js");
|
|
46544
|
+
/* harmony import */ var _base_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../base/styles */ "./node_modules/@kdcloudjs/table/es/table/base/styles.js");
|
|
46545
|
+
/* harmony import */ var _columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./columnResizeWidth */ "./node_modules/@kdcloudjs/table/es/table/pipeline/features/columnResizeWidth.js");
|
|
46546
|
+
|
|
46501
46547
|
|
|
46502
46548
|
|
|
46503
46549
|
|
|
@@ -46526,8 +46572,8 @@ var autoFillTableWidth = function autoFillTableWidth() {
|
|
|
46526
46572
|
// 保存剩余的flex总和和剩余宽度总和宽度
|
|
46527
46573
|
var residualFlexCount = flexCount;
|
|
46528
46574
|
var residualFlexWidth = remainingWidth;
|
|
46529
|
-
var columnSize = pipeline.getFeatureOptions(
|
|
46530
|
-
pipeline.mapColumns(Object(
|
|
46575
|
+
var columnSize = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__["COLUMN_SIZE_KEY"]) || {};
|
|
46576
|
+
pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_8__["makeRecursiveMapper"])(function (col, recursiveFlatMapInfo) {
|
|
46531
46577
|
var isLeaf = recursiveFlatMapInfo.isLeaf;
|
|
46532
46578
|
|
|
46533
46579
|
if (isLeaf && isValidFlexColumn(col, pipeline)) {
|
|
@@ -46550,7 +46596,7 @@ var autoFillTableWidth = function autoFillTableWidth() {
|
|
|
46550
46596
|
|
|
46551
46597
|
return col;
|
|
46552
46598
|
}));
|
|
46553
|
-
pipeline.setFeatureOptions(
|
|
46599
|
+
pipeline.setFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__["COLUMN_SIZE_KEY"], columnSize);
|
|
46554
46600
|
}
|
|
46555
46601
|
} else {
|
|
46556
46602
|
// 未设置了flex宽度,创建占位列
|
|
@@ -46565,7 +46611,7 @@ var autoFillTableWidth = function autoFillTableWidth() {
|
|
|
46565
46611
|
if (fillColumns) {
|
|
46566
46612
|
fillColumns.width = width;
|
|
46567
46613
|
} else {
|
|
46568
|
-
var rightNestedLockCount = Object(
|
|
46614
|
+
var rightNestedLockCount = Object(_base_calculations__WEBPACK_IMPORTED_MODULE_7__["getLeftNestedLockCount"])(_babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_3___default()(columns).call(columns).reverse());
|
|
46569
46615
|
var spliceIndex = columns.length - rightNestedLockCount;
|
|
46570
46616
|
var _fillColumns = {
|
|
46571
46617
|
name: '',
|
|
@@ -46576,7 +46622,7 @@ var autoFillTableWidth = function autoFillTableWidth() {
|
|
|
46576
46622
|
},
|
|
46577
46623
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
46578
46624
|
return {
|
|
46579
|
-
className:
|
|
46625
|
+
className: _base_styles__WEBPACK_IMPORTED_MODULE_9__["Classes"].emptyColCell
|
|
46580
46626
|
};
|
|
46581
46627
|
}
|
|
46582
46628
|
};
|
|
@@ -46596,7 +46642,7 @@ var autoFillTableWidth = function autoFillTableWidth() {
|
|
|
46596
46642
|
|
|
46597
46643
|
function dfs(columns, result) {
|
|
46598
46644
|
columns.forEach(function (col) {
|
|
46599
|
-
if (Object(
|
|
46645
|
+
if (Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isLeafNode"])(col)) {
|
|
46600
46646
|
if (isValidFlexColumn(col, pipeline)) {
|
|
46601
46647
|
result.set(FLEX_COLUMN_COUNT, result.get(FLEX_COLUMN_COUNT) + col.features.flex);
|
|
46602
46648
|
}
|
|
@@ -46617,8 +46663,8 @@ function getColumnWidthSum(pipeline) {
|
|
|
46617
46663
|
var width = col.width,
|
|
46618
46664
|
code = col.code;
|
|
46619
46665
|
|
|
46620
|
-
if (Object(
|
|
46621
|
-
var resizeColumn = pipeline.getFeatureOptions(
|
|
46666
|
+
if (Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isLeafNode"])(col) && code !== FILL_COLUMN_CODE) {
|
|
46667
|
+
var resizeColumn = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__["COLUMN_SIZE_KEY"]);
|
|
46622
46668
|
return acc + (resizeColumn && resizeColumn[code] || width);
|
|
46623
46669
|
} else {
|
|
46624
46670
|
return acc + dfs(col.children);
|
|
@@ -46634,17 +46680,34 @@ function getTableRemainingWidth(pipeline) {
|
|
|
46634
46680
|
return remainingWidth > 0 ? remainingWidth : 0;
|
|
46635
46681
|
}
|
|
46636
46682
|
|
|
46683
|
+
function isAfterLastResizeCol(column, pipeline) {
|
|
46684
|
+
var _context, _context2;
|
|
46685
|
+
|
|
46686
|
+
var lastResizedColumnCode = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__["LAST_RESIZED_COLUMN_KEY"]);
|
|
46687
|
+
if (lastResizedColumnCode === undefined) return true;
|
|
46688
|
+
|
|
46689
|
+
var lastResizedColumnIndex = _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_6___default()(_context = pipeline.getColumns()).call(_context, function (col) {
|
|
46690
|
+
return col.code === lastResizedColumnCode;
|
|
46691
|
+
});
|
|
46692
|
+
|
|
46693
|
+
var colIndex = _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_6___default()(_context2 = pipeline.getColumns()).call(_context2, function (col) {
|
|
46694
|
+
return col.code === column.code;
|
|
46695
|
+
});
|
|
46696
|
+
|
|
46697
|
+
return colIndex > lastResizedColumnIndex;
|
|
46698
|
+
}
|
|
46699
|
+
|
|
46637
46700
|
function isValidFlexColumn(col, pipeline) {
|
|
46638
46701
|
var _a;
|
|
46639
46702
|
|
|
46640
|
-
var resizeColumn = pipeline.getFeatureOptions(
|
|
46703
|
+
var resizeColumn = pipeline.getFeatureOptions(_columnResizeWidth__WEBPACK_IMPORTED_MODULE_10__["RESIZED_COLUMN_KEY"]); // 拖拽列自动禁止flex
|
|
46641
46704
|
|
|
46642
46705
|
if (resizeColumn === null || resizeColumn === void 0 ? void 0 : resizeColumn.has(col.code)) {
|
|
46643
46706
|
return false;
|
|
46644
46707
|
}
|
|
46645
46708
|
|
|
46646
46709
|
var flex = (_a = col.features) === null || _a === void 0 ? void 0 : _a.flex;
|
|
46647
|
-
return typeof flex === 'number' && flex > 0;
|
|
46710
|
+
return typeof flex === 'number' && flex > 0 && isAfterLastResizeCol(col, pipeline);
|
|
46648
46711
|
}
|
|
46649
46712
|
|
|
46650
46713
|
function clamp(min, x, max) {
|
|
@@ -47714,13 +47777,14 @@ function columnRangeHover() {
|
|
|
47714
47777
|
/*!***************************************************************************************!*\
|
|
47715
47778
|
!*** ./node_modules/@kdcloudjs/table/es/table/pipeline/features/columnResizeWidth.js ***!
|
|
47716
47779
|
\***************************************************************************************/
|
|
47717
|
-
/*! exports provided: COLUMN_SIZE_KEY, RESIZED_COLUMN_KEY, columnResize */
|
|
47780
|
+
/*! exports provided: COLUMN_SIZE_KEY, RESIZED_COLUMN_KEY, LAST_RESIZED_COLUMN_KEY, columnResize */
|
|
47718
47781
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
47719
47782
|
|
|
47720
47783
|
"use strict";
|
|
47721
47784
|
__webpack_require__.r(__webpack_exports__);
|
|
47722
47785
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "COLUMN_SIZE_KEY", function() { return COLUMN_SIZE_KEY; });
|
|
47723
47786
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RESIZED_COLUMN_KEY", function() { return RESIZED_COLUMN_KEY; });
|
|
47787
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LAST_RESIZED_COLUMN_KEY", function() { return LAST_RESIZED_COLUMN_KEY; });
|
|
47724
47788
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "columnResize", function() { return columnResize; });
|
|
47725
47789
|
/* 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");
|
|
47726
47790
|
/* 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__);
|
|
@@ -47769,6 +47833,7 @@ function disableSelect(event) {
|
|
|
47769
47833
|
var stateKey = 'columnResize';
|
|
47770
47834
|
var COLUMN_SIZE_KEY = 'columnResize';
|
|
47771
47835
|
var RESIZED_COLUMN_KEY = 'resizedColumn';
|
|
47836
|
+
var LAST_RESIZED_COLUMN_KEY = 'lastResizedColumn';
|
|
47772
47837
|
function columnResize() {
|
|
47773
47838
|
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47774
47839
|
|
|
@@ -47876,6 +47941,7 @@ function columnResize() {
|
|
|
47876
47941
|
});
|
|
47877
47942
|
|
|
47878
47943
|
pipeline.setFeatureOptions(RESIZED_COLUMN_KEY, resizedColumnSet);
|
|
47944
|
+
pipeline.setFeatureOptions(LAST_RESIZED_COLUMN_KEY, code);
|
|
47879
47945
|
},
|
|
47880
47946
|
complete: function complete() {
|
|
47881
47947
|
var _context;
|
|
@@ -49441,7 +49507,7 @@ function multiSelect() {
|
|
|
49441
49507
|
/*!************************************************************************************!*\
|
|
49442
49508
|
!*** ./node_modules/@kdcloudjs/table/es/table/pipeline/features/rangeSelection.js ***!
|
|
49443
49509
|
\************************************************************************************/
|
|
49444
|
-
/*! exports provided: rangeSelectionKey, lastClickCellKey, rangeSelection */
|
|
49510
|
+
/*! exports provided: rangeSelectionKey, lastClickCellKey, rangeSelection, getCellRangeId */
|
|
49445
49511
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
49446
49512
|
|
|
49447
49513
|
"use strict";
|
|
@@ -49449,25 +49515,32 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49449
49515
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rangeSelectionKey", function() { return rangeSelectionKey; });
|
|
49450
49516
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lastClickCellKey", function() { return lastClickCellKey; });
|
|
49451
49517
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rangeSelection", function() { return rangeSelection; });
|
|
49452
|
-
/* harmony
|
|
49453
|
-
/* harmony import */ var
|
|
49454
|
-
/* harmony import */ var
|
|
49455
|
-
/* harmony import */ var
|
|
49518
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCellRangeId", function() { return getCellRangeId; });
|
|
49519
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ "./node_modules/@babel/runtime-corejs3/helpers/defineProperty.js");
|
|
49520
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
|
|
49521
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ "./node_modules/@babel/runtime-corejs3/helpers/typeof.js");
|
|
49522
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);
|
|
49456
49523
|
/* harmony import */ var _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/extends */ "./node_modules/@babel/runtime-corejs3/helpers/extends.js");
|
|
49457
49524
|
/* harmony import */ var _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_2__);
|
|
49458
|
-
/* harmony import */ var
|
|
49459
|
-
/* harmony import */ var
|
|
49460
|
-
/* harmony import */ var
|
|
49461
|
-
/* harmony import */ var
|
|
49462
|
-
/* harmony import */ var
|
|
49463
|
-
/* harmony import */ var
|
|
49464
|
-
/* harmony import */ var
|
|
49465
|
-
/* harmony import */ var
|
|
49466
|
-
/* harmony import */ var
|
|
49467
|
-
/* harmony import */ var
|
|
49468
|
-
/* harmony import */ var
|
|
49469
|
-
/* harmony import */ var
|
|
49470
|
-
/* harmony import */ var
|
|
49525
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime-corejs3/helpers/toConsumableArray */ "./node_modules/@babel/runtime-corejs3/helpers/toConsumableArray.js");
|
|
49526
|
+
/* harmony import */ var _babel_runtime_corejs3_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3__);
|
|
49527
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.js");
|
|
49528
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4__);
|
|
49529
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/find-index */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/find-index.js");
|
|
49530
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5__);
|
|
49531
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/slice */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js");
|
|
49532
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_6__);
|
|
49533
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_includes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/includes */ "./node_modules/@babel/runtime-corejs3/core-js-stable/instance/includes.js");
|
|
49534
|
+
/* harmony import */ var _babel_runtime_corejs3_core_js_stable_instance_includes__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_instance_includes__WEBPACK_IMPORTED_MODULE_7__);
|
|
49535
|
+
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils */ "./node_modules/@kdcloudjs/table/es/table/utils/index.js");
|
|
49536
|
+
/* harmony import */ var _utils_others__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/others */ "./node_modules/@kdcloudjs/table/es/table/utils/others.js");
|
|
49537
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
|
|
49538
|
+
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
|
|
49539
|
+
/* harmony import */ var _base_styles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../base/styles */ "./node_modules/@kdcloudjs/table/es/table/base/styles.js");
|
|
49540
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
49541
|
+
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_13__);
|
|
49542
|
+
|
|
49543
|
+
|
|
49471
49544
|
|
|
49472
49545
|
|
|
49473
49546
|
|
|
@@ -49482,9 +49555,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49482
49555
|
|
|
49483
49556
|
var rangeSelectionKey = 'rangeSelection';
|
|
49484
49557
|
var lastClickCellKey = 'lastClickCell';
|
|
49558
|
+
var startSelectedCellRangesKey = 'startSelectedCellRanges';
|
|
49559
|
+
var SCROLL_OFFSET = 30;
|
|
49485
49560
|
function rangeSelection(opts) {
|
|
49486
49561
|
return function step(pipeline) {
|
|
49487
|
-
var SCROLL_SIZE = 30;
|
|
49488
49562
|
var tableBody = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableBody;
|
|
49489
49563
|
var tableFooter = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.tableFooter;
|
|
49490
49564
|
var artTable = pipeline.ref.current.domHelper && pipeline.ref.current.domHelper.artTable;
|
|
@@ -49496,14 +49570,18 @@ function rangeSelection(opts) {
|
|
|
49496
49570
|
var columns = pipeline.getColumns();
|
|
49497
49571
|
var dataSource = pipeline.getDataSource();
|
|
49498
49572
|
|
|
49499
|
-
var rangeSelectedChange = function rangeSelectedChange(rangeSelection) {
|
|
49573
|
+
var rangeSelectedChange = function rangeSelectedChange(rangeSelection, isFinished) {
|
|
49500
49574
|
var _a;
|
|
49501
49575
|
|
|
49576
|
+
if (isFinished) {
|
|
49577
|
+
pipeline.setFeatureOptions(startSelectedCellRangesKey, rangeSelection);
|
|
49578
|
+
}
|
|
49579
|
+
|
|
49502
49580
|
pipeline.setStateAtKey(rangeSelectionKey, rangeSelection);
|
|
49503
|
-
(_a = opts === null || opts === void 0 ? void 0 : opts.rangeSelectedChange) === null || _a === void 0 ? void 0 : _a.call(opts, rangeSelection);
|
|
49581
|
+
(_a = opts === null || opts === void 0 ? void 0 : opts.rangeSelectedChange) === null || _a === void 0 ? void 0 : _a.call(opts, rangeSelection, isFinished);
|
|
49504
49582
|
};
|
|
49505
49583
|
|
|
49506
|
-
var setRangeSelection = function setRangeSelection(startDragCell, draggingCell) {
|
|
49584
|
+
var setRangeSelection = function setRangeSelection(startDragCell, draggingCell, isFinished) {
|
|
49507
49585
|
if (!startDragCell || !draggingCell) return;
|
|
49508
49586
|
var rangeColumns = getRangeColumns(startDragCell, draggingCell, columns);
|
|
49509
49587
|
|
|
@@ -49512,21 +49590,31 @@ function rangeSelection(opts) {
|
|
|
49512
49590
|
endRow = _getRangeSelectionRow.endRow,
|
|
49513
49591
|
footerRowRange = _getRangeSelectionRow.footerRowRange;
|
|
49514
49592
|
|
|
49515
|
-
var
|
|
49593
|
+
var cellRange = {
|
|
49516
49594
|
startRow: startRow,
|
|
49517
49595
|
endRow: endRow,
|
|
49518
49596
|
columns: rangeColumns,
|
|
49519
49597
|
startColumn: startDragCell.column,
|
|
49520
49598
|
footerRowRange: footerRowRange
|
|
49521
49599
|
};
|
|
49600
|
+
var cellRanges = pipeline.getFeatureOptions(startSelectedCellRangesKey) ? _babel_runtime_corejs3_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3___default()(pipeline.getFeatureOptions(startSelectedCellRangesKey)) : [];
|
|
49601
|
+
|
|
49602
|
+
if (isCellRangeSingleCell([cellRange])) {
|
|
49603
|
+
var singleCellRangeId = getCellRangeId(cellRange);
|
|
49604
|
+
cellRanges = _babel_runtime_corejs3_core_js_stable_instance_filter__WEBPACK_IMPORTED_MODULE_4___default()(cellRanges).call(cellRanges, function (item) {
|
|
49605
|
+
return getCellRangeId(item) !== singleCellRangeId;
|
|
49606
|
+
});
|
|
49607
|
+
}
|
|
49522
49608
|
|
|
49523
|
-
|
|
49524
|
-
|
|
49609
|
+
cellRanges.push(cellRange);
|
|
49610
|
+
|
|
49611
|
+
if (isCellRangeSingleCell(cellRanges)) {
|
|
49612
|
+
artTable.classList.remove(classnames__WEBPACK_IMPORTED_MODULE_13___default()(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].rangeSelection));
|
|
49525
49613
|
} else {
|
|
49526
|
-
artTable.classList.add(
|
|
49614
|
+
artTable.classList.add(classnames__WEBPACK_IMPORTED_MODULE_13___default()(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].rangeSelection));
|
|
49527
49615
|
}
|
|
49528
49616
|
|
|
49529
|
-
rangeSelectedChange(
|
|
49617
|
+
rangeSelectedChange(cellRanges, isFinished);
|
|
49530
49618
|
};
|
|
49531
49619
|
|
|
49532
49620
|
var shiftKeySelect = function shiftKeySelect(event) {
|
|
@@ -49534,81 +49622,115 @@ function rangeSelection(opts) {
|
|
|
49534
49622
|
var clickCell = getTargetCell(target, columns);
|
|
49535
49623
|
|
|
49536
49624
|
if (clickCell) {
|
|
49537
|
-
|
|
49538
|
-
var _lastClickCell = pipeline.getFeatureOptions(lastClickCellKey);
|
|
49625
|
+
var _lastClickCell = pipeline.getFeatureOptions(lastClickCellKey);
|
|
49539
49626
|
|
|
49540
|
-
|
|
49541
|
-
|
|
49542
|
-
} else {
|
|
49543
|
-
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
49544
|
-
pipeline.setFeatureOptions(lastClickCellKey, clickCell);
|
|
49545
|
-
}
|
|
49627
|
+
if (_lastClickCell) {
|
|
49628
|
+
setRangeSelection(_lastClickCell, clickCell, true);
|
|
49546
49629
|
} else {
|
|
49630
|
+
// 第一次进来就按住shift键,这时候要记住点击的单元格
|
|
49547
49631
|
pipeline.setFeatureOptions(lastClickCellKey, clickCell);
|
|
49548
|
-
setRangeSelection(clickCell, clickCell);
|
|
49549
49632
|
}
|
|
49550
49633
|
}
|
|
49551
49634
|
};
|
|
49552
49635
|
|
|
49553
|
-
var
|
|
49554
|
-
|
|
49555
|
-
|
|
49556
|
-
|
|
49557
|
-
shiftKeySelect(mouseDownEvent);
|
|
49558
|
-
if (mouseDownEvent.shiftKey) return;
|
|
49559
|
-
var target = mouseDownEvent.target;
|
|
49560
|
-
var startDragCell = getTargetCell(target, columns);
|
|
49561
|
-
var mousemove$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_8__["fromEvent"])(window, 'mousemove');
|
|
49562
|
-
var mouseup$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_8__["fromEvent"])(window, 'mouseup');
|
|
49636
|
+
var updateScrollPosition = function updateScrollPosition(client) {
|
|
49637
|
+
var clientX = client.clientX,
|
|
49638
|
+
clientY = client.clientY;
|
|
49563
49639
|
var tableBodyClientRect = tableBody.getBoundingClientRect();
|
|
49640
|
+
var left = tableBodyClientRect.left,
|
|
49641
|
+
top = tableBodyClientRect.top,
|
|
49642
|
+
height = tableBodyClientRect.height,
|
|
49643
|
+
width = tableBodyClientRect.width;
|
|
49564
49644
|
|
|
49565
|
-
|
|
49566
|
-
|
|
49567
|
-
|
|
49568
|
-
var left = tableBodyClientRect.left,
|
|
49569
|
-
top = tableBodyClientRect.top,
|
|
49570
|
-
height = tableBodyClientRect.height,
|
|
49571
|
-
width = tableBodyClientRect.width;
|
|
49645
|
+
if (clientX + SCROLL_OFFSET >= left + width) {
|
|
49646
|
+
pipeline.ref.current.domHelper.virtual.scrollLeft += SCROLL_OFFSET;
|
|
49647
|
+
}
|
|
49572
49648
|
|
|
49573
|
-
|
|
49574
|
-
|
|
49575
|
-
|
|
49649
|
+
if (clientX - SCROLL_OFFSET <= left) {
|
|
49650
|
+
pipeline.ref.current.domHelper.virtual.scrollLeft -= SCROLL_OFFSET;
|
|
49651
|
+
}
|
|
49576
49652
|
|
|
49577
|
-
|
|
49578
|
-
|
|
49579
|
-
|
|
49653
|
+
if (clientY + SCROLL_OFFSET >= top + height) {
|
|
49654
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop += SCROLL_OFFSET;
|
|
49655
|
+
}
|
|
49580
49656
|
|
|
49581
|
-
|
|
49582
|
-
|
|
49583
|
-
|
|
49657
|
+
if (clientY + SCROLL_OFFSET <= top) {
|
|
49658
|
+
pipeline.ref.current.domHelper.tableBody.scrollTop -= SCROLL_OFFSET;
|
|
49659
|
+
}
|
|
49660
|
+
};
|
|
49584
49661
|
|
|
49585
|
-
|
|
49586
|
-
|
|
49587
|
-
|
|
49588
|
-
|
|
49662
|
+
var setStartSelectedCellRanges = function setStartSelectedCellRanges(isCtrlKey, isShiftKey) {
|
|
49663
|
+
if (opts === null || opts === void 0 ? void 0 : opts.suppressMultiRangeSelection) {
|
|
49664
|
+
pipeline.setFeatureOptions(startSelectedCellRangesKey, []);
|
|
49665
|
+
return;
|
|
49666
|
+
} // ctrl 和shift 同时按时,优先生效shift
|
|
49667
|
+
// 没有点击ctrl 或者shift时,每次点击开始时都清空选中范围
|
|
49589
49668
|
|
|
49590
|
-
|
|
49669
|
+
|
|
49670
|
+
if (!isCtrlKey && !isShiftKey) {
|
|
49671
|
+
pipeline.setFeatureOptions(startSelectedCellRangesKey, []);
|
|
49672
|
+
} // shift 点击框选,要保留之前的选中结果。最新的框选范围覆盖最后一次的框选范围
|
|
49673
|
+
|
|
49674
|
+
|
|
49675
|
+
if (isShiftKey) {
|
|
49676
|
+
var _startDragCellRanges = pipeline.getFeatureOptions(startSelectedCellRangesKey) ? _babel_runtime_corejs3_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_3___default()(pipeline.getFeatureOptions(startSelectedCellRangesKey)) : [];
|
|
49677
|
+
|
|
49678
|
+
_startDragCellRanges.pop();
|
|
49679
|
+
|
|
49680
|
+
pipeline.setFeatureOptions(startSelectedCellRangesKey, _startDragCellRanges);
|
|
49681
|
+
}
|
|
49682
|
+
};
|
|
49683
|
+
|
|
49684
|
+
var onMouseDown = function onMouseDown(mouseDownEvent) {
|
|
49685
|
+
if (mouseDownEvent.button !== 0 || !(Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isElementInEventPath"])(tableBody, mouseDownEvent.nativeEvent) || Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isElementInEventPath"])(tableFooter, mouseDownEvent.nativeEvent))) return; // mouseDownEvent.preventDefault()
|
|
49686
|
+
|
|
49687
|
+
var isCtrlKey = mouseDownEvent.ctrlKey || mouseDownEvent.metaKey;
|
|
49688
|
+
var isShiftKey = mouseDownEvent.shiftKey;
|
|
49689
|
+
var target = mouseDownEvent.target; // 每次点击时先确认初始生效的框选范围
|
|
49690
|
+
|
|
49691
|
+
setStartSelectedCellRanges(isCtrlKey, isShiftKey);
|
|
49692
|
+
|
|
49693
|
+
if (isShiftKey) {
|
|
49694
|
+
shiftKeySelect(mouseDownEvent);
|
|
49695
|
+
return;
|
|
49696
|
+
}
|
|
49697
|
+
|
|
49698
|
+
var startDragCell = getTargetCell(target, columns);
|
|
49699
|
+
pipeline.setFeatureOptions(lastClickCellKey, startDragCell);
|
|
49700
|
+
var draggingCell = startDragCell;
|
|
49701
|
+
var mousemove$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_10__["fromEvent"])(window, 'mousemove');
|
|
49702
|
+
var mouseup$ = Object(rxjs__WEBPACK_IMPORTED_MODULE_10__["fromEvent"])(window, 'mouseup');
|
|
49703
|
+
var rangeSelected$ = mousemove$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_11__["map"])(function (mouseMoveEvent) {
|
|
49591
49704
|
var target = mouseMoveEvent.target || mouseMoveEvent.srcElement;
|
|
49592
|
-
|
|
49705
|
+
draggingCell = getTargetCell(target, columns);
|
|
49593
49706
|
var client = {
|
|
49594
49707
|
clientX: mouseMoveEvent.clientX,
|
|
49595
49708
|
clientY: mouseMoveEvent.clientY
|
|
49596
49709
|
};
|
|
49597
|
-
|
|
49710
|
+
|
|
49711
|
+
if (!(draggingCell === null || draggingCell === void 0 ? void 0 : draggingCell.isFooterCell)) {
|
|
49712
|
+
updateScrollPosition(client);
|
|
49713
|
+
}
|
|
49714
|
+
|
|
49598
49715
|
return {
|
|
49599
49716
|
startDragCell: startDragCell,
|
|
49600
49717
|
draggingCell: draggingCell
|
|
49601
49718
|
};
|
|
49602
|
-
}), Object(
|
|
49603
|
-
rangeSelected$.subscribe(
|
|
49604
|
-
|
|
49605
|
-
|
|
49606
|
-
|
|
49719
|
+
}), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_11__["takeUntil"])(mouseup$));
|
|
49720
|
+
rangeSelected$.subscribe({
|
|
49721
|
+
next: function next(_ref) {
|
|
49722
|
+
var startDragCell = _ref.startDragCell,
|
|
49723
|
+
draggingCell = _ref.draggingCell;
|
|
49724
|
+
setRangeSelection(startDragCell, draggingCell, false);
|
|
49725
|
+
},
|
|
49726
|
+
complete: function complete() {
|
|
49727
|
+
setRangeSelection(startDragCell, draggingCell, true);
|
|
49728
|
+
}
|
|
49607
49729
|
});
|
|
49608
49730
|
};
|
|
49609
49731
|
|
|
49610
49732
|
var onKeyDown = function onKeyDown(e) {
|
|
49611
|
-
if (!(Object(
|
|
49733
|
+
if (!(Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isElementInEventPath"])(tableBody, e.nativeEvent) || Object(_utils__WEBPACK_IMPORTED_MODULE_8__["isElementInEventPath"])(tableFooter, e.nativeEvent))) return;
|
|
49612
49734
|
|
|
49613
49735
|
if ((e.ctrlKey || e.metaKey) && e.key === 'a') {
|
|
49614
49736
|
var rowLen = pipeline.getDataSource().length;
|
|
@@ -49616,17 +49738,17 @@ function rangeSelection(opts) {
|
|
|
49616
49738
|
|
|
49617
49739
|
if (columns.length && rowLen && !getElementEditable(e.target)) {
|
|
49618
49740
|
opts.preventkDefaultOfKeyDownEvent !== false && e.preventDefault();
|
|
49619
|
-
artTable.classList.add(
|
|
49620
|
-
rangeSelectedChange({
|
|
49741
|
+
artTable.classList.add(classnames__WEBPACK_IMPORTED_MODULE_13___default()(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].rangeSelection));
|
|
49742
|
+
rangeSelectedChange([{
|
|
49621
49743
|
startRow: 0,
|
|
49622
49744
|
endRow: rowLen - 1,
|
|
49623
|
-
columns: Object(
|
|
49745
|
+
columns: Object(_utils__WEBPACK_IMPORTED_MODULE_8__["collectNodes"])(columns, 'leaf-only'),
|
|
49624
49746
|
startColumn: columns[0],
|
|
49625
49747
|
footerRowRange: footerDataSource.length > 0 ? {
|
|
49626
49748
|
startRow: 0,
|
|
49627
49749
|
endRow: footerDataSource.length - 1
|
|
49628
49750
|
} : null
|
|
49629
|
-
});
|
|
49751
|
+
}], true);
|
|
49630
49752
|
}
|
|
49631
49753
|
}
|
|
49632
49754
|
};
|
|
@@ -49635,46 +49757,26 @@ function rangeSelection(opts) {
|
|
|
49635
49757
|
onMouseDown: onMouseDown,
|
|
49636
49758
|
onKeyDown: onKeyDown,
|
|
49637
49759
|
tabIndex: -1,
|
|
49638
|
-
className:
|
|
49760
|
+
className: classnames__WEBPACK_IMPORTED_MODULE_13___default()([_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].rangeSelection])
|
|
49639
49761
|
}); // todo: 后面可以把mousedown放到一个流里面
|
|
49640
49762
|
|
|
49641
|
-
return pipeline.mapColumns(Object(
|
|
49642
|
-
var
|
|
49643
|
-
|
|
49644
|
-
var rangeSelection = pipeline.getStateAtKey(rangeSelectionKey);
|
|
49645
|
-
if (!rangeSelection || _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_3___default()(_context = rangeSelection.columns).call(_context, function (selectedCol) {
|
|
49646
|
-
return selectedCol.code === col.code;
|
|
49647
|
-
}) === -1) return col;
|
|
49763
|
+
return pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_8__["makeRecursiveMapper"])(function (col) {
|
|
49764
|
+
var cellRanges = pipeline.getStateAtKey(rangeSelectionKey) || [];
|
|
49648
49765
|
var prevGetCellProps = col.getCellProps;
|
|
49649
49766
|
return _babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()(_babel_runtime_corejs3_helpers_extends__WEBPACK_IMPORTED_MODULE_2___default()({}, col), {
|
|
49650
49767
|
getCellProps: function getCellProps(value, record, rowIndex) {
|
|
49651
|
-
var _cx;
|
|
49652
|
-
|
|
49653
49768
|
var prevCellProps = prevGetCellProps === null || prevGetCellProps === void 0 ? void 0 : prevGetCellProps(value, record, rowIndex);
|
|
49654
|
-
var
|
|
49655
|
-
|
|
49656
|
-
|
|
49657
|
-
|
|
49658
|
-
|
|
49659
|
-
|
|
49660
|
-
|
|
49661
|
-
|
|
49662
|
-
|
|
49663
|
-
|
|
49664
|
-
|
|
49665
|
-
footerStartRowIndex = _getFooterRowIndex.startRowIndex,
|
|
49666
|
-
footerEndRowIndex = _getFooterRowIndex.endRowIndex;
|
|
49667
|
-
|
|
49668
|
-
var startCol = columns[0];
|
|
49669
|
-
var endCol = columns[columns.length - 1];
|
|
49670
|
-
var bodyMatch = !isInFooter && rowIndex >= startRowIndex && rowIndex <= endRowIndex;
|
|
49671
|
-
var footerMatch = isInFooter && footerRowRange && rowIndex >= footerStartRowIndex && rowIndex <= footerEndRowIndex;
|
|
49672
|
-
var match = footerMatch || bodyMatch;
|
|
49673
|
-
var matchSingleCell = match && isCellRangeSingleCell(rangeSelection); // 单个范围选中单元格不显示样式
|
|
49674
|
-
|
|
49675
|
-
var showCellRangeStyle = match && !matchSingleCell;
|
|
49676
|
-
var className = classnames__WEBPACK_IMPORTED_MODULE_11___default()((_cx = {}, _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeSingleCell, matchSingleCell), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeSelected, showCellRangeStyle), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeTop, showCellRangeStyle && (isInFooter ? startRowIndex !== -1 ? false : rowIndex === footerStartRowIndex : rowIndex === startRowIndex)), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeLeft, showCellRangeStyle && col.code === startCol.code), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeBottom, showCellRangeStyle && (isInFooter ? rowIndex === footerEndRowIndex : footerRowRange ? false : rowIndex === endRowIndex)), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_10__["Classes"].tableCellRangeRight, showCellRangeStyle && col.code === endCol.code), _cx));
|
|
49677
|
-
return Object(_utils__WEBPACK_IMPORTED_MODULE_6__["mergeCellProps"])(prevCellProps, {
|
|
49769
|
+
var isFooterCell = record[pipeline.getFeatureOptions('footerRowMetaKey')];
|
|
49770
|
+
if (!cellRanges.some(function (cellRange) {
|
|
49771
|
+
return isCellInRange(cellRange, rowIndex, col, isFooterCell);
|
|
49772
|
+
})) return prevCellProps;
|
|
49773
|
+
var className = getCellRangesClassName(cellRanges, {
|
|
49774
|
+
isFooterCell: isFooterCell,
|
|
49775
|
+
rowIndex: rowIndex,
|
|
49776
|
+
col: col,
|
|
49777
|
+
record: record
|
|
49778
|
+
});
|
|
49779
|
+
return Object(_utils__WEBPACK_IMPORTED_MODULE_8__["mergeCellProps"])(prevCellProps, {
|
|
49678
49780
|
className: className
|
|
49679
49781
|
});
|
|
49680
49782
|
}
|
|
@@ -49688,7 +49790,7 @@ function getTargetCell(target, columns) {
|
|
|
49688
49790
|
if (target.getAttribute('data-role') === 'table-cell') {
|
|
49689
49791
|
var _ret = function () {
|
|
49690
49792
|
var columnCode = target.getAttribute('data-code');
|
|
49691
|
-
var column = Object(
|
|
49793
|
+
var column = Object(_utils_others__WEBPACK_IMPORTED_MODULE_9__["findByTree"])(columns, function (item, index) {
|
|
49692
49794
|
return item.code === columnCode;
|
|
49693
49795
|
});
|
|
49694
49796
|
if (!column) return {
|
|
@@ -49700,12 +49802,12 @@ function getTargetCell(target, columns) {
|
|
|
49700
49802
|
rowSpan: parseInt(target.getAttribute('rowspan') || 1),
|
|
49701
49803
|
code: columnCode,
|
|
49702
49804
|
column: column,
|
|
49703
|
-
|
|
49805
|
+
isFooterCell: isEleInFooter(target)
|
|
49704
49806
|
}
|
|
49705
49807
|
};
|
|
49706
49808
|
}();
|
|
49707
49809
|
|
|
49708
|
-
if (
|
|
49810
|
+
if (_babel_runtime_corejs3_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(_ret) === "object") return _ret.v;
|
|
49709
49811
|
}
|
|
49710
49812
|
|
|
49711
49813
|
target = target.parentElement;
|
|
@@ -49715,12 +49817,12 @@ function getTargetCell(target, columns) {
|
|
|
49715
49817
|
}
|
|
49716
49818
|
|
|
49717
49819
|
function isSameCell(cell1, cell2) {
|
|
49718
|
-
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code && cell1.
|
|
49820
|
+
return cell1.rowIndex === cell2.rowIndex && cell1.code === cell2.code && cell1.isFooterCell === cell2.isFooterCell;
|
|
49719
49821
|
}
|
|
49720
49822
|
|
|
49721
49823
|
function isEleInFooter(target) {
|
|
49722
|
-
while (target && !target.classList.contains(
|
|
49723
|
-
if (target.classList.contains(
|
|
49824
|
+
while (target && !target.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].artTable)) {
|
|
49825
|
+
if (target.classList.contains(_base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableFooter)) {
|
|
49724
49826
|
return true;
|
|
49725
49827
|
}
|
|
49726
49828
|
|
|
@@ -49731,20 +49833,20 @@ function isEleInFooter(target) {
|
|
|
49731
49833
|
}
|
|
49732
49834
|
|
|
49733
49835
|
function getRangeColumns(startCell, endCell, columns) {
|
|
49734
|
-
var flatColumns = Object(
|
|
49836
|
+
var flatColumns = Object(_utils__WEBPACK_IMPORTED_MODULE_8__["collectNodes"])(columns, 'leaf-only');
|
|
49735
49837
|
|
|
49736
|
-
var startIndex =
|
|
49838
|
+
var startIndex = _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5___default()(flatColumns).call(flatColumns, function (col) {
|
|
49737
49839
|
return col.code === startCell.code;
|
|
49738
49840
|
});
|
|
49739
49841
|
|
|
49740
|
-
var endIndex =
|
|
49842
|
+
var endIndex = _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5___default()(flatColumns).call(flatColumns, function (col) {
|
|
49741
49843
|
return col.code === endCell.code;
|
|
49742
49844
|
});
|
|
49743
49845
|
|
|
49744
49846
|
if (startIndex < endIndex) {
|
|
49745
|
-
return
|
|
49847
|
+
return _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_6___default()(flatColumns).call(flatColumns, startIndex, endIndex + 1);
|
|
49746
49848
|
} else {
|
|
49747
|
-
return
|
|
49849
|
+
return _babel_runtime_corejs3_core_js_stable_instance_slice__WEBPACK_IMPORTED_MODULE_6___default()(flatColumns).call(flatColumns, endIndex, startIndex + 1);
|
|
49748
49850
|
}
|
|
49749
49851
|
}
|
|
49750
49852
|
|
|
@@ -49758,10 +49860,10 @@ function getRangeSelectionRowInfo(startCell, endCell, dataSource) {
|
|
|
49758
49860
|
_endRow = _getCellRangeRow.endRow; // 两个单元格都在表体
|
|
49759
49861
|
|
|
49760
49862
|
|
|
49761
|
-
if (!startCell.
|
|
49863
|
+
if (!startCell.isFooterCell && !endCell.isFooterCell) {
|
|
49762
49864
|
startRow = _startRow;
|
|
49763
49865
|
endRow = _endRow;
|
|
49764
|
-
} else if (startCell.
|
|
49866
|
+
} else if (startCell.isFooterCell && endCell.isFooterCell) {
|
|
49765
49867
|
// 两个单元格都在表底
|
|
49766
49868
|
footerRowRange = {
|
|
49767
49869
|
startRow: _startRow,
|
|
@@ -49769,7 +49871,7 @@ function getRangeSelectionRowInfo(startCell, endCell, dataSource) {
|
|
|
49769
49871
|
};
|
|
49770
49872
|
} else {
|
|
49771
49873
|
// 一个单元格在表体,一个在表底
|
|
49772
|
-
if (startCell.
|
|
49874
|
+
if (startCell.isFooterCell) {
|
|
49773
49875
|
startRow = dataSource.length - 1;
|
|
49774
49876
|
endRow = endCell.rowIndex;
|
|
49775
49877
|
footerRowRange = {
|
|
@@ -49792,6 +49894,13 @@ function getRangeSelectionRowInfo(startCell, endCell, dataSource) {
|
|
|
49792
49894
|
footerRowRange: footerRowRange
|
|
49793
49895
|
};
|
|
49794
49896
|
}
|
|
49897
|
+
/**
|
|
49898
|
+
* 获取框选范围的起始结束行
|
|
49899
|
+
* @param startCell 起始单元格
|
|
49900
|
+
* @param endCell 结束单元格
|
|
49901
|
+
* @returns
|
|
49902
|
+
*/
|
|
49903
|
+
|
|
49795
49904
|
|
|
49796
49905
|
function getCellRangeRow(startCell, endCell) {
|
|
49797
49906
|
if (isSameCell(startCell, endCell)) {
|
|
@@ -49809,12 +49918,20 @@ function getCellRangeRow(startCell, endCell) {
|
|
|
49809
49918
|
endRow: endRow
|
|
49810
49919
|
};
|
|
49811
49920
|
}
|
|
49921
|
+
/**
|
|
49922
|
+
* 框选范围是否只包含单个单元格
|
|
49923
|
+
* @param cellRanges
|
|
49924
|
+
* @returns
|
|
49925
|
+
*/
|
|
49926
|
+
|
|
49812
49927
|
|
|
49813
|
-
function isCellRangeSingleCell(
|
|
49814
|
-
|
|
49815
|
-
|
|
49816
|
-
|
|
49817
|
-
|
|
49928
|
+
function isCellRangeSingleCell(cellRanges) {
|
|
49929
|
+
if (cellRanges.length !== 1) return false;
|
|
49930
|
+
var _cellRanges$ = cellRanges[0],
|
|
49931
|
+
startRow = _cellRanges$.startRow,
|
|
49932
|
+
endRow = _cellRanges$.endRow,
|
|
49933
|
+
columns = _cellRanges$.columns,
|
|
49934
|
+
footerRowRange = _cellRanges$.footerRowRange;
|
|
49818
49935
|
var isBodySingleCell = !footerRowRange && startRow === endRow && columns.length === 1;
|
|
49819
49936
|
var isFooterSingleCell = startRow === -1 && footerRowRange.startRow === footerRowRange.endRow && columns.length === 1;
|
|
49820
49937
|
return isBodySingleCell || isFooterSingleCell;
|
|
@@ -49842,15 +49959,143 @@ function getFooterRowIndex(footerRowRange) {
|
|
|
49842
49959
|
}
|
|
49843
49960
|
|
|
49844
49961
|
function getElementEditable(target) {
|
|
49845
|
-
var
|
|
49962
|
+
var _context;
|
|
49846
49963
|
|
|
49847
49964
|
if (!target) return;
|
|
49848
49965
|
|
|
49849
|
-
if (
|
|
49966
|
+
if (_babel_runtime_corejs3_core_js_stable_instance_includes__WEBPACK_IMPORTED_MODULE_7___default()(_context = ['input', 'textarea']).call(_context, target.tagName.toLowerCase())) {
|
|
49850
49967
|
if (target.type === 'checkbox') return;
|
|
49851
49968
|
return !target.disabled && !target.readOnly;
|
|
49852
49969
|
}
|
|
49853
49970
|
}
|
|
49971
|
+
/**
|
|
49972
|
+
* 判断单元格是否在框选范围内
|
|
49973
|
+
* @param cellRange
|
|
49974
|
+
* @param rowIndex
|
|
49975
|
+
* @param col
|
|
49976
|
+
* @param isFooterCell
|
|
49977
|
+
* @returns
|
|
49978
|
+
*/
|
|
49979
|
+
|
|
49980
|
+
|
|
49981
|
+
function isCellInRange(cellRange, rowIndex, col, isFooterCell) {
|
|
49982
|
+
var startRow = cellRange.startRow,
|
|
49983
|
+
endRow = cellRange.endRow,
|
|
49984
|
+
columns = cellRange.columns,
|
|
49985
|
+
footerRowRange = cellRange.footerRowRange;
|
|
49986
|
+
var isColInRanges = _babel_runtime_corejs3_core_js_stable_instance_find_index__WEBPACK_IMPORTED_MODULE_5___default()(columns).call(columns, function (item) {
|
|
49987
|
+
return item.code === col.code;
|
|
49988
|
+
}) !== -1;
|
|
49989
|
+
if (!isColInRanges) return false;
|
|
49990
|
+
|
|
49991
|
+
var _getRowIndex = getRowIndex(startRow, endRow),
|
|
49992
|
+
startRowIndex = _getRowIndex.startRowIndex,
|
|
49993
|
+
endRowIndex = _getRowIndex.endRowIndex;
|
|
49994
|
+
|
|
49995
|
+
var _getFooterRowIndex = getFooterRowIndex(footerRowRange),
|
|
49996
|
+
footerStartRowIndex = _getFooterRowIndex.startRowIndex,
|
|
49997
|
+
footerEndRowIndex = _getFooterRowIndex.endRowIndex;
|
|
49998
|
+
|
|
49999
|
+
var bodyMatch = !isFooterCell && rowIndex >= startRowIndex && rowIndex <= endRowIndex;
|
|
50000
|
+
var footerMatch = isFooterCell && footerRowRange && rowIndex >= footerStartRowIndex && rowIndex <= footerEndRowIndex;
|
|
50001
|
+
var isRowInRange = footerMatch || bodyMatch;
|
|
50002
|
+
return isRowInRange;
|
|
50003
|
+
}
|
|
50004
|
+
/**
|
|
50005
|
+
* 获取框选范围唯一标识
|
|
50006
|
+
* @param {*} cellRange
|
|
50007
|
+
* @returns
|
|
50008
|
+
*/
|
|
50009
|
+
|
|
50010
|
+
|
|
50011
|
+
function getCellRangeId(cellRange) {
|
|
50012
|
+
var startRow = cellRange.startRow,
|
|
50013
|
+
endRow = cellRange.endRow,
|
|
50014
|
+
footerRowRange = cellRange.footerRowRange,
|
|
50015
|
+
columns = cellRange.columns;
|
|
50016
|
+
|
|
50017
|
+
var _getRowIndex2 = getRowIndex(startRow, endRow),
|
|
50018
|
+
startRowIndex = _getRowIndex2.startRowIndex,
|
|
50019
|
+
endRowIndex = _getRowIndex2.endRowIndex;
|
|
50020
|
+
|
|
50021
|
+
var _getFooterRowIndex2 = getFooterRowIndex(footerRowRange),
|
|
50022
|
+
footerStartRowIndex = _getFooterRowIndex2.startRowIndex,
|
|
50023
|
+
footerEndRowIndex = _getFooterRowIndex2.endRowIndex;
|
|
50024
|
+
|
|
50025
|
+
var firstColId = columns[0].code;
|
|
50026
|
+
var endColId = columns[columns.length - 1].code;
|
|
50027
|
+
return startRowIndex + '_' + endRowIndex + '_' + footerStartRowIndex + '_' + footerEndRowIndex + '_' + firstColId + '_' + endColId;
|
|
50028
|
+
}
|
|
50029
|
+
/**
|
|
50030
|
+
* 获取框选范围中单元格的样式
|
|
50031
|
+
* @param cellRanges
|
|
50032
|
+
* @param param1
|
|
50033
|
+
* @returns
|
|
50034
|
+
*/
|
|
50035
|
+
|
|
50036
|
+
function getCellRangesClassName(cellRanges, _ref2) {
|
|
50037
|
+
var _cx;
|
|
50038
|
+
|
|
50039
|
+
var isFooterCell = _ref2.isFooterCell,
|
|
50040
|
+
rowIndex = _ref2.rowIndex,
|
|
50041
|
+
col = _ref2.col,
|
|
50042
|
+
record = _ref2.record;
|
|
50043
|
+
|
|
50044
|
+
var _getMatchBorderStyle = getMatchBorderStyle(cellRanges, {
|
|
50045
|
+
isFooterCell: isFooterCell,
|
|
50046
|
+
rowIndex: rowIndex,
|
|
50047
|
+
col: col,
|
|
50048
|
+
record: record
|
|
50049
|
+
}),
|
|
50050
|
+
matchCellRangeTop = _getMatchBorderStyle.matchCellRangeTop,
|
|
50051
|
+
matchCellRangeLeft = _getMatchBorderStyle.matchCellRangeLeft,
|
|
50052
|
+
matchCellRangeBottom = _getMatchBorderStyle.matchCellRangeBottom,
|
|
50053
|
+
matchCellRangeRight = _getMatchBorderStyle.matchCellRangeRight;
|
|
50054
|
+
|
|
50055
|
+
var isSingleCell = isCellRangeSingleCell(cellRanges);
|
|
50056
|
+
var className = classnames__WEBPACK_IMPORTED_MODULE_13___default()((_cx = {}, _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeSingleCell, isSingleCell), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeSelected, !isSingleCell), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeTop, !isSingleCell && matchCellRangeTop), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeLeft, !isSingleCell && matchCellRangeLeft), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeBottom, !isSingleCell && matchCellRangeBottom), _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cx, _base_styles__WEBPACK_IMPORTED_MODULE_12__["Classes"].tableCellRangeRight, !isSingleCell && matchCellRangeRight), _cx));
|
|
50057
|
+
return className;
|
|
50058
|
+
}
|
|
50059
|
+
|
|
50060
|
+
function getMatchBorderStyle(cellRanges, _ref3) {
|
|
50061
|
+
var isFooterCell = _ref3.isFooterCell,
|
|
50062
|
+
rowIndex = _ref3.rowIndex,
|
|
50063
|
+
col = _ref3.col,
|
|
50064
|
+
record = _ref3.record;
|
|
50065
|
+
return cellRanges.reduce(function (obj, cellRange) {
|
|
50066
|
+
if (!isCellInRange(cellRange, rowIndex, col, isFooterCell)) return obj;
|
|
50067
|
+
var startRow = cellRange.startRow,
|
|
50068
|
+
endRow = cellRange.endRow,
|
|
50069
|
+
columns = cellRange.columns,
|
|
50070
|
+
footerRowRange = cellRange.footerRowRange;
|
|
50071
|
+
|
|
50072
|
+
var _getRowIndex3 = getRowIndex(startRow, endRow),
|
|
50073
|
+
startRowIndex = _getRowIndex3.startRowIndex,
|
|
50074
|
+
endRowIndex = _getRowIndex3.endRowIndex;
|
|
50075
|
+
|
|
50076
|
+
var _getFooterRowIndex3 = getFooterRowIndex(footerRowRange),
|
|
50077
|
+
footerStartRowIndex = _getFooterRowIndex3.startRowIndex,
|
|
50078
|
+
footerEndRowIndex = _getFooterRowIndex3.endRowIndex;
|
|
50079
|
+
|
|
50080
|
+
var startCol = columns[0];
|
|
50081
|
+
var endCol = columns[columns.length - 1];
|
|
50082
|
+
var matchCellRangeTop = isFooterCell ? startRowIndex !== -1 ? false : rowIndex === footerStartRowIndex : rowIndex === startRowIndex;
|
|
50083
|
+
var matchCellRangeLeft = col.code === startCol.code;
|
|
50084
|
+
var matchCellRangeBottom = isFooterCell ? rowIndex === footerEndRowIndex : footerRowRange ? false : rowIndex === endRowIndex;
|
|
50085
|
+
var matchCellRangeRight = col.code === endCol.code; // 如果样式已经匹配上了,就不需要再取计算的样式
|
|
50086
|
+
|
|
50087
|
+
obj.matchCellRangeTop = obj.matchCellRangeTop || matchCellRangeTop;
|
|
50088
|
+
obj.matchCellRangeLeft = obj.matchCellRangeLeft || matchCellRangeLeft;
|
|
50089
|
+
obj.matchCellRangeBottom = obj.matchCellRangeBottom || matchCellRangeBottom;
|
|
50090
|
+
obj.matchCellRangeRight = obj.matchCellRangeRight || matchCellRangeRight;
|
|
50091
|
+
return obj;
|
|
50092
|
+
}, {
|
|
50093
|
+
matchCellRangeTop: false,
|
|
50094
|
+
matchCellRangeLeft: false,
|
|
50095
|
+
matchCellRangeBottom: false,
|
|
50096
|
+
matchCellRangeRight: false
|
|
50097
|
+
});
|
|
50098
|
+
}
|
|
49854
50099
|
|
|
49855
50100
|
/***/ }),
|
|
49856
50101
|
|