vxe-table 3.12.10-beta.9 → 3.12.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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +4 -3
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -7
- package/es/table/module/export/mixin.js +105 -69
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +114 -87
- package/es/table/src/cell.js +43 -57
- package/es/table/src/column.js +43 -8
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/footer.js +47 -6
- package/es/table/src/header.js +67 -165
- package/es/table/src/methods.js +962 -480
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +114 -33
- package/es/table/src/util.js +74 -58
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -6
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1725 -1022
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +7 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +105 -64
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +114 -80
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +12 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +43 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +49 -172
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1072 -538
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +113 -36
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +88 -71
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -6
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +246 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +4 -3
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +138 -80
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +126 -90
- package/packages/table/src/cell.ts +45 -67
- package/packages/table/src/column.ts +48 -10
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/footer.ts +50 -7
- package/packages/table/src/header.ts +67 -166
- package/packages/table/src/methods.ts +1007 -492
- package/packages/table/src/props.ts +16 -6
- package/packages/table/src/table.ts +124 -33
- package/packages/table/src/util.ts +83 -63
- package/packages/ui/index.ts +19 -5
- package/styles/components/table.scss +313 -274
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/es/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/es/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
- /package/lib/{iconfont.1736854649055.ttf → iconfont.1739008141486.ttf} +0 -0
- /package/lib/{iconfont.1736854649055.woff → iconfont.1739008141486.woff} +0 -0
- /package/lib/{iconfont.1736854649055.woff2 → iconfont.1739008141486.woff2} +0 -0
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _xeUtils = _interopRequireDefault(require("xe-utils"));
|
|
8
|
+
var _util = require("../../src/util");
|
|
8
9
|
var _dom = require("../../../ui/src/dom");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
function getTargetOffset(target, container) {
|
|
@@ -32,37 +33,72 @@ function getTargetOffset(target, container) {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
36
|
+
const props = $xeTable;
|
|
35
37
|
const reactData = $xeTable;
|
|
36
38
|
const internalData = $xeTable;
|
|
39
|
+
const {
|
|
40
|
+
showOverflow
|
|
41
|
+
} = props;
|
|
42
|
+
const {
|
|
43
|
+
fullAllDataRowIdData,
|
|
44
|
+
isResizeCellHeight
|
|
45
|
+
} = internalData;
|
|
46
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
47
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
48
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
49
|
+
const {
|
|
50
|
+
row
|
|
51
|
+
} = params;
|
|
37
52
|
let countHeight = 0;
|
|
38
53
|
let rangeRows = [];
|
|
39
54
|
let moveSize = 0;
|
|
40
55
|
const isDown = moveRange > 0;
|
|
41
56
|
const {
|
|
42
|
-
scrollYLoad
|
|
43
|
-
rowHeight
|
|
57
|
+
scrollYLoad
|
|
44
58
|
} = reactData;
|
|
45
59
|
const {
|
|
46
60
|
afterFullData
|
|
47
61
|
} = internalData;
|
|
62
|
+
if (isDown) {
|
|
63
|
+
moveSize = offsetClientTop + moveRange;
|
|
64
|
+
} else {
|
|
65
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
66
|
+
}
|
|
48
67
|
if (scrollYLoad) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
69
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
70
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
71
|
+
if (isDown) {
|
|
72
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
|
|
73
|
+
} else {
|
|
74
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
|
|
75
|
+
}
|
|
57
76
|
} else {
|
|
58
|
-
|
|
77
|
+
if (isDown) {
|
|
78
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
79
|
+
const item = afterFullData[i];
|
|
80
|
+
const rowid = $xeTable.getRowid(item);
|
|
81
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
82
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
83
|
+
rangeRows.push(item);
|
|
84
|
+
if (countHeight > moveSize) {
|
|
85
|
+
return rangeRows;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
90
|
+
const item = afterFullData[len];
|
|
91
|
+
const rowid = $xeTable.getRowid(item);
|
|
92
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
93
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
94
|
+
rangeRows.push(item);
|
|
95
|
+
if (countHeight > moveSize) {
|
|
96
|
+
return rangeRows;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
59
100
|
}
|
|
60
101
|
} else {
|
|
61
|
-
if (isDown) {
|
|
62
|
-
moveSize = evnt.clientY - trRect.y;
|
|
63
|
-
} else {
|
|
64
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
65
|
-
}
|
|
66
102
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
67
103
|
while (targetTrElem && countHeight < moveSize) {
|
|
68
104
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -240,21 +276,31 @@ var _default = exports.default = {
|
|
|
240
276
|
},
|
|
241
277
|
handleCheckboxRangeEvent(evnt, params) {
|
|
242
278
|
const $xeTable = this;
|
|
279
|
+
const internalData = $xeTable;
|
|
280
|
+
const {
|
|
281
|
+
elemStore
|
|
282
|
+
} = internalData;
|
|
283
|
+
const bodyScrollElem = (0, _util.getRefElem)(elemStore['main-body-scroll']);
|
|
284
|
+
const leftScrollElem = (0, _util.getRefElem)(elemStore['left-body-scroll']);
|
|
285
|
+
const rightScrollElem = (0, _util.getRefElem)(elemStore['right-body-scroll']);
|
|
243
286
|
const {
|
|
244
287
|
column,
|
|
245
288
|
cell
|
|
246
289
|
} = params;
|
|
247
290
|
if (column.type === 'checkbox') {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
291
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
292
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
293
|
+
bodyWrapperElem = leftScrollElem;
|
|
294
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
295
|
+
bodyWrapperElem = rightScrollElem;
|
|
296
|
+
}
|
|
297
|
+
if (!bodyWrapperElem) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
const el = $xeTable.$refs.refElem;
|
|
252
301
|
const disX = evnt.clientX;
|
|
253
302
|
const disY = evnt.clientY;
|
|
254
|
-
const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
|
|
255
303
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
256
|
-
const domMousemove = document.onmousemove;
|
|
257
|
-
const domMouseup = document.onmouseup;
|
|
258
304
|
const trElem = cell.parentNode;
|
|
259
305
|
const selectRecords = this.getCheckboxRecords();
|
|
260
306
|
let lastRangeRows = [];
|
|
@@ -365,7 +411,7 @@ var _default = exports.default = {
|
|
|
365
411
|
}
|
|
366
412
|
}, 50);
|
|
367
413
|
};
|
|
368
|
-
(0, _dom.addClass)(
|
|
414
|
+
(0, _dom.addClass)(el, 'drag--range');
|
|
369
415
|
document.onmousemove = evnt => {
|
|
370
416
|
evnt.preventDefault();
|
|
371
417
|
evnt.stopPropagation();
|
|
@@ -395,10 +441,10 @@ var _default = exports.default = {
|
|
|
395
441
|
};
|
|
396
442
|
document.onmouseup = evnt => {
|
|
397
443
|
stopMouseScroll();
|
|
398
|
-
(0, _dom.removeClass)(
|
|
444
|
+
(0, _dom.removeClass)(el, 'drag--range');
|
|
399
445
|
checkboxRangeElem.removeAttribute('style');
|
|
400
|
-
document.onmousemove =
|
|
401
|
-
document.onmouseup =
|
|
446
|
+
document.onmousemove = null;
|
|
447
|
+
document.onmouseup = null;
|
|
402
448
|
triggerEvent('end', evnt);
|
|
403
449
|
};
|
|
404
450
|
triggerEvent('start', evnt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_dom=require("../../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTargetOffset(e,t){let
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _xeUtils=_interopRequireDefault(require("xe-utils")),_util=require("../../src/util"),_dom=require("../../../ui/src/dom");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getTargetOffset(e,t){let l=0,o=0;var i,r,n=!_dom.browse.firefox&&(0,_dom.hasClass)(e,"vxe-checkbox--label");for(n&&(i=getComputedStyle(e),l-=_xeUtils.default.toNumber(i.paddingTop),o-=_xeUtils.default.toNumber(i.paddingLeft));e&&e!==t;)l+=e.offsetTop,o+=e.offsetLeft,e=e.offsetParent,n&&(r=getComputedStyle(e),l-=_xeUtils.default.toNumber(r.paddingTop),o-=_xeUtils.default.toNumber(r.paddingLeft));return{offsetTop:l,offsetLeft:o}}function getCheckboxRangeRows(t,e,l,o,i,r,n){var s=t.showOverflow,{fullAllDataRowIdData:h,isResizeCellHeight:a}=t,d=t.computeRowOpts,c=t.computeCellOpts,u=t.computeDefaultRowHeight,l=l.row;let g=0,f=[],m=0;var x=0<n,p=t.scrollYLoad,w=t.afterFullData;if(m=x?r+n:i.height-r+Math.abs(n),p){i=t.getVTRowIndex(l);if(!(a||c.height||d.height)&&s)f=x?w.slice(i,i+Math.ceil(m/u)):w.slice(i-Math.floor(m/u),i+1);else if(x)for(let e=i;e<w.length;e++){var v=w[e],b=h[t.getRowid(v)]||{};if(g+=b.resizeHeight||c.height||d.height||b.height||u,f.push(v),g>m)return f}else for(let e=i;0<=e;e--){var R=w[e],C=h[t.getRowid(R)]||{};if(g+=C.resizeHeight||c.height||d.height||C.height||u,f.push(R),g>m)return f}}else for(var T=x?"next":"previous";o&&g<m;){var _=t.getRowNode(o);_&&(f.push(_.item),g+=o.offsetHeight,o=o[T+"ElementSibling"])}return f}var _default=exports.default={methods:{moveTabSelected(e,t,l){var{afterFullData:o,visibleColumn:i,editConfig:r,editOpts:n}=this;let s,h,a,d=Object.assign({},e);var e=this.getVTRowIndex(d.row),c=this.getVTColumnIndex(d.column),t=(l.preventDefault(),t?c<=0?0<e&&(h=e-1,s=o[h],a=i.length-1):a=c-1:c>=i.length-1?e<o.length-1&&(h=e+1,s=o[h],a=0):a=c+1,i[a]);t&&(s?(d.rowIndex=h,d.row=s):d.rowIndex=e,d.columnIndex=a,d.column=t,d.cell=this.getCellElement(d.row,d.column),r?"click"!==n.trigger&&"dblclick"!==n.trigger||("row"===n.mode?this.handleEdit(d,l):this.scrollToRow(d.row,d.column).then(()=>this.handleSelected(d,l))):this.scrollToRow(d.row,d.column).then(()=>this.handleSelected(d,l)))},moveCurrentRow(e,t,l){let{currentRow:o,treeConfig:i,treeOpts:r,afterFullData:n}=this;var s,h=r.children||r.childrenField;let a;if(l.preventDefault(),o?i?({index:h,items:s}=_xeUtils.default.findTree(n,e=>e===o,{children:h}),e&&0<h?a=s[h-1]:t&&h<s.length-1&&(a=s[h+1])):(s=this.getVTRowIndex(o),e&&0<s?a=n[s-1]:t&&s<n.length-1&&(a=n[s+1])):a=n[0],a){let e={$table:this,row:a};this.scrollToRow(a).then(()=>this.triggerCurrentRowEvent(l,e))}},moveSelected(e,t,l,o,i,r){var{afterFullData:n,visibleColumn:s}=this;let h=Object.assign({},e);var e=this.getVTRowIndex(h.row),a=this.getVTColumnIndex(h.column);r.preventDefault(),l&&0<e?(h.rowIndex=e-1,h.row=n[h.rowIndex]):i&&e<n.length-1?(h.rowIndex=e+1,h.row=n[h.rowIndex]):t&&a?(h.columnIndex=a-1,h.column=s[h.columnIndex]):o&&a<s.length-1&&(h.columnIndex=a+1,h.column=s[h.columnIndex]),this.scrollToRow(h.row,h.column).then(()=>{h.cell=this.getCellElement(h.row,h.column),this.handleSelected(h,r)})},handleCellMousedownEvent(e,t){var{editConfig:l,editOpts:o,handleSelected:i,checkboxConfig:r,checkboxOpts:n,mouseConfig:s,mouseOpts:h}=this;if(s&&h.area&&this.handleMousedownCellAreaEvent)return this.handleMousedownCellAreaEvent(e,t);r&&n.range&&this.handleCheckboxRangeEvent(e,t),s&&h.selected&&(l&&"cell"!==o.mode||i(t,e))},handleCheckboxRangeEvent(e,y){let E=this;var t=E.elemStore,l=(0,_util.getRefElem)(t["main-body-scroll"]),o=(0,_util.getRefElem)(t["left-body-scroll"]),t=(0,_util.getRefElem)(t["right-body-scroll"]),{column:i,cell:r}=y;if("checkbox"===i.type){let I=l;if(o&&"left"===i.fixed?I=o:t&&"right"===i.fixed&&(I=t),I){let t=E.$refs.refElem,s=e.clientX,h=e.clientY,a=I.querySelector(".vxe-table--checkbox-range"),d=r.parentNode,c=this.getCheckboxRecords(),u=[],g=1;l=getTargetOffset(e.target,I);let f=l.offsetTop+e.offsetY,m=l.offsetLeft+e.offsetX,x=I.scrollTop,n=d.offsetHeight,p=d.getBoundingClientRect(),w=h-p.y,v=null,b=!1,R=1,C=(e,t)=>{this.emitEvent("checkbox-range-"+e,{records:this.getCheckboxRecords(),reserves:this.getCheckboxReserveRecords()},t)},T=e=>{var{clientX:t,clientY:l}=e,t=t-s,l=l-h+(I.scrollTop-x);let o=Math.abs(l),i=Math.abs(t),r=f,n=m;l<g?(r+=l)<g&&(r=g,o=f):o=Math.min(o,I.scrollHeight-f-g),t<g?(n+=t,i>m&&(n=g,i=m)):i=Math.min(i,I.clientWidth-m-g),a.style.height=o+"px",a.style.width=i+"px",a.style.left=n+"px",a.style.top=r+"px",a.style.display="block";t=getCheckboxRangeRows(this,e,y,d,p,w,l<g?-o:o);10<o&&t.length!==u.length&&(u=t,e.ctrlKey?t.forEach(e=>{E.handleBatchSelectRows([e],-1===c.indexOf(e))}):(this.setAllCheckboxRow(!1),this.handleCheckedCheckboxRow(t,!0,!1)),C("change",e))},_=()=>{clearTimeout(v),v=null},k=r=>{_(),v=setTimeout(()=>{var e,t,l,o,i;v&&({scrollLeft:e,scrollTop:t,clientHeight:l,scrollHeight:o}=I,i=Math.ceil(50*R/n),b?t+l<o?(this.scrollTo(e,t+i),k(r),T(r)):_():t?(this.scrollTo(e,t-i),k(r),T(r)):_())},50)};(0,_dom.addClass)(t,"drag--range"),document.onmousemove=e=>{e.preventDefault(),e.stopPropagation();var t=e.clientY,l=(0,_dom.getAbsolutePos)(I).boundingTop;t<l?(b=!1,R=l-t,v||k(e)):t>l+I.clientHeight?(b=!0,R=t-l-I.clientHeight,v||k(e)):v&&_(),T(e)},document.onmouseup=e=>{_(),(0,_dom.removeClass)(t,"drag--range"),a.removeAttribute("style"),document.onmousemove=null,document.onmouseup=null,C("end",e)},C("start",e)}}}}};
|
|
@@ -62,6 +62,8 @@ var _default = exports.default = {
|
|
|
62
62
|
* 快捷菜单事件处理
|
|
63
63
|
*/
|
|
64
64
|
handleGlobalContextmenuEvent(evnt) {
|
|
65
|
+
const $xeTable = this;
|
|
66
|
+
const internalData = $xeTable;
|
|
65
67
|
const {
|
|
66
68
|
$refs,
|
|
67
69
|
tId,
|
|
@@ -82,7 +84,7 @@ var _default = exports.default = {
|
|
|
82
84
|
evnt.preventDefault();
|
|
83
85
|
return;
|
|
84
86
|
}
|
|
85
|
-
if (
|
|
87
|
+
if (internalData._keyCtx) {
|
|
86
88
|
const type = 'body';
|
|
87
89
|
const params = {
|
|
88
90
|
type,
|