@kdcloudjs/table 1.1.3-canary.2 → 1.1.3-canary.3

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.
@@ -7,6 +7,10 @@ import { FILL_COLUMN_CODE } from './autoFill';
7
7
  var stateKey = 'columnDrag';
8
8
  var SCROLL_SIZE = 30;
9
9
 
10
+ function disableSelect(event) {
11
+ event.preventDefault();
12
+ }
13
+
10
14
  function sortColumns(columns, sort) {
11
15
  var res = new Array(columns.length);
12
16
 
@@ -63,7 +67,9 @@ export function columnDrag() {
63
67
  onMouseDown: !isLeaf || path.length > 1 ? undefined : function (e) {
64
68
  if (e.button !== 0) {
65
69
  return;
66
- } // const cx = e.clientX
70
+ }
71
+
72
+ window.addEventListener('selectstart', disableSelect); // const cx = e.clientX
67
73
  // const width = col.width
68
74
  // const a = startIndex
69
75
  // const b = endIndex
@@ -72,7 +78,6 @@ export function columnDrag() {
72
78
  // let newStartIndex = startIndex
73
79
  // let endIdx = endIndex
74
80
 
75
-
76
81
  var columnMoved = false;
77
82
  var columns = pipeline.getColumns();
78
83
 
@@ -245,6 +250,7 @@ export function columnDrag() {
245
250
  e.stopPropagation();
246
251
  document.body.removeEventListener('mousemove', handleMouseMove);
247
252
  document.body.removeEventListener('mouseup', handleMouseUp);
253
+ window.removeEventListener('selectstart', disableSelect);
248
254
  window.requestAnimationFrame(function () {
249
255
  // 取消阻止列头点击事件
250
256
  currentTarget.removeEventListener('click', stopClickPropagation);
@@ -330,10 +336,6 @@ export function columnDrag() {
330
336
 
331
337
  document.body.addEventListener('mousemove', handleMouseMove);
332
338
  document.body.addEventListener('mouseup', handleMouseUp);
333
-
334
- document.body.onselectstart = function () {
335
- return false;
336
- };
337
339
  },
338
340
  style: style
339
341
  })
@@ -22,6 +22,10 @@ var _autoFill = require("./autoFill");
22
22
  var stateKey = 'columnDrag';
23
23
  var SCROLL_SIZE = 30;
24
24
 
25
+ function disableSelect(event) {
26
+ event.preventDefault();
27
+ }
28
+
25
29
  function sortColumns(columns, sort) {
26
30
  var res = new Array(columns.length);
27
31
  var lastColumns = (0, _toConsumableArray2.default)(columns);
@@ -77,7 +81,9 @@ function columnDrag() {
77
81
  onMouseDown: !isLeaf || path.length > 1 ? undefined : function (e) {
78
82
  if (e.button !== 0) {
79
83
  return;
80
- } // const cx = e.clientX
84
+ }
85
+
86
+ window.addEventListener('selectstart', disableSelect); // const cx = e.clientX
81
87
  // const width = col.width
82
88
  // const a = startIndex
83
89
  // const b = endIndex
@@ -86,7 +92,6 @@ function columnDrag() {
86
92
  // let newStartIndex = startIndex
87
93
  // let endIdx = endIndex
88
94
 
89
-
90
95
  var columnMoved = false;
91
96
  var columns = pipeline.getColumns();
92
97
 
@@ -259,6 +264,7 @@ function columnDrag() {
259
264
  e.stopPropagation();
260
265
  document.body.removeEventListener('mousemove', handleMouseMove);
261
266
  document.body.removeEventListener('mouseup', handleMouseUp);
267
+ window.removeEventListener('selectstart', disableSelect);
262
268
  window.requestAnimationFrame(function () {
263
269
  // 取消阻止列头点击事件
264
270
  currentTarget.removeEventListener('click', stopClickPropagation);
@@ -343,10 +349,6 @@ function columnDrag() {
343
349
 
344
350
  document.body.addEventListener('mousemove', handleMouseMove);
345
351
  document.body.addEventListener('mouseup', handleMouseUp);
346
-
347
- document.body.onselectstart = function () {
348
- return false;
349
- };
350
352
  },
351
353
  style: style
352
354
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/table",
3
- "version": "1.1.3-canary.2",
3
+ "version": "1.1.3-canary.3",
4
4
  "description": "金蝶 react table 组件",
5
5
  "title": "table",
6
6
  "keywords": [