-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: 将 S2Event 提取到 API 文档中, 方便查看 (#1618)
- Loading branch information
1 parent
f40a711
commit 5689ae3
Showing
6 changed files
with
153 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: S2Event | ||
order: 4 | ||
--- | ||
|
||
`markdown:docs/api/general/S2Event.en.md` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
title: S2Event | ||
order: 4 | ||
redirect_from: | ||
- /zh/docs/api | ||
--- | ||
|
||
表格事件列表,可以根据实际需要,监听所需事件,实现自定义业务。[详情](https://github.com/antvis/S2/blob/master/packages/s2-core/src/common/constant/events/basic.ts) | ||
|
||
```ts | ||
s2.on(S2Event.ROW_CELL_CLICK, () => { | ||
... | ||
}); | ||
``` | ||
|
||
### 行头 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :----------- | :------------------------------------ | :------------------------- | | ||
| 展开树状结构 | `S2Event.ROW_CELL_COLLAPSE_TREE_ROWS` | 树状结构下,行头单元格展开 | | ||
| 点击 | `S2Event.ROW_CELL_CLICK` | 行头单元格点击 | | ||
| 双击 | `S2Event.ROW_CELL_DOUBLE_CLICK` | 行头单元格双击 | | ||
| 右键 | `S2Event.ROW_CELL_CONTEXT_MENU` | 行头单元格右键 | | ||
| 悬停 | `S2Event.ROW_CELL_HOVER` | 行头单元格悬停 | | ||
| 鼠标按下 | `S2Event.ROW_CELL_MOUSE_DOWN` | 行头单元格鼠标按下 | | ||
| 鼠标移动 | `S2Event.ROW_CELL_MOUSE_MOVE` | 行头单元格鼠标移动 | | ||
| 鼠标松开 | `S2Event.ROW_CELL_MOUSE_UP` | 行头单元格鼠标松开 | | ||
| 滚动 | `S2Event.ROW_CELL_SCROLL` | 行头单元格滚动 | | ||
|
||
### 列头 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :------- | :------------------------------ | :----------------- | | ||
| 点击 | `S2Event.COL_CELL_CLICK` | 列头单元格点击 | | ||
| 双击 | `S2Event.COL_CELL_DOUBLE_CLICK` | 列头单元格双击 | | ||
| 右键 | `S2Event.COL_CELL_CONTEXT_MENU` | 列头单元格右键 | | ||
| 悬停 | `S2Event.COL_CELL_HOVER` | 列头单元格悬停 | | ||
| 鼠标按下 | `S2Event.COL_CELL_MOUSE_DOWN` | 列头单元格鼠标按下 | | ||
| 鼠标移动 | `S2Event.COL_CELL_MOUSE_MOVE` | 列头单元格鼠标移动 | | ||
| 鼠标松开 | `S2Event.COL_CELL_MOUSE_UP` | 列头单元格鼠标松开 | | ||
|
||
### 数值单元格 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :------------- | :----------------------------------- | :-------------------------------------- | | ||
| 点击 | `S2Event.DATA_CELL_CLICK` | 数值单元格点击 | | ||
| 双击 | `S2Event.DATA_CELL_DOUBLE_CLICK` | 数值单元格双击 | | ||
| 右键 | `S2Event.DATA_CELL_CONTEXT_MENU` | 数值单元格右键 | | ||
| 悬停 | `S2Event.DATA_CELL_HOVER` | 数值单元格悬停 | | ||
| 鼠标按下 | `S2Event.DATA_CELL_MOUSE_DOWN` | 数值单元格鼠标按下 | | ||
| 鼠标移动 | `S2Event.DATA_CELL_MOUSE_MOVE` | 数值单元格鼠标移动 | | ||
| 鼠标松开 | `S2Event.DATA_CELL_MOUSE_UP` | 数值单元格鼠标松开 | | ||
| 趋势 icon 点击 | `S2Event.DATA_CELL_TREND_ICON_CLICK` | 数值单元格 tooltip 里面的趋势 icon 点击 | | ||
| 刷选 | `S2Event.DATA_CELL_BRUSH_SELECTION` | 数值单元格刷选 | | ||
|
||
### 角头 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :------- | :--------------------------------- | :----------------- | | ||
| 点击 | `S2Event.CORNER_CELL_CLICK` | 角头单元格点击 | | ||
| 双击 | `S2Event.CORNER_CELL_DOUBLE_CLICK` | 角头单元格双击 | | ||
| 右键 | `S2Event.CORNER_CELL_CONTEXT_MENU` | 角头单元格右键 | | ||
| 悬停 | `S2Event.CORNER_CELL_HOVER` | 角头单元格悬停 | | ||
| 鼠标按下 | `S2Event.CORNER_CELL_MOUSE_DOWN` | 角头单元格鼠标按下 | | ||
| 鼠标移动 | `S2Event.CORNER_CELL_MOUSE_MOVE` | 角头单元格鼠标移动 | | ||
| 鼠标松开 | `S2Event.CORNER_CELL_MOUSE_UP` | 角头单元格鼠标松开 | | ||
|
||
### 布局 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :----------------------- | :--------------------------------- | :------------------------------------------ | | ||
| 单元格调整 | `S2Event.LAYOUT_RESIZE` | 单元格宽高发生改变 | | ||
| 调整单元格大小时鼠标按下 | `S2Event.LAYOUT_RESIZE_MOUSE_DOWN` | 调整单元格大小鼠标按下,目前仅 行/列 头有效 | | ||
| 调整单元格大小时鼠标移动 | `S2Event.LAYOUT_RESIZE_MOUSE_MOVE` | 调整单元格大小鼠标移动,目前仅 行/列 头有效 | | ||
| 调整单元格大小时鼠标松开 | `S2Event.LAYOUT_RESIZE_MOUSE_UP` | 调整单元格大小鼠标松开,目前仅 行/列 头有效 | | ||
| 行头宽度改变 | `S2Event.LAYOUT_RESIZE_ROW_WIDTH` | | | ||
| 行头高度改变 | `S2Event.LAYOUT_RESIZE_ROW_HEIGHT` | | | ||
| 列头宽度改变 | `S2Event.LAYOUT_RESIZE_COL_WIDTH` | | | ||
| 列头高度改变 | `S2Event.LAYOUT_RESIZE_COL_HEIGHT` | | | ||
| 树状结构宽度改变 | `S2Event.LAYOUT_RESIZE_TREE_WIDTH` | 树状模式下,单元格宽度发生改变时触发 | | ||
| 列头展开 | `S2Event.LAYOUT_COLS_EXPANDED` | 列头展开时触发 | | ||
| 列头隐藏 | `S2Event.LAYOUT_COLS_HIDDEN` | 列头隐藏时触发 | | ||
| 单元格虚拟滚动 | `S2Event.LAYOUT_CELL_SCROLL` | 已废弃,请使用 `S2Event.GLOBAL_SCROLL` 替代 | | ||
|
||
### 全局 | ||
|
||
| 名称 | 事件名 | 描述 | | ||
| :-------- | :--------------------------------- | :------------------------------------------- | | ||
| 键盘按下 | `S2Event.GLOBAL_KEYBOARD_DOWN` | 键盘按下 | | ||
| 键盘松开 | `S2Event.GLOBAL_KEYBOARD_UP` | 键盘松开 | | ||
| 复制 | `S2Event.GLOBAL_COPIED` | 对选中的单元格复制 | | ||
| 鼠标松开 | `S2Event.GLOBAL_MOUSE_UP` | 图表区域鼠标松开 | | ||
| 点击 | `S2Event.GLOBAL_CLICK` | 图表区域点击 | | ||
| 右键 | `S2Event.GLOBAL_CONTEXT_MENU` | 图表区域按下右键 | | ||
| 选中 | `S2Event.GLOBAL_SELECTED` | 选中单元格时,如:刷选,多选,单选 | | ||
| 悬停 | `S2Event.GLOBAL_HOVER` | 鼠标悬停在单元格 | | ||
| 重置 | `S2Event.GLOBAL_RESET` | 点击空白处,按下 Esc 键 重置交互样式时 | | ||
| 链接跳转 | `S2Event.GLOBAL_LINK_FIELD_JUMP` | 点击行列头被编辑为链接字段的文本时 | | ||
| icon 点击 | `S2Event.GLOBAL_ACTION_ICON_CLICK` | 单元格右侧的操作 icon 点击时,比如:排序图标 | | ||
| icon 悬停 | `S2Event.GLOBAL_ACTION_ICON_HOVER` | 单元格右侧的操作 icon 悬停时,比如:排序图标 | | ||
| 滚动 | `S2Event.GLOBAL_SCROLL` | 表格滚动 (含数值和行头单元格) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.