vxe-table 3.11.31 → 3.11.32
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/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/keyboard/mixin.js +1 -26
- package/es/table/src/body.js +13 -1
- package/es/table/src/cell.js +23 -19
- package/es/table/src/header.js +33 -22
- package/es/table/src/methods.js +77 -4
- package/es/table/src/table.js +3 -1
- package/es/table/style.css +36 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +36 -0
- 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 +172 -81
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/keyboard/mixin.js +0 -32
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +15 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +23 -17
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/header.js +35 -26
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +94 -2
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +3 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +36 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- 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 +36 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/keyboard/mixin.ts +1 -26
- package/packages/table/src/body.ts +13 -1
- package/packages/table/src/cell.ts +23 -19
- package/packages/table/src/header.ts +34 -22
- package/packages/table/src/methods.ts +79 -4
- package/packages/table/src/table.ts +3 -1
- package/styles/components/table.scss +36 -0
- /package/es/{iconfont.1734190867802.ttf → iconfont.1734331305049.ttf} +0 -0
- /package/es/{iconfont.1734190867802.woff → iconfont.1734331305049.woff} +0 -0
- /package/es/{iconfont.1734190867802.woff2 → iconfont.1734331305049.woff2} +0 -0
- /package/lib/{iconfont.1734190867802.ttf → iconfont.1734331305049.ttf} +0 -0
- /package/lib/{iconfont.1734190867802.woff → iconfont.1734331305049.woff} +0 -0
- /package/lib/{iconfont.1734190867802.woff2 → iconfont.1734331305049.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.11.
|
|
2223
|
+
const version = "3.11.32";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2790,7 +2790,7 @@ function isNodeElement(elem) {
|
|
|
2790
2790
|
const {
|
|
2791
2791
|
log: log_log
|
|
2792
2792
|
} = core_.VxeUI;
|
|
2793
|
-
const log_version = `table v${"3.11.
|
|
2793
|
+
const log_version = `table v${"3.11.32"}`;
|
|
2794
2794
|
const warnLog = log_log.create('warn', log_version);
|
|
2795
2795
|
const errLog = log_log.create('error', log_version);
|
|
2796
2796
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -3564,23 +3564,26 @@ function renderCellDragIcon(h, params) {
|
|
|
3564
3564
|
const rowDragOpts = $table.computeRowDragOpts;
|
|
3565
3565
|
const {
|
|
3566
3566
|
icon,
|
|
3567
|
+
trigger,
|
|
3567
3568
|
disabledMethod
|
|
3568
3569
|
} = rowDragOpts;
|
|
3569
3570
|
const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null);
|
|
3570
3571
|
const isDisabled = rDisabledMethod && rDisabledMethod(params);
|
|
3572
|
+
const ons = {};
|
|
3573
|
+
if (trigger !== 'cell') {
|
|
3574
|
+
ons.mousedown = evnt => {
|
|
3575
|
+
if (!isDisabled) {
|
|
3576
|
+
$table.handleCellDragMousedownEvent(evnt, params);
|
|
3577
|
+
}
|
|
3578
|
+
};
|
|
3579
|
+
ons.mouseup = $table.handleCellDragMouseupEvent;
|
|
3580
|
+
}
|
|
3571
3581
|
return h('span', {
|
|
3572
3582
|
key: 'dg',
|
|
3573
3583
|
class: ['vxe-cell--drag-handle', {
|
|
3574
3584
|
'is--disabled': isDisabled
|
|
3575
3585
|
}],
|
|
3576
|
-
on:
|
|
3577
|
-
mousedown(evnt) {
|
|
3578
|
-
if (!isDisabled) {
|
|
3579
|
-
$table.handleCellDragMousedownEvent(evnt, params);
|
|
3580
|
-
}
|
|
3581
|
-
},
|
|
3582
|
-
mouseup: $table.handleCellDragMouseupEvent
|
|
3583
|
-
}
|
|
3586
|
+
on: ons
|
|
3584
3587
|
}, [h('i', {
|
|
3585
3588
|
class: icon || (dragConfig ? dragConfig.rowIcon : '') || cell_getIcon().TABLE_DRAG_ROW
|
|
3586
3589
|
})]);
|
|
@@ -3629,26 +3632,29 @@ function renderHeaderCellDragIcon(h, params) {
|
|
|
3629
3632
|
const {
|
|
3630
3633
|
showIcon,
|
|
3631
3634
|
icon,
|
|
3635
|
+
trigger,
|
|
3632
3636
|
isCrossDrag,
|
|
3633
3637
|
visibleMethod,
|
|
3634
3638
|
disabledMethod
|
|
3635
3639
|
} = columnDragOpts;
|
|
3636
|
-
const isDisabled = disabledMethod && disabledMethod(params);
|
|
3637
3640
|
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
3638
3641
|
if (!column.fixed && (isCrossDrag || !column.parentId)) {
|
|
3642
|
+
const isDisabled = disabledMethod && disabledMethod(params);
|
|
3643
|
+
const ons = {};
|
|
3644
|
+
if (trigger !== 'cell') {
|
|
3645
|
+
ons.mousedown = evnt => {
|
|
3646
|
+
if (!isDisabled) {
|
|
3647
|
+
$table.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
3648
|
+
}
|
|
3649
|
+
};
|
|
3650
|
+
ons.mouseup = $table.handleHeaderCellDragMouseupEvent;
|
|
3651
|
+
}
|
|
3639
3652
|
return h('span', {
|
|
3640
3653
|
key: 'dg',
|
|
3641
3654
|
class: ['vxe-cell--drag-handle', {
|
|
3642
3655
|
'is--disabled': isDisabled
|
|
3643
3656
|
}],
|
|
3644
|
-
on:
|
|
3645
|
-
mousedown(evnt) {
|
|
3646
|
-
if (!isDisabled) {
|
|
3647
|
-
$table.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
3648
|
-
}
|
|
3649
|
-
},
|
|
3650
|
-
mouseup: $table.handleHeaderCellDragMouseupEvent
|
|
3651
|
-
}
|
|
3657
|
+
on: ons
|
|
3652
3658
|
}, [h('i', {
|
|
3653
3659
|
class: icon || cell_getIcon().TABLE_DRAG_COLUMN
|
|
3654
3660
|
})]);
|
|
@@ -10965,6 +10971,94 @@ const Methods = {
|
|
|
10965
10971
|
$xeTable.handleColumnSortEvent(evnt, column);
|
|
10966
10972
|
}
|
|
10967
10973
|
},
|
|
10974
|
+
/**
|
|
10975
|
+
* 表头单元格按下事件
|
|
10976
|
+
*/
|
|
10977
|
+
triggerHeaderCellMousedownEvent(evnt, params) {
|
|
10978
|
+
const $xeTable = this;
|
|
10979
|
+
const props = $xeTable;
|
|
10980
|
+
const {
|
|
10981
|
+
mouseConfig
|
|
10982
|
+
} = props;
|
|
10983
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
10984
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
10985
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
10986
|
+
const {
|
|
10987
|
+
trigger,
|
|
10988
|
+
disabledMethod
|
|
10989
|
+
} = columnDragOpts;
|
|
10990
|
+
const cell = evnt.currentTarget;
|
|
10991
|
+
const triggerInput = cell && cell.tagName && cell.tagName.toLowerCase() === 'input';
|
|
10992
|
+
const triggerCheckbox = getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
|
|
10993
|
+
const triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
|
|
10994
|
+
const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
|
|
10995
|
+
let triggerDrag = false;
|
|
10996
|
+
if (!(triggerInput || triggerCheckbox || triggerSort || triggerFilter)) {
|
|
10997
|
+
if (columnOpts.drag && trigger === 'cell' && !(disabledMethod && disabledMethod(params))) {
|
|
10998
|
+
triggerDrag = true;
|
|
10999
|
+
$xeTable.handleHeaderCellDragMousedownEvent(evnt, params);
|
|
11000
|
+
}
|
|
11001
|
+
}
|
|
11002
|
+
if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaEvent) {
|
|
11003
|
+
$xeTable.handleHeaderCellAreaEvent(evnt, Object.assign({
|
|
11004
|
+
cell,
|
|
11005
|
+
triggerSort,
|
|
11006
|
+
triggerFilter
|
|
11007
|
+
}, params));
|
|
11008
|
+
}
|
|
11009
|
+
$xeTable.focus();
|
|
11010
|
+
if ($xeTable.closeMenu) {
|
|
11011
|
+
$xeTable.closeMenu();
|
|
11012
|
+
}
|
|
11013
|
+
},
|
|
11014
|
+
/**
|
|
11015
|
+
* 单元格按下事件
|
|
11016
|
+
*/
|
|
11017
|
+
triggerCellMousedownEvent(evnt, params) {
|
|
11018
|
+
const $xeTable = this;
|
|
11019
|
+
const {
|
|
11020
|
+
column
|
|
11021
|
+
} = params;
|
|
11022
|
+
const {
|
|
11023
|
+
type,
|
|
11024
|
+
treeNode
|
|
11025
|
+
} = column;
|
|
11026
|
+
const isRadioType = type === 'radio';
|
|
11027
|
+
const isCheckboxType = type === 'checkbox';
|
|
11028
|
+
const isExpandType = type === 'expand';
|
|
11029
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
11030
|
+
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
11031
|
+
const {
|
|
11032
|
+
trigger,
|
|
11033
|
+
disabledMethod
|
|
11034
|
+
} = rowDragOpts;
|
|
11035
|
+
const cell = evnt.currentTarget;
|
|
11036
|
+
params.cell = cell;
|
|
11037
|
+
const triggerInput = cell && cell.tagName && cell.tagName.toLowerCase() === 'input';
|
|
11038
|
+
const triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag;
|
|
11039
|
+
const triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag;
|
|
11040
|
+
const triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag;
|
|
11041
|
+
const triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag;
|
|
11042
|
+
let isColDragCell = false;
|
|
11043
|
+
if (rowOpts.drag) {
|
|
11044
|
+
isColDragCell = trigger === 'row' || column.dragSort && trigger === 'cell';
|
|
11045
|
+
}
|
|
11046
|
+
let triggerDrag = false;
|
|
11047
|
+
if (!(triggerInput || triggerRadio || triggerCheckbox || triggerTreeNode || triggerExpandNode)) {
|
|
11048
|
+
if (isColDragCell && !(disabledMethod && disabledMethod(params))) {
|
|
11049
|
+
triggerDrag = true;
|
|
11050
|
+
$xeTable.handleCellDragMousedownEvent(evnt, params);
|
|
11051
|
+
}
|
|
11052
|
+
}
|
|
11053
|
+
if (!triggerDrag && $xeTable.handleCellMousedownEvent) {
|
|
11054
|
+
$xeTable.handleCellMousedownEvent(evnt, params);
|
|
11055
|
+
}
|
|
11056
|
+
$xeTable.focus();
|
|
11057
|
+
$xeTable.closeFilter();
|
|
11058
|
+
if ($xeTable.closeMenu) {
|
|
11059
|
+
$xeTable.closeMenu();
|
|
11060
|
+
}
|
|
11061
|
+
},
|
|
10968
11062
|
/**
|
|
10969
11063
|
* 行拖拽
|
|
10970
11064
|
*/
|
|
@@ -11225,18 +11319,20 @@ const Methods = {
|
|
|
11225
11319
|
const $xeTable = this;
|
|
11226
11320
|
const props = $xeTable;
|
|
11227
11321
|
const reactData = $xeTable;
|
|
11322
|
+
evnt.stopPropagation();
|
|
11228
11323
|
const {
|
|
11229
11324
|
dragConfig
|
|
11230
11325
|
} = props;
|
|
11231
11326
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
11232
11327
|
const {
|
|
11328
|
+
trigger,
|
|
11233
11329
|
dragStartMethod
|
|
11234
11330
|
} = rowDragOpts;
|
|
11235
11331
|
const {
|
|
11236
11332
|
row
|
|
11237
11333
|
} = params;
|
|
11238
11334
|
const dragEl = evnt.currentTarget;
|
|
11239
|
-
const tdEl = dragEl.parentElement?.parentElement;
|
|
11335
|
+
const tdEl = trigger === 'cell' || trigger === 'row' ? dragEl : dragEl.parentElement?.parentElement;
|
|
11240
11336
|
const trEl = tdEl.parentElement;
|
|
11241
11337
|
const dStartMethod = dragStartMethod || (dragConfig ? dragConfig.dragStartMethod : null);
|
|
11242
11338
|
reactData.isDragRowMove = false;
|
|
@@ -11496,15 +11592,17 @@ const Methods = {
|
|
|
11496
11592
|
handleHeaderCellDragMousedownEvent(evnt, params) {
|
|
11497
11593
|
const $xeTable = this;
|
|
11498
11594
|
const reactData = $xeTable;
|
|
11595
|
+
evnt.stopPropagation();
|
|
11499
11596
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
11500
11597
|
const {
|
|
11598
|
+
trigger,
|
|
11501
11599
|
dragStartMethod
|
|
11502
11600
|
} = columnDragOpts;
|
|
11503
11601
|
const {
|
|
11504
11602
|
column
|
|
11505
11603
|
} = params;
|
|
11506
11604
|
const dragEl = evnt.currentTarget;
|
|
11507
|
-
const thEl = dragEl.parentElement?.parentElement;
|
|
11605
|
+
const thEl = trigger === 'cell' ? dragEl : dragEl.parentElement?.parentElement;
|
|
11508
11606
|
reactData.isDragColMove = false;
|
|
11509
11607
|
clearColDropOrigin($xeTable);
|
|
11510
11608
|
if (dragStartMethod && !dragStartMethod(params)) {
|
|
@@ -13698,6 +13796,10 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13698
13796
|
areaOpts,
|
|
13699
13797
|
validErrorMaps
|
|
13700
13798
|
} = $xetable;
|
|
13799
|
+
const rowDragOpts = $xetable.computeRowDragOpts;
|
|
13800
|
+
const {
|
|
13801
|
+
disabledMethod: dragDisabledMethod
|
|
13802
|
+
} = rowDragOpts;
|
|
13701
13803
|
const {
|
|
13702
13804
|
selectCellToRow
|
|
13703
13805
|
} = areaOpts;
|
|
@@ -13773,6 +13875,14 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13773
13875
|
data: tableData,
|
|
13774
13876
|
items
|
|
13775
13877
|
};
|
|
13878
|
+
let isColDragCell = false;
|
|
13879
|
+
let isDisabledDrag = false;
|
|
13880
|
+
if (rowOpts.drag) {
|
|
13881
|
+
isColDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
13882
|
+
}
|
|
13883
|
+
if (isColDragCell) {
|
|
13884
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
|
|
13885
|
+
}
|
|
13776
13886
|
// hover 进入事件
|
|
13777
13887
|
if (showTitle || showTooltip || showAllTip || bindMouseenter || tooltipConfig) {
|
|
13778
13888
|
tdOns.mouseenter = evnt => {
|
|
@@ -13809,7 +13919,7 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13809
13919
|
};
|
|
13810
13920
|
}
|
|
13811
13921
|
// 按下事件处理
|
|
13812
|
-
if (checkboxOpts.range || mouseConfig) {
|
|
13922
|
+
if (isColDragCell || checkboxOpts.range || mouseConfig) {
|
|
13813
13923
|
tdOns.mousedown = evnt => {
|
|
13814
13924
|
$xetable.triggerCellMousedownEvent(evnt, params);
|
|
13815
13925
|
};
|
|
@@ -13942,6 +14052,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13942
14052
|
'col--edit': isEdit,
|
|
13943
14053
|
'col--ellipsis': hasEllipsis,
|
|
13944
14054
|
'fixed--hidden': fixedHiddenColumn,
|
|
14055
|
+
'is--drag-cell': isColDragCell,
|
|
14056
|
+
'is--drag-disabled': isDisabledDrag,
|
|
13945
14057
|
'col--dirty': isDirty,
|
|
13946
14058
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
13947
14059
|
'col--valid-error': !!errorValidItem,
|
|
@@ -14581,12 +14693,12 @@ const {
|
|
|
14581
14693
|
} = core_.VxeUI;
|
|
14582
14694
|
const cellType = 'header';
|
|
14583
14695
|
const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
14696
|
+
const $xeTable = _vm.$parent;
|
|
14697
|
+
const $xeGrid = $xeTable.xegrid;
|
|
14584
14698
|
const {
|
|
14585
|
-
$parent: $xetable,
|
|
14586
14699
|
fixedType
|
|
14587
14700
|
} = _vm;
|
|
14588
14701
|
const {
|
|
14589
|
-
$listeners: tableListeners,
|
|
14590
14702
|
resizable: allResizable,
|
|
14591
14703
|
border,
|
|
14592
14704
|
columnKey,
|
|
@@ -14595,15 +14707,17 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
14595
14707
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
14596
14708
|
headerAlign: allHeaderAlign,
|
|
14597
14709
|
align: allAlign,
|
|
14598
|
-
highlightCurrentColumn,
|
|
14599
14710
|
currentColumn,
|
|
14600
14711
|
scrollXLoad,
|
|
14601
14712
|
overflowX,
|
|
14602
14713
|
scrollbarWidth,
|
|
14603
|
-
sortOpts,
|
|
14604
14714
|
mouseConfig,
|
|
14605
14715
|
columnOpts
|
|
14606
|
-
} = $
|
|
14716
|
+
} = $xeTable;
|
|
14717
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
14718
|
+
const {
|
|
14719
|
+
disabledMethod: dragDisabledMethod
|
|
14720
|
+
} = columnDragOpts;
|
|
14607
14721
|
return cols.map((column, $columnIndex) => {
|
|
14608
14722
|
const {
|
|
14609
14723
|
type,
|
|
@@ -14626,13 +14740,12 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
14626
14740
|
const showTitle = headOverflow === 'title';
|
|
14627
14741
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
14628
14742
|
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
14629
|
-
const thOns = {};
|
|
14630
14743
|
const hasFilter = column.filters && column.filters.some(item => item.checked);
|
|
14631
|
-
const columnIndex = $
|
|
14632
|
-
const _columnIndex = $
|
|
14744
|
+
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14745
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
14633
14746
|
const params = {
|
|
14634
|
-
$table: $
|
|
14635
|
-
$grid: $
|
|
14747
|
+
$table: $xeTable,
|
|
14748
|
+
$grid: $xeGrid,
|
|
14636
14749
|
$rowIndex,
|
|
14637
14750
|
column,
|
|
14638
14751
|
columnIndex,
|
|
@@ -14643,25 +14756,36 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
14643
14756
|
isHidden: fixedHiddenColumn,
|
|
14644
14757
|
hasFilter
|
|
14645
14758
|
};
|
|
14759
|
+
const thAttrs = {
|
|
14760
|
+
colid,
|
|
14761
|
+
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
14762
|
+
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
14763
|
+
};
|
|
14764
|
+
const thOns = {
|
|
14765
|
+
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, params),
|
|
14766
|
+
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
|
|
14767
|
+
};
|
|
14646
14768
|
// 虚拟滚动不支持动态高度
|
|
14647
14769
|
if (scrollXLoad && !hasEllipsis) {
|
|
14648
14770
|
showEllipsis = hasEllipsis = true;
|
|
14649
14771
|
}
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
thOns.dblclick = evnt => $xetable.triggerHeaderCellDblclickEvent(evnt, params);
|
|
14772
|
+
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
14773
|
+
let isDisabledDrag = false;
|
|
14774
|
+
if (isColDragCell) {
|
|
14775
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params));
|
|
14655
14776
|
}
|
|
14656
14777
|
// 按下事件处理
|
|
14657
|
-
if (mouseConfig) {
|
|
14658
|
-
thOns.mousedown = evnt => $
|
|
14778
|
+
if (mouseConfig || isColDragCell) {
|
|
14779
|
+
thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, params);
|
|
14659
14780
|
}
|
|
14660
|
-
//
|
|
14781
|
+
// 拖拽列事件
|
|
14661
14782
|
if (columnOpts.drag) {
|
|
14662
|
-
thOns.dragstart = $
|
|
14663
|
-
thOns.dragend = $
|
|
14664
|
-
thOns.dragover = $
|
|
14783
|
+
thOns.dragstart = $xeTable.handleHeaderCellDragDragstartEvent;
|
|
14784
|
+
thOns.dragend = $xeTable.handleHeaderCellDragDragendEvent;
|
|
14785
|
+
thOns.dragover = $xeTable.handleHeaderCellDragDragoverEvent;
|
|
14786
|
+
if (isColDragCell) {
|
|
14787
|
+
thOns.mouseup = $xeTable.handleHeaderCellDragMouseupEvent;
|
|
14788
|
+
}
|
|
14665
14789
|
}
|
|
14666
14790
|
return h('th', {
|
|
14667
14791
|
class: ['vxe-header--column', colid, {
|
|
@@ -14675,13 +14799,10 @@ const header_renderRows = (h, _vm, cols, $rowIndex) => {
|
|
|
14675
14799
|
'is--sortable': column.sortable,
|
|
14676
14800
|
'col--filter': !!column.filters,
|
|
14677
14801
|
'is--filter-active': hasFilter,
|
|
14802
|
+
'is--drag-disabled': isDisabledDrag,
|
|
14678
14803
|
'col--current': currentColumn === column
|
|
14679
14804
|
}, getClass(headerClassName, params), getClass(headerCellClassName, params)],
|
|
14680
|
-
attrs:
|
|
14681
|
-
colid,
|
|
14682
|
-
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
14683
|
-
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
14684
|
-
},
|
|
14805
|
+
attrs: thAttrs,
|
|
14685
14806
|
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle : null,
|
|
14686
14807
|
on: thOns,
|
|
14687
14808
|
key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
@@ -21762,38 +21883,6 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
21762
21883
|
this.handleSelected(params, evnt);
|
|
21763
21884
|
});
|
|
21764
21885
|
},
|
|
21765
|
-
/**
|
|
21766
|
-
* 表头单元格按下事件
|
|
21767
|
-
*/
|
|
21768
|
-
triggerHeaderCellMousedownEvent(evnt, params) {
|
|
21769
|
-
const {
|
|
21770
|
-
mouseConfig,
|
|
21771
|
-
mouseOpts
|
|
21772
|
-
} = this;
|
|
21773
|
-
if (mouseConfig && mouseOpts.area && this.handleHeaderCellAreaEvent) {
|
|
21774
|
-
const cell = evnt.currentTarget;
|
|
21775
|
-
const triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
|
|
21776
|
-
const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
|
|
21777
|
-
this.handleHeaderCellAreaEvent(evnt, Object.assign({
|
|
21778
|
-
cell,
|
|
21779
|
-
triggerSort,
|
|
21780
|
-
triggerFilter
|
|
21781
|
-
}, params));
|
|
21782
|
-
}
|
|
21783
|
-
this.focus();
|
|
21784
|
-
this.closeMenu();
|
|
21785
|
-
},
|
|
21786
|
-
/**
|
|
21787
|
-
* 单元格按下事件
|
|
21788
|
-
*/
|
|
21789
|
-
triggerCellMousedownEvent(evnt, params) {
|
|
21790
|
-
const cell = evnt.currentTarget;
|
|
21791
|
-
params.cell = cell;
|
|
21792
|
-
this.handleCellMousedownEvent(evnt, params);
|
|
21793
|
-
this.focus();
|
|
21794
|
-
this.closeFilter();
|
|
21795
|
-
this.closeMenu();
|
|
21796
|
-
},
|
|
21797
21886
|
handleCellMousedownEvent(evnt, params) {
|
|
21798
21887
|
const {
|
|
21799
21888
|
editConfig,
|
|
@@ -24034,7 +24123,7 @@ function handleUupdateResize(_vm) {
|
|
|
24034
24123
|
if (this.editRules && !this._validate) {
|
|
24035
24124
|
errLog('vxe.error.reqModule', ['Validator']);
|
|
24036
24125
|
}
|
|
24037
|
-
if ((this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig) && !this.
|
|
24126
|
+
if ((this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig) && !this.handleCellMousedownEvent) {
|
|
24038
24127
|
errLog('vxe.error.reqModule', ['Keyboard']);
|
|
24039
24128
|
}
|
|
24040
24129
|
if ((this.printConfig || this.importConfig || this.exportConfig) && !this._exportData) {
|
|
@@ -24212,6 +24301,7 @@ function handleUupdateResize(_vm) {
|
|
|
24212
24301
|
const virtualScrollBars = $xeTable.computeVirtualScrollBars;
|
|
24213
24302
|
const isArea = mouseConfig && mouseOpts.area;
|
|
24214
24303
|
const tableStyle = $xeTable.computeTableStyle;
|
|
24304
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
24215
24305
|
return h('div', {
|
|
24216
24306
|
ref: 'refElem',
|
|
24217
24307
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
@@ -24227,6 +24317,7 @@ function handleUupdateResize(_vm) {
|
|
|
24227
24317
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
24228
24318
|
'checkbox--range': checkboxOpts.range,
|
|
24229
24319
|
'column--calc': isCalcColumn,
|
|
24320
|
+
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
24230
24321
|
'is--header': showHeader,
|
|
24231
24322
|
'is--footer': showFooter,
|
|
24232
24323
|
'is--group': isGroup,
|