vxe-table 3.14.0-beta.9 → 3.14.0
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/grid/src/grid.js +62 -42
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +4 -2
- package/es/table/module/custom/panel.js +24 -23
- package/es/table/module/edit/mixin.js +17 -11
- package/es/table/module/export/export-panel.js +5 -4
- package/es/table/module/export/import-panel.js +8 -7
- package/es/table/module/export/mixin.js +30 -27
- package/es/table/module/filter/panel.js +21 -10
- package/es/table/module/keyboard/mixin.js +141 -41
- package/es/table/module/menu/mixin.js +6 -3
- package/es/table/module/menu/panel.js +7 -7
- package/es/table/module/validator/mixin.js +2 -2
- package/es/table/render/index.js +2 -2
- package/es/table/src/body.js +39 -20
- package/es/table/src/cell.js +27 -22
- package/es/table/src/column.js +11 -9
- package/es/table/src/columnInfo.js +6 -6
- package/es/table/src/footer.js +12 -7
- package/es/table/src/group.js +6 -5
- package/es/table/src/header.js +15 -9
- package/es/table/src/methods.js +761 -698
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +85 -49
- package/es/table/src/util.js +55 -20
- package/es/toolbar/src/toolbar.js +3 -3
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +69 -59
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1558 -1232
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +5 -3
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +22 -29
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +19 -13
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +5 -4
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +8 -7
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +35 -34
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +16 -16
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +149 -47
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +6 -3
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +7 -7
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +3 -3
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +3 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +47 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +39 -23
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +11 -9
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +12 -5
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +6 -5
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +16 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +898 -825
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +93 -52
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +62 -21
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -3
- package/lib/ui/index.js +2 -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/package.json +2 -2
- package/packages/grid/src/grid.ts +75 -51
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/custom/mixin.ts +6 -3
- package/packages/table/module/custom/panel.ts +42 -37
- package/packages/table/module/edit/mixin.ts +20 -14
- package/packages/table/module/export/export-panel.ts +8 -5
- package/packages/table/module/export/import-panel.ts +11 -7
- package/packages/table/module/export/mixin.ts +37 -32
- package/packages/table/module/filter/panel.ts +25 -10
- package/packages/table/module/keyboard/mixin.ts +155 -49
- package/packages/table/module/menu/mixin.ts +12 -6
- package/packages/table/module/menu/panel.ts +10 -7
- package/packages/table/module/validator/mixin.ts +2 -2
- package/packages/table/render/index.ts +2 -2
- package/packages/table/src/body.ts +39 -20
- package/packages/table/src/cell.ts +27 -22
- package/packages/table/src/column.ts +14 -10
- package/packages/table/src/columnInfo.ts +9 -6
- package/packages/table/src/footer.ts +12 -7
- package/packages/table/src/group.ts +9 -5
- package/packages/table/src/header.ts +16 -9
- package/packages/table/src/methods.ts +840 -734
- package/packages/table/src/props.ts +16 -12
- package/packages/table/src/table.ts +99 -52
- package/packages/table/src/util.ts +63 -21
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/es/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/es/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
- /package/lib/{iconfont.1741336976538.ttf → iconfont.1742955973002.ttf} +0 -0
- /package/lib/{iconfont.1741336976538.woff → iconfont.1742955973002.woff} +0 -0
- /package/lib/{iconfont.1741336976538.woff2 → iconfont.1742955973002.woff2} +0 -0
|
@@ -61,13 +61,23 @@ export default {
|
|
|
61
61
|
if (filterSlot) {
|
|
62
62
|
return [
|
|
63
63
|
h('div', {
|
|
64
|
-
class: 'vxe-table--filter-template'
|
|
64
|
+
class: 'vxe-table--filter-template',
|
|
65
|
+
style: maxHeight
|
|
66
|
+
? {
|
|
67
|
+
maxHeight: `${maxHeight}px`
|
|
68
|
+
}
|
|
69
|
+
: {}
|
|
65
70
|
}, $xeTable.callSlot(filterSlot, params, h))
|
|
66
71
|
]
|
|
67
72
|
} else if (rtFilter) {
|
|
68
73
|
return [
|
|
69
74
|
h('div', {
|
|
70
|
-
class: 'vxe-table--filter-template'
|
|
75
|
+
class: 'vxe-table--filter-template',
|
|
76
|
+
style: maxHeight
|
|
77
|
+
? {
|
|
78
|
+
maxHeight: `${maxHeight}px`
|
|
79
|
+
}
|
|
80
|
+
: {}
|
|
71
81
|
}, getSlotVNs(rtFilter.call($xeTable, h, filterRender, params)))
|
|
72
82
|
]
|
|
73
83
|
}
|
|
@@ -188,19 +198,22 @@ export default {
|
|
|
188
198
|
*************************/
|
|
189
199
|
// (单选)筛选发生改变
|
|
190
200
|
changeRadioOption (evnt: any, checked: any, item: any) {
|
|
191
|
-
const
|
|
201
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
202
|
+
|
|
203
|
+
const { filterStore } = this
|
|
192
204
|
filterStore.options.forEach((option: any) => {
|
|
193
205
|
option._checked = false
|
|
194
206
|
})
|
|
195
207
|
item._checked = checked
|
|
196
|
-
$
|
|
208
|
+
$xeTable.checkFilterOptions()
|
|
197
209
|
this.confirmFilter(evnt)
|
|
198
210
|
},
|
|
199
211
|
// (多选)筛选发生改变
|
|
200
212
|
changeMultipleOption (evnt: any, checked: any, item: any) {
|
|
201
|
-
const
|
|
213
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
214
|
+
|
|
202
215
|
item._checked = checked
|
|
203
|
-
$
|
|
216
|
+
$xeTable.checkFilterOptions()
|
|
204
217
|
},
|
|
205
218
|
changeAllOption (evnt: any, checked: any) {
|
|
206
219
|
if (this.filterStore.multiple) {
|
|
@@ -219,13 +232,15 @@ export default {
|
|
|
219
232
|
},
|
|
220
233
|
// 确认筛选
|
|
221
234
|
confirmFilter (evnt: any) {
|
|
222
|
-
const
|
|
223
|
-
|
|
235
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
236
|
+
|
|
237
|
+
$xeTable.handleFilterConfirmFilter(evnt)
|
|
224
238
|
},
|
|
225
239
|
// 重置筛选
|
|
226
240
|
resetFilter (evnt: any) {
|
|
227
|
-
const
|
|
228
|
-
|
|
241
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
242
|
+
|
|
243
|
+
$xeTable.handleFilterResetFilter(evnt)
|
|
229
244
|
}
|
|
230
245
|
/*************************
|
|
231
246
|
* Publish methods
|
|
@@ -2,7 +2,7 @@ import XEUtils from 'xe-utils'
|
|
|
2
2
|
import { getRefElem } from '../../src/util'
|
|
3
3
|
import { browse, hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom'
|
|
4
4
|
|
|
5
|
-
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../../types'
|
|
5
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines, TableReactData, TableInternalData } from '../../../../types'
|
|
6
6
|
|
|
7
7
|
function getTargetOffset (target: any, container: any) {
|
|
8
8
|
let offsetTop = 0
|
|
@@ -26,10 +26,10 @@ function getTargetOffset (target: any, container: any) {
|
|
|
26
26
|
return { offsetTop, offsetLeft }
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function getCheckboxRangeRows ($xeTable:
|
|
29
|
+
function getCheckboxRangeRows ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, params: any, targetTrElem: HTMLElement, trRect: DOMRect, offsetClientTop: number, moveRange: number) {
|
|
30
30
|
const props = $xeTable
|
|
31
|
-
const reactData = $xeTable
|
|
32
|
-
const internalData = $xeTable
|
|
31
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
32
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
33
33
|
|
|
34
34
|
const { showOverflow } = props
|
|
35
35
|
const { fullAllDataRowIdData, isResizeCellHeight } = internalData
|
|
@@ -96,17 +96,59 @@ function getCheckboxRangeRows ($xeTable: any, evnt: MouseEvent, params: any, tar
|
|
|
96
96
|
return rangeRows
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
function handleMoveSelected ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: any, args: any, isLeftArrow: boolean, isUpArrow: boolean, isRightArrow: boolean, isDwArrow: boolean) {
|
|
100
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
101
|
+
|
|
102
|
+
const { afterFullData, visibleColumn } = internalData
|
|
103
|
+
const params = Object.assign({}, args)
|
|
104
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row)
|
|
105
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column)
|
|
106
|
+
evnt.preventDefault()
|
|
107
|
+
if (isUpArrow && _rowIndex > 0) {
|
|
108
|
+
// 移动到上一行
|
|
109
|
+
params.rowIndex = _rowIndex - 1
|
|
110
|
+
params.row = afterFullData[params.rowIndex]
|
|
111
|
+
} else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
112
|
+
// 移动到下一行
|
|
113
|
+
params.rowIndex = _rowIndex + 1
|
|
114
|
+
params.row = afterFullData[params.rowIndex]
|
|
115
|
+
} else if (isLeftArrow && _columnIndex) {
|
|
116
|
+
// 移动到左侧单元格
|
|
117
|
+
params.columnIndex = _columnIndex - 1
|
|
118
|
+
params.column = visibleColumn[params.columnIndex]
|
|
119
|
+
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
120
|
+
// 移动到右侧单元格
|
|
121
|
+
params.columnIndex = _columnIndex + 1
|
|
122
|
+
params.column = visibleColumn[params.columnIndex]
|
|
123
|
+
}
|
|
124
|
+
$xeTable.scrollToRow(params.row, params.column).then(() => {
|
|
125
|
+
params.cell = $xeTable.getCellElement(params.row, params.column)
|
|
126
|
+
$xeTable.handleSelected(params, evnt)
|
|
127
|
+
})
|
|
128
|
+
return params
|
|
129
|
+
}
|
|
130
|
+
|
|
99
131
|
export default {
|
|
100
132
|
methods: {
|
|
101
133
|
// 处理 Tab 键移动
|
|
102
134
|
moveTabSelected (args: any, isLeft: any, evnt: any) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
135
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
136
|
+
const props = $xeTable
|
|
137
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
138
|
+
|
|
139
|
+
const { editConfig } = props
|
|
140
|
+
const { afterFullData, visibleColumn } = internalData
|
|
141
|
+
const editOpts = $xeTable.computeEditOpts
|
|
142
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
143
|
+
const currentRowOpts = $xeTable.computeCurrentRowOpts
|
|
144
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
145
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts
|
|
146
|
+
let targetRow: any
|
|
147
|
+
let targetRowIndex: any
|
|
148
|
+
let targetColumnIndex: any
|
|
107
149
|
const params = Object.assign({}, args)
|
|
108
|
-
const _rowIndex =
|
|
109
|
-
const _columnIndex =
|
|
150
|
+
const _rowIndex = $xeTable.getVTRowIndex(params.row)
|
|
151
|
+
const _columnIndex = $xeTable.getVTColumnIndex(params.column)
|
|
110
152
|
evnt.preventDefault()
|
|
111
153
|
if (isLeft) {
|
|
112
154
|
// 向左
|
|
@@ -142,28 +184,45 @@ export default {
|
|
|
142
184
|
}
|
|
143
185
|
params.columnIndex = targetColumnIndex
|
|
144
186
|
params.column = targetColumn
|
|
145
|
-
params.cell =
|
|
187
|
+
params.cell = $xeTable.getCellElement(params.row, params.column)
|
|
188
|
+
if (rowOpts.isCurrent && currentRowOpts.isFollowSelected) {
|
|
189
|
+
$xeTable.triggerCurrentRowEvent(evnt, params)
|
|
190
|
+
}
|
|
191
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
192
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params)
|
|
193
|
+
}
|
|
146
194
|
if (editConfig) {
|
|
147
195
|
if (editOpts.trigger === 'click' || editOpts.trigger === 'dblclick') {
|
|
148
196
|
if (editOpts.mode === 'row') {
|
|
149
|
-
|
|
197
|
+
$xeTable.handleEdit(params, evnt)
|
|
150
198
|
} else {
|
|
151
|
-
|
|
152
|
-
.then(() =>
|
|
199
|
+
$xeTable.scrollToRow(params.row, params.column)
|
|
200
|
+
.then(() => {
|
|
201
|
+
$xeTable.handleSelected(params, evnt)
|
|
202
|
+
})
|
|
153
203
|
}
|
|
154
204
|
}
|
|
155
205
|
} else {
|
|
156
|
-
|
|
157
|
-
.then(() =>
|
|
206
|
+
$xeTable.scrollToRow(params.row, params.column)
|
|
207
|
+
.then(() => {
|
|
208
|
+
$xeTable.handleSelected(params, evnt)
|
|
209
|
+
})
|
|
158
210
|
}
|
|
159
211
|
}
|
|
160
212
|
},
|
|
161
213
|
// 处理当前行方向键移动
|
|
162
|
-
moveCurrentRow (isUpArrow:
|
|
163
|
-
const
|
|
214
|
+
moveCurrentRow (isUpArrow: boolean, isDwArrow: boolean, evnt: any) {
|
|
215
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
216
|
+
const props = $xeTable
|
|
217
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
218
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
219
|
+
|
|
220
|
+
const { treeConfig } = props
|
|
221
|
+
const { currentRow } = reactData
|
|
222
|
+
const { afterFullData } = internalData
|
|
223
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
164
224
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
165
225
|
let targetRow
|
|
166
|
-
evnt.preventDefault()
|
|
167
226
|
if (currentRow) {
|
|
168
227
|
if (treeConfig) {
|
|
169
228
|
const { index, items } = XEUtils.findTree(afterFullData, item => item === currentRow, { children: childrenField })
|
|
@@ -173,7 +232,7 @@ export default {
|
|
|
173
232
|
targetRow = items[index + 1]
|
|
174
233
|
}
|
|
175
234
|
} else {
|
|
176
|
-
const _rowIndex =
|
|
235
|
+
const _rowIndex = $xeTable.getVTRowIndex(currentRow)
|
|
177
236
|
if (isUpArrow && _rowIndex > 0) {
|
|
178
237
|
targetRow = afterFullData[_rowIndex - 1]
|
|
179
238
|
} else if (isDwArrow && _rowIndex < afterFullData.length - 1) {
|
|
@@ -184,39 +243,86 @@ export default {
|
|
|
184
243
|
targetRow = afterFullData[0]
|
|
185
244
|
}
|
|
186
245
|
if (targetRow) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
246
|
+
evnt.preventDefault()
|
|
247
|
+
const params = {
|
|
248
|
+
$table: $xeTable,
|
|
249
|
+
row: targetRow,
|
|
250
|
+
rowIndex: $xeTable.getRowIndex(targetRow),
|
|
251
|
+
$rowIndex: $xeTable.getVMRowIndex(targetRow)
|
|
252
|
+
}
|
|
253
|
+
$xeTable.scrollToRow(targetRow)
|
|
254
|
+
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params))
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
// 处理当前列方向键移动
|
|
258
|
+
moveCurrentColumn (isLeftArrow: boolean, isRightArrow: boolean, evnt: any) {
|
|
259
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
260
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
261
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
262
|
+
|
|
263
|
+
const { currentColumn } = reactData
|
|
264
|
+
const { visibleColumn } = internalData
|
|
265
|
+
let targetCol: VxeTableDefines.ColumnInfo | null = null
|
|
266
|
+
if (currentColumn) {
|
|
267
|
+
const _columnIndex = $xeTable.getVTColumnIndex(currentColumn)
|
|
268
|
+
if (isLeftArrow && _columnIndex > 0) {
|
|
269
|
+
targetCol = visibleColumn[_columnIndex - 1]
|
|
270
|
+
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
271
|
+
targetCol = visibleColumn[_columnIndex + 1]
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
targetCol = visibleColumn[0]
|
|
275
|
+
}
|
|
276
|
+
if (targetCol) {
|
|
277
|
+
evnt.preventDefault()
|
|
278
|
+
const params = {
|
|
279
|
+
$table: $xeTable,
|
|
280
|
+
column: targetCol,
|
|
281
|
+
columnIndex: $xeTable.getColumnIndex(targetCol),
|
|
282
|
+
$columnIndex: $xeTable.getVMColumnIndex(targetCol)
|
|
283
|
+
}
|
|
284
|
+
$xeTable.scrollToColumn(targetCol)
|
|
285
|
+
.then(() => $xeTable.triggerCurrentColumnEvent(evnt, params))
|
|
190
286
|
}
|
|
191
287
|
},
|
|
192
288
|
// 处理可编辑方向键移动
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
// 移动到下一行
|
|
205
|
-
params.rowIndex = _rowIndex + 1
|
|
206
|
-
params.row = afterFullData[params.rowIndex]
|
|
207
|
-
} else if (isLeftArrow && _columnIndex) {
|
|
208
|
-
// 移动到左侧单元格
|
|
209
|
-
params.columnIndex = _columnIndex - 1
|
|
210
|
-
params.column = visibleColumn[params.columnIndex]
|
|
211
|
-
} else if (isRightArrow && _columnIndex < visibleColumn.length - 1) {
|
|
212
|
-
// 移动到右侧单元格
|
|
213
|
-
params.columnIndex = _columnIndex + 1
|
|
214
|
-
params.column = visibleColumn[params.columnIndex]
|
|
289
|
+
moveArrowSelected (args: any, isLeftArrow: boolean, isUpArrow: boolean, isRightArrow: boolean, isDwArrow: boolean, evnt: any) {
|
|
290
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
291
|
+
const props = $xeTable
|
|
292
|
+
|
|
293
|
+
const { highlightCurrentRow, highlightCurrentColumn } = props
|
|
294
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
295
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
296
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow)
|
|
297
|
+
// 当前行按键上下移动
|
|
298
|
+
if ((isUpArrow || isDwArrow) && (rowOpts.isCurrent || highlightCurrentRow)) {
|
|
299
|
+
$xeTable.moveCurrentRow(isUpArrow, isDwArrow, evnt)
|
|
215
300
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
301
|
+
// 当前行按键左右移动
|
|
302
|
+
if ((isLeftArrow || isRightArrow) && (columnOpts.isCurrent || highlightCurrentColumn)) {
|
|
303
|
+
$xeTable.moveCurrentColumn(isLeftArrow, isRightArrow, evnt)
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
moveEnterSelected (args: any, isLeftArrow: boolean, isUpArrow: boolean, isRightArrow: boolean, isDwArrow: boolean, evnt: any) {
|
|
307
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
308
|
+
|
|
309
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
310
|
+
const currentRowOpts = $xeTable.computeCurrentRowOpts
|
|
311
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
312
|
+
const currentColumnOpts = $xeTable.computeCurrentColumnOpts
|
|
313
|
+
const params = handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow)
|
|
314
|
+
if ((rowOpts.isCurrent && currentRowOpts.isFollowSelected)) {
|
|
315
|
+
$xeTable.triggerCurrentRowEvent(evnt, params)
|
|
316
|
+
}
|
|
317
|
+
if (columnOpts.isCurrent && currentColumnOpts.isFollowSelected) {
|
|
318
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params)
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
// 处理可编辑方向键移动
|
|
322
|
+
moveSelected (args: any, isLeftArrow: boolean, isUpArrow: boolean, isRightArrow: boolean, isDwArrow: boolean, evnt: any) {
|
|
323
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
324
|
+
|
|
325
|
+
handleMoveSelected($xeTable, evnt, args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow)
|
|
220
326
|
},
|
|
221
327
|
handleCellMousedownEvent (evnt: any, params: any) {
|
|
222
328
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -4,6 +4,8 @@ import { getDomNode, getAbsolutePos, getEventTargetNode } from '../../../ui/src/
|
|
|
4
4
|
import { isEnableConf, hasChildrenList } from '../../../ui/src/utils'
|
|
5
5
|
import { warnLog } from '../../../ui/src/log'
|
|
6
6
|
|
|
7
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeGridConstructor, GridPrivateMethods, TableInternalData } from '../../../../types'
|
|
8
|
+
|
|
7
9
|
const { menus } = VxeUI
|
|
8
10
|
|
|
9
11
|
export default {
|
|
@@ -55,8 +57,9 @@ export default {
|
|
|
55
57
|
* 快捷菜单事件处理
|
|
56
58
|
*/
|
|
57
59
|
handleGlobalContextmenuEvent (evnt: any) {
|
|
58
|
-
const $xeTable = this
|
|
59
|
-
const
|
|
60
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
61
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
62
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
60
63
|
|
|
61
64
|
const { $refs, tId, editStore, menuConfig, contextMenu, ctxMenuStore, ctxMenuOpts, mouseConfig, mouseOpts } = this
|
|
62
65
|
const { selected } = editStore
|
|
@@ -69,7 +72,7 @@ export default {
|
|
|
69
72
|
}
|
|
70
73
|
if (internalData._keyCtx) {
|
|
71
74
|
const type = 'body'
|
|
72
|
-
const params: any = { type, $grid:
|
|
75
|
+
const params: any = { type, $grid: $xeGrid, $table: this, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt }
|
|
73
76
|
// 如果开启单元格区域
|
|
74
77
|
if (mouseConfig && mouseOpts.area) {
|
|
75
78
|
const activeArea = this.getActiveCellArea()
|
|
@@ -96,7 +99,7 @@ export default {
|
|
|
96
99
|
// target=td|th,直接向上找 table 去匹配即可
|
|
97
100
|
return target.parentNode.parentNode.parentNode.getAttribute('xid') === tId
|
|
98
101
|
})
|
|
99
|
-
const params: any = { type: layout, $grid:
|
|
102
|
+
const params: any = { type: layout, $grid: $xeGrid, $table: this, columns: this.visibleColumn.slice(0), $event: evnt }
|
|
100
103
|
if (columnTargetNode.flag) {
|
|
101
104
|
const cell = columnTargetNode.targetElem
|
|
102
105
|
const column = this.getColumnNode(cell).item
|
|
@@ -129,7 +132,7 @@ export default {
|
|
|
129
132
|
}
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
|
-
if (tableFilter && !getEventTargetNode(evnt, tableFilter.$el).flag) {
|
|
135
|
+
if (tableFilter && !getEventTargetNode(evnt, (tableFilter as any).$el).flag) {
|
|
133
136
|
this.closeFilter()
|
|
134
137
|
}
|
|
135
138
|
this.closeMenu()
|
|
@@ -253,10 +256,13 @@ export default {
|
|
|
253
256
|
* 快捷菜单点击事件
|
|
254
257
|
*/
|
|
255
258
|
ctxMenuLinkEvent (evnt: any, menu: any) {
|
|
259
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
260
|
+
const $xeGrid = $xeTable.$xeGrid as VxeGridConstructor & GridPrivateMethods
|
|
261
|
+
|
|
256
262
|
// 如果一级菜单有配置 code 则允许点击,否则不能点击
|
|
257
263
|
if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
|
|
258
264
|
const gMenuOpts = menus.get(menu.code)
|
|
259
|
-
const params = Object.assign({ menu, $grid:
|
|
265
|
+
const params = Object.assign({ menu, $grid: $xeGrid, $table: this, $event: evnt }, this.ctxMenuStore.args)
|
|
260
266
|
if (gMenuOpts && gMenuOpts.menuMethod) {
|
|
261
267
|
gMenuOpts.menuMethod(params, evnt)
|
|
262
268
|
}
|
|
@@ -2,6 +2,8 @@ import { CreateElement } from 'vue'
|
|
|
2
2
|
import { VxeUI } from '../../../ui'
|
|
3
3
|
import { getFuncText } from '../../../ui/src/utils'
|
|
4
4
|
|
|
5
|
+
import type { VxeTableConstructor, VxeTablePrivateMethods } from '../../../../types'
|
|
6
|
+
|
|
5
7
|
const { getIcon } = VxeUI
|
|
6
8
|
|
|
7
9
|
export default {
|
|
@@ -20,7 +22,8 @@ export default {
|
|
|
20
22
|
}
|
|
21
23
|
},
|
|
22
24
|
render (this: any, h: CreateElement) {
|
|
23
|
-
const $
|
|
25
|
+
const $xeTable = this.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
26
|
+
|
|
24
27
|
const { _e, ctxMenuOpts, ctxMenuStore } = this
|
|
25
28
|
return h('div', {
|
|
26
29
|
class: ['vxe-table--context-menu-wrapper', ctxMenuOpts.className, {
|
|
@@ -50,13 +53,13 @@ export default {
|
|
|
50
53
|
class: 'vxe-context-menu--link',
|
|
51
54
|
on: {
|
|
52
55
|
click (evnt: any) {
|
|
53
|
-
$
|
|
56
|
+
$xeTable.ctxMenuLinkEvent(evnt, item)
|
|
54
57
|
},
|
|
55
58
|
mouseover (evnt: any) {
|
|
56
|
-
$
|
|
59
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item)
|
|
57
60
|
},
|
|
58
61
|
mouseout (evnt: any) {
|
|
59
|
-
$
|
|
62
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
}, [
|
|
@@ -101,13 +104,13 @@ export default {
|
|
|
101
104
|
class: 'vxe-context-menu--link',
|
|
102
105
|
on: {
|
|
103
106
|
click (evnt: any) {
|
|
104
|
-
$
|
|
107
|
+
$xeTable.ctxMenuLinkEvent(evnt, child)
|
|
105
108
|
},
|
|
106
109
|
mouseover (evnt: any) {
|
|
107
|
-
$
|
|
110
|
+
$xeTable.ctxMenuMouseoverEvent(evnt, item, child)
|
|
108
111
|
},
|
|
109
112
|
mouseout (evnt: any) {
|
|
110
|
-
$
|
|
113
|
+
$xeTable.ctxMenuMouseoutEvent(evnt, item)
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
}, [
|
|
@@ -161,8 +161,8 @@ export default {
|
|
|
161
161
|
|
|
162
162
|
const validRest: any = {}
|
|
163
163
|
const { editRules, treeConfig } = props
|
|
164
|
-
const { editStore
|
|
165
|
-
const { afterFullData } = internalData
|
|
164
|
+
const { editStore } = reactData
|
|
165
|
+
const { afterFullData, pendingRowMaps } = internalData
|
|
166
166
|
const { removeMaps } = editStore
|
|
167
167
|
const treeOpts = $xeTable.computeTreeOpts
|
|
168
168
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
@@ -8,7 +8,7 @@ import { errLog } from '../../ui/src/log'
|
|
|
8
8
|
|
|
9
9
|
import type { VxeGlobalRendererHandles, VxeColumnPropTypes, VxeTableConstructor, VxeTablePrivateMethods } from '../../../types'
|
|
10
10
|
|
|
11
|
-
const { getConfig, renderer, getI18n } = VxeUI
|
|
11
|
+
const { getConfig, renderer, getI18n, getComponent } = VxeUI
|
|
12
12
|
|
|
13
13
|
const componentDefaultModelProp = 'value'
|
|
14
14
|
|
|
@@ -48,7 +48,7 @@ function getOldComponent ({ name }: any) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function getDefaultComponent ({ name }: any) {
|
|
51
|
-
return name
|
|
51
|
+
return getComponent(name) || name
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function handleConfirmFilter (params: any, checked: any, option: any) {
|