vxe-table 4.2.4-beta.2 → 4.2.4-beta.3
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/all.js +0 -2
- package/es/edit/src/hook.js +35 -4
- package/es/table/src/table.js +3 -2
- package/es/tools/log.js +1 -1
- package/es/v-x-e-table/index.js +1 -1
- package/lib/all.js +15 -15
- package/lib/all.min.js +1 -1
- package/lib/edit/src/hook.js +35 -4
- package/lib/edit/src/hook.min.js +1 -1
- package/lib/index.umd.js +1720 -1689
- package/lib/index.umd.min.js +1 -1
- package/lib/table/src/table.js +4 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +1 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/package.json +1 -1
- package/packages/all.ts +0 -2
- package/packages/edit/src/hook.ts +35 -4
- package/packages/table/src/table.ts +3 -2
- package/types/all.d.ts +0 -1
- package/types/edit.d.ts +38 -5
|
@@ -440,6 +440,9 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
440
440
|
return []
|
|
441
441
|
},
|
|
442
442
|
getActiveRecord () {
|
|
443
|
+
return this.getEditRecord()
|
|
444
|
+
},
|
|
445
|
+
getEditRecord () {
|
|
443
446
|
const { editStore } = reactData
|
|
444
447
|
const { afterFullData } = internalData
|
|
445
448
|
const el = refElem.value
|
|
@@ -460,10 +463,17 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
460
463
|
}
|
|
461
464
|
return null
|
|
462
465
|
},
|
|
466
|
+
clearActived (evnt) {
|
|
467
|
+
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
468
|
+
// warnLog('vxe.error.delFunc', ['clearActived', 'clearEdit'])
|
|
469
|
+
// }
|
|
470
|
+
// 即将废弃
|
|
471
|
+
return this.clearEdit(evnt)
|
|
472
|
+
},
|
|
463
473
|
/**
|
|
464
474
|
* 清除激活的编辑
|
|
465
475
|
*/
|
|
466
|
-
|
|
476
|
+
clearEdit (evnt) {
|
|
467
477
|
const { editStore } = reactData
|
|
468
478
|
const { actived } = editStore
|
|
469
479
|
const { row, column } = actived
|
|
@@ -495,25 +505,46 @@ const editHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
495
505
|
removeCellSelectedClass()
|
|
496
506
|
return nextTick()
|
|
497
507
|
},
|
|
508
|
+
isActiveByRow (row) {
|
|
509
|
+
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
510
|
+
// warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
|
|
511
|
+
// }
|
|
512
|
+
// 即将废弃
|
|
513
|
+
return this.isEditByRow(row)
|
|
514
|
+
},
|
|
498
515
|
/**
|
|
499
516
|
* 判断行是否为激活编辑状态
|
|
500
517
|
* @param {Row} row 行对象
|
|
501
518
|
*/
|
|
502
|
-
|
|
519
|
+
isEditByRow (row) {
|
|
503
520
|
const { editStore } = reactData
|
|
504
521
|
return editStore.actived.row === row
|
|
505
522
|
},
|
|
523
|
+
setActiveRow (row) {
|
|
524
|
+
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
525
|
+
// warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
|
|
526
|
+
// }
|
|
527
|
+
// 即将废弃
|
|
528
|
+
return editMethods.setEditRow(row)
|
|
529
|
+
},
|
|
506
530
|
/**
|
|
507
531
|
* 激活行编辑
|
|
508
532
|
*/
|
|
509
|
-
|
|
533
|
+
setEditRow (row) {
|
|
510
534
|
const { visibleColumn } = internalData
|
|
511
535
|
return $xetable.setActiveCell(row, XEUtils.find(visibleColumn, column => isEnableConf(column.editRender)))
|
|
512
536
|
},
|
|
537
|
+
setActiveCell (row, fieldOrColumn) {
|
|
538
|
+
// if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
539
|
+
// warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
|
|
540
|
+
// }
|
|
541
|
+
// 即将废弃
|
|
542
|
+
return editMethods.setEditCell(row, fieldOrColumn)
|
|
543
|
+
},
|
|
513
544
|
/**
|
|
514
545
|
* 激活单元格编辑
|
|
515
546
|
*/
|
|
516
|
-
|
|
547
|
+
setEditCell (row, fieldOrColumn) {
|
|
517
548
|
const { editConfig } = props
|
|
518
549
|
const column = XEUtils.isString(fieldOrColumn) ? $xetable.getColumnByField(fieldOrColumn) : fieldOrColumn
|
|
519
550
|
if (row && column && isEnableConf(editConfig) && isEnableConf(column.editRender)) {
|
|
@@ -10,6 +10,7 @@ import { VXETable } from '../../v-x-e-table'
|
|
|
10
10
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
11
11
|
import Cell from './cell'
|
|
12
12
|
import TableBodyComponent from './body'
|
|
13
|
+
import TableHeaderComponent from '../../header'
|
|
13
14
|
import tableProps from './props'
|
|
14
15
|
import tableEmits from './emits'
|
|
15
16
|
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, restoreScrollListener, XEBodyScrollElement } from './util'
|
|
@@ -5569,7 +5570,7 @@ export default defineComponent({
|
|
|
5569
5570
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
5570
5571
|
class: `vxe-table--fixed-${fixedType}-wrapper`
|
|
5571
5572
|
}, [
|
|
5572
|
-
showHeader ? h(
|
|
5573
|
+
showHeader ? h(TableHeaderComponent, {
|
|
5573
5574
|
ref: isFixedLeft ? refTableLeftHeader : refTableRightHeader,
|
|
5574
5575
|
fixedType,
|
|
5575
5576
|
tableData,
|
|
@@ -5963,7 +5964,7 @@ export default defineComponent({
|
|
|
5963
5964
|
/**
|
|
5964
5965
|
* 表头
|
|
5965
5966
|
*/
|
|
5966
|
-
showHeader ? h(
|
|
5967
|
+
showHeader ? h(TableHeaderComponent, {
|
|
5967
5968
|
ref: refTableHeader,
|
|
5968
5969
|
tableData,
|
|
5969
5970
|
tableColumn,
|
package/types/all.d.ts
CHANGED
package/types/edit.d.ts
CHANGED
|
@@ -60,7 +60,8 @@ export interface TableEditMethods {
|
|
|
60
60
|
*/
|
|
61
61
|
getUpdateRecords(): any[]
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* 请使用 getEditRecord
|
|
64
|
+
* @deprecated
|
|
64
65
|
*/
|
|
65
66
|
getActiveRecord(): {
|
|
66
67
|
row: any
|
|
@@ -71,6 +72,18 @@ export interface TableEditMethods {
|
|
|
71
72
|
$columnIndex: number
|
|
72
73
|
cell: HTMLElement
|
|
73
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* 用于 edit-config,获取已激活的行数据
|
|
77
|
+
*/
|
|
78
|
+
getEditRecord(): {
|
|
79
|
+
row: any
|
|
80
|
+
rowIndex: number
|
|
81
|
+
$rowIndex: number
|
|
82
|
+
column: VxeTableDefines.ColumnInfo
|
|
83
|
+
columnIndex: number
|
|
84
|
+
$columnIndex: number
|
|
85
|
+
cell: HTMLElement
|
|
86
|
+
}
|
|
74
87
|
/**
|
|
75
88
|
* 用于 mouse-config.selected,获取选中的单元格信息
|
|
76
89
|
*/
|
|
@@ -79,29 +92,49 @@ export interface TableEditMethods {
|
|
|
79
92
|
column: VxeTableDefines.ColumnInfo
|
|
80
93
|
}
|
|
81
94
|
/**
|
|
82
|
-
*
|
|
95
|
+
* 请使用 clearEdit
|
|
96
|
+
* @deprecated
|
|
83
97
|
*/
|
|
84
98
|
clearActived(evnt?: Event): Promise<any>
|
|
99
|
+
/**
|
|
100
|
+
* 手动清除单元格激活状态
|
|
101
|
+
*/
|
|
102
|
+
clearEdit(evnt?: Event): Promise<any>
|
|
85
103
|
/**
|
|
86
104
|
* 手动清除单元格选中状态
|
|
87
105
|
*/
|
|
88
106
|
clearSelected(): Promise<any>
|
|
107
|
+
/**
|
|
108
|
+
* 请使用 isEditByRow
|
|
109
|
+
* @deprecated
|
|
110
|
+
*/
|
|
111
|
+
isActiveByRow(row: any): boolean
|
|
89
112
|
/**
|
|
90
113
|
* 用于 edit-config,判断行是否为激活编辑状态
|
|
91
114
|
* @param row 指定行
|
|
92
115
|
*/
|
|
93
|
-
|
|
116
|
+
isEditByRow(row: any): boolean
|
|
117
|
+
/**
|
|
118
|
+
* 请使用 setEditRow
|
|
119
|
+
* @deprecated
|
|
120
|
+
*/
|
|
121
|
+
setActiveRow(row: any): Promise<any>
|
|
94
122
|
/**
|
|
95
123
|
* 用于 edit-config,激活行编辑并激活第一个单元格
|
|
96
124
|
* @param row 指定行
|
|
97
125
|
*/
|
|
98
|
-
|
|
126
|
+
setEditRow(row: any): Promise<any>
|
|
127
|
+
/**
|
|
128
|
+
* 请使用 setEditCell
|
|
129
|
+
* @deprecated
|
|
130
|
+
*/
|
|
131
|
+
setActiveCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo): Promise<any>
|
|
99
132
|
/**
|
|
100
133
|
* 用于 edit-config,激活单元格编辑
|
|
101
134
|
* @param row 指定行
|
|
102
135
|
* @param field 字段名
|
|
103
136
|
*/
|
|
104
|
-
|
|
137
|
+
setEditCell(row: any, fieldOrColumn: string | VxeTableDefines.ColumnInfo): Promise<any>
|
|
105
138
|
/**
|
|
106
139
|
* 用于 mouse-config.mouse-config,选中某个单元格
|
|
107
140
|
* @param row 指定行
|