vxe-table 3.11.31 → 3.11.33
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/custom/panel.js +7 -6
- package/es/table/module/keyboard/mixin.js +1 -26
- package/es/table/src/body.js +21 -5
- package/es/table/src/cell.js +23 -19
- package/es/table/src/footer.js +4 -2
- package/es/table/src/header.js +40 -28
- 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 +5 -3
- 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 +200 -111
- 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/custom/panel.js +7 -14
- package/lib/table/module/custom/panel.min.js +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 +21 -5
- 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/footer.js +4 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +42 -34
- 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 +5 -3
- 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/custom/panel.ts +9 -6
- package/packages/table/module/keyboard/mixin.ts +1 -26
- package/packages/table/src/body.ts +21 -5
- package/packages/table/src/cell.ts +23 -19
- package/packages/table/src/footer.ts +6 -2
- package/packages/table/src/header.ts +43 -28
- package/packages/table/src/methods.ts +79 -4
- package/packages/table/src/table.ts +3 -1
- package/packages/ui/index.ts +4 -2
- package/styles/components/table.scss +36 -0
- /package/es/{iconfont.1734190867802.ttf → iconfont.1734402738434.ttf} +0 -0
- /package/es/{iconfont.1734190867802.woff → iconfont.1734402738434.woff} +0 -0
- /package/es/{iconfont.1734190867802.woff2 → iconfont.1734402738434.woff2} +0 -0
- /package/lib/{iconfont.1734190867802.ttf → iconfont.1734402738434.ttf} +0 -0
- /package/lib/{iconfont.1734190867802.woff → iconfont.1734402738434.woff} +0 -0
- /package/lib/{iconfont.1734190867802.woff2 → iconfont.1734402738434.woff2} +0 -0
|
@@ -53,22 +53,24 @@ function renderCellDragIcon (h: CreateElement, params: any) {
|
|
|
53
53
|
const tableProps = $table
|
|
54
54
|
const { dragConfig } = tableProps
|
|
55
55
|
const rowDragOpts = $table.computeRowDragOpts
|
|
56
|
-
const { icon, disabledMethod } = rowDragOpts
|
|
56
|
+
const { icon, trigger, disabledMethod } = rowDragOpts
|
|
57
57
|
const rDisabledMethod = disabledMethod || (dragConfig ? dragConfig.rowDisabledMethod : null)
|
|
58
58
|
const isDisabled = rDisabledMethod && rDisabledMethod(params)
|
|
59
|
+
const ons: Record<string, any> = {}
|
|
60
|
+
if (trigger !== 'cell') {
|
|
61
|
+
ons.mousedown = (evnt: MouseEvent) => {
|
|
62
|
+
if (!isDisabled) {
|
|
63
|
+
$table.handleCellDragMousedownEvent(evnt, params)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
ons.mouseup = $table.handleCellDragMouseupEvent
|
|
67
|
+
}
|
|
59
68
|
return h('span', {
|
|
60
69
|
key: 'dg',
|
|
61
70
|
class: ['vxe-cell--drag-handle', {
|
|
62
71
|
'is--disabled': isDisabled
|
|
63
72
|
}],
|
|
64
|
-
on:
|
|
65
|
-
mousedown (evnt: DragEvent) {
|
|
66
|
-
if (!isDisabled) {
|
|
67
|
-
$table.handleCellDragMousedownEvent(evnt, params)
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
mouseup: $table.handleCellDragMouseupEvent
|
|
71
|
-
}
|
|
73
|
+
on: ons
|
|
72
74
|
}, [
|
|
73
75
|
h('i', {
|
|
74
76
|
class: icon || (dragConfig ? dragConfig.rowIcon : '') || getIcon().TABLE_DRAG_ROW
|
|
@@ -106,23 +108,25 @@ function renderHeaderCellDragIcon (h: CreateElement, params: VxeTableDefines.Cel
|
|
|
106
108
|
const { $table, column } = params
|
|
107
109
|
const columnOpts = $table.computeColumnOpts
|
|
108
110
|
const columnDragOpts = $table.computeColumnDragOpts
|
|
109
|
-
const { showIcon, icon, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts
|
|
110
|
-
const isDisabled = disabledMethod && disabledMethod(params)
|
|
111
|
+
const { showIcon, icon, trigger, isCrossDrag, visibleMethod, disabledMethod } = columnDragOpts
|
|
111
112
|
if (columnOpts.drag && showIcon && (!visibleMethod || visibleMethod(params))) {
|
|
112
113
|
if (!column.fixed && (isCrossDrag || !column.parentId)) {
|
|
114
|
+
const isDisabled = disabledMethod && disabledMethod(params)
|
|
115
|
+
const ons: Record<string, any> = {}
|
|
116
|
+
if (trigger !== 'cell') {
|
|
117
|
+
ons.mousedown = (evnt: MouseEvent) => {
|
|
118
|
+
if (!isDisabled) {
|
|
119
|
+
$table.handleHeaderCellDragMousedownEvent(evnt, params)
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
ons.mouseup = $table.handleHeaderCellDragMouseupEvent
|
|
123
|
+
}
|
|
113
124
|
return h('span', {
|
|
114
125
|
key: 'dg',
|
|
115
126
|
class: ['vxe-cell--drag-handle', {
|
|
116
127
|
'is--disabled': isDisabled
|
|
117
128
|
}],
|
|
118
|
-
on:
|
|
119
|
-
mousedown (evnt: MouseEvent) {
|
|
120
|
-
if (!isDisabled) {
|
|
121
|
-
$table.handleHeaderCellDragMousedownEvent(evnt, params)
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
mouseup: $table.handleHeaderCellDragMouseupEvent
|
|
125
|
-
}
|
|
129
|
+
on: ons
|
|
126
130
|
}, [
|
|
127
131
|
h('i', {
|
|
128
132
|
class: icon || getIcon().TABLE_DRAG_COLUMN
|
|
@@ -153,15 +153,19 @@ function renderRows (h: CreateElement, _vm: any, tableColumn: VxeTableDefines.Co
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
function renderHeads (h: CreateElement, _vm: any, footerTableData: any[]) {
|
|
156
|
+
const $xeTable = _vm.$parent
|
|
157
|
+
|
|
158
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
159
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
160
|
+
|
|
156
161
|
const { $parent: $xetable, fixedType, tableColumn } = _vm
|
|
157
162
|
const { footerRowClassName, footerRowStyle, isDragColMove } = $xetable
|
|
158
|
-
const columnOpts = $xetable.columnOpts
|
|
159
163
|
|
|
160
164
|
return footerTableData.map((row: any, $rowIndex: any) => {
|
|
161
165
|
const _rowIndex = $rowIndex
|
|
162
166
|
const rowParams = { $table: $xetable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType }
|
|
163
167
|
|
|
164
|
-
if (columnOpts.drag) {
|
|
168
|
+
if (columnOpts.drag && columnDragOpts.animation) {
|
|
165
169
|
return h('transition-group', {
|
|
166
170
|
props: {
|
|
167
171
|
tag: 'tr',
|
|
@@ -12,9 +12,14 @@ const { renderer } = VxeUI
|
|
|
12
12
|
const cellType = 'header'
|
|
13
13
|
|
|
14
14
|
const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo[], $rowIndex: number) => {
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const $xeTable = _vm.$parent
|
|
16
|
+
const $xeGrid = $xeTable.xegrid
|
|
17
17
|
|
|
18
|
+
const { fixedType } = _vm
|
|
19
|
+
|
|
20
|
+
const { resizable: allResizable, border, columnKey, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, currentColumn, scrollXLoad, overflowX, scrollbarWidth, mouseConfig, columnOpts } = $xeTable
|
|
21
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
22
|
+
const { disabledMethod: dragDisabledMethod } = columnDragOpts
|
|
18
23
|
return cols.map((column: any, $columnIndex: any) => {
|
|
19
24
|
const { type, showHeaderOverflow, headerAlign, align, headerClassName, editRender, cellRender } = column
|
|
20
25
|
// const { enabled } = tooltipOpts
|
|
@@ -29,30 +34,40 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
|
|
|
29
34
|
const showTitle = headOverflow === 'title'
|
|
30
35
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip'
|
|
31
36
|
let hasEllipsis = showTitle || showTooltip || showEllipsis
|
|
32
|
-
const thOns: any = {}
|
|
33
37
|
const hasFilter = column.filters && column.filters.some((item: any) => item.checked)
|
|
34
|
-
const columnIndex = $
|
|
35
|
-
const _columnIndex = $
|
|
36
|
-
const params = { $table: $
|
|
38
|
+
const columnIndex = $xeTable.getColumnIndex(column)
|
|
39
|
+
const _columnIndex = $xeTable.getVTColumnIndex(column)
|
|
40
|
+
const params = { $table: $xeTable, $grid: $xeGrid, $rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: cellType, isHidden: fixedHiddenColumn, hasFilter }
|
|
41
|
+
const thAttrs: Record<string, string | number | null> = {
|
|
42
|
+
colid,
|
|
43
|
+
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
44
|
+
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
45
|
+
}
|
|
46
|
+
const thOns: any = {
|
|
47
|
+
click: (evnt: MouseEvent) => $xeTable.triggerHeaderCellClickEvent(evnt, params),
|
|
48
|
+
dblclick: (evnt: MouseEvent) => $xeTable.triggerHeaderCellDblclickEvent(evnt, params)
|
|
49
|
+
}
|
|
37
50
|
// 虚拟滚动不支持动态高度
|
|
38
51
|
if (scrollXLoad && !hasEllipsis) {
|
|
39
52
|
showEllipsis = hasEllipsis = true
|
|
40
53
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
thOns.dblclick = (evnt: any) => $xetable.triggerHeaderCellDblclickEvent(evnt, params)
|
|
54
|
+
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell'
|
|
55
|
+
let isDisabledDrag = false
|
|
56
|
+
if (isColDragCell) {
|
|
57
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(params))
|
|
46
58
|
}
|
|
47
59
|
// 按下事件处理
|
|
48
|
-
if (mouseConfig) {
|
|
49
|
-
thOns.mousedown = (evnt: any) => $
|
|
60
|
+
if (mouseConfig || isColDragCell) {
|
|
61
|
+
thOns.mousedown = (evnt: any) => $xeTable.triggerHeaderCellMousedownEvent(evnt, params)
|
|
50
62
|
}
|
|
51
|
-
//
|
|
63
|
+
// 拖拽列事件
|
|
52
64
|
if (columnOpts.drag) {
|
|
53
|
-
thOns.dragstart = $
|
|
54
|
-
thOns.dragend = $
|
|
55
|
-
thOns.dragover = $
|
|
65
|
+
thOns.dragstart = $xeTable.handleHeaderCellDragDragstartEvent
|
|
66
|
+
thOns.dragend = $xeTable.handleHeaderCellDragDragendEvent
|
|
67
|
+
thOns.dragover = $xeTable.handleHeaderCellDragDragoverEvent
|
|
68
|
+
if (isColDragCell) {
|
|
69
|
+
thOns.mouseup = $xeTable.handleHeaderCellDragMouseupEvent
|
|
70
|
+
}
|
|
56
71
|
}
|
|
57
72
|
return h('th', {
|
|
58
73
|
class: ['vxe-header--column', colid, {
|
|
@@ -66,13 +81,10 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
|
|
|
66
81
|
'is--sortable': column.sortable,
|
|
67
82
|
'col--filter': !!column.filters,
|
|
68
83
|
'is--filter-active': hasFilter,
|
|
84
|
+
'is--drag-disabled': isDisabledDrag,
|
|
69
85
|
'col--current': currentColumn === column
|
|
70
86
|
}, getClass(headerClassName, params), getClass(headerCellClassName, params)],
|
|
71
|
-
attrs:
|
|
72
|
-
colid,
|
|
73
|
-
colspan: column.colSpan > 1 ? column.colSpan : null,
|
|
74
|
-
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
75
|
-
},
|
|
87
|
+
attrs: thAttrs,
|
|
76
88
|
style: headerCellStyle ? (XEUtils.isFunction(headerCellStyle) ? headerCellStyle(params) : headerCellStyle) : null,
|
|
77
89
|
on: thOns,
|
|
78
90
|
key: columnKey || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
@@ -109,18 +121,21 @@ const renderRows = (h: CreateElement, _vm: any, cols: VxeTableDefines.ColumnInfo
|
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
function renderHeads (h: CreateElement, _vm: any, headerGroups: any[]) {
|
|
112
|
-
const
|
|
113
|
-
const tableProps = $
|
|
124
|
+
const $xeTable = _vm.$parent
|
|
125
|
+
const tableProps = $xeTable
|
|
114
126
|
|
|
115
127
|
const { fixedType } = _vm
|
|
128
|
+
|
|
129
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
130
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
131
|
+
|
|
116
132
|
const { headerRowClassName, headerRowStyle } = tableProps
|
|
117
|
-
const { isDragColMove } = $
|
|
118
|
-
const columnOpts = $xetable.columnOpts
|
|
133
|
+
const { isDragColMove } = $xeTable
|
|
119
134
|
|
|
120
135
|
return headerGroups.map((cols: any, $rowIndex: any) => {
|
|
121
|
-
const params = { $table: $
|
|
136
|
+
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: cellType }
|
|
122
137
|
|
|
123
|
-
if (columnOpts.drag) {
|
|
138
|
+
if (columnOpts.drag && columnDragOpts.animation) {
|
|
124
139
|
return h('transition-group', {
|
|
125
140
|
props: {
|
|
126
141
|
tag: 'tr',
|
|
@@ -5156,6 +5156,79 @@ const Methods = {
|
|
|
5156
5156
|
$xeTable.handleColumnSortEvent(evnt, column)
|
|
5157
5157
|
}
|
|
5158
5158
|
},
|
|
5159
|
+
/**
|
|
5160
|
+
* 表头单元格按下事件
|
|
5161
|
+
*/
|
|
5162
|
+
triggerHeaderCellMousedownEvent (evnt: any, params: any) {
|
|
5163
|
+
const $xeTable = this
|
|
5164
|
+
const props = $xeTable
|
|
5165
|
+
|
|
5166
|
+
const { mouseConfig } = props
|
|
5167
|
+
const mouseOpts = $xeTable.computeMouseOpts
|
|
5168
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
5169
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
5170
|
+
const { trigger, disabledMethod } = columnDragOpts
|
|
5171
|
+
const cell = evnt.currentTarget
|
|
5172
|
+
const triggerInput = cell && cell.tagName && cell.tagName.toLowerCase() === 'input'
|
|
5173
|
+
const triggerCheckbox = getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag
|
|
5174
|
+
const triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag
|
|
5175
|
+
const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag
|
|
5176
|
+
let triggerDrag = false
|
|
5177
|
+
if (!(triggerInput || triggerCheckbox || triggerSort || triggerFilter)) {
|
|
5178
|
+
if (columnOpts.drag && trigger === 'cell' && !(disabledMethod && disabledMethod(params))) {
|
|
5179
|
+
triggerDrag = true
|
|
5180
|
+
$xeTable.handleHeaderCellDragMousedownEvent(evnt, params)
|
|
5181
|
+
}
|
|
5182
|
+
}
|
|
5183
|
+
if (!triggerDrag && mouseConfig && mouseOpts.area && $xeTable.handleHeaderCellAreaEvent) {
|
|
5184
|
+
$xeTable.handleHeaderCellAreaEvent(evnt, Object.assign({ cell, triggerSort, triggerFilter }, params))
|
|
5185
|
+
}
|
|
5186
|
+
$xeTable.focus()
|
|
5187
|
+
if ($xeTable.closeMenu) {
|
|
5188
|
+
$xeTable.closeMenu()
|
|
5189
|
+
}
|
|
5190
|
+
},
|
|
5191
|
+
/**
|
|
5192
|
+
* 单元格按下事件
|
|
5193
|
+
*/
|
|
5194
|
+
triggerCellMousedownEvent (evnt: any, params: any) {
|
|
5195
|
+
const $xeTable = this
|
|
5196
|
+
|
|
5197
|
+
const { column } = params
|
|
5198
|
+
const { type, treeNode } = column
|
|
5199
|
+
const isRadioType = type === 'radio'
|
|
5200
|
+
const isCheckboxType = type === 'checkbox'
|
|
5201
|
+
const isExpandType = type === 'expand'
|
|
5202
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
5203
|
+
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
5204
|
+
const { trigger, disabledMethod } = rowDragOpts
|
|
5205
|
+
const cell = evnt.currentTarget
|
|
5206
|
+
params.cell = cell
|
|
5207
|
+
const triggerInput = cell && cell.tagName && cell.tagName.toLowerCase() === 'input'
|
|
5208
|
+
const triggerRadio = isRadioType && getEventTargetNode(evnt, cell, 'vxe-cell--radio').flag
|
|
5209
|
+
const triggerCheckbox = isCheckboxType && getEventTargetNode(evnt, cell, 'vxe-cell--checkbox').flag
|
|
5210
|
+
const triggerTreeNode = treeNode && getEventTargetNode(evnt, cell, 'vxe-tree--btn-wrapper').flag
|
|
5211
|
+
const triggerExpandNode = isExpandType && getEventTargetNode(evnt, cell, 'vxe-table--expanded').flag
|
|
5212
|
+
let isColDragCell = false
|
|
5213
|
+
if (rowOpts.drag) {
|
|
5214
|
+
isColDragCell = trigger === 'row' || (column.dragSort && trigger === 'cell')
|
|
5215
|
+
}
|
|
5216
|
+
let triggerDrag = false
|
|
5217
|
+
if (!(triggerInput || triggerRadio || triggerCheckbox || triggerTreeNode || triggerExpandNode)) {
|
|
5218
|
+
if (isColDragCell && !(disabledMethod && disabledMethod(params))) {
|
|
5219
|
+
triggerDrag = true
|
|
5220
|
+
$xeTable.handleCellDragMousedownEvent(evnt, params)
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
if (!triggerDrag && $xeTable.handleCellMousedownEvent) {
|
|
5224
|
+
$xeTable.handleCellMousedownEvent(evnt, params)
|
|
5225
|
+
}
|
|
5226
|
+
$xeTable.focus()
|
|
5227
|
+
$xeTable.closeFilter()
|
|
5228
|
+
if ($xeTable.closeMenu) {
|
|
5229
|
+
$xeTable.closeMenu()
|
|
5230
|
+
}
|
|
5231
|
+
},
|
|
5159
5232
|
/**
|
|
5160
5233
|
* 行拖拽
|
|
5161
5234
|
*/
|
|
@@ -5395,12 +5468,13 @@ const Methods = {
|
|
|
5395
5468
|
const props = $xeTable
|
|
5396
5469
|
const reactData = $xeTable
|
|
5397
5470
|
|
|
5471
|
+
evnt.stopPropagation()
|
|
5398
5472
|
const { dragConfig } = props
|
|
5399
5473
|
const rowDragOpts = $xeTable.computeRowDragOpts
|
|
5400
|
-
const { dragStartMethod } = rowDragOpts
|
|
5474
|
+
const { trigger, dragStartMethod } = rowDragOpts
|
|
5401
5475
|
const { row } = params
|
|
5402
5476
|
const dragEl = evnt.currentTarget as HTMLElement
|
|
5403
|
-
const tdEl = dragEl.parentElement?.parentElement as HTMLElement
|
|
5477
|
+
const tdEl = trigger === 'cell' || trigger === 'row' ? dragEl : dragEl.parentElement?.parentElement as HTMLElement
|
|
5404
5478
|
const trEl = tdEl.parentElement as HTMLElement
|
|
5405
5479
|
const dStartMethod = dragStartMethod || (dragConfig ? dragConfig.dragStartMethod : null)
|
|
5406
5480
|
reactData.isDragRowMove = false
|
|
@@ -5652,11 +5726,12 @@ const Methods = {
|
|
|
5652
5726
|
const $xeTable = this
|
|
5653
5727
|
const reactData = $xeTable
|
|
5654
5728
|
|
|
5729
|
+
evnt.stopPropagation()
|
|
5655
5730
|
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
5656
|
-
const { dragStartMethod } = columnDragOpts
|
|
5731
|
+
const { trigger, dragStartMethod } = columnDragOpts
|
|
5657
5732
|
const { column } = params
|
|
5658
5733
|
const dragEl = evnt.currentTarget as HTMLElement
|
|
5659
|
-
const thEl = dragEl.parentElement?.parentElement as HTMLElement
|
|
5734
|
+
const thEl = trigger === 'cell' ? dragEl : dragEl.parentElement?.parentElement as HTMLElement
|
|
5660
5735
|
reactData.isDragColMove = false
|
|
5661
5736
|
clearColDropOrigin($xeTable)
|
|
5662
5737
|
if (dragStartMethod && !dragStartMethod(params)) {
|
|
@@ -1072,7 +1072,7 @@ export default {
|
|
|
1072
1072
|
if (this.editRules && !this._validate) {
|
|
1073
1073
|
errLog('vxe.error.reqModule', ['Validator'])
|
|
1074
1074
|
}
|
|
1075
|
-
if ((this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig) && !this.
|
|
1075
|
+
if ((this.checkboxOpts.range || this.keyboardConfig || this.mouseConfig) && !this.handleCellMousedownEvent) {
|
|
1076
1076
|
errLog('vxe.error.reqModule', ['Keyboard'])
|
|
1077
1077
|
}
|
|
1078
1078
|
if ((this.printConfig || this.importConfig || this.exportConfig) && !this._exportData) {
|
|
@@ -1253,6 +1253,7 @@ export default {
|
|
|
1253
1253
|
const virtualScrollBars = $xeTable.computeVirtualScrollBars
|
|
1254
1254
|
const isArea = mouseConfig && mouseOpts.area
|
|
1255
1255
|
const tableStyle = $xeTable.computeTableStyle
|
|
1256
|
+
const columnDragOpts = $xeTable.computeColumnDragOpts
|
|
1256
1257
|
return h('div', {
|
|
1257
1258
|
ref: 'refElem',
|
|
1258
1259
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
@@ -1268,6 +1269,7 @@ export default {
|
|
|
1268
1269
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
1269
1270
|
'checkbox--range': checkboxOpts.range,
|
|
1270
1271
|
'column--calc': isCalcColumn,
|
|
1272
|
+
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
1271
1273
|
'is--header': showHeader,
|
|
1272
1274
|
'is--footer': showFooter,
|
|
1273
1275
|
'is--group': isGroup,
|
package/packages/ui/index.ts
CHANGED
|
@@ -48,10 +48,12 @@ VxeUI.setConfig({
|
|
|
48
48
|
strict: true
|
|
49
49
|
},
|
|
50
50
|
rowDragConfig: {
|
|
51
|
-
showIcon: true
|
|
51
|
+
showIcon: true,
|
|
52
|
+
animation: true
|
|
52
53
|
},
|
|
53
54
|
columnDragConfig: {
|
|
54
|
-
showIcon: true
|
|
55
|
+
showIcon: true,
|
|
56
|
+
animation: true
|
|
55
57
|
},
|
|
56
58
|
checkboxConfig: {
|
|
57
59
|
// trigger: 'default',
|
|
@@ -677,6 +677,24 @@
|
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
|
+
&.col--drag-cell {
|
|
681
|
+
.vxe-header--column {
|
|
682
|
+
user-select: none;
|
|
683
|
+
&:not(.is--drag-disabled) {
|
|
684
|
+
cursor: grab;
|
|
685
|
+
&:active {
|
|
686
|
+
cursor: grabbing;
|
|
687
|
+
}
|
|
688
|
+
&:hover {
|
|
689
|
+
color: var(--vxe-ui-font-primary-color);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
&.is--drag-disabled {
|
|
693
|
+
color: var(--vxe-ui-input-disabled-color);
|
|
694
|
+
cursor: not-allowed;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
680
698
|
&.column--highlight {
|
|
681
699
|
.vxe-header--column {
|
|
682
700
|
&:not(.col--seq) {
|
|
@@ -1368,6 +1386,24 @@
|
|
|
1368
1386
|
}
|
|
1369
1387
|
}
|
|
1370
1388
|
}
|
|
1389
|
+
.vxe-body--column {
|
|
1390
|
+
&.is--drag-cell {
|
|
1391
|
+
user-select: none;
|
|
1392
|
+
&:not(.is--drag-disabled) {
|
|
1393
|
+
cursor: grab;
|
|
1394
|
+
&:active {
|
|
1395
|
+
cursor: grabbing;
|
|
1396
|
+
}
|
|
1397
|
+
&:hover {
|
|
1398
|
+
color: var(--vxe-ui-font-primary-color);
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
&.is--drag-disabled {
|
|
1402
|
+
color: var(--vxe-ui-input-disabled-color);
|
|
1403
|
+
cursor: not-allowed;
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1371
1407
|
.vxe-body--row-list-move {
|
|
1372
1408
|
transition-property: transform;
|
|
1373
1409
|
transition-duration: 0.35s;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|