@kdcloudjs/table 1.2.1-canary.4 → 1.2.1-canary.6

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.1-canary.3
3
+ * @kdcloudjs/table v1.2.1-canary.5
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @kdcloudjs/table v1.2.1-canary.3
3
+ * @kdcloudjs/table v1.2.1-canary.5
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -8696,8 +8696,7 @@ function rangeSelection(opts) {
8696
8696
  pipeline.addTableProps({
8697
8697
  onMouseDown: onMouseDown,
8698
8698
  onKeyDown: onKeyDown,
8699
- tabIndex: -1,
8700
- className: classnames__WEBPACK_IMPORTED_MODULE_18___default()([_base_styles__WEBPACK_IMPORTED_MODULE_17__["Classes"].rangeSelection])
8699
+ tabIndex: -1
8701
8700
  }); // todo: 后面可以把mousedown放到一个流里面
8702
8701
 
8703
8702
  return pipeline.mapColumns(Object(_utils__WEBPACK_IMPORTED_MODULE_13__["makeRecursiveMapper"])(function (col) {
@@ -9470,11 +9469,11 @@ function rowDrag(opt) {
9470
9469
  pipeline.setStateAtKey(rowDragKey, event);
9471
9470
  };
9472
9471
 
9473
- var handleDragEnd = function handleDragEnd(event, isOutOfRange) {
9472
+ var handleDragEnd = function handleDragEnd(event, isValid) {
9474
9473
  artTable.classList.remove(classnames__WEBPACK_IMPORTED_MODULE_6___default()(_base_styles__WEBPACK_IMPORTED_MODULE_7__["Classes"].rowDragging));
9475
9474
  pipeline.setStateAtKey(rowDragKey, event); // 超出拖拽范围不触发dragend事件
9476
9475
 
9477
- if (!isOutOfRange) {
9476
+ if (isValid) {
9478
9477
  var _opt$onDragEnd;
9479
9478
 
9480
9479
  opt === null || opt === void 0 ? void 0 : (_opt$onDragEnd = opt.onDragEnd) === null || _opt$onDragEnd === void 0 ? void 0 : _opt$onDragEnd.call(opt, event);
@@ -9521,6 +9520,7 @@ function rowDrag(opt) {
9521
9520
 
9522
9521
  var dragPosition = 'bottom';
9523
9522
  var isOutOfRange = false;
9523
+ var isValidDrag = false;
9524
9524
  var dragStartEvent = getDragEvent(startRowInfo, endRowInfo, {
9525
9525
  isFinished: false,
9526
9526
  dragPosition: 'bottom'
@@ -9529,6 +9529,7 @@ function rowDrag(opt) {
9529
9529
  var tableWidth = tableBody.clientWidth;
9530
9530
  var startRowRects = startRowInfo.cell.getBoundingClientRect(); // 光标位置距离初始拖拽行的偏移量
9531
9531
 
9532
+ var mouseDownClientY = mouseDownEvent.clientY;
9532
9533
  var startOffset = mouseDownEvent.clientY - startRowRects.top;
9533
9534
  var dragElement = createDragElement(startRowRects, tableWidth, rowHeight); // 可拖拽的范围
9534
9535
 
@@ -9555,7 +9556,15 @@ function rowDrag(opt) {
9555
9556
  };
9556
9557
 
9557
9558
  document.addEventListener('scroll', scrollCallback, true);
9558
- var rowDrag$ = mousemove$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (mouseMoveEvent) {
9559
+ var rowDrag$ = mousemove$.pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["filter"])(function (mouseMoveEvent) {
9560
+ var mouseMoveClientY = mouseMoveEvent.clientY; // 上下移动偏移量大于5才是有效的拖拽
9561
+
9562
+ if (Math.abs(mouseMoveClientY - mouseDownClientY) > 5) {
9563
+ isValidDrag = true;
9564
+ }
9565
+
9566
+ return isValidDrag;
9567
+ }), Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_5__["map"])(function (mouseMoveEvent) {
9559
9568
  var clientX = mouseMoveEvent.clientX,
9560
9569
  clientY = mouseMoveEvent.clientY;
9561
9570
  var tagretRow = getTargetRowInfo(mouseMoveEvent.target, tableBody, dataSource);
@@ -9606,7 +9615,8 @@ function rowDrag(opt) {
9606
9615
  isFinished: true,
9607
9616
  dragPosition: dragPosition
9608
9617
  });
9609
- handleDragEnd(dragEndEvent, isOutOfRange);
9618
+ var isValid = isValidDrag && !isOutOfRange;
9619
+ handleDragEnd(dragEndEvent, isValid);
9610
9620
  removeDragElement(dragElement);
9611
9621
  removeCurSorStyle();
9612
9622
  document.removeEventListener('scroll', scrollCallback, true);
@@ -13656,7 +13666,7 @@ __webpack_require__.r(__webpack_exports__);
13656
13666
  /*
13657
13667
  * @Author: wqhui
13658
13668
  * @Date: 2022-05-13 17:06:51
13659
- * @LastEditTime: 2024-05-06 16:18:12
13669
+ * @LastEditTime: 2024-05-29 16:25:48
13660
13670
  * @Description:
13661
13671
  */
13662
13672
  var browserData = getBrowserData();
@@ -13713,7 +13723,11 @@ function getBrowserData() {
13713
13723
 
13714
13724
 
13715
13725
  if (!browser.name) {
13716
- if (match = ua.match(/MSIE\s(.*?);/)) {
13726
+ if (/Trident\/(\d+)/.test(ua)) {
13727
+ browser.name = 'IE';
13728
+ match = ua.match(/Trident.*rv:([\d.]+)/) || [];
13729
+ browser.version = match[1];
13730
+ } else if (match = ua.match(/MSIE\s(.*?);/)) {
13717
13731
  browser.name = 'IE';
13718
13732
  browser.version = match[1];
13719
13733
  }