vxe-table 3.23.5 → 3.23.7
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/filter/mixin.js +71 -56
- package/es/table/module/keyboard/mixin.js +3 -5
- package/es/table/src/body.js +3 -3
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +6 -6
- package/es/table/src/methods.js +128 -68
- package/es/table/src/table.js +10 -2
- package/es/table/src/util.js +6 -5
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +162 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- 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 +320 -133
- 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/filter/mixin.js +69 -58
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +3 -6
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +5 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +10 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +46 -44
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +10 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- 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/dom.js +167 -0
- package/lib/ui/src/dom.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 +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/filter/mixin.ts +72 -53
- package/packages/table/module/keyboard/mixin.ts +3 -5
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +6 -6
- package/packages/table/src/methods.ts +166 -80
- package/packages/table/src/table.ts +10 -2
- package/packages/table/src/util.ts +9 -6
- package/packages/ui/src/dom.ts +176 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +4 -4
- package/styles/theme/light.scss +4 -4
- package/styles/variable.scss +4 -4
- /package/es/{iconfont.1788403274136.ttf → iconfont.1788696064361.ttf} +0 -0
- /package/es/{iconfont.1788403274136.woff → iconfont.1788696064361.woff} +0 -0
- /package/es/{iconfont.1788403274136.woff2 → iconfont.1788696064361.woff2} +0 -0
- /package/lib/{iconfont.1788403274136.ttf → iconfont.1788696064361.ttf} +0 -0
- /package/lib/{iconfont.1788403274136.woff → iconfont.1788696064361.woff} +0 -0
- /package/lib/{iconfont.1788403274136.woff2 → iconfont.1788696064361.woff2} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
-
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement,
|
|
2
|
+
import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollLeftTo, wheelScrollTopTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from '../../ui/src/dom'
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
4
4
|
import { VxeUI } from '../../ui'
|
|
5
5
|
import Cell from './cell'
|
|
@@ -5184,8 +5184,10 @@ const tableMethods: any = {
|
|
|
5184
5184
|
* @param {ColumnInfo} columns 列配置
|
|
5185
5185
|
*/
|
|
5186
5186
|
reloadColumn (columns: any) {
|
|
5187
|
-
|
|
5188
|
-
|
|
5187
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5188
|
+
|
|
5189
|
+
return $xeTable.clearAll().then(() => {
|
|
5190
|
+
return $xeTable.loadColumn(columns)
|
|
5189
5191
|
})
|
|
5190
5192
|
},
|
|
5191
5193
|
handleInitColumn (collectColumn: any[]) {
|
|
@@ -5321,15 +5323,15 @@ const tableMethods: any = {
|
|
|
5321
5323
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
5322
5324
|
const parentRest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
5323
5325
|
const parentLevel = parentRest ? parentRest.level : 0
|
|
5324
|
-
return
|
|
5326
|
+
return $xeTable.createData(childRecords).then((rows: any) => {
|
|
5325
5327
|
if (keepSource) {
|
|
5326
|
-
const rowid = getRowid(
|
|
5327
|
-
const matchObj = XEUtils.findTree(tableSourceData, (item) => rowid === getRowid(
|
|
5328
|
+
const rowid = getRowid($xeTable, row)
|
|
5329
|
+
const matchObj = XEUtils.findTree(tableSourceData, (item) => rowid === getRowid($xeTable, item), { children: childrenField })
|
|
5328
5330
|
if (matchObj) {
|
|
5329
5331
|
matchObj.item[childrenField] = XEUtils.clone(rows, true)
|
|
5330
5332
|
}
|
|
5331
5333
|
rows.forEach((childRow: any) => {
|
|
5332
|
-
const rowid = getRowid(
|
|
5334
|
+
const rowid = getRowid($xeTable, childRow)
|
|
5333
5335
|
sourceDataRowIdData[rowid] = XEUtils.clone(childRow, true)
|
|
5334
5336
|
})
|
|
5335
5337
|
}
|
|
@@ -5422,13 +5424,17 @@ const tableMethods: any = {
|
|
|
5422
5424
|
getVMRowIndex: createGetRowCacheProp('$index') as ((row: any) => number),
|
|
5423
5425
|
// 在 v3 中废弃
|
|
5424
5426
|
_getRowIndex (row: any) {
|
|
5427
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5428
|
+
|
|
5425
5429
|
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex'])
|
|
5426
|
-
return
|
|
5430
|
+
return $xeTable.getVTRowIndex(row)
|
|
5427
5431
|
},
|
|
5428
5432
|
// 在 v3 中废弃
|
|
5429
5433
|
$getRowIndex (row: any) {
|
|
5434
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5435
|
+
|
|
5430
5436
|
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex'])
|
|
5431
|
-
return
|
|
5437
|
+
return $xeTable.getVMRowIndex(row)
|
|
5432
5438
|
},
|
|
5433
5439
|
/**
|
|
5434
5440
|
* 根据 column 获取相对于 columns 中的索引
|
|
@@ -5447,13 +5453,17 @@ const tableMethods: any = {
|
|
|
5447
5453
|
getVMColumnIndex: createGetColumnCacheProp('$index'),
|
|
5448
5454
|
// 在 v3 中废弃
|
|
5449
5455
|
_getColumnIndex (column: any) {
|
|
5456
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5457
|
+
|
|
5450
5458
|
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex'])
|
|
5451
|
-
return
|
|
5459
|
+
return $xeTable.getVTColumnIndex(column)
|
|
5452
5460
|
},
|
|
5453
5461
|
// 在 v3 中废弃
|
|
5454
5462
|
$getColumnIndex (column: any) {
|
|
5463
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
5464
|
+
|
|
5455
5465
|
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex'])
|
|
5456
|
-
return
|
|
5466
|
+
return $xeTable.getVMColumnIndex(column)
|
|
5457
5467
|
},
|
|
5458
5468
|
/**
|
|
5459
5469
|
* 判断是否为索引列
|
|
@@ -6204,8 +6214,11 @@ const tableMethods: any = {
|
|
|
6204
6214
|
return fullColumnFieldData[field] ? fullColumnFieldData[field].column : null
|
|
6205
6215
|
},
|
|
6206
6216
|
getParentColumn (fieldOrColumn: any) {
|
|
6207
|
-
const
|
|
6208
|
-
const
|
|
6217
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6218
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
6219
|
+
|
|
6220
|
+
const { fullColumnIdData } = internalData
|
|
6221
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
6209
6222
|
return column && column.parentId && fullColumnIdData[column.parentId] ? fullColumnIdData[column.parentId].column : null
|
|
6210
6223
|
},
|
|
6211
6224
|
/**
|
|
@@ -6340,7 +6353,11 @@ const tableMethods: any = {
|
|
|
6340
6353
|
* 获取数据,和 data 的行为一致,也可以指定索引获取数据
|
|
6341
6354
|
*/
|
|
6342
6355
|
getData (rowIndex: any) {
|
|
6343
|
-
const
|
|
6356
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6357
|
+
const props = $xeTable
|
|
6358
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
6359
|
+
|
|
6360
|
+
const tableSynchData = props.data || internalData.tableSynchData
|
|
6344
6361
|
return XEUtils.isUndefined(rowIndex) ? tableSynchData.slice(0) : tableSynchData[rowIndex]
|
|
6345
6362
|
},
|
|
6346
6363
|
/**
|
|
@@ -6678,8 +6695,10 @@ const tableMethods: any = {
|
|
|
6678
6695
|
fixed?: boolean
|
|
6679
6696
|
order?: boolean
|
|
6680
6697
|
}) {
|
|
6698
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
6699
|
+
|
|
6681
6700
|
warnLog('vxe.error.delFunc', ['resetColumn', 'resetCustom'])
|
|
6682
|
-
return
|
|
6701
|
+
return $xeTable.resetCustom(options)
|
|
6683
6702
|
},
|
|
6684
6703
|
/**
|
|
6685
6704
|
* @private
|
|
@@ -7069,13 +7088,13 @@ const tableMethods: any = {
|
|
|
7069
7088
|
* 刷新列配置
|
|
7070
7089
|
*/
|
|
7071
7090
|
refreshColumn (initSort?: boolean) {
|
|
7072
|
-
const $xeTable = this
|
|
7091
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
7073
7092
|
|
|
7074
7093
|
if (initSort) {
|
|
7075
7094
|
handleUpdateColumn($xeTable)
|
|
7076
7095
|
}
|
|
7077
7096
|
return parseColumns($xeTable, true).then(() => {
|
|
7078
|
-
return
|
|
7097
|
+
return $xeTable.refreshScroll()
|
|
7079
7098
|
}).then(() => {
|
|
7080
7099
|
return handleLazyRecalculate($xeTable, false, true, true)
|
|
7081
7100
|
})
|
|
@@ -7084,17 +7103,22 @@ const tableMethods: any = {
|
|
|
7084
7103
|
* 指定列宽的列进行拆分
|
|
7085
7104
|
*/
|
|
7086
7105
|
analyColumnWidth () {
|
|
7087
|
-
const
|
|
7106
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
7107
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
7108
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
7109
|
+
|
|
7110
|
+
const { tableFullColumn } = internalData
|
|
7111
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
7088
7112
|
const { width: defaultWidth, minWidth: defaultMinWidth } = columnOpts
|
|
7089
|
-
const resizeList:
|
|
7090
|
-
const pxList:
|
|
7091
|
-
const pxMinList
|
|
7092
|
-
const autoMinList:
|
|
7093
|
-
const scaleList
|
|
7094
|
-
const scaleMinList:
|
|
7095
|
-
const autoList
|
|
7096
|
-
const remainList:
|
|
7097
|
-
|
|
7113
|
+
const resizeList: VxeTableDefines.ColumnInfo[] = []
|
|
7114
|
+
const pxList: VxeTableDefines.ColumnInfo[] = []
|
|
7115
|
+
const pxMinList: VxeTableDefines.ColumnInfo[] = []
|
|
7116
|
+
const autoMinList: VxeTableDefines.ColumnInfo[] = []
|
|
7117
|
+
const scaleList: VxeTableDefines.ColumnInfo[] = []
|
|
7118
|
+
const scaleMinList: VxeTableDefines.ColumnInfo[] = []
|
|
7119
|
+
const autoList: VxeTableDefines.ColumnInfo[] = []
|
|
7120
|
+
const remainList: VxeTableDefines.ColumnInfo[] = []
|
|
7121
|
+
tableFullColumn.forEach((column) => {
|
|
7098
7122
|
if (defaultWidth && !column.width) {
|
|
7099
7123
|
column.width = defaultWidth
|
|
7100
7124
|
}
|
|
@@ -7121,7 +7145,7 @@ const tableMethods: any = {
|
|
|
7121
7145
|
}
|
|
7122
7146
|
}
|
|
7123
7147
|
})
|
|
7124
|
-
Object.assign(
|
|
7148
|
+
Object.assign(reactData.columnStore, { resizeList, pxList, pxMinList, autoMinList, scaleList, scaleMinList, autoList, remainList })
|
|
7125
7149
|
},
|
|
7126
7150
|
handleColResizeMousedownEvent (evnt: MouseEvent, fixedType: 'left' | 'right' | '', params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
7127
7151
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -7949,23 +7973,23 @@ const tableMethods: any = {
|
|
|
7949
7973
|
const { actived } = editStore
|
|
7950
7974
|
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE)
|
|
7951
7975
|
if (isEsc) {
|
|
7952
|
-
|
|
7976
|
+
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
7953
7977
|
$xeTable.dispatchEvent('keydown-start', {}, evnt)
|
|
7954
7978
|
if (keyboardConfig && mouseConfig && mouseOpts.area && $xeTable.handleKdClAreaEvent) {
|
|
7955
7979
|
$xeTable.handleKdClAreaEvent(evnt)
|
|
7956
7980
|
} else if (actived.row || filterStore.visible || ctxMenuStore.visible) {
|
|
7957
7981
|
evnt.stopPropagation()
|
|
7958
7982
|
// 如果按下了 Esc 键,关闭快捷菜单、筛选
|
|
7959
|
-
|
|
7960
|
-
|
|
7983
|
+
$xeTable.closeFilter()
|
|
7984
|
+
$xeTable.closeMenu()
|
|
7961
7985
|
if (keyboardConfig && keyboardOpts.isEsc) {
|
|
7962
7986
|
// 如果是激活编辑状态,则取消编辑
|
|
7963
7987
|
if (actived.row) {
|
|
7964
7988
|
const params = actived.args
|
|
7965
|
-
|
|
7989
|
+
$xeTable.handleClearEdit(evnt)
|
|
7966
7990
|
// 如果配置了选中功能,则为选中状态
|
|
7967
7991
|
if (mouseConfig && mouseOpts.selected) {
|
|
7968
|
-
|
|
7992
|
+
$xeTable.$nextTick(() => $xeTable.handleSelected(params, evnt))
|
|
7969
7993
|
}
|
|
7970
7994
|
}
|
|
7971
7995
|
}
|
|
@@ -8343,7 +8367,7 @@ const tableMethods: any = {
|
|
|
8343
8367
|
.then(() => $xeTable.scrollToRow(parentRow))
|
|
8344
8368
|
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params))
|
|
8345
8369
|
}
|
|
8346
|
-
} else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !
|
|
8370
|
+
} else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
|
|
8347
8371
|
if (isY || (hasShiftKey && isZ)) {
|
|
8348
8372
|
// 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
|
|
8349
8373
|
evnt.preventDefault()
|
|
@@ -8460,7 +8484,12 @@ const tableMethods: any = {
|
|
|
8460
8484
|
},
|
|
8461
8485
|
handleGlobalResizeEvent () {
|
|
8462
8486
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
8487
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
8463
8488
|
|
|
8489
|
+
const { filterStore } = reactData
|
|
8490
|
+
if (filterStore.visible) {
|
|
8491
|
+
$xeTable.handleFilterStyle()
|
|
8492
|
+
}
|
|
8464
8493
|
$xeTable.closeMenu()
|
|
8465
8494
|
$xeTable.updateCellAreas()
|
|
8466
8495
|
handleResizeEvent($xeTable)
|
|
@@ -9512,8 +9541,6 @@ const tableMethods: any = {
|
|
|
9512
9541
|
* 多选,选中所有事件
|
|
9513
9542
|
*/
|
|
9514
9543
|
triggerCheckAllEvent (evnt: any, value: any) {
|
|
9515
|
-
const $xeTable = this
|
|
9516
|
-
|
|
9517
9544
|
const { checkboxOpts } = this
|
|
9518
9545
|
const { trigger } = checkboxOpts
|
|
9519
9546
|
if (trigger === 'manual') {
|
|
@@ -9522,14 +9549,17 @@ const tableMethods: any = {
|
|
|
9522
9549
|
if (evnt) {
|
|
9523
9550
|
evnt.stopPropagation()
|
|
9524
9551
|
}
|
|
9525
|
-
|
|
9552
|
+
this.handleCheckAllEvent(evnt, value)
|
|
9526
9553
|
},
|
|
9527
9554
|
/**
|
|
9528
9555
|
* 多选,切换所有行的选中状态
|
|
9529
9556
|
*/
|
|
9530
9557
|
toggleAllCheckboxRow () {
|
|
9531
|
-
this
|
|
9532
|
-
|
|
9558
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9559
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
9560
|
+
|
|
9561
|
+
this.handleCheckAllEvent(null, !reactData.isAllSelected)
|
|
9562
|
+
return $xeTable.$nextTick()
|
|
9533
9563
|
},
|
|
9534
9564
|
/**
|
|
9535
9565
|
* 用于多选行,手动清空用户的选择
|
|
@@ -9570,7 +9600,7 @@ const tableMethods: any = {
|
|
|
9570
9600
|
internalData.selectCheckboxMaps = {}
|
|
9571
9601
|
internalData.treeIndeterminateRowMaps = {}
|
|
9572
9602
|
reactData.updateCheckboxFlag++
|
|
9573
|
-
return
|
|
9603
|
+
return $xeTable.$nextTick()
|
|
9574
9604
|
},
|
|
9575
9605
|
/**
|
|
9576
9606
|
* 单选,行选中事件
|
|
@@ -9615,9 +9645,9 @@ const tableMethods: any = {
|
|
|
9615
9645
|
column: VxeTableDefines.ColumnInfo
|
|
9616
9646
|
}) {
|
|
9617
9647
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9618
|
-
const
|
|
9648
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
9619
9649
|
|
|
9620
|
-
const {
|
|
9650
|
+
const { currentCol: oldValue } = internalData
|
|
9621
9651
|
const columnOpts = $xeTable.computeColumnOpts
|
|
9622
9652
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts
|
|
9623
9653
|
const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod as any
|
|
@@ -9693,15 +9723,16 @@ const tableMethods: any = {
|
|
|
9693
9723
|
*/
|
|
9694
9724
|
setCurrentRow (row: any) {
|
|
9695
9725
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9726
|
+
const props = $xeTable
|
|
9696
9727
|
const internalData = $xeTable as unknown as TableInternalData
|
|
9697
9728
|
|
|
9698
9729
|
const $xeGanttView = internalData.xeGanttView
|
|
9699
9730
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
9700
9731
|
const rowOpts = $xeTable.computeRowOpts
|
|
9701
|
-
|
|
9732
|
+
$xeTable.clearCurrentRow()
|
|
9702
9733
|
// this.clearCurrentColumn()
|
|
9703
|
-
|
|
9704
|
-
if (rowOpts.isCurrent ||
|
|
9734
|
+
internalData.currentRow = row
|
|
9735
|
+
if (rowOpts.isCurrent || props.highlightCurrentRow) {
|
|
9705
9736
|
if (el) {
|
|
9706
9737
|
XEUtils.arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable, row)}"]`), elem => addClass(elem, 'row--current'))
|
|
9707
9738
|
}
|
|
@@ -9709,7 +9740,7 @@ const tableMethods: any = {
|
|
|
9709
9740
|
if ($xeGanttView && $xeGanttView.handleUpdateCurrentRow) {
|
|
9710
9741
|
$xeGanttView.handleUpdateCurrentRow(row)
|
|
9711
9742
|
}
|
|
9712
|
-
return
|
|
9743
|
+
return $xeTable.$nextTick()
|
|
9713
9744
|
},
|
|
9714
9745
|
isCheckedByRadioRow (row: any) {
|
|
9715
9746
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -9837,7 +9868,9 @@ const tableMethods: any = {
|
|
|
9837
9868
|
* 行 hover 事件
|
|
9838
9869
|
*/
|
|
9839
9870
|
triggerHoverEvent (evnt: any, { row }: any) {
|
|
9840
|
-
this
|
|
9871
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9872
|
+
|
|
9873
|
+
$xeTable.setHoverRow(row)
|
|
9841
9874
|
},
|
|
9842
9875
|
setHoverRow (row: any) {
|
|
9843
9876
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -9902,7 +9935,12 @@ const tableMethods: any = {
|
|
|
9902
9935
|
$xeTable.dispatchEvent('header-cell-dblclick', Object.assign({ cell: evnt.currentTarget }, params), evnt)
|
|
9903
9936
|
},
|
|
9904
9937
|
getCurrentColumn () {
|
|
9905
|
-
|
|
9938
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9939
|
+
const props = $xeTable
|
|
9940
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
9941
|
+
|
|
9942
|
+
const columnOpts = $xeTable.computeColumnOpts
|
|
9943
|
+
return columnOpts.isCurrent || props.highlightCurrentColumn ? internalData.currentCol : null
|
|
9906
9944
|
},
|
|
9907
9945
|
/**
|
|
9908
9946
|
* 用于当前列,设置某列行为高亮状态
|
|
@@ -9912,6 +9950,7 @@ const tableMethods: any = {
|
|
|
9912
9950
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9913
9951
|
const props = $xeTable
|
|
9914
9952
|
const reactData = $xeTable as unknown as TableReactData
|
|
9953
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
9915
9954
|
|
|
9916
9955
|
const { mouseConfig } = props
|
|
9917
9956
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
@@ -9919,7 +9958,8 @@ const tableMethods: any = {
|
|
|
9919
9958
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
9920
9959
|
if (column) {
|
|
9921
9960
|
$xeTable.clearCurrentColumn()
|
|
9922
|
-
|
|
9961
|
+
internalData.currentCol = column
|
|
9962
|
+
reactData.currColFlag++ // 刷新当前列状态
|
|
9923
9963
|
}
|
|
9924
9964
|
return $xeTable.$nextTick().then(() => {
|
|
9925
9965
|
// 更新状选中态
|
|
@@ -9932,8 +9972,13 @@ const tableMethods: any = {
|
|
|
9932
9972
|
* 用于当前列,手动清空当前高亮的状态
|
|
9933
9973
|
*/
|
|
9934
9974
|
clearCurrentColumn () {
|
|
9935
|
-
|
|
9936
|
-
|
|
9975
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
9976
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
9977
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
9978
|
+
|
|
9979
|
+
internalData.currentCol = null
|
|
9980
|
+
reactData.currColFlag++ // 刷新当前列状态
|
|
9981
|
+
return $xeTable.$nextTick()
|
|
9937
9982
|
},
|
|
9938
9983
|
/**
|
|
9939
9984
|
* 列点击事件
|
|
@@ -11652,20 +11697,31 @@ const tableMethods: any = {
|
|
|
11652
11697
|
},
|
|
11653
11698
|
// 在 v3 中废弃
|
|
11654
11699
|
getSortColumn () {
|
|
11700
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11701
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
11702
|
+
|
|
11703
|
+
const { tableFullColumn } = internalData
|
|
11655
11704
|
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns'])
|
|
11656
|
-
return XEUtils.find(
|
|
11705
|
+
return XEUtils.find(tableFullColumn, column => (column.sortable || (column as any).remoteSort) && column.order)
|
|
11657
11706
|
},
|
|
11658
11707
|
isSort (fieldOrColumn: any) {
|
|
11708
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11709
|
+
|
|
11659
11710
|
if (fieldOrColumn) {
|
|
11660
|
-
const column = handleFieldOrColumn(
|
|
11711
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
11661
11712
|
return column && column.sortable && !!column.order
|
|
11662
11713
|
}
|
|
11663
|
-
return
|
|
11714
|
+
return $xeTable.getSortColumns().length > 0
|
|
11664
11715
|
},
|
|
11665
11716
|
getSortColumns () {
|
|
11666
|
-
const
|
|
11667
|
-
const
|
|
11668
|
-
|
|
11717
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11718
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
11719
|
+
|
|
11720
|
+
const sortOpts = $xeTable.computeSortOpts
|
|
11721
|
+
const { multiple, chronological } = sortOpts
|
|
11722
|
+
const sortList: VxeTableDefines.SortCheckedParams[] = []
|
|
11723
|
+
const { tableFullColumn } = internalData
|
|
11724
|
+
tableFullColumn.forEach((column: any) => {
|
|
11669
11725
|
const { field, order } = column
|
|
11670
11726
|
if ((column.sortable || column.remoteSort) && order) {
|
|
11671
11727
|
sortList.push({ column, field, property: field, order, sortTime: column.sortTime })
|
|
@@ -11716,15 +11772,19 @@ const tableMethods: any = {
|
|
|
11716
11772
|
* @param {String} fieldOrColumn 字段名
|
|
11717
11773
|
*/
|
|
11718
11774
|
isActiveFilterByColumn (fieldOrColumn: any) {
|
|
11719
|
-
const
|
|
11775
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11776
|
+
|
|
11777
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
11720
11778
|
if (column) {
|
|
11721
11779
|
return column.filters && column.filters.some((option: any) => option.checked)
|
|
11722
11780
|
}
|
|
11723
|
-
return
|
|
11781
|
+
return $xeTable.getCheckedFilters().length > 0
|
|
11724
11782
|
},
|
|
11725
11783
|
// 已废弃
|
|
11726
11784
|
isFilter (fieldOrColumn: any) {
|
|
11727
|
-
|
|
11785
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11786
|
+
|
|
11787
|
+
return $xeTable.isActiveFilterByColumn(fieldOrColumn)
|
|
11728
11788
|
},
|
|
11729
11789
|
clearFilterByEvent (evnt: Event, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo<any> | null) {
|
|
11730
11790
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -11849,9 +11909,11 @@ const tableMethods: any = {
|
|
|
11849
11909
|
return $xeTable.$nextTick()
|
|
11850
11910
|
},
|
|
11851
11911
|
reloadExpandContent (row: any) {
|
|
11912
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11913
|
+
|
|
11852
11914
|
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand'])
|
|
11853
11915
|
// 即将废弃
|
|
11854
|
-
return
|
|
11916
|
+
return $xeTable.reloadRowExpand(row)
|
|
11855
11917
|
},
|
|
11856
11918
|
/**
|
|
11857
11919
|
* 展开行事件
|
|
@@ -11891,24 +11953,31 @@ const tableMethods: any = {
|
|
|
11891
11953
|
* 切换展开行
|
|
11892
11954
|
*/
|
|
11893
11955
|
toggleRowExpand (row: any) {
|
|
11894
|
-
|
|
11956
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11957
|
+
|
|
11958
|
+
return $xeTable.setRowExpand(row, !$xeTable.isRowExpandByRow(row))
|
|
11895
11959
|
},
|
|
11896
11960
|
/**
|
|
11897
11961
|
* 设置所有行的展开与否
|
|
11898
11962
|
* @param {Boolean} expanded 是否展开
|
|
11899
11963
|
*/
|
|
11900
11964
|
setAllRowExpand (expanded: any) {
|
|
11901
|
-
const
|
|
11965
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
11966
|
+
const props = $xeTable
|
|
11967
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
11968
|
+
|
|
11969
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
11970
|
+
const { tableFullData, tableFullTreeData } = internalData
|
|
11902
11971
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
11903
|
-
let expandedRows = []
|
|
11904
|
-
if (treeConfig) {
|
|
11972
|
+
let expandedRows: any[] = []
|
|
11973
|
+
if (props.treeConfig) {
|
|
11905
11974
|
XEUtils.eachTree(tableFullTreeData, (row) => {
|
|
11906
11975
|
expandedRows.push(row)
|
|
11907
11976
|
}, { children: childrenField })
|
|
11908
11977
|
} else {
|
|
11909
11978
|
expandedRows = tableFullData
|
|
11910
11979
|
}
|
|
11911
|
-
return
|
|
11980
|
+
return $xeTable.setRowExpand(expandedRows, expanded)
|
|
11912
11981
|
},
|
|
11913
11982
|
/**
|
|
11914
11983
|
* 设置展开行,二个参数设置这一行展开与否
|
|
@@ -11992,9 +12061,11 @@ const tableMethods: any = {
|
|
|
11992
12061
|
return !!rowExpandedFlag && !!rowExpandedMaps[rowid]
|
|
11993
12062
|
},
|
|
11994
12063
|
isExpandByRow (row: any) {
|
|
12064
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12065
|
+
|
|
11995
12066
|
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow'])
|
|
11996
12067
|
// 即将废弃
|
|
11997
|
-
return
|
|
12068
|
+
return $xeTable.isRowExpandByRow(row)
|
|
11998
12069
|
},
|
|
11999
12070
|
/**
|
|
12000
12071
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
@@ -12027,8 +12098,11 @@ const tableMethods: any = {
|
|
|
12027
12098
|
})
|
|
12028
12099
|
},
|
|
12029
12100
|
clearRowExpandReserve () {
|
|
12030
|
-
|
|
12031
|
-
|
|
12101
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12102
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
12103
|
+
|
|
12104
|
+
internalData.rowExpandedReserveRowMap = {}
|
|
12105
|
+
return $xeTable.$nextTick()
|
|
12032
12106
|
},
|
|
12033
12107
|
getRowExpandRecords () {
|
|
12034
12108
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -12255,10 +12329,14 @@ const tableMethods: any = {
|
|
|
12255
12329
|
* @private
|
|
12256
12330
|
*/
|
|
12257
12331
|
getTreeStatus () {
|
|
12258
|
-
|
|
12332
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12333
|
+
const props = $xeTable
|
|
12334
|
+
|
|
12335
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
12336
|
+
if (props.treeConfig) {
|
|
12259
12337
|
return {
|
|
12260
|
-
config:
|
|
12261
|
-
rowExpandeds:
|
|
12338
|
+
config: treeOpts,
|
|
12339
|
+
rowExpandeds: $xeTable.getTreeExpandRecords()
|
|
12262
12340
|
}
|
|
12263
12341
|
}
|
|
12264
12342
|
return null
|
|
@@ -12269,8 +12347,9 @@ const tableMethods: any = {
|
|
|
12269
12347
|
*/
|
|
12270
12348
|
isTreeExpandLoaded (row: any) {
|
|
12271
12349
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12350
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
12272
12351
|
|
|
12273
|
-
const { fullAllDataRowIdData } =
|
|
12352
|
+
const { fullAllDataRowIdData } = internalData
|
|
12274
12353
|
const rowRest = fullAllDataRowIdData[getRowid($xeTable, row)]
|
|
12275
12354
|
return rowRest && !!rowRest.treeLoaded
|
|
12276
12355
|
},
|
|
@@ -12405,7 +12484,9 @@ const tableMethods: any = {
|
|
|
12405
12484
|
* 切换/展开树节点
|
|
12406
12485
|
*/
|
|
12407
12486
|
toggleTreeExpand (row: any) {
|
|
12408
|
-
|
|
12487
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12488
|
+
|
|
12489
|
+
return $xeTable.setTreeExpand(row, !$xeTable.isTreeExpandByRow(row))
|
|
12409
12490
|
},
|
|
12410
12491
|
/**
|
|
12411
12492
|
* 设置所有树节点的展开与否
|
|
@@ -12445,7 +12526,7 @@ const tableMethods: any = {
|
|
|
12445
12526
|
setTreeExpand (rows: any | any[], expanded: boolean) {
|
|
12446
12527
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12447
12528
|
|
|
12448
|
-
const
|
|
12529
|
+
const treeOpts = $xeTable.computeTreeOpts
|
|
12449
12530
|
const { transform } = treeOpts
|
|
12450
12531
|
if (rows) {
|
|
12451
12532
|
if (!XEUtils.isArray(rows)) {
|
|
@@ -12460,7 +12541,7 @@ const tableMethods: any = {
|
|
|
12460
12541
|
}
|
|
12461
12542
|
}
|
|
12462
12543
|
}
|
|
12463
|
-
return
|
|
12544
|
+
return $xeTable.$nextTick()
|
|
12464
12545
|
},
|
|
12465
12546
|
/**
|
|
12466
12547
|
* 判断行是否为树形节点展开状态
|
|
@@ -12506,8 +12587,11 @@ const tableMethods: any = {
|
|
|
12506
12587
|
})
|
|
12507
12588
|
},
|
|
12508
12589
|
clearTreeExpandReserve () {
|
|
12509
|
-
|
|
12510
|
-
|
|
12590
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12591
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
12592
|
+
|
|
12593
|
+
internalData.treeExpandedReserveRowMap = {}
|
|
12594
|
+
return $xeTable.$nextTick()
|
|
12511
12595
|
},
|
|
12512
12596
|
/**
|
|
12513
12597
|
* 获取表格的滚动状态
|
|
@@ -13606,7 +13690,7 @@ const tableMethods: any = {
|
|
|
13606
13690
|
const props = $xeTable
|
|
13607
13691
|
const internalData = $xeTable as unknown as TableInternalData
|
|
13608
13692
|
|
|
13609
|
-
return
|
|
13693
|
+
return $xeTable.$nextTick().then(() => {
|
|
13610
13694
|
const { editRules } = props
|
|
13611
13695
|
const { isActivated } = internalData
|
|
13612
13696
|
if (isActivated && slotParams && editRules) {
|
|
@@ -13990,7 +14074,9 @@ const tableMethods: any = {
|
|
|
13990
14074
|
return $xeTable.getCellElement(row, column)
|
|
13991
14075
|
},
|
|
13992
14076
|
findRowIndexOf (list: any, row: any) {
|
|
13993
|
-
|
|
14077
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
14078
|
+
|
|
14079
|
+
return row ? XEUtils.findIndexOf(list, item => $xeTable.eqRow(item, row)) : -1
|
|
13994
14080
|
},
|
|
13995
14081
|
eqRow (row1: any, row2: any) {
|
|
13996
14082
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -931,13 +931,21 @@ export default {
|
|
|
931
931
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
932
932
|
const props = $xeTable
|
|
933
933
|
|
|
934
|
-
|
|
934
|
+
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
935
|
+
return Object.assign({}, getConfig().tooltip, {
|
|
936
|
+
enterable: tooltipOpts.enterable,
|
|
937
|
+
defaultPlacement: tooltipOpts.defaultPlacement
|
|
938
|
+
}, getConfig().table.headerTooltipConfig, props.headerTooltipConfig)
|
|
935
939
|
},
|
|
936
940
|
computeFooterTooltipOpts () {
|
|
937
941
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
938
942
|
const props = $xeTable
|
|
939
943
|
|
|
940
|
-
|
|
944
|
+
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
945
|
+
return Object.assign({}, getConfig().tooltip, {
|
|
946
|
+
enterable: tooltipOpts.enterable,
|
|
947
|
+
defaultPlacement: tooltipOpts.defaultPlacement
|
|
948
|
+
}, getConfig().table.footerTooltipConfig, props.footerTooltipConfig)
|
|
941
949
|
},
|
|
942
950
|
computeTableTipConfig () {
|
|
943
951
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
@@ -41,8 +41,14 @@ export function createInternalData (): TableInternalData {
|
|
|
41
41
|
customHeight: 0,
|
|
42
42
|
customMinHeight: 0,
|
|
43
43
|
customMaxHeight: 0,
|
|
44
|
+
|
|
44
45
|
// 当前 hover 行
|
|
45
46
|
hoverRow: null,
|
|
47
|
+
hoverCol: null,
|
|
48
|
+
// 当前行
|
|
49
|
+
currentRow: null,
|
|
50
|
+
currentCol: null,
|
|
51
|
+
|
|
46
52
|
// 最后滚动位置
|
|
47
53
|
lastScrollLeft: 0,
|
|
48
54
|
lastScrollTop: 0,
|
|
@@ -96,9 +102,6 @@ export function createInternalData (): TableInternalData {
|
|
|
96
102
|
|
|
97
103
|
fullCellStoreMaps: {},
|
|
98
104
|
|
|
99
|
-
// 当前行
|
|
100
|
-
currentRow: null,
|
|
101
|
-
|
|
102
105
|
// 合并表头单元格的数据
|
|
103
106
|
mergeHeaderList: [],
|
|
104
107
|
mergeHeaderMaps: {},
|
|
@@ -207,8 +210,6 @@ export function createReactData (): TableReactData {
|
|
|
207
210
|
isAllSelected: false,
|
|
208
211
|
// 复选框属性,有选中且非全选状态
|
|
209
212
|
isIndeterminate: false,
|
|
210
|
-
// 单选框属性,选中列
|
|
211
|
-
currentColumn: null,
|
|
212
213
|
// 单选框属性,选中行
|
|
213
214
|
selectRadioRow: null,
|
|
214
215
|
// 表尾合计数据
|
|
@@ -428,7 +429,9 @@ export function createReactData (): TableReactData {
|
|
|
428
429
|
|
|
429
430
|
isDragResize: false,
|
|
430
431
|
isRowLoading: false,
|
|
431
|
-
isColLoading: false
|
|
432
|
+
isColLoading: false,
|
|
433
|
+
|
|
434
|
+
currColFlag: 1
|
|
432
435
|
}
|
|
433
436
|
}
|
|
434
437
|
|