@kdcloudjs/table 1.2.0-canary.10 → 1.2.0-canary.11

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.0-canary.9
3
+ * @kdcloudjs/table v1.2.0-canary.10
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.0-canary.9
3
+ * @kdcloudjs/table v1.2.0-canary.10
4
4
  *
5
5
  * Copyright 2020-present, Kingdee, Inc.
6
6
  * All rights reserved.
@@ -5164,7 +5164,9 @@ function getColumnWidthSum(pipeline) {
5164
5164
  }
5165
5165
 
5166
5166
  function getTableRemainingWidth(pipeline) {
5167
- var tableWidth = pipeline.getStateAtKey(tableWidthKey);
5167
+ var _pipeline$ref$current, _pipeline$ref$current2;
5168
+
5169
+ var tableWidth = ((_pipeline$ref$current = pipeline.ref.current.domHelper) === null || _pipeline$ref$current === void 0 ? void 0 : (_pipeline$ref$current2 = _pipeline$ref$current.tableBody) === null || _pipeline$ref$current2 === void 0 ? void 0 : _pipeline$ref$current2.clientWidth) || pipeline.getStateAtKey(tableWidthKey);
5168
5170
  if (!tableWidth) return;
5169
5171
  var remainingWidth = Math.floor(tableWidth - getColumnWidthSum(pipeline));
5170
5172
  return remainingWidth > 0 ? remainingWidth : 0;
@@ -5851,9 +5853,14 @@ function columnDrag() {
5851
5853
  var onColumnDragStopped = opts.onColumnDragStopped; // 拖拽结束返回列顺序
5852
5854
 
5853
5855
  if (onColumnDragStopped) {
5856
+ var isRowDragColumn = function isRowDragColumn(code) {
5857
+ var rowDragColumnKey = pipeline.getFeatureOptions('rowDragColumnKey');
5858
+ return code === rowDragColumnKey;
5859
+ };
5860
+
5854
5861
  var newColumns = sortColumns(columns, cloumnsSortData).filter(function (_ref) {
5855
5862
  var code = _ref.code;
5856
- return code !== _autoFill__WEBPACK_IMPORTED_MODULE_11__["FILL_COLUMN_CODE"];
5863
+ return code !== _autoFill__WEBPACK_IMPORTED_MODULE_11__["FILL_COLUMN_CODE"] && !isRowDragColumn(code);
5857
5864
  }); // TODO drag需要在resize之后use,否则这里返回的列对应的宽度不是拖拽后的
5858
5865
 
5859
5866
  onColumnDragStopped(columnMoved, newColumns);
@@ -9423,6 +9430,7 @@ function rowDrag(opt) {
9423
9430
  };
9424
9431
 
9425
9432
  var updateScrollPosition = function updateScrollPosition(mouseMoveEvent) {
9433
+ if (opt !== null && opt !== void 0 && opt.suppressScrollMove) return;
9426
9434
  var clientY = mouseMoveEvent.clientY;
9427
9435
  var tableBodyClientRect = tableBody.getBoundingClientRect();
9428
9436
  var top = tableBodyClientRect.top,
@@ -9519,6 +9527,7 @@ function rowDrag(opt) {
9519
9527
  };
9520
9528
 
9521
9529
  var rowDragColumn = (opt === null || opt === void 0 ? void 0 : opt.rowDragColumn) || defaultRowDragColumn;
9530
+ pipeline.setFeatureOptions('rowDragColumnKey', rowDragColumn.code);
9522
9531
  var nextColumns = pipeline.getColumns().slice();
9523
9532
  nextColumns.unshift(rowDragColumn);
9524
9533
  pipeline.columns(nextColumns);