vxe-table 4.1.6 → 4.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...",
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -34,15 +34,15 @@ export default {
34
34
  footerAlign: { type: String as PropType<VxeTablePropTypes.FooterAlign>, default: () => GlobalConfig.table.footerAlign },
35
35
  // 是否显示表头
36
36
  showHeader: { type: Boolean as PropType<VxeTablePropTypes.ShowHeader>, default: () => GlobalConfig.table.showHeader },
37
- // 是否要高亮当前选中行
37
+ // (即将废弃)是否要高亮当前选中行
38
38
  highlightCurrentRow: { type: Boolean as PropType<VxeTablePropTypes.HighlightCurrentRow>, default: () => GlobalConfig.table.highlightCurrentRow },
39
- // 鼠标移到行是否要高亮显示
39
+ // (即将废弃)鼠标移到行是否要高亮显示
40
40
  highlightHoverRow: { type: Boolean as PropType<VxeTablePropTypes.HighlightHoverRow>, default: () => GlobalConfig.table.highlightHoverRow },
41
- // 是否要高亮当前选中列
41
+ // (即将废弃)是否要高亮当前选中列
42
42
  highlightCurrentColumn: { type: Boolean as PropType<VxeTablePropTypes.HighlightCurrentColumn>, default: () => GlobalConfig.table.highlightCurrentColumn },
43
- // 鼠标移到列是否要高亮显示
43
+ // (即将废弃)鼠标移到列是否要高亮显示
44
44
  highlightHoverColumn: { type: Boolean as PropType<VxeTablePropTypes.HighlightHoverColumn>, default: () => GlobalConfig.table.highlightHoverColumn },
45
- // 激活单元格编辑时是否高亮显示
45
+ // (即将废弃)激活单元格编辑时是否高亮显示
46
46
  highlightCell: Boolean as PropType<VxeTablePropTypes.HighlightCell>,
47
47
  // 是否显示表尾合计
48
48
  showFooter: Boolean as PropType<VxeTablePropTypes.ShowFooter>,
@@ -153,7 +153,7 @@ export default {
153
153
  scrollX: Object as PropType<VxeTablePropTypes.ScrollX>,
154
154
  // 纵向虚拟滚动配置项
155
155
  scrollY: Object as PropType<VxeTablePropTypes.ScrollY>,
156
- // 优化相关
156
+ // (即将废弃)优化相关
157
157
  animat: { type: Boolean as PropType<VxeTablePropTypes.Animat>, default: () => GlobalConfig.table.animat },
158
158
  delayHover: { type: Number as PropType<VxeTablePropTypes.DelayHover>, default: () => GlobalConfig.table.delayHover as number },
159
159
  // 额外的参数
@@ -3230,7 +3230,7 @@ export default defineComponent({
3230
3230
  return selectRow
3231
3231
  }
3232
3232
  } else {
3233
- if (afterFullData.indexOf(selectRow) > -1) {
3233
+ if ($xetable.findRowIndexOf(afterFullData, selectRow) > -1) {
3234
3234
  return selectRow
3235
3235
  }
3236
3236
  }
@@ -3993,6 +3993,7 @@ export default defineComponent({
3993
3993
  const { mouseConfig, keyboardConfig } = props
3994
3994
  const { filterStore, ctxMenuStore, editStore } = reactData
3995
3995
  const mouseOpts = computeMouseOpts.value
3996
+ const keyboardOpts = computeKeyboardOpts.value
3996
3997
  const { actived } = editStore
3997
3998
  const isEsc = hasEventKey(evnt, EVENT_KEYS.ESCAPE)
3998
3999
  if (isEsc) {
@@ -4006,13 +4007,15 @@ export default defineComponent({
4006
4007
  $xetable.closeMenu()
4007
4008
  }
4008
4009
  tableMethods.closeFilter()
4009
- // 如果是激活编辑状态,则取消编辑
4010
- if (actived.row) {
4011
- const params = actived.args
4012
- $xetable.clearActived(evnt)
4013
- // 如果配置了选中功能,则为选中状态
4014
- if (mouseOpts.selected) {
4015
- nextTick(() => $xetable.handleSelected(params, evnt))
4010
+ if (keyboardConfig && keyboardOpts.isEsc) {
4011
+ // 如果是激活编辑状态,则取消编辑
4012
+ if (actived.row) {
4013
+ const params = actived.args
4014
+ $xetable.clearActived(evnt)
4015
+ // 如果配置了选中功能,则为选中状态
4016
+ if (mouseOpts.selected) {
4017
+ nextTick(() => $xetable.handleSelected(params, evnt))
4018
+ }
4016
4019
  }
4017
4020
  }
4018
4021
  }
@@ -4076,7 +4079,7 @@ export default defineComponent({
4076
4079
  $xetable.closeMenu()
4077
4080
  }
4078
4081
  tableMethods.closeFilter()
4079
- if (actived.row) {
4082
+ if (keyboardConfig && keyboardOpts.isEsc) {
4080
4083
  // 如果是激活编辑状态,则取消编辑
4081
4084
  if (actived.row) {
4082
4085
  const params = actived.args
@@ -93,6 +93,9 @@ const GlobalConfig: VXETableGlobalConfig = {
93
93
  mouseConfig: {
94
94
  extension: true
95
95
  },
96
+ keyboardConfig: {
97
+ isEsc: true
98
+ },
96
99
  areaConfig: {
97
100
  selectCellByHeader: true
98
101
  },
package/types/table.d.ts CHANGED
@@ -1555,6 +1555,10 @@ export namespace VxeTablePropTypes {
1555
1555
  * 是否开启非编辑状态下,上下左右移动功能
1556
1556
  */
1557
1557
  isArrow?: boolean;
1558
+ /**
1559
+ * 是否开启Esc键退出编辑功能
1560
+ */
1561
+ isEsc?: boolean;
1558
1562
  /**
1559
1563
  * 是否开启删除键功能
1560
1564
  */