Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat(interaction): 新增选中/高亮单元格 & 滚动 API #2586

Open
wants to merge 12 commits into
base: next
Choose a base branch
from

Conversation

lijinke666
Copy link
Member

@lijinke666 lijinke666 commented Mar 7, 2024

👀 PR includes

✨ Feature

  • New feature

📝 Description

选中单元格 API 调整/完善

selectHeaderCell 变更为 changeCell, 支持所有类型单元格的选中。同时支持 选中 (selectCell)高亮 (highlightCell) 等语法糖, 现有 API 可以实现 (如: s2.interaction.changeState()), 但成本过高, 开发者需要理解部分源码逻辑, 简化从而满足外部逻辑主动触发的场景.

- s2.interaction.selectHeaderCell(selectHeaderCellInfo: SelectHeaderCellInfo)
+ s2.interaction.changeCell(options: ChangeCellOptions)

+ s2.interaction.selectCell(cell: S2CellType)
+ s2.interaction.highlightCell(cell: S2CellType)

选中

Kapture 2024-03-07 at 15 19 16

高亮

Kapture 2024-03-07 at 15 18 23

滚动 API 调整/完善

滚动 API s2.updateScrollOffset 移除,统一至 s2.interaction 命名空间下, 保持 API 一致性。同时支持 scrollToCellscrollToTop 等语法糖。

- s2.updateScrollOffset(offsetConfig: ScrollOffsetConfig)
+ s2.interaction.scrollTo(offsetConfig: ScrollOffsetConfig)
+ s2.interaction.scrollToCellById('root[&]浙江[&]杭州-root[&]笔[&]price');
+ s2.interaction.scrollToCell(dataCell);
+ s2.interaction.scrollToTop();

Kapture 2024-03-07 at 17 28 43

🖼️ Screenshot

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Mar 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Mar 15, 2024 2:50am

@github-actions github-actions bot added the next 2.0-next 版本的问题 label Mar 7, 2024
Copy link
Contributor

github-actions bot commented Mar 7, 2024

Size Change: +450 B (0%)

Total Size: 318 kB

Filename Size Change
./packages/s2-core/dist/index.min.js 222 kB +450 B (0%)
ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/style.min.css 402 B
./packages/s2-react/dist/index.min.js 69.3 kB
./packages/s2-react/dist/style.min.css 4 kB
./packages/s2-vue/dist/index.min.js 20.3 kB
./packages/s2-vue/dist/style.min.css 1.97 kB

compressed-size-action

@lijinke666 lijinke666 changed the title [WIP] feat(interaction): 新增选中/高亮单元格 & 滚动 API feat(interaction): 新增选中/高亮单元格 & 滚动 API Mar 8, 2024
@github-actions github-actions bot added the pr(feature) new feature label Mar 8, 2024
Copy link
Contributor

github-actions bot commented Mar 8, 2024

你好, @lijinke666 CI 执行失败, 请点击 [Details] 按钮查看, 并根据日志修复。

Hello, @lijinke666 CI run failed, please click the [Details] button for detailed log information and fix it.

@github-actions github-actions bot added the 🚨 test failed 单元测试挂了 label Mar 8, 2024
@lijinke666 lijinke666 changed the title feat(interaction): 新增选中/高亮单元格 & 滚动 API [WIP] feat(interaction): 新增选中/高亮单元格 & 滚动 API Mar 8, 2024
@github-actions github-actions bot removed the pr(feature) new feature label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 🚨 test failed 单元测试挂了
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant