vxe-table 3.8.4 → 3.8.5-beta.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/README.md +4 -3
- package/lib/edit/src/mixin.js +88 -82
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +99 -90
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +3 -3
- package/lib/table/index.min.js +1 -1
- package/lib/table/src/methods.js +13 -1
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +9 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -6
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +0 -6
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/edit/src/mixin.js +79 -74
- package/packages/table/index.js +3 -3
- package/packages/table/src/methods.js +12 -2
- package/packages/table/src/table.js +9 -9
- package/styles/table.scss +14 -14
- /package/lib/icon/style/{iconfont.1714486550546.ttf → iconfont.1715055325097.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1714486550546.woff → iconfont.1715055325097.woff} +0 -0
- /package/lib/icon/style/{iconfont.1714486550546.woff2 → iconfont.1715055325097.woff2} +0 -0
- /package/lib/{iconfont.1714486550546.ttf → iconfont.1715055325097.ttf} +0 -0
- /package/lib/{iconfont.1714486550546.woff → iconfont.1715055325097.woff} +0 -0
- /package/lib/{iconfont.1714486550546.woff2 → iconfont.1715055325097.woff2} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.5-beta.1",
|
|
4
4
|
"description": "一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式...",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"typings": "types/index.d.ts",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"dom-zindex": "^1.0.2",
|
|
30
|
-
"xe-utils": "^3.5.
|
|
30
|
+
"xe-utils": "^3.5.26"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/resize-observer-browser": "^0.1.11",
|
|
@@ -422,85 +422,90 @@ export default {
|
|
|
422
422
|
handleActived (params, evnt) {
|
|
423
423
|
const { editStore, editOpts, tableColumn, editConfig, mouseConfig } = this
|
|
424
424
|
const { mode } = editOpts
|
|
425
|
-
const { actived } = editStore
|
|
425
|
+
const { actived, focused } = editStore
|
|
426
426
|
const { row, column } = params
|
|
427
427
|
const { editRender } = column
|
|
428
428
|
const cell = params.cell = (params.cell || this.getCell(row, column))
|
|
429
429
|
const beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod
|
|
430
|
-
if (isEnableConf(editConfig) && isEnableConf(editRender)
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
430
|
+
if (cell && isEnableConf(editConfig) && isEnableConf(editRender)) {
|
|
431
|
+
// 激活编辑
|
|
432
|
+
if (!this.hasPendingByRow(row)) {
|
|
433
|
+
if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
|
|
434
|
+
// 判断是否禁用编辑
|
|
435
|
+
let type = 'edit-disabled'
|
|
436
|
+
if (!beforeEditMethod || beforeEditMethod({ ...params, $table: this, $grid: this.$xegrid })) {
|
|
437
|
+
if (mouseConfig) {
|
|
438
|
+
this.clearSelected(evnt)
|
|
439
|
+
this.clearCellAreas(evnt)
|
|
440
|
+
this.clearCopyCellArea(evnt)
|
|
441
|
+
}
|
|
442
|
+
this.closeTooltip()
|
|
443
|
+
if (actived.column) {
|
|
444
|
+
this.clearEdit(evnt)
|
|
445
|
+
}
|
|
446
|
+
type = 'edit-activated'
|
|
447
|
+
column.renderHeight = cell.offsetHeight
|
|
448
|
+
actived.args = params
|
|
449
|
+
actived.row = row
|
|
450
|
+
actived.column = column
|
|
451
|
+
if (mode === 'row') {
|
|
452
|
+
tableColumn.forEach(column => this._getColumnModel(row, column))
|
|
453
|
+
} else {
|
|
454
|
+
this._getColumnModel(row, column)
|
|
455
|
+
}
|
|
456
|
+
const afterEditMethod = editOpts.afterEditMethod
|
|
457
|
+
this.$nextTick(() => {
|
|
458
|
+
this.handleFocus(params, evnt)
|
|
459
|
+
if (afterEditMethod) {
|
|
460
|
+
afterEditMethod({ ...params, $table: this, $grid: this.$xegrid })
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
}
|
|
464
|
+
this.emitEvent(type, {
|
|
465
|
+
row,
|
|
466
|
+
rowIndex: this.getRowIndex(row),
|
|
467
|
+
$rowIndex: this.getVMRowIndex(row),
|
|
468
|
+
column,
|
|
469
|
+
columnIndex: this.getColumnIndex(column),
|
|
470
|
+
$columnIndex: this.getVMColumnIndex(column)
|
|
471
|
+
}, evnt)
|
|
472
|
+
|
|
473
|
+
// v4已废弃
|
|
474
|
+
if (type === 'edit-activated') {
|
|
475
|
+
this.emitEvent('edit-actived', {
|
|
476
|
+
row,
|
|
477
|
+
rowIndex: this.getRowIndex(row),
|
|
478
|
+
$rowIndex: this.getVMRowIndex(row),
|
|
479
|
+
column,
|
|
480
|
+
columnIndex: this.getColumnIndex(column),
|
|
481
|
+
$columnIndex: this.getVMColumnIndex(column)
|
|
482
|
+
}, evnt)
|
|
483
|
+
}
|
|
484
|
+
} else {
|
|
485
|
+
const { column: oldColumn } = actived
|
|
435
486
|
if (mouseConfig) {
|
|
436
487
|
this.clearSelected(evnt)
|
|
437
488
|
this.clearCellAreas(evnt)
|
|
438
489
|
this.clearCopyCellArea(evnt)
|
|
439
490
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
491
|
+
if (oldColumn !== column) {
|
|
492
|
+
const { model: oldModel } = oldColumn
|
|
493
|
+
if (oldModel.update) {
|
|
494
|
+
UtilTools.setCellValue(row, oldColumn, oldModel.value)
|
|
495
|
+
}
|
|
496
|
+
this.clearValidate()
|
|
443
497
|
}
|
|
444
|
-
type = 'edit-activated'
|
|
445
498
|
column.renderHeight = cell.offsetHeight
|
|
446
499
|
actived.args = params
|
|
447
|
-
actived.row = row
|
|
448
500
|
actived.column = column
|
|
449
|
-
|
|
450
|
-
tableColumn.forEach(column => this._getColumnModel(row, column))
|
|
451
|
-
} else {
|
|
452
|
-
this._getColumnModel(row, column)
|
|
453
|
-
}
|
|
454
|
-
const afterEditMethod = editOpts.afterEditMethod
|
|
455
|
-
this.$nextTick(() => {
|
|
501
|
+
setTimeout(() => {
|
|
456
502
|
this.handleFocus(params, evnt)
|
|
457
|
-
if (afterEditMethod) {
|
|
458
|
-
afterEditMethod({ ...params, $table: this, $grid: this.$xegrid })
|
|
459
|
-
}
|
|
460
503
|
})
|
|
461
504
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
$rowIndex: this.getVMRowIndex(row),
|
|
466
|
-
column,
|
|
467
|
-
columnIndex: this.getColumnIndex(column),
|
|
468
|
-
$columnIndex: this.getVMColumnIndex(column)
|
|
469
|
-
}, evnt)
|
|
470
|
-
|
|
471
|
-
// v4已废弃
|
|
472
|
-
if (type === 'edit-activated') {
|
|
473
|
-
this.emitEvent('edit-actived', {
|
|
474
|
-
row,
|
|
475
|
-
rowIndex: this.getRowIndex(row),
|
|
476
|
-
$rowIndex: this.getVMRowIndex(row),
|
|
477
|
-
column,
|
|
478
|
-
columnIndex: this.getColumnIndex(column),
|
|
479
|
-
$columnIndex: this.getVMColumnIndex(column)
|
|
480
|
-
}, evnt)
|
|
481
|
-
}
|
|
482
|
-
} else {
|
|
483
|
-
const { column: oldColumn } = actived
|
|
484
|
-
if (mouseConfig) {
|
|
485
|
-
this.clearSelected(evnt)
|
|
486
|
-
this.clearCellAreas(evnt)
|
|
487
|
-
this.clearCopyCellArea(evnt)
|
|
488
|
-
}
|
|
489
|
-
if (oldColumn !== column) {
|
|
490
|
-
const { model: oldModel } = oldColumn
|
|
491
|
-
if (oldModel.update) {
|
|
492
|
-
UtilTools.setCellValue(row, oldColumn, oldModel.value)
|
|
493
|
-
}
|
|
494
|
-
this.clearValidate()
|
|
495
|
-
}
|
|
496
|
-
column.renderHeight = cell.offsetHeight
|
|
497
|
-
actived.args = params
|
|
498
|
-
actived.column = column
|
|
499
|
-
setTimeout(() => {
|
|
500
|
-
this.handleFocus(params, evnt)
|
|
501
|
-
})
|
|
505
|
+
focused.column = null
|
|
506
|
+
focused.row = null
|
|
507
|
+
this.focus()
|
|
502
508
|
}
|
|
503
|
-
this.focus()
|
|
504
509
|
}
|
|
505
510
|
return this.$nextTick()
|
|
506
511
|
},
|
|
@@ -570,9 +575,9 @@ export default {
|
|
|
570
575
|
return this.$nextTick()
|
|
571
576
|
},
|
|
572
577
|
_getActiveRecord () {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
578
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
579
|
+
warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
|
|
580
|
+
}
|
|
576
581
|
// 即将废弃
|
|
577
582
|
return this.getEditRecord()
|
|
578
583
|
},
|
|
@@ -586,9 +591,9 @@ export default {
|
|
|
586
591
|
return null
|
|
587
592
|
},
|
|
588
593
|
_isActiveByRow (row) {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
594
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
595
|
+
warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
|
|
596
|
+
}
|
|
592
597
|
// 即将废弃
|
|
593
598
|
return this.isEditByRow(row)
|
|
594
599
|
},
|
|
@@ -642,9 +647,9 @@ export default {
|
|
|
642
647
|
}
|
|
643
648
|
},
|
|
644
649
|
_setActiveRow (row) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
650
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
651
|
+
warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
|
|
652
|
+
}
|
|
648
653
|
// 即将废弃
|
|
649
654
|
return this.setEditRow(row)
|
|
650
655
|
},
|
|
@@ -659,9 +664,9 @@ export default {
|
|
|
659
664
|
return this.setEditCell(row, column)
|
|
660
665
|
},
|
|
661
666
|
_setActiveCell (row) {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
667
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
668
|
+
warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
|
|
669
|
+
}
|
|
665
670
|
// 即将废弃
|
|
666
671
|
return this.setEditCell(row)
|
|
667
672
|
},
|
package/packages/table/index.js
CHANGED
|
@@ -8,9 +8,9 @@ export const VxeTable = Object.assign(VxeTableComponent, {
|
|
|
8
8
|
VxeTableComponent.mixins.push(window.VXETableMixin)
|
|
9
9
|
delete window.VXETableMixin
|
|
10
10
|
}
|
|
11
|
-
if (typeof window !== 'undefined' && window.
|
|
12
|
-
window.
|
|
13
|
-
delete window.
|
|
11
|
+
if (typeof window !== 'undefined' && window.VxeTableExtendCellArea && window.VxeTableExtendCellArea.init) {
|
|
12
|
+
window.VxeTableExtendCellArea.init(VXETable)
|
|
13
|
+
delete window.VxeTableExtendCellArea
|
|
14
14
|
} else if (typeof window !== 'undefined' && window.VXETablePro && window.VXETablePro.init) {
|
|
15
15
|
window.VXETablePro.init(VXETable)
|
|
16
16
|
delete window.VXETablePro
|
|
@@ -2420,6 +2420,11 @@ const Methods = {
|
|
|
2420
2420
|
// 兼容老版本
|
|
2421
2421
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
2422
2422
|
evntList = VXETable.interceptor.get('event.clearActived')
|
|
2423
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
2424
|
+
if (evntList.length) {
|
|
2425
|
+
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit'])
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2423
2428
|
}
|
|
2424
2429
|
// 兼容老版本
|
|
2425
2430
|
|
|
@@ -3897,8 +3902,8 @@ const Methods = {
|
|
|
3897
3902
|
* 如果是双击模式,则单击后选中状态
|
|
3898
3903
|
*/
|
|
3899
3904
|
triggerCellClickEvent (evnt, params) {
|
|
3900
|
-
const { highlightCurrentRow, editStore, radioOpts, expandOpts, treeOpts, editConfig, editOpts, checkboxOpts, rowOpts } = this
|
|
3901
|
-
const { actived } = editStore
|
|
3905
|
+
const { highlightCurrentRow, editStore, radioOpts, expandOpts, treeOpts, keyboardOpts, editConfig, editOpts, checkboxOpts, rowOpts } = this
|
|
3906
|
+
const { actived, focused } = editStore
|
|
3902
3907
|
const { row, column } = params
|
|
3903
3908
|
const { type, treeNode } = column
|
|
3904
3909
|
const isRadioType = type === 'radio'
|
|
@@ -3940,6 +3945,11 @@ const Methods = {
|
|
|
3940
3945
|
}
|
|
3941
3946
|
// 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式)
|
|
3942
3947
|
if (isEnableConf(editConfig)) {
|
|
3948
|
+
// 记录点击输入框聚焦状态
|
|
3949
|
+
if (keyboardOpts.arrowCursorLock && evnt && editOpts.mode === 'cell' && evnt.target && /^input|textarea$/i.test(evnt.target.tagName)) {
|
|
3950
|
+
focused.column = column
|
|
3951
|
+
focused.row = row
|
|
3952
|
+
}
|
|
3943
3953
|
if (editOpts.trigger === 'manual') {
|
|
3944
3954
|
if (actived.args && actived.row === row && column !== actived.column) {
|
|
3945
3955
|
this.handleChangeCell(evnt, params)
|
|
@@ -778,15 +778,15 @@ export default {
|
|
|
778
778
|
})
|
|
779
779
|
|
|
780
780
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
781
|
+
if (this.rowId) {
|
|
782
|
+
warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
|
|
783
|
+
}
|
|
784
|
+
if (this.rowKey) {
|
|
785
|
+
warnLog('vxe.error.delProp', ['row-key', 'row-config.useKey'])
|
|
786
|
+
}
|
|
787
|
+
if (this.columnKey) {
|
|
788
|
+
warnLog('vxe.error.delProp', ['column-id', 'column-config.useKey'])
|
|
789
|
+
}
|
|
790
790
|
if (!(this.rowId || rowOpts.keyField) && (this.checkboxOpts.reserve || this.checkboxOpts.checkRowKeys || this.radioOpts.reserve || this.radioOpts.checkRowKey || this.expandOpts.expandRowKeys || this.treeOpts.expandRowKeys)) {
|
|
791
791
|
warnLog('vxe.error.reqProp', ['row-config.keyField'])
|
|
792
792
|
}
|
package/styles/table.scss
CHANGED
|
@@ -937,20 +937,20 @@
|
|
|
937
937
|
}
|
|
938
938
|
|
|
939
939
|
/*树形节点*/
|
|
940
|
-
&.is--tree-line {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
940
|
+
// &.is--tree-line {
|
|
941
|
+
// .vxe-body--row {
|
|
942
|
+
// &:first-child {
|
|
943
|
+
// .vxe-tree--line {
|
|
944
|
+
// border-width: 0 0 1px 0;
|
|
945
|
+
// }
|
|
946
|
+
// }
|
|
947
|
+
// }
|
|
948
|
+
// .vxe-body--row {
|
|
949
|
+
// .vxe-body--column {
|
|
950
|
+
// background-image: none;
|
|
951
|
+
// }
|
|
952
|
+
// }
|
|
953
|
+
// }
|
|
954
954
|
.vxe-tree--line-wrapper {
|
|
955
955
|
position: relative;
|
|
956
956
|
display: block;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|