vxe-table 3.20.0-beta.9 → 3.20.1
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 +6 -0
- package/es/locale/lang/de-DE.js +6 -0
- package/es/locale/lang/en-US.js +6 -0
- package/es/locale/lang/es-ES.js +6 -0
- package/es/locale/lang/fr-FR.js +6 -0
- package/es/locale/lang/hu-HU.js +6 -0
- package/es/locale/lang/hy-AM.js +6 -0
- package/es/locale/lang/id-ID.js +6 -0
- package/es/locale/lang/it-IT.js +6 -0
- package/es/locale/lang/ja-JP.js +6 -0
- package/es/locale/lang/ko-KR.js +6 -0
- package/es/locale/lang/ms-MY.js +6 -0
- package/es/locale/lang/nb-NO.js +6 -0
- package/es/locale/lang/pt-BR.js +6 -0
- package/es/locale/lang/ru-RU.js +6 -0
- package/es/locale/lang/th-TH.js +6 -0
- package/es/locale/lang/ug-CN.js +6 -0
- package/es/locale/lang/uk-UA.js +6 -0
- package/es/locale/lang/uz-UZ.js +6 -0
- package/es/locale/lang/vi-VN.js +6 -0
- package/es/locale/lang/zh-CHT.js +6 -0
- package/es/locale/lang/zh-CN.js +6 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/mixin.js +15 -1
- package/es/table/module/keyboard/mixin.js +18 -8
- package/es/table/module/validator/mixin.js +7 -6
- package/es/table/render/index.js +11 -0
- package/es/table/src/body.js +12 -5
- package/es/table/src/column.js +1 -1
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/methods.js +208 -79
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +64 -3
- package/es/table/src/util.js +38 -20
- package/es/table/style.css +11 -17
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +7 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +11 -17
- 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 +241 -76
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +6 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +6 -0
- package/lib/locale/lang/de-DE.js +6 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +6 -0
- package/lib/locale/lang/en-US.js +6 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +6 -0
- package/lib/locale/lang/es-ES.js +6 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +6 -0
- package/lib/locale/lang/fr-FR.js +6 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +6 -0
- package/lib/locale/lang/hu-HU.js +6 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +6 -0
- package/lib/locale/lang/hy-AM.js +6 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +6 -0
- package/lib/locale/lang/id-ID.js +6 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +6 -0
- package/lib/locale/lang/it-IT.js +6 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +6 -0
- package/lib/locale/lang/ja-JP.js +6 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +6 -0
- package/lib/locale/lang/ko-KR.js +6 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +6 -0
- package/lib/locale/lang/ms-MY.js +6 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +6 -0
- package/lib/locale/lang/nb-NO.js +6 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +6 -0
- package/lib/locale/lang/pt-BR.js +6 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +6 -0
- package/lib/locale/lang/ru-RU.js +6 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +6 -0
- package/lib/locale/lang/th-TH.js +6 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +6 -0
- package/lib/locale/lang/ug-CN.js +6 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +6 -0
- package/lib/locale/lang/uk-UA.js +6 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +6 -0
- package/lib/locale/lang/uz-UZ.js +6 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +6 -0
- package/lib/locale/lang/vi-VN.js +6 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +6 -0
- package/lib/locale/lang/zh-CHT.js +6 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +6 -0
- package/lib/locale/lang/zh-CN.js +6 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +6 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/mixin.js +18 -6
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +18 -4
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +8 -6
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +15 -0
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +13 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/column.js +1 -1
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +806 -14157
- 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 +74 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +41 -21
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +11 -17
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +7 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +11 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +6 -0
- package/packages/locale/lang/de-DE.ts +6 -0
- package/packages/locale/lang/en-US.ts +6 -0
- package/packages/locale/lang/es-ES.ts +6 -0
- package/packages/locale/lang/fr-FR.ts +6 -0
- package/packages/locale/lang/hu-HU.ts +6 -0
- package/packages/locale/lang/hy-AM.ts +6 -0
- package/packages/locale/lang/id-ID.ts +6 -0
- package/packages/locale/lang/it-IT.ts +6 -0
- package/packages/locale/lang/ja-JP.ts +6 -0
- package/packages/locale/lang/ko-KR.ts +6 -0
- package/packages/locale/lang/ms-MY.ts +6 -0
- package/packages/locale/lang/nb-NO.ts +6 -0
- package/packages/locale/lang/pt-BR.ts +6 -0
- package/packages/locale/lang/ru-RU.ts +6 -0
- package/packages/locale/lang/th-TH.ts +6 -0
- package/packages/locale/lang/ug-CN.ts +6 -0
- package/packages/locale/lang/uk-UA.ts +6 -0
- package/packages/locale/lang/uz-UZ.ts +6 -0
- package/packages/locale/lang/vi-VN.ts +6 -0
- package/packages/locale/lang/zh-CHT.ts +6 -0
- package/packages/locale/lang/zh-CN.ts +6 -0
- package/packages/table/module/export/mixin.ts +13 -1
- package/packages/table/module/keyboard/mixin.ts +21 -12
- package/packages/table/module/validator/mixin.ts +7 -6
- package/packages/table/render/index.ts +12 -0
- package/packages/table/src/body.ts +12 -5
- package/packages/table/src/column.ts +1 -1
- package/packages/table/src/columnInfo.ts +2 -0
- package/packages/table/src/methods.ts +201 -78
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +70 -2
- package/packages/table/src/util.ts +43 -19
- package/packages/ui/index.ts +6 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/components/table-module/menu.scss +4 -9
- package/styles/components/table.scss +8 -2
- package/styles/theme/base.scss +0 -1
- /package/es/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
- /package/es/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
- /package/es/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
- /package/lib/{iconfont.1768625297791.ttf → iconfont.1773109164685.ttf} +0 -0
- /package/lib/{iconfont.1768625297791.woff → iconfont.1773109164685.woff} +0 -0
- /package/lib/{iconfont.1768625297791.woff2 → iconfont.1773109164685.woff2} +0 -0
|
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, scrollTopTo,
|
|
|
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'
|
|
6
|
-
import { getRowUniqueId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn } from './util'
|
|
6
|
+
import { getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem, getCellRestHeight, getLastChildColumn } from './util'
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
8
8
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
|
|
9
9
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
@@ -230,6 +230,7 @@ function handleCustomRestore ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
230
230
|
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
|
|
231
231
|
internalData.collectColumn = newCollectCols
|
|
232
232
|
internalData.tableFullColumn = getColumnList(newCollectCols)
|
|
233
|
+
reactData.updateColFlag++
|
|
233
234
|
}
|
|
234
235
|
reactData.isCustomStatus = true
|
|
235
236
|
} else {
|
|
@@ -386,14 +387,19 @@ function cacheColumnMap ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
386
387
|
tableFullColumn.forEach(handleFunc)
|
|
387
388
|
}
|
|
388
389
|
|
|
389
|
-
if (expandColumn
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
390
|
+
if (expandColumn) {
|
|
391
|
+
if (expandOpts.mode !== 'fixed' && virtualYOpts.enabled) {
|
|
392
|
+
warnLog('vxe.error.notConflictProp', ['column.type="expand', 'virtual-y-config.enabled=false'])
|
|
393
|
+
}
|
|
394
|
+
if ((expandOpts.mode !== 'fixed') && mouseOpts.area) {
|
|
395
|
+
errLog('vxe.error.errConflicts', ['mouse-config.area', 'column.type=expand'])
|
|
396
|
+
}
|
|
397
|
+
if (expandOpts.mode !== 'inside' && (treeConfig && !treeOpts.transform)) {
|
|
398
|
+
errLog('vxe.error.notConflictProp', ['tree-config.transform=false', 'expand-config.mode=fixed'])
|
|
399
|
+
}
|
|
400
|
+
if (props.spanMethod) {
|
|
401
|
+
warnLog('vxe.error.notSupportProp', ['column.type=expand', 'span-method', 'span-method=null'])
|
|
402
|
+
}
|
|
397
403
|
}
|
|
398
404
|
|
|
399
405
|
if (htmlColumn) {
|
|
@@ -2917,13 +2923,13 @@ function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods,
|
|
|
2917
2923
|
return $xeTable.$nextTick()
|
|
2918
2924
|
}
|
|
2919
2925
|
|
|
2920
|
-
function handleScrollToRowColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, fieldOrColumn: string | VxeTableDefines.ColumnInfo | null, row?:
|
|
2926
|
+
function handleScrollToRowColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, fieldOrColumn: string | VxeTableDefines.ColumnInfo | null, row: any, options?: VxeTableDefines.ScrollToRowConfig) {
|
|
2921
2927
|
const internalData = $xeTable as unknown as TableInternalData
|
|
2922
2928
|
|
|
2923
2929
|
const { fullColumnIdData } = internalData
|
|
2924
2930
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
2925
2931
|
if (column && fullColumnIdData[column.id]) {
|
|
2926
|
-
return colToVisible($xeTable, column, row)
|
|
2932
|
+
return colToVisible($xeTable, options ? options.colAlign !== false : true, column, row)
|
|
2927
2933
|
}
|
|
2928
2934
|
return $xeTable.$nextTick()
|
|
2929
2935
|
}
|
|
@@ -3302,6 +3308,7 @@ function handleGroupData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
3302
3308
|
if (rowGroups) {
|
|
3303
3309
|
const aggregateOpts = $xeTable.computeAggregateOpts
|
|
3304
3310
|
const { rowField, parentField, childrenField, mapChildrenField } = aggregateOpts
|
|
3311
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
3305
3312
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
3306
3313
|
const { checkField } = checkboxOpts
|
|
3307
3314
|
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField
|
|
@@ -3337,10 +3344,10 @@ function handleGroupData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
3337
3344
|
childCount: 0,
|
|
3338
3345
|
[rowField]: getRowUniqueId(),
|
|
3339
3346
|
[parentField]: null,
|
|
3340
|
-
[rowkey]: getRowUniqueId(),
|
|
3341
3347
|
[childrenField]: childTreeData,
|
|
3342
3348
|
[mapChildrenField]: childTreeData
|
|
3343
3349
|
}
|
|
3350
|
+
aggRow[rowkey] = createRowId(rowOpts, aggRow, rowkey)
|
|
3344
3351
|
if (checkField) {
|
|
3345
3352
|
aggRow[checkField] = false
|
|
3346
3353
|
}
|
|
@@ -3633,12 +3640,14 @@ function handleTableColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMetho
|
|
|
3633
3640
|
}
|
|
3634
3641
|
|
|
3635
3642
|
function handleUpdateColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
3643
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
3636
3644
|
const internalData = $xeTable as unknown as TableInternalData
|
|
3637
3645
|
|
|
3638
3646
|
const columnList = XEUtils.orderBy(internalData.collectColumn, 'renderSortNumber')
|
|
3639
3647
|
internalData.collectColumn = columnList
|
|
3640
|
-
const
|
|
3641
|
-
internalData.tableFullColumn =
|
|
3648
|
+
const tFullColumn = getColumnList(columnList)
|
|
3649
|
+
internalData.tableFullColumn = tFullColumn
|
|
3650
|
+
reactData.updateColFlag++
|
|
3642
3651
|
cacheColumnMap($xeTable)
|
|
3643
3652
|
}
|
|
3644
3653
|
|
|
@@ -3830,8 +3839,9 @@ function handleInitColumn ($xeTable: VxeTableConstructor & VxeTablePrivateMethod
|
|
|
3830
3839
|
|
|
3831
3840
|
const expandOpts = $xeTable.computeExpandOpts
|
|
3832
3841
|
internalData.collectColumn = collectColumn
|
|
3833
|
-
const
|
|
3834
|
-
internalData.tableFullColumn =
|
|
3842
|
+
const tFullColumn = getColumnList(collectColumn)
|
|
3843
|
+
internalData.tableFullColumn = tFullColumn
|
|
3844
|
+
reactData.updateColFlag++
|
|
3835
3845
|
reactData.isColLoading = true
|
|
3836
3846
|
initColumnHierarchy($xeTable)
|
|
3837
3847
|
return Promise.resolve(
|
|
@@ -4242,7 +4252,7 @@ function updateRowExpandStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMe
|
|
|
4242
4252
|
const rowid = expandEl.getAttribute('rowid') || ''
|
|
4243
4253
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
4244
4254
|
if (rowRest) {
|
|
4245
|
-
const expandHeight = expandEl.offsetHeight
|
|
4255
|
+
const expandHeight = expandEl.offsetHeight
|
|
4246
4256
|
const trEl = bodyScrollElem.querySelector(`.vxe-body--row[rowid="${rowid}"]`) as HTMLTableCellElement
|
|
4247
4257
|
let offsetTop = 0
|
|
4248
4258
|
if (scrollYLoad) {
|
|
@@ -5028,6 +5038,7 @@ const tableMethods: any = {
|
|
|
5028
5038
|
const expandOpts = $xeTable.computeExpandOpts
|
|
5029
5039
|
const treeOpts = $xeTable.computeTreeOpts
|
|
5030
5040
|
const radioOpts = $xeTable.computeRadioOpts
|
|
5041
|
+
const rowOpts = $xeTable.computeRowOpts
|
|
5031
5042
|
const checkboxOpts = $xeTable.computeCheckboxOpts
|
|
5032
5043
|
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
5033
5044
|
const rowkey = getRowkey($xeTable)
|
|
@@ -5061,7 +5072,7 @@ const tableMethods: any = {
|
|
|
5061
5072
|
}
|
|
5062
5073
|
// 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数
|
|
5063
5074
|
if (eqEmptyValue(XEUtils.get(record, rowkey))) {
|
|
5064
|
-
XEUtils.set(record, rowkey,
|
|
5075
|
+
XEUtils.set(record, rowkey, createRowId(rowOpts, record, rowkey))
|
|
5065
5076
|
}
|
|
5066
5077
|
return record
|
|
5067
5078
|
})
|
|
@@ -5407,9 +5418,10 @@ const tableMethods: any = {
|
|
|
5407
5418
|
const props = $xeTable
|
|
5408
5419
|
const internalData = $xeTable as unknown as TableInternalData
|
|
5409
5420
|
|
|
5410
|
-
const { keepSource } = props
|
|
5411
|
-
const {
|
|
5412
|
-
|
|
5421
|
+
const { keepSource, editConfig } = props
|
|
5422
|
+
const { fullDataRowIdData, sourceDataRowIdData } = internalData
|
|
5423
|
+
const keepFields = $xeTable.computeKeepFields
|
|
5424
|
+
if (keepSource && editConfig) {
|
|
5413
5425
|
const rowid = XEUtils.isString(rowOrId) || XEUtils.isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId)
|
|
5414
5426
|
const rowRest = fullDataRowIdData[rowid]
|
|
5415
5427
|
// 新增的数据不需要检测
|
|
@@ -5422,9 +5434,8 @@ const tableMethods: any = {
|
|
|
5422
5434
|
if (arguments.length > 1) {
|
|
5423
5435
|
return !eqCellValue(oRow, row, field as string)
|
|
5424
5436
|
}
|
|
5425
|
-
for (let
|
|
5426
|
-
|
|
5427
|
-
if (property && !eqCellValue(oRow, row, property)) {
|
|
5437
|
+
for (let i = 0; i < keepFields.length; i++) {
|
|
5438
|
+
if (!eqCellValue(oRow, row, keepFields[i])) {
|
|
5428
5439
|
return true
|
|
5429
5440
|
}
|
|
5430
5441
|
}
|
|
@@ -7020,13 +7031,15 @@ const tableMethods: any = {
|
|
|
7020
7031
|
if (ctxMenuStore.visible && tableMenu && !getEventTargetNode(evnt, tableMenu.$el).flag) {
|
|
7021
7032
|
$xeTable.closeMenu()
|
|
7022
7033
|
}
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7034
|
+
if (!(actived.row && getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag)) {
|
|
7035
|
+
const isActivated = getEventTargetNode(evnt, ($xeGGWrapper || $xeTable).$el).flag
|
|
7036
|
+
// 如果存在校验,点击了表格之外则清除
|
|
7037
|
+
if (!isActivated && editRules && validOpts.autoClear) {
|
|
7038
|
+
reactData.validErrorMaps = {}
|
|
7039
|
+
}
|
|
7040
|
+
// 最后激活的表格
|
|
7041
|
+
internalData.isActivated = isActivated
|
|
7027
7042
|
}
|
|
7028
|
-
// 最后激活的表格
|
|
7029
|
-
internalData.isActivated = isActivated
|
|
7030
7043
|
},
|
|
7031
7044
|
/**
|
|
7032
7045
|
* 窗口失焦事件处理
|
|
@@ -7104,7 +7117,7 @@ const tableMethods: any = {
|
|
|
7104
7117
|
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
7105
7118
|
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props
|
|
7106
7119
|
const { ctxMenuStore, editStore, currentRow } = reactData
|
|
7107
|
-
const { afterFullData } = internalData
|
|
7120
|
+
const { afterFullData, visibleColumn } = internalData
|
|
7108
7121
|
const isContentMenu = $xeTable.computeIsContentMenu
|
|
7109
7122
|
const bodyMenu = $xeTable.computeBodyMenu
|
|
7110
7123
|
const keyboardOpts = $xeTable.computeKeyboardOpts
|
|
@@ -7114,6 +7127,7 @@ const tableMethods: any = {
|
|
|
7114
7127
|
const menuList = $xeTable.computeMenuList
|
|
7115
7128
|
const rowOpts = $xeTable.computeRowOpts
|
|
7116
7129
|
const columnOpts = $xeTable.computeColumnOpts
|
|
7130
|
+
const { isLastEnterAppendRow, beforeEnterMethod, enterMethod, isLastTabAppendRow, beforeTabMethod, tabMethod } = keyboardOpts
|
|
7117
7131
|
const { selected, actived } = editStore
|
|
7118
7132
|
const { keyCode } = evnt
|
|
7119
7133
|
const hasBackspaceKey = keyCode === 8
|
|
@@ -7188,7 +7202,6 @@ const tableMethods: any = {
|
|
|
7188
7202
|
internalData._keyCtx = false
|
|
7189
7203
|
}, 1000)
|
|
7190
7204
|
} else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || (treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow))) {
|
|
7191
|
-
const { isLastEnterAppendRow, beforeEnterMethod, enterMethod } = keyboardOpts
|
|
7192
7205
|
// 退出选中
|
|
7193
7206
|
if (isControlKey) {
|
|
7194
7207
|
// 如果是激活编辑状态,则取消编辑
|
|
@@ -7203,6 +7216,8 @@ const tableMethods: any = {
|
|
|
7203
7216
|
} else {
|
|
7204
7217
|
// 如果是激活状态,退则出到上一行/下一行
|
|
7205
7218
|
if (selected.row || actived.row) {
|
|
7219
|
+
const activeRow = selected.row || actived.row
|
|
7220
|
+
const activeColumn = selected.column || actived.column
|
|
7206
7221
|
const activeParams = selected.row ? selected.args : actived.args
|
|
7207
7222
|
if (hasShiftKey) {
|
|
7208
7223
|
if (keyboardOpts.enterToTab) {
|
|
@@ -7211,12 +7226,44 @@ const tableMethods: any = {
|
|
|
7211
7226
|
$xeTable.moveEnterSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt)
|
|
7212
7227
|
}
|
|
7213
7228
|
} else {
|
|
7229
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow)
|
|
7230
|
+
const _columnIndex = $xeTable.getVTColumnIndex(activeColumn)
|
|
7214
7231
|
if (keyboardOpts.enterToTab) {
|
|
7215
|
-
|
|
7232
|
+
const ttrParams = {
|
|
7233
|
+
row: activeRow,
|
|
7234
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
7235
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
7236
|
+
_rowIndex,
|
|
7237
|
+
column: activeColumn,
|
|
7238
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7239
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7240
|
+
_columnIndex,
|
|
7241
|
+
$table: $xeTable
|
|
7242
|
+
}
|
|
7243
|
+
if (!beforeTabMethod || beforeTabMethod(ttrParams) !== false) {
|
|
7244
|
+
evnt.preventDefault()
|
|
7245
|
+
// 最后一行按下Tab键,自动追加一行
|
|
7246
|
+
if (isLastTabAppendRow) {
|
|
7247
|
+
const newColumn = visibleColumn[0]
|
|
7248
|
+
if (_rowIndex >= afterFullData.length - 1 && _columnIndex >= visibleColumn.length - 1) {
|
|
7249
|
+
if (actived.row) {
|
|
7250
|
+
$xeTable.handleClearEdit(evnt)
|
|
7251
|
+
}
|
|
7252
|
+
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7253
|
+
$xeTable.scrollToRow(newRow, newColumn)
|
|
7254
|
+
$xeTable.handleSelected({ ...activeParams, row: newRow, column: newColumn }, evnt)
|
|
7255
|
+
})
|
|
7256
|
+
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt)
|
|
7257
|
+
return
|
|
7258
|
+
}
|
|
7259
|
+
}
|
|
7260
|
+
if (tabMethod) {
|
|
7261
|
+
tabMethod(ttrParams)
|
|
7262
|
+
} else {
|
|
7263
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt)
|
|
7264
|
+
}
|
|
7265
|
+
}
|
|
7216
7266
|
} else {
|
|
7217
|
-
const activeRow = selected.row || actived.row
|
|
7218
|
-
const activeColumn = selected.column || actived.column
|
|
7219
|
-
const _rowIndex = $xeTable.getVTRowIndex(activeRow)
|
|
7220
7267
|
const etrParams = {
|
|
7221
7268
|
row: activeRow,
|
|
7222
7269
|
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
@@ -7225,10 +7272,11 @@ const tableMethods: any = {
|
|
|
7225
7272
|
column: activeColumn,
|
|
7226
7273
|
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7227
7274
|
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7228
|
-
_columnIndex
|
|
7275
|
+
_columnIndex,
|
|
7229
7276
|
$table: $xeTable
|
|
7230
7277
|
}
|
|
7231
7278
|
if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
|
|
7279
|
+
evnt.preventDefault()
|
|
7232
7280
|
// 最后一行按下回车键,自动追加一行
|
|
7233
7281
|
if (isLastEnterAppendRow) {
|
|
7234
7282
|
if (_rowIndex >= afterFullData.length - 1) {
|
|
@@ -7240,9 +7288,13 @@ const tableMethods: any = {
|
|
|
7240
7288
|
return
|
|
7241
7289
|
}
|
|
7242
7290
|
}
|
|
7243
|
-
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt)
|
|
7244
7291
|
if (enterMethod) {
|
|
7245
7292
|
enterMethod(etrParams)
|
|
7293
|
+
} else {
|
|
7294
|
+
if (actived.row) {
|
|
7295
|
+
$xeTable.handleClearEdit(evnt)
|
|
7296
|
+
}
|
|
7297
|
+
$xeTable.moveEnterSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt)
|
|
7246
7298
|
}
|
|
7247
7299
|
}
|
|
7248
7300
|
}
|
|
@@ -7283,10 +7335,49 @@ const tableMethods: any = {
|
|
|
7283
7335
|
}
|
|
7284
7336
|
} else if (isTab && keyboardConfig && keyboardOpts.isTab) {
|
|
7285
7337
|
// 如果按下了 Tab 键切换
|
|
7286
|
-
if (selected.row ||
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7338
|
+
if (selected.row || actived.row) {
|
|
7339
|
+
const activeRow = selected.row || actived.row
|
|
7340
|
+
const activeColumn = selected.column || actived.column
|
|
7341
|
+
const activeParams = selected.row ? selected.args : actived.args
|
|
7342
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow)
|
|
7343
|
+
const _columnIndex = $xeTable.getVTColumnIndex(activeColumn)
|
|
7344
|
+
const ttrParams = {
|
|
7345
|
+
row: activeRow,
|
|
7346
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
7347
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
7348
|
+
_rowIndex,
|
|
7349
|
+
column: activeColumn,
|
|
7350
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
7351
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
7352
|
+
_columnIndex,
|
|
7353
|
+
$table: $xeTable
|
|
7354
|
+
}
|
|
7355
|
+
if (!beforeTabMethod || beforeTabMethod(ttrParams) !== false) {
|
|
7356
|
+
evnt.preventDefault()
|
|
7357
|
+
// 最后一行按下Tab键,自动追加一行
|
|
7358
|
+
if (isLastTabAppendRow) {
|
|
7359
|
+
const newColumn = visibleColumn[0]
|
|
7360
|
+
if (_rowIndex >= afterFullData.length - 1 && _columnIndex >= visibleColumn.length - 1) {
|
|
7361
|
+
if (actived.row) {
|
|
7362
|
+
$xeTable.handleClearEdit(evnt)
|
|
7363
|
+
}
|
|
7364
|
+
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
7365
|
+
$xeTable.scrollToRow(newRow, newColumn)
|
|
7366
|
+
$xeTable.handleSelected({ ...activeParams, row: newRow, column: newColumn }, evnt)
|
|
7367
|
+
})
|
|
7368
|
+
$xeTable.dispatchEvent('tab-append-row', ttrParams, evnt)
|
|
7369
|
+
return
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
if (tabMethod) {
|
|
7373
|
+
tabMethod(ttrParams)
|
|
7374
|
+
} else {
|
|
7375
|
+
if (actived.row) {
|
|
7376
|
+
$xeTable.handleClearEdit(evnt)
|
|
7377
|
+
}
|
|
7378
|
+
$xeTable.moveTabSelected(activeParams, hasShiftKey, evnt)
|
|
7379
|
+
}
|
|
7380
|
+
}
|
|
7290
7381
|
}
|
|
7291
7382
|
} else if (keyboardConfig && keyboardOpts.isDel && hasDeleteKey && isEnableConf(editConfig) && (selected.row || selected.column)) {
|
|
7292
7383
|
// 如果是删除键
|
|
@@ -8404,7 +8495,7 @@ const tableMethods: any = {
|
|
|
8404
8495
|
const { selectRadioRow: oldValue } = reactData
|
|
8405
8496
|
const { row } = params
|
|
8406
8497
|
const radioOpts = $xeTable.computeRadioOpts
|
|
8407
|
-
const { trigger, checkMethod } = radioOpts
|
|
8498
|
+
const { trigger, strict, checkMethod } = radioOpts
|
|
8408
8499
|
if (trigger === 'manual') {
|
|
8409
8500
|
return
|
|
8410
8501
|
}
|
|
@@ -8412,9 +8503,10 @@ const tableMethods: any = {
|
|
|
8412
8503
|
if (!checkMethod || checkMethod({ $table: $xeTable, row })) {
|
|
8413
8504
|
let newValue = row
|
|
8414
8505
|
let isChange = oldValue !== newValue
|
|
8506
|
+
const selected = !isChange
|
|
8415
8507
|
if (isChange) {
|
|
8416
8508
|
handleCheckedRadioRow($xeTable, newValue)
|
|
8417
|
-
} else if (!
|
|
8509
|
+
} else if (!strict) {
|
|
8418
8510
|
isChange = oldValue === newValue
|
|
8419
8511
|
if (isChange) {
|
|
8420
8512
|
newValue = null
|
|
@@ -8422,7 +8514,7 @@ const tableMethods: any = {
|
|
|
8422
8514
|
}
|
|
8423
8515
|
}
|
|
8424
8516
|
if (isChange) {
|
|
8425
|
-
$xeTable.dispatchEvent('radio-change', { oldValue, newValue, ...params }, evnt)
|
|
8517
|
+
$xeTable.dispatchEvent('radio-change', { oldValue, newValue, selected, ...params }, evnt)
|
|
8426
8518
|
}
|
|
8427
8519
|
}
|
|
8428
8520
|
},
|
|
@@ -8436,16 +8528,27 @@ const tableMethods: any = {
|
|
|
8436
8528
|
const columnOpts = $xeTable.computeColumnOpts
|
|
8437
8529
|
const currentColumnOpts = $xeTable.computeCurrentColumnOpts
|
|
8438
8530
|
const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod as any
|
|
8439
|
-
|
|
8440
|
-
const { trigger } = currentColumnOpts
|
|
8531
|
+
let { column: newValue } = params
|
|
8532
|
+
const { trigger, strict } = currentColumnOpts
|
|
8441
8533
|
if (trigger === 'manual') {
|
|
8442
8534
|
return
|
|
8443
8535
|
}
|
|
8444
|
-
|
|
8445
|
-
|
|
8446
|
-
|
|
8536
|
+
let isChange = oldValue !== newValue
|
|
8537
|
+
const selected = !isChange
|
|
8538
|
+
if (!beforeRowMethod || beforeRowMethod({ column: newValue, selected, $table: $xeTable })) {
|
|
8539
|
+
if (strict) {
|
|
8540
|
+
$xeTable.setCurrentColumn(newValue)
|
|
8541
|
+
} else {
|
|
8542
|
+
isChange = oldValue === newValue
|
|
8543
|
+
if (isChange) {
|
|
8544
|
+
newValue = null as any
|
|
8545
|
+
$xeTable.clearCurrentColumn()
|
|
8546
|
+
} else {
|
|
8547
|
+
$xeTable.setCurrentColumn(newValue)
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8447
8550
|
if (isChange) {
|
|
8448
|
-
$xeTable.dispatchEvent('current-column-change', { oldValue, newValue, ...params }, evnt)
|
|
8551
|
+
$xeTable.dispatchEvent('current-column-change', { oldValue, newValue, selected, ...params }, evnt)
|
|
8449
8552
|
}
|
|
8450
8553
|
} else {
|
|
8451
8554
|
$xeTable.dispatchEvent('current-column-disabled', params, evnt)
|
|
@@ -8459,18 +8562,29 @@ const tableMethods: any = {
|
|
|
8459
8562
|
const rowOpts = $xeTable.computeRowOpts
|
|
8460
8563
|
const currentRowOpts = $xeTable.computeCurrentRowOpts
|
|
8461
8564
|
const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod as any
|
|
8462
|
-
|
|
8463
|
-
const { trigger } = currentRowOpts
|
|
8565
|
+
let { row: newValue } = params
|
|
8566
|
+
const { trigger, strict } = currentRowOpts
|
|
8464
8567
|
if (trigger === 'manual') {
|
|
8465
8568
|
return
|
|
8466
8569
|
}
|
|
8467
|
-
|
|
8468
|
-
|
|
8469
|
-
|
|
8570
|
+
let isChange = oldValue !== newValue
|
|
8571
|
+
const selected = !isChange
|
|
8572
|
+
if (!beforeRowMethod || beforeRowMethod({ row: newValue, selected, $table: $xeTable })) {
|
|
8573
|
+
if (strict) {
|
|
8574
|
+
$xeTable.setCurrentRow(newValue)
|
|
8575
|
+
} else {
|
|
8576
|
+
isChange = oldValue === newValue
|
|
8577
|
+
if (isChange) {
|
|
8578
|
+
newValue = null
|
|
8579
|
+
$xeTable.clearCurrentRow()
|
|
8580
|
+
} else {
|
|
8581
|
+
$xeTable.setCurrentRow(newValue)
|
|
8582
|
+
}
|
|
8583
|
+
}
|
|
8470
8584
|
if (isChange) {
|
|
8471
|
-
$xeTable.dispatchEvent('current-row-change', { oldValue, newValue, ...params }, evnt)
|
|
8585
|
+
$xeTable.dispatchEvent('current-row-change', { oldValue, newValue, selected, ...params }, evnt)
|
|
8472
8586
|
// 已废弃
|
|
8473
|
-
$xeTable.dispatchEvent('current-change', { oldValue, newValue, ...params }, evnt)
|
|
8587
|
+
$xeTable.dispatchEvent('current-change', { oldValue, newValue, selected, ...params }, evnt)
|
|
8474
8588
|
}
|
|
8475
8589
|
} else {
|
|
8476
8590
|
$xeTable.dispatchEvent('current-row-disabled', params, evnt)
|
|
@@ -9126,11 +9240,13 @@ const tableMethods: any = {
|
|
|
9126
9240
|
if (isPeerDrag && !isCrossDrag) {
|
|
9127
9241
|
if (oldRest.row[parentField] !== newRest.row[parentField]) {
|
|
9128
9242
|
// 非同级
|
|
9129
|
-
|
|
9243
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9244
|
+
return Promise.resolve(errRest)
|
|
9130
9245
|
}
|
|
9131
9246
|
} else {
|
|
9132
9247
|
if (!isCrossDrag) {
|
|
9133
|
-
|
|
9248
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9249
|
+
return Promise.resolve(errRest)
|
|
9134
9250
|
}
|
|
9135
9251
|
if (oldAllMaps[newRowid]) {
|
|
9136
9252
|
isSelfToChildStatus = true
|
|
@@ -9141,7 +9257,8 @@ const tableMethods: any = {
|
|
|
9141
9257
|
content: getI18n('vxe.error.treeDragChild')
|
|
9142
9258
|
})
|
|
9143
9259
|
}
|
|
9144
|
-
|
|
9260
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9261
|
+
return Promise.resolve(errRest)
|
|
9145
9262
|
}
|
|
9146
9263
|
}
|
|
9147
9264
|
}
|
|
@@ -9149,13 +9266,15 @@ const tableMethods: any = {
|
|
|
9149
9266
|
// 子到根
|
|
9150
9267
|
|
|
9151
9268
|
if (!isCrossDrag) {
|
|
9152
|
-
|
|
9269
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9270
|
+
return Promise.resolve(errRest)
|
|
9153
9271
|
}
|
|
9154
9272
|
} else if (newLevel) {
|
|
9155
9273
|
// 根到子
|
|
9156
9274
|
|
|
9157
9275
|
if (!isCrossDrag) {
|
|
9158
|
-
|
|
9276
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9277
|
+
return Promise.resolve(errRest)
|
|
9159
9278
|
}
|
|
9160
9279
|
if (oldAllMaps[newRowid]) {
|
|
9161
9280
|
isSelfToChildStatus = true
|
|
@@ -9166,7 +9285,8 @@ const tableMethods: any = {
|
|
|
9166
9285
|
content: getI18n('vxe.error.treeDragChild')
|
|
9167
9286
|
})
|
|
9168
9287
|
}
|
|
9169
|
-
|
|
9288
|
+
handleRowDragEndClearStatus($xeTable)
|
|
9289
|
+
return Promise.resolve(errRest)
|
|
9170
9290
|
}
|
|
9171
9291
|
}
|
|
9172
9292
|
} else {
|
|
@@ -9188,6 +9308,7 @@ const tableMethods: any = {
|
|
|
9188
9308
|
// 移出源位置
|
|
9189
9309
|
if (oldRest && newRest) {
|
|
9190
9310
|
const fullList = XEUtils.toTreeArray(internalData.afterTreeFullData, {
|
|
9311
|
+
updated: false,
|
|
9191
9312
|
key: rowField,
|
|
9192
9313
|
parentKey: parentField,
|
|
9193
9314
|
children: mapChildrenField
|
|
@@ -11056,8 +11177,8 @@ const tableMethods: any = {
|
|
|
11056
11177
|
XEUtils.each(fullAllDataRowIdData, (rowRest) => {
|
|
11057
11178
|
rowRest.treeLoaded = false
|
|
11058
11179
|
})
|
|
11180
|
+
internalData.treeExpandedMaps = {}
|
|
11059
11181
|
}
|
|
11060
|
-
internalData.treeExpandedMaps = {}
|
|
11061
11182
|
if (transform) {
|
|
11062
11183
|
handleVirtualTreeToList($xeTable)
|
|
11063
11184
|
$xeTable.handleTableData()
|
|
@@ -12176,7 +12297,7 @@ const tableMethods: any = {
|
|
|
12176
12297
|
* @param {Row} row 行对象
|
|
12177
12298
|
* @param {ColumnInfo} column 列配置
|
|
12178
12299
|
*/
|
|
12179
|
-
scrollToRow (row: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo) {
|
|
12300
|
+
scrollToRow (row: any, fieldOrColumn?: VxeColumnPropTypes.Field | VxeTableDefines.ColumnInfo, options?: VxeTableDefines.ScrollToRowConfig) {
|
|
12180
12301
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12181
12302
|
const props = $xeTable
|
|
12182
12303
|
const reactData = $xeTable as unknown as TableReactData
|
|
@@ -12191,7 +12312,7 @@ const tableMethods: any = {
|
|
|
12191
12312
|
}
|
|
12192
12313
|
}
|
|
12193
12314
|
if (fieldOrColumn) {
|
|
12194
|
-
rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row))
|
|
12315
|
+
rest.push(handleScrollToRowColumn($xeTable, fieldOrColumn, row, options))
|
|
12195
12316
|
}
|
|
12196
12317
|
return Promise.all(rest).then(() => {
|
|
12197
12318
|
if (row) {
|
|
@@ -12206,51 +12327,51 @@ const tableMethods: any = {
|
|
|
12206
12327
|
/**
|
|
12207
12328
|
* 如果有滚动条,则滚动到第一行
|
|
12208
12329
|
*/
|
|
12209
|
-
scrollToStartRow (fieldOrColumn?: string | VxeTableDefines.ColumnInfo) {
|
|
12330
|
+
scrollToStartRow (fieldOrColumn?: string | VxeTableDefines.ColumnInfo, options?: VxeTableDefines.ScrollToRowConfig) {
|
|
12210
12331
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12211
12332
|
const internalData = $xeTable as unknown as TableInternalData
|
|
12212
12333
|
|
|
12213
12334
|
const { afterFullData } = internalData
|
|
12214
|
-
return $xeTable.scrollToRow(afterFullData[0], fieldOrColumn)
|
|
12335
|
+
return $xeTable.scrollToRow(afterFullData[0], fieldOrColumn, options)
|
|
12215
12336
|
},
|
|
12216
12337
|
/**
|
|
12217
12338
|
* 如果有滚动条,则滚动到最后一行
|
|
12218
12339
|
*/
|
|
12219
|
-
scrollToEndRow (fieldOrColumn?: string | VxeTableDefines.ColumnInfo) {
|
|
12340
|
+
scrollToEndRow (fieldOrColumn?: string | VxeTableDefines.ColumnInfo, options?: VxeTableDefines.ScrollToRowConfig) {
|
|
12220
12341
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12221
12342
|
const internalData = $xeTable as unknown as TableInternalData
|
|
12222
12343
|
|
|
12223
12344
|
const { afterFullData } = internalData
|
|
12224
|
-
return $xeTable.scrollToRow(afterFullData[afterFullData.length - 1], fieldOrColumn)
|
|
12345
|
+
return $xeTable.scrollToRow(afterFullData[afterFullData.length - 1], fieldOrColumn, options)
|
|
12225
12346
|
},
|
|
12226
12347
|
/**
|
|
12227
12348
|
* 如果有滚动条,则滚动到对应的列
|
|
12228
12349
|
* @param {ColumnInfo} column 列配置
|
|
12229
12350
|
*/
|
|
12230
|
-
scrollToColumn (fieldOrColumn: any) {
|
|
12351
|
+
scrollToColumn (fieldOrColumn: any, options?: VxeTableDefines.ScrollToColumnConfig) {
|
|
12231
12352
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12232
12353
|
|
|
12233
|
-
return handleScrollToRowColumn($xeTable, fieldOrColumn)
|
|
12354
|
+
return handleScrollToRowColumn($xeTable, null, fieldOrColumn, options)
|
|
12234
12355
|
},
|
|
12235
12356
|
/**
|
|
12236
12357
|
* 如果有滚动条,则滚动到第一列
|
|
12237
12358
|
*/
|
|
12238
|
-
scrollToStartColumn () {
|
|
12359
|
+
scrollToStartColumn (options?: VxeTableDefines.ScrollToColumnConfig) {
|
|
12239
12360
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12240
12361
|
const internalData = $xeTable as unknown as TableInternalData
|
|
12241
12362
|
|
|
12242
12363
|
const { visibleColumn } = internalData
|
|
12243
|
-
return $xeTable.scrollToColumn(visibleColumn[0])
|
|
12364
|
+
return $xeTable.scrollToColumn(visibleColumn[0], options)
|
|
12244
12365
|
},
|
|
12245
12366
|
/**
|
|
12246
12367
|
* 如果有滚动条,则滚动到最后一列
|
|
12247
12368
|
*/
|
|
12248
|
-
scrollToEndColumn () {
|
|
12369
|
+
scrollToEndColumn (options?: VxeTableDefines.ScrollToColumnConfig) {
|
|
12249
12370
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12250
12371
|
const internalData = $xeTable as unknown as TableInternalData
|
|
12251
12372
|
|
|
12252
12373
|
const { visibleColumn } = internalData
|
|
12253
|
-
return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length - 1])
|
|
12374
|
+
return $xeTable.scrollToColumn(visibleColumn[visibleColumn.length - 1], options)
|
|
12254
12375
|
},
|
|
12255
12376
|
/**
|
|
12256
12377
|
* 对于树形结构中,可以直接滚动到指定深层节点中
|
|
@@ -12361,10 +12482,12 @@ const tableMethods: any = {
|
|
|
12361
12482
|
updateStatus (slotParams: any, cellValue: any) {
|
|
12362
12483
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
12363
12484
|
const props = $xeTable
|
|
12485
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
12364
12486
|
|
|
12365
12487
|
return this.$nextTick().then(() => {
|
|
12366
12488
|
const { editRules } = props
|
|
12367
|
-
|
|
12489
|
+
const { isActivated } = internalData
|
|
12490
|
+
if (isActivated && slotParams && editRules) {
|
|
12368
12491
|
return $xeTable.handleCellRuleUpdateStatus('change', slotParams, cellValue)
|
|
12369
12492
|
}
|
|
12370
12493
|
})
|
|
@@ -205,6 +205,8 @@ export const tableProps = {
|
|
|
205
205
|
rowConfig: Object as PropType<VxeTablePropTypes.RowConfig>,
|
|
206
206
|
// 数据聚合配置项
|
|
207
207
|
aggregateConfig: Object as PropType<VxeTablePropTypes.AggregateConfig>,
|
|
208
|
+
// 聚合函数计算精度配置项
|
|
209
|
+
aggregateAccuracyConfig: Object as PropType<VxeTablePropTypes.AggregateAccuracyConfig>,
|
|
208
210
|
/**
|
|
209
211
|
* 已废弃,被 aggregateConfig 替换
|
|
210
212
|
* @deprecated
|
|
@@ -270,6 +272,8 @@ export const tableProps = {
|
|
|
270
272
|
fnrConfig: Object,
|
|
271
273
|
// 编辑配置项
|
|
272
274
|
editConfig: [Boolean, Object] as PropType<VxeTablePropTypes.EditConfig>,
|
|
275
|
+
// 数据状态监听配置项
|
|
276
|
+
editDirtyConfig: Object as PropType<VxeTablePropTypes.EditDirtyConfig>,
|
|
273
277
|
// 校验配置项
|
|
274
278
|
validConfig: Object as PropType<VxeTablePropTypes.ValidConfig>,
|
|
275
279
|
// 校验规则配置项
|