x icon indicating copy to clipboard operation
x copied to clipboard

Feat/actions

Open disturbwe opened this issue 1 year ago • 3 comments

Summary by CodeRabbit

  • 新功能
    • 引入了 ActionMenu 组件,支持渲染带有操作项的下拉菜单。
    • 新增 Actions 组件,用于渲染一组操作项,并支持可选的工具提示。
    • 新增多个 Demo 组件,展示不同的操作项和用法。
  • 文档
    • 添加了中英文文档,涵盖 Actions 组件及其用法。
    • 更新了 basic.mdsub.md 文件,增加了中英文支持。
  • 测试
    • findItem 函数和 Actions 组件添加了单元测试,确保功能正常。

disturbwe avatar Nov 25 '24 15:11 disturbwe

📝 Walkthrough

Walkthrough

此次更改引入了多个新的 React 组件和相关的测试、文档以及样式配置,主要集中在 Actions 组件及其功能上。新增的 ActionMenu 组件提供了一个可自定义的下拉菜单,支持不同语言的文档更新。同时,添加了针对 findItem 函数和 Actions 组件的单元测试,确保其功能的正确性。文档部分也增加了中英文支持,以便于多语言用户的使用。

Changes

文件路径 更改摘要
components/actions/ActionMenu.tsx 新增 ActionMenu 组件,包含 findItem 函数,用于根据键路径查找动作项。
components/actions/tests/actionMenu.test.tsx findItem 函数新增测试套件,验证其在不同场景下的功能。
components/actions/tests/actions.test.tsx Actions 组件新增单元测试,验证渲染、点击处理和子菜单的功能。
components/actions/demo/basic.md basic.md 文件中新增中英文使用说明。
components/actions/demo/basic.tsx 新增 Demo 组件,展示基本的动作项和点击处理。
components/actions/demo/sub.md sub.md 文件中新增中英文使用说明。
components/actions/demo/sub.tsx 新增 Demo 组件,展示包含嵌套子项的动作项。
components/actions/demo/variant.md variant.md 文件中新增中英文使用说明。
components/actions/demo/variant.tsx 新增 Demo 组件,展示变体功能的动作项。
components/actions/index.en-US.md 新增英文文档,全面介绍 Actions 组件的使用和 API。
components/actions/index.tsx 新增 Actions 组件及其类型 ActionsProps 的导出。
components/actions/index.zh-CN.md 新增中文文档,全面介绍 Actions 组件的使用和 API。
components/actions/interface.ts 新增多个 TypeScript 接口和类型,定义动作项的结构。
components/actions/style/index.ts 新增样式逻辑,定义 Actions 组件的样式生成函数。
components/index.ts index.ts 文件中新增 Actions 组件的导出。
components/theme/components.ts ComponentTokenMap 接口中新增 Actions 属性。
components/x-provider/context.ts XComponentsConfig 接口中新增 actions 属性。

Suggested reviewers

  • MadCcc

🐰 在草地上跳跃欢快,
新组件如花绽放开。
菜单多样任你选,
多语言助你无碍。
代码美丽如春天,
祝贺更新乐开怀! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Nov 25 '24 15:11 coderabbitai[bot]

Preview is ready

github-actions[bot] avatar Nov 25 '24 15:11 github-actions[bot]

size-limit report 📦

Path Size
dist/antdx.min.js 41.08 KB (+602 B 🔺)

github-actions[bot] avatar Nov 25 '24 15:11 github-actions[bot]

什么时候合并呀,挺需要的 :)

wzxinchen1 avatar Mar 23 '25 07:03 wzxinchen1