vxe-table 3.8.4 → 3.8.5-beta.0

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.
Files changed (33) hide show
  1. package/README.md +4 -3
  2. package/lib/edit/src/mixin.js +88 -82
  3. package/lib/edit/src/mixin.min.js +1 -1
  4. package/lib/icon/style/style.css +1 -1
  5. package/lib/icon/style/style.min.css +1 -1
  6. package/lib/index.css +1 -1
  7. package/lib/index.umd.js +93 -85
  8. package/lib/index.umd.min.js +1 -1
  9. package/lib/style.css +1 -1
  10. package/lib/style.min.css +1 -1
  11. package/lib/table/src/methods.js +13 -1
  12. package/lib/table/src/methods.min.js +1 -1
  13. package/lib/table/src/table.js +9 -9
  14. package/lib/table/src/table.min.js +1 -1
  15. package/lib/table/style/style.css +0 -6
  16. package/lib/table/style/style.min.css +1 -1
  17. package/lib/tools/log.js +1 -1
  18. package/lib/tools/log.min.js +1 -1
  19. package/lib/v-x-e-table/index.js +1 -1
  20. package/lib/v-x-e-table/index.min.js +1 -1
  21. package/lib/vxe-table/style/style.css +0 -6
  22. package/lib/vxe-table/style/style.min.css +1 -1
  23. package/package.json +2 -2
  24. package/packages/edit/src/mixin.js +79 -74
  25. package/packages/table/src/methods.js +12 -2
  26. package/packages/table/src/table.js +9 -9
  27. package/styles/table.scss +14 -14
  28. /package/lib/icon/style/{iconfont.1714486550546.ttf → iconfont.1714960961818.ttf} +0 -0
  29. /package/lib/icon/style/{iconfont.1714486550546.woff → iconfont.1714960961818.woff} +0 -0
  30. /package/lib/icon/style/{iconfont.1714486550546.woff2 → iconfont.1714960961818.woff2} +0 -0
  31. /package/lib/{iconfont.1714486550546.ttf → iconfont.1714960961818.ttf} +0 -0
  32. /package/lib/{iconfont.1714486550546.woff → iconfont.1714960961818.woff} +0 -0
  33. /package/lib/{iconfont.1714486550546.woff2 → iconfont.1714960961818.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.8.4",
3
+ "version": "3.8.5-beta.0",
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.25"
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) && !this.hasPendingByRow(row) && cell) {
431
- if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
432
- // 判断是否禁用编辑
433
- let type = 'edit-disabled'
434
- if (!beforeEditMethod || beforeEditMethod({ ...params, $table: this, $grid: this.$xegrid })) {
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
- this.closeTooltip()
441
- if (actived.column) {
442
- this.clearEdit(evnt)
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
- if (mode === 'row') {
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
- this.emitEvent(type, {
463
- row,
464
- rowIndex: this.getRowIndex(row),
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
- // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
574
- // warnLog('vxe.error.delFunc', ['getActiveRecord', 'getEditRecord'])
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
- // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
590
- // warnLog('vxe.error.delFunc', ['isActiveByRow', 'isEditByRow'])
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
- // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
646
- // warnLog('vxe.error.delFunc', ['setActiveRow', 'setEditRow'])
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
- // if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
663
- // warnLog('vxe.error.delFunc', ['setActiveCell', 'setEditCell'])
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
  },
@@ -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
- // if (this.rowId) {
782
- // warnLog('vxe.error.delProp', ['row-id', 'row-config.keyField'])
783
- // }
784
- // if (this.rowKey) {
785
- // warnLog('vxe.error.delProp', ['row-id', 'row-config.useKey'])
786
- // }
787
- // if (this.columnKey) {
788
- // warnLog('vxe.error.delProp', ['row-id', 'column-config.useKey'])
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
- .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
- }
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;