vxe-table 3.12.10-beta.2 → 3.12.10-beta.21
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 +2 -1
- 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 +55 -32
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +96 -64
- package/es/table/src/cell.js +3 -7
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +31 -6
- package/es/table/src/header.js +45 -141
- package/es/table/src/methods.js +918 -456
- package/es/table/src/props.js +6 -2
- package/es/table/src/table.js +299 -149
- package/es/table/src/util.js +67 -57
- package/es/table/style.css +299 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -10
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +299 -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 +1735 -1025
- 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 +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- 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 +12 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +52 -27
- 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 +89 -60
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -5
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +26 -6
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +38 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1076 -551
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +269 -129
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +80 -70
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +299 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -10
- 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 +299 -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 +2 -1
- 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 +50 -27
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +102 -61
- package/packages/table/src/cell.ts +3 -7
- package/packages/table/src/column.ts +7 -2
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/footer.ts +31 -6
- package/packages/table/src/header.ts +45 -141
- package/packages/table/src/methods.ts +957 -461
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/table.ts +325 -149
- package/packages/table/src/util.ts +75 -62
- package/packages/ui/index.ts +21 -9
- package/styles/components/table.scss +352 -260
- 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.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/es/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/es/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
- /package/lib/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/lib/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/lib/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
|
@@ -30,7 +30,7 @@ function insertTreeRow (_vm: any, newRecords: any[], isAppend: any) {
|
|
|
30
30
|
}
|
|
31
31
|
parentChilds[funcName](item)
|
|
32
32
|
mapChilds[funcName](item)
|
|
33
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, oTop: 0 }
|
|
33
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0 }
|
|
34
34
|
fullDataRowIdData[rowid] = rest
|
|
35
35
|
fullAllDataRowIdData[rowid] = rest
|
|
36
36
|
} else {
|
|
@@ -41,7 +41,7 @@ function insertTreeRow (_vm: any, newRecords: any[], isAppend: any) {
|
|
|
41
41
|
}
|
|
42
42
|
afterFullData[funcName](item)
|
|
43
43
|
tableFullTreeData[funcName](item)
|
|
44
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, oTop: 0 }
|
|
44
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: tableFullTreeData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 }
|
|
45
45
|
fullDataRowIdData[rowid] = rest
|
|
46
46
|
fullAllDataRowIdData[rowid] = rest
|
|
47
47
|
}
|
|
@@ -70,7 +70,7 @@ function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isIns
|
|
|
70
70
|
} else {
|
|
71
71
|
newRecords.forEach(item => {
|
|
72
72
|
const rowid = getRowid($xeTable, item)
|
|
73
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0, oTop: 0 }
|
|
73
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 }
|
|
74
74
|
fullDataRowIdData[rowid] = rest
|
|
75
75
|
fullAllDataRowIdData[rowid] = rest
|
|
76
76
|
afterFullData.unshift(item)
|
|
@@ -92,7 +92,7 @@ function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isIns
|
|
|
92
92
|
} else {
|
|
93
93
|
newRecords.forEach(item => {
|
|
94
94
|
const rowid = getRowid($xeTable, item)
|
|
95
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: afterFullData, parent: null, level: 0, height: 0, oTop: 0 }
|
|
95
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: afterFullData, parent: null, level: 0, height: 0, resizeHeight: 0, oTop: 0 }
|
|
96
96
|
fullDataRowIdData[rowid] = rest
|
|
97
97
|
fullAllDataRowIdData[rowid] = rest
|
|
98
98
|
afterFullData.push(item)
|
|
@@ -132,7 +132,7 @@ function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isIns
|
|
|
132
132
|
targetIndex = targetIndex + 1
|
|
133
133
|
}
|
|
134
134
|
parentMapChilds.splice(targetIndex, 0, item)
|
|
135
|
-
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, oTop: 0 }
|
|
135
|
+
const rest = { row: item, rowid, seq: -1, index: -1, _index: -1, $index: -1, treeIndex: -1, items: parentMapChilds, parent: parentRow, level: parentLevel + 1, height: 0, resizeHeight: 0, oTop: 0 }
|
|
136
136
|
fullDataRowIdData[rowid] = rest
|
|
137
137
|
fullAllDataRowIdData[rowid] = rest
|
|
138
138
|
})
|
|
@@ -199,7 +199,7 @@ function handleInsertRowAt ($xeTable: any, records: any[], targetRow: any, isIns
|
|
|
199
199
|
const rowid = getRowid($xeTable, newRow)
|
|
200
200
|
insertMaps[rowid] = newRow
|
|
201
201
|
})
|
|
202
|
-
$xeTable.cacheRowMap()
|
|
202
|
+
$xeTable.cacheRowMap(false)
|
|
203
203
|
$xeTable.updateScrollYStatus()
|
|
204
204
|
$xeTable.handleTableData(treeConfig && transform)
|
|
205
205
|
if (!(treeConfig && transform)) {
|
|
@@ -376,7 +376,7 @@ export default {
|
|
|
376
376
|
}
|
|
377
377
|
})
|
|
378
378
|
$xeTable.updateFooter()
|
|
379
|
-
$xeTable.cacheRowMap()
|
|
379
|
+
$xeTable.cacheRowMap(false)
|
|
380
380
|
$xeTable.handleTableData(treeConfig && transform)
|
|
381
381
|
if (!(treeConfig && transform)) {
|
|
382
382
|
$xeTable.updateAfterDataIndex()
|
|
@@ -984,6 +984,45 @@ export function readLocalFile (options: any = {}) {
|
|
|
984
984
|
})
|
|
985
985
|
}
|
|
986
986
|
|
|
987
|
+
function handleFilterColumns (exportOpts: VxeTablePropTypes.ExportConfig, column: VxeTableDefines.ColumnInfo, columns: VxeTableDefines.ColumnInfo[] | VxeTablePropTypes.ExportOrPrintColumnOption[]) {
|
|
988
|
+
return columns.some((item: any) => {
|
|
989
|
+
if (isColumnInfo(item)) {
|
|
990
|
+
return column.id === (item as any).id
|
|
991
|
+
} else if (XEUtils.isString(item)) {
|
|
992
|
+
return column.field === item
|
|
993
|
+
} else {
|
|
994
|
+
const colid = item.id || item.colId
|
|
995
|
+
const type = item.type
|
|
996
|
+
const field = item.field
|
|
997
|
+
if (colid) {
|
|
998
|
+
return column.id === colid
|
|
999
|
+
} else if (field && type) {
|
|
1000
|
+
return column.field === field && column.type === type
|
|
1001
|
+
} else if (field) {
|
|
1002
|
+
return column.field === field
|
|
1003
|
+
} else if (type) {
|
|
1004
|
+
return column.type === type
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return false
|
|
1008
|
+
})
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
function handleFilterFields (exportOpts: VxeTablePropTypes.ExportConfig, column: VxeTableDefines.ColumnInfo, includeFields: string[] | undefined, excludeFields: string[] | undefined) {
|
|
1012
|
+
if (excludeFields) {
|
|
1013
|
+
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1014
|
+
return false
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
if (includeFields) {
|
|
1018
|
+
if (XEUtils.includes(includeFields, column.field)) {
|
|
1019
|
+
return true
|
|
1020
|
+
}
|
|
1021
|
+
return false
|
|
1022
|
+
}
|
|
1023
|
+
return exportOpts.original ? column.field : defaultFilterExportColumn(column)
|
|
1024
|
+
}
|
|
1025
|
+
|
|
987
1026
|
function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTablePropTypes.ExportOpts | VxeTablePropTypes.ExportConfig, isPrint?: any) {
|
|
988
1027
|
const props = $xeTable
|
|
989
1028
|
const reactData = $xeTable as unknown as TableReactData
|
|
@@ -1014,7 +1053,7 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1014
1053
|
const modes = defOpts.modes || []
|
|
1015
1054
|
const checkMethod = customOpts.checkMethod
|
|
1016
1055
|
const exportColumns = collectColumn.slice(0)
|
|
1017
|
-
const { columns } = defOpts
|
|
1056
|
+
const { columns, excludeFields, includeFields } = defOpts
|
|
1018
1057
|
// 处理类型
|
|
1019
1058
|
const typeList = types.map((value) => {
|
|
1020
1059
|
return {
|
|
@@ -1037,33 +1076,17 @@ function handleExportAndPrint ($xeTable: VxeTableConstructor, options: VxeTableP
|
|
|
1037
1076
|
// 默认选中
|
|
1038
1077
|
XEUtils.eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
1039
1078
|
const isColGroup = column.children && column.children.length
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
} else {
|
|
1048
|
-
const colid = item.id || item.colId
|
|
1049
|
-
const type = item.type
|
|
1050
|
-
const field = item.field
|
|
1051
|
-
if (colid) {
|
|
1052
|
-
return column.id === colid
|
|
1053
|
-
} else if (field && type) {
|
|
1054
|
-
return column.field === field && column.type === type
|
|
1055
|
-
} else if (field) {
|
|
1056
|
-
return column.field === field
|
|
1057
|
-
} else if (type) {
|
|
1058
|
-
return column.type === type
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
return false
|
|
1062
|
-
})
|
|
1063
|
-
: column.visible
|
|
1064
|
-
column.halfChecked = false
|
|
1065
|
-
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false)
|
|
1079
|
+
let isChecked = false
|
|
1080
|
+
if (columns && columns.length) {
|
|
1081
|
+
isChecked = handleFilterColumns(defOpts, column, columns)
|
|
1082
|
+
} else if (excludeFields || includeFields) {
|
|
1083
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields)
|
|
1084
|
+
} else {
|
|
1085
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column))
|
|
1066
1086
|
}
|
|
1087
|
+
column.checked = isChecked
|
|
1088
|
+
column.halfChecked = false
|
|
1089
|
+
column.disabled = (parent && parent.disabled) || (checkMethod ? !checkMethod({ column }) : false)
|
|
1067
1090
|
})
|
|
1068
1091
|
// 更新条件
|
|
1069
1092
|
Object.assign(exportStore, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
+
import { getRefElem } from '../../src/util'
|
|
2
3
|
import { browse, hasClass, getAbsolutePos, addClass, removeClass } from '../../../ui/src/dom'
|
|
3
4
|
|
|
4
5
|
function getTargetOffset (target: any, container: any) {
|
|
@@ -24,33 +25,62 @@ function getTargetOffset (target: any, container: any) {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
function getCheckboxRangeRows ($xeTable: any, evnt: MouseEvent, params: any, targetTrElem: HTMLElement, trRect: DOMRect, offsetClientTop: number, moveRange: number) {
|
|
28
|
+
const props = $xeTable
|
|
27
29
|
const reactData = $xeTable
|
|
28
30
|
const internalData = $xeTable
|
|
29
31
|
|
|
32
|
+
const { showOverflow } = props
|
|
33
|
+
const { fullAllDataRowIdData, isResizeCellHeight } = internalData
|
|
34
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
35
|
+
const cellOpts = $xeTable.computeCellOpts
|
|
36
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight
|
|
37
|
+
const { row } = params
|
|
30
38
|
let countHeight = 0
|
|
31
39
|
let rangeRows: any[] = []
|
|
32
40
|
let moveSize = 0
|
|
33
41
|
const isDown = moveRange > 0
|
|
34
|
-
const { scrollYLoad
|
|
42
|
+
const { scrollYLoad } = reactData
|
|
35
43
|
const { afterFullData } = internalData
|
|
44
|
+
if (isDown) {
|
|
45
|
+
moveSize = offsetClientTop + moveRange
|
|
46
|
+
} else {
|
|
47
|
+
moveSize = (trRect.height - offsetClientTop) + Math.abs(moveRange)
|
|
48
|
+
}
|
|
36
49
|
if (scrollYLoad) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
const _rowIndex = $xeTable.getVTRowIndex(row)
|
|
51
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
52
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
53
|
+
if (isDown) {
|
|
54
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight))
|
|
55
|
+
} else {
|
|
56
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1)
|
|
57
|
+
}
|
|
45
58
|
} else {
|
|
46
|
-
|
|
59
|
+
if (isDown) {
|
|
60
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
61
|
+
const item = afterFullData[i]
|
|
62
|
+
const rowid = $xeTable.getRowid(item)
|
|
63
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
64
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
65
|
+
rangeRows.push(item)
|
|
66
|
+
if (countHeight > moveSize) {
|
|
67
|
+
return rangeRows
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
72
|
+
const item = afterFullData[len]
|
|
73
|
+
const rowid = $xeTable.getRowid(item)
|
|
74
|
+
const rowRest = fullAllDataRowIdData[rowid] || {}
|
|
75
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight
|
|
76
|
+
rangeRows.push(item)
|
|
77
|
+
if (countHeight > moveSize) {
|
|
78
|
+
return rangeRows
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
47
82
|
}
|
|
48
83
|
} else {
|
|
49
|
-
if (isDown) {
|
|
50
|
-
moveSize = evnt.clientY - trRect.y
|
|
51
|
-
} else {
|
|
52
|
-
moveSize = trRect.y - evnt.clientY + trRect.height
|
|
53
|
-
}
|
|
54
84
|
const siblingProp = isDown ? 'next' : 'previous'
|
|
55
85
|
while (targetTrElem && countHeight < moveSize) {
|
|
56
86
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem)
|
|
@@ -203,16 +233,27 @@ export default {
|
|
|
203
233
|
},
|
|
204
234
|
handleCheckboxRangeEvent (evnt: any, params: any) {
|
|
205
235
|
const $xeTable = this
|
|
236
|
+
const internalData = $xeTable
|
|
206
237
|
|
|
238
|
+
const { elemStore } = internalData
|
|
239
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
240
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
241
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
207
242
|
const { column, cell } = params
|
|
208
243
|
if (column.type === 'checkbox') {
|
|
209
|
-
|
|
244
|
+
let bodyWrapperElem = bodyScrollElem as HTMLElement
|
|
245
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
246
|
+
bodyWrapperElem = leftScrollElem
|
|
247
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
248
|
+
bodyWrapperElem = rightScrollElem
|
|
249
|
+
}
|
|
250
|
+
if (!bodyWrapperElem) {
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
210
254
|
const disX = evnt.clientX
|
|
211
255
|
const disY = evnt.clientY
|
|
212
|
-
const
|
|
213
|
-
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range')
|
|
214
|
-
const domMousemove = document.onmousemove
|
|
215
|
-
const domMouseup = document.onmouseup
|
|
256
|
+
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range') as HTMLElement
|
|
216
257
|
const trElem = cell.parentNode
|
|
217
258
|
const selectRecords = this.getCheckboxRecords()
|
|
218
259
|
let lastRangeRows = []
|
|
@@ -312,7 +353,7 @@ export default {
|
|
|
312
353
|
}
|
|
313
354
|
}, 50)
|
|
314
355
|
}
|
|
315
|
-
addClass(
|
|
356
|
+
addClass(el, 'drag--range')
|
|
316
357
|
document.onmousemove = evnt => {
|
|
317
358
|
evnt.preventDefault()
|
|
318
359
|
evnt.stopPropagation()
|
|
@@ -338,10 +379,10 @@ export default {
|
|
|
338
379
|
}
|
|
339
380
|
document.onmouseup = (evnt) => {
|
|
340
381
|
stopMouseScroll()
|
|
341
|
-
removeClass(
|
|
382
|
+
removeClass(el, 'drag--range')
|
|
342
383
|
checkboxRangeElem.removeAttribute('style')
|
|
343
|
-
document.onmousemove =
|
|
344
|
-
document.onmouseup =
|
|
384
|
+
document.onmousemove = null
|
|
385
|
+
document.onmouseup = null
|
|
345
386
|
triggerEvent('end', evnt)
|
|
346
387
|
}
|
|
347
388
|
triggerEvent('start', evnt)
|
|
@@ -55,6 +55,9 @@ export default {
|
|
|
55
55
|
* 快捷菜单事件处理
|
|
56
56
|
*/
|
|
57
57
|
handleGlobalContextmenuEvent (evnt: any) {
|
|
58
|
+
const $xeTable = this
|
|
59
|
+
const internalData = $xeTable
|
|
60
|
+
|
|
58
61
|
const { $refs, tId, editStore, menuConfig, contextMenu, ctxMenuStore, ctxMenuOpts, mouseConfig, mouseOpts } = this
|
|
59
62
|
const { selected } = editStore
|
|
60
63
|
const layoutList = ['header', 'body', 'footer']
|
|
@@ -63,7 +66,7 @@ export default {
|
|
|
63
66
|
evnt.preventDefault()
|
|
64
67
|
return
|
|
65
68
|
}
|
|
66
|
-
if (
|
|
69
|
+
if (internalData._keyCtx) {
|
|
67
70
|
const type = 'body'
|
|
68
71
|
const params: any = { type, $grid: this.$xegrid, $table: this, keyboard: true, columns: this.visibleColumn.slice(0), $event: evnt }
|
|
69
72
|
// 如果开启单元格区域
|