Skip to content

Commit

Permalink
feat: add textArea editor
Browse files Browse the repository at this point in the history
  • Loading branch information
fangsmile committed Jun 5, 2024
1 parent d3789d9 commit e977b5c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs/assets/demo/en/edit/edit-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ option: ListTable-columns-text#editor

# edit cell

This example shows the editability of the table. Double-click a cell to enter the edit state. If you want to change the timing of entering the edit state, you can set:
This example shows the editability of the table. Click a cell to enter the edit state. If you want to change the timing of entering the edit state, you can set:

```
/** Edit triggering time: double click event | single click event | api to manually start editing. Default is double click 'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api';
```

The current example has four editors: input, date, list, and textArea. Different effects can be achieved by setting different editors.

For detailed introduction, please click on the tutorial to learn!

## Key Configurations
Expand Down
13 changes: 10 additions & 3 deletions docs/assets/demo/zh/edit/edit-cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ option: ListTable-columns-text#editor

# 编辑单元格

该示例展示了表格的可编辑能力。双击单元格,即可进入编辑状态。如果想要修改进入编辑的时机,可以设置:
该示例展示了表格的可编辑能力。单击单元格,即可进入编辑状态。如果想要修改进入编辑的时机,可以设置:

```
/** 编辑触发时机:双击事件 | 单击事件 | api手动开启编辑。默认为双击'doubleclick' */
editCellTrigger?: 'doubleclick' | 'click' | 'api';
```

当前示例中有 input、date、list、textArea 四种编辑器,可以通过设置不同的编辑器来实现不同的效果。

具体介绍可以点击教程进入学习!

## 关键配置
Expand Down Expand Up @@ -197,7 +199,7 @@ const columns = [
{
field: 'address',
title: 'address\n(textArea editor)',
width: 350,
width: 300,
editor: 'textArea-editor'
},
{
Expand All @@ -224,7 +226,12 @@ const option = {
autoWrapText: true,
limitMaxAutoWidth: 600,
heightMode: 'autoHeight',
editCellTrigger: 'click'
editCellTrigger: 'click',
keyboardOptions: {
copySelected: true,
pasteValueToCell: true,
selectAllOnCtrlA: true
}
};
tableInstance = new VTable.ListTable(option);
tableInstance.on('change_cell_value', arg => {
Expand Down
2 changes: 0 additions & 2 deletions packages/vtable-editors/src/input-editor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { EditContext, IEditor, RectProps } from './types';

export interface InputEditorConfig {
max?: number;
min?: number;
readonly?: boolean;
}

Expand Down
2 changes: 0 additions & 2 deletions packages/vtable-editors/src/textArea-editor.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { EditContext, IEditor, RectProps } from './types';

export interface TextAreaEditorConfig {
max?: number;
min?: number;
readonly?: boolean;
}

Expand Down

0 comments on commit e977b5c

Please sign in to comment.