Skip to content

Commit

Permalink
feat: add cellKeydown #179
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Nov 15, 2023
1 parent 125e175 commit 53adffa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core
Submodule core updated from 7a5dae to 17553d
13 changes: 13 additions & 0 deletions src/doc/api.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
| resizeColumn | Triggered when the column is dragged. If you do not need to automatically change the width internally, you can return `false` | Function(width, column, action: 'start' \| 'move' \| 'end' ) => boolean \| void | 2.0.3 |
| rowDragEnd | Triggered when the dragged row ends | (opt: [DragRowEventInfo](#dragroweventinfo)) => boolean \| Promise \| void | 2.1.0 |
| columnDragEnd | Triggered when the drag column ends | (opt: [DragColumnEventInfo](#dragcolumneventinfo)) => boolean \| Promise \| void | 2.1.1 |
| cellKeydown | Cell keyboard event, when false is returned, internal processing of the component will be skipped, such as left and right switching, etc. | (event: KeyboardEvent, opt: [KeydownPayload](#keydownpayload)) => void | 4.2.1 |

### Method

Expand Down Expand Up @@ -109,6 +110,18 @@ export interface AppendCellRange {
}
```

### KeydownPayload

```ts
export interface KeydownPayload {
cellPosition: {
rowIndex: number;
column: Column;
};
isEditing: boolean;
}
```

#### customRow usage

Same as `customRow` `customCell` `customHeaderCell`. Follow [Vue jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx) syntax。
Expand Down
13 changes: 13 additions & 0 deletions src/doc/api.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ setConfig(config: {
| resizeColumn | 拖动列时触发, 如果不需要内部自动更改宽度,可以返回 `false` | Function(width, column, action: 'start' \| 'move' \| 'end' ) => boolean \| void | 2.0.3 |
| rowDragEnd | 拖拽行结束时触发 | (opt: [DragRowEventInfo](#dragroweventinfo)) => boolean \| Promise \| void | 2.1.0 |
| columnDragEnd | 拖拽列结束时触发 | (opt: [DragColumnEventInfo](#dragcolumneventinfo)) => boolean \| Promise \| void | 2.1.1 |
| cellKeydown | 单元格键盘事件, 返回 false 时,将跳过组件内部处理,如左右切换等 | (event: KeyboardEvent, params: [KeydownPayload](#keydownpayload)) => void | 4.2.1 |

### 方法

Expand Down Expand Up @@ -136,6 +137,18 @@ export interface AppendCellRange {
}
```

### KeydownPayload

```ts
export interface KeydownPayload {
cellPosition: {
rowIndex: number;
column: Column;
};
isEditing: boolean;
}
```

#### customRow 用法

适用于 `customRow` `customCell` `customHeaderCell`。遵循[Vue jsx](https://github.com/vuejs/babel-plugin-transform-vue-jsx)语法。
Expand Down

0 comments on commit 53adffa

Please sign in to comment.