Skip to content

feat: support classNames and styles #1261

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

Merged
merged 8 commits into from
May 20, 2025

Conversation

thinkasany
Copy link
Contributor

@thinkasany thinkasany commented Apr 22, 2025

Summary by CodeRabbit

  • 新功能

    • 表格组件现支持为各个语义部分(如标题、页脚、表头、内容区、行等)自定义 className 和内联样式,提升了样式定制能力。
    • 示例文档新增演示,展示了表格标题/页脚渲染和可滚动表格的用法。
    • 单元格、固定头部和面板组件新增支持通过 style 属性传入自定义内联样式。
    • 表体和表头行、单元格支持接收上下文传递的 className 和样式,实现更灵活的样式控制。
  • 测试

    • 新增测试用例,验证自定义 className 和样式在表格各部分的正确应用。

Copy link

vercel bot commented Apr 22, 2025

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

Name Status Preview Comments Updated (UTC)
table ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2025 4:42pm

Copy link

coderabbitai bot commented Apr 22, 2025

"""

Walkthrough

本次变更主要为 Table 组件及其相关子组件引入了对自定义 classNames 与 styles 的支持。通过在 TableProps 和 TableContextProps 中增加 classNames 和 styles 属性,开发者可为表格各语义部分(如 section、header、title、footer、body、content、item)灵活指定样式类名与内联样式。相关子组件(如 Cell、FixedHolder、Panel)也同步支持了这些属性。此外,新增了示例与测试用例,展示并验证了自定义样式功能的正确性和覆盖范围。

Changes

文件/路径 变更摘要
docs/examples/className.tsx 示例扩展:为 Table 组件添加 title/footer 展示,并新增带滚动条的 Table 用例,演示自定义样式能力。
docs/examples/components.tsx 为 Table 组件添加 classNames 属性示例,演示对表体和表头子元素的样式定制。
src/Table.tsx 新增 SemanticName 类型,TableProps 增加 classNames/styles 属性,并在各语义节点应用这些自定义样式。
src/context/TableContext.tsx TableContextProps 增加 classNames、styles 属性,支持通过 context 传递自定义样式。
src/Cell/index.tsx 支持从 context 获取并应用 classNames.cell 与 styles.cell,允许单元格自定义样式。
src/FixedHolder/index.tsx 支持接收并合并 style 属性,允许固定头部容器自定义样式。
src/Panel/index.tsx TitleProps 增加 style 属性,Panel 组件支持自定义样式传递。
src/Body/index.tsx Body 组件支持从 context 获取 classNames.styles,应用于 tbody 包裹元素及传递 rowType。
src/Body/BodyRow.tsx BodyRow 支持 classNames 和 styles 属性,从 context 获取对应的 classNames.styles,区分 header/body 行样式。
src/Header/Header.tsx Header 组件支持从 context 获取 classNames.styles,应用于 thead 包裹元素及表头单元格。
src/Header/HeaderRow.tsx HeaderRow 组件支持 classNames 和 styles 属性,应用于表头行元素。
tests/semantic.spec.tsx 新增测试用例,验证 Table 组件在各语义节点正确应用自定义 classNames 与 styles。

Sequence Diagram(s)

Loading
sequenceDiagram
    participant User
    participant Table
    participant TableContext
    participant Panel
    participant FixedHolder
    participant Header
    participant BodyRow
    participant Cell

    User->>Table: 传入 classNames/styles 属性
    Table->>TableContext: 通过 Provider 传递 classNames/styles
    Table->>Panel: 渲染 title/footer,传递对应 classNames/styles
    Table->>FixedHolder: 渲染固定头部,传递 style
    Table->>Header: 渲染表头,传递 classNames/styles
    Table->>BodyRow: 渲染表体行,传递 classNames/styles
    BodyRow->>Cell: 渲染单元格,应用 context 中的 classNames.cell/styles.cell

Suggested reviewers

  • zombieJ
  • MadCcc

Poem

🐰
新增样式随心配,
表格语义各自美。
头脚标题皆可换,
滚动行间自成辉。
兔子写码乐无边,
变幻风格任你为!

"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/Body/BodyRow.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

src/Cell/index.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

src/Header/HeaderRow.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

  • 2 others

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 931ed44 and 16e497a.

📒 Files selected for processing (5)
  • src/Body/BodyRow.tsx (7 hunks)
  • src/Cell/index.tsx (6 hunks)
  • src/Header/HeaderRow.tsx (4 hunks)
  • src/Table.tsx (8 hunks)
  • tests/semantic.spec.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/Header/HeaderRow.tsx
  • tests/semantic.spec.tsx
  • src/Cell/index.tsx
  • src/Table.tsx
🔇 Additional comments (7)
src/Body/BodyRow.tsx (7)

1-1: 导入更改适当

将 classnames 库的导入别名从 classNames 改为 cls 以避免与新的 props 混淆,同时添加 TableProps 导入用于类型定义,这些改动很合理。

Also applies to: 10-10


18-19: props 类型定义正确

classNamesstyles 属性已添加到 BodyRowProps 接口中,并使用 TableProps['classNames']['body']TableProps['styles']['body'] 进行了正确的类型约束。这些属性被标记为必需的(没有 ? 后缀),符合组件的设计需求。


100-102: 成功解构新增的 props

从 props 对象中正确解构了新的 classNamesstyles 属性,使其在组件中可用。


142-147: 行类名设置正确

使用 cls 函数正确合并基础类名与新的 classNames.row prop,保持了一致的类名应用逻辑。


152-156: 行样式设置正确

合理地将基础样式、行属性样式和新的 styles.row prop 合并在一起。这种方式确保了所有样式都能够正确应用,而不会相互覆盖。


171-172: 单元格类名和样式设置正确

单元格组件现在包含了 classNames.cell 类名并应用了 styles.cell 样式,这与 PR 中增加自定义样式支持的目标一致。


202-206: ExpandedRow 组件中的类名设置正确

在 ExpandedRow 组件中,也正确地使用了 cls 函数来合并类名,保持了整个组件的一致性。

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch cp-table
  • Post Copyable Unit Tests in Comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this 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.

Sorry, something went wrong.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/Table.tsx (1)

871-919: ⚠️ Potential issue

上下文依赖项列表需考虑新增属性

在 useMemo 依赖项列表中,没有包含新增的 classNamesstyles 属性。这可能导致当这些属性变化时,上下文值不会更新。

 [
      // Scroll
      mergedScrollX,
      scrollInfo,

+     // Styles
+     classNames,
+     styles,
+     
      // Table
      prefixCls,
      getComponent,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c02189e and e9d89ed.

📒 Files selected for processing (7)
  • docs/examples/className.tsx (1 hunks)
  • src/Cell/index.tsx (4 hunks)
  • src/FixedHolder/index.tsx (2 hunks)
  • src/Panel/index.tsx (1 hunks)
  • src/Table.tsx (9 hunks)
  • src/context/TableContext.tsx (2 hunks)
  • tests/semantic.spec.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/context/TableContext.tsx (1)
src/Table.tsx (1)
  • SemanticName (88-88)
docs/examples/className.tsx (1)
tests/FixedColumn-IE.spec.jsx (1)
  • columns (27-40)
🔇 Additional comments (20)
src/Panel/index.tsx (1)

9-10: 组件样式应用正确

Panel 组件正确地接收并应用了 style 属性,符合样式自定义的需求。

src/context/TableContext.tsx (2)

17-17: 导入 SemanticName 类型

正确导入了 SemanticName 类型,用于定义样式和类名的语义化键名。


27-29: 新增样式和类名支持

TableContextProps 接口中添加了三个可选属性:styleclassNamesstyles,这些属性正确使用了 TypeScript 类型,并且设置为可选,符合良好的 API 设计原则。

src/Cell/index.tsx (4)

2-2: 将 classnames 导入重命名为 cls

classnames 库的导入重命名为更简洁的 cls,这是一种常见的实践,可以避免与组件内部变量命名冲突。


125-126: 从上下文中获取样式和类名

TableContext 上下文中获取了 classNamesstyles 属性,用于支持单元格的样式自定义。


213-215: 应用自定义类名到单元格

正确地将上下文中的自定义类名 classNames?.item 应用到单元格的 className 中,使用 cls 函数合并多个类名。


251-251: 应用自定义样式到单元格

正确地将上下文中的自定义样式 styles?.item 应用到单元格的样式对象中,这使得用户可以自定义单元格的外观。

src/FixedHolder/index.tsx (2)

49-49: 添加样式属性到组件参数

正确地在组件的解构参数中添加了 style 属性,使组件能够接收外部传入的样式。


163-163: 合并自定义样式到组件

正确地将自定义样式与现有样式合并,确保了原有样式不会被覆盖,同时允许用户添加自定义样式。

tests/semantic.spec.tsx (1)

1-111: 测试用例设计全面,有效验证了自定义样式功能

测试文件对 Table 组件的 classNames 和 styles 属性进行了全面测试,覆盖了表格的各个语义部分(section, header, title, footer, body, content, item)。测试分别验证了普通表格和带滚动条的表格场景,确保样式在不同状态下都能正确应用。代码结构清晰,测试断言完整。

docs/examples/className.tsx (1)

55-68: 示例扩展有助于用户理解功能

新增的 title 和 footer 示例,以及带滚动功能的表格示例,能有效帮助用户理解如何使用这些新特性。示例代码简洁明了,展示了实际使用场景。

src/Table.tsx (9)

28-28: import 命名更改保持一致性

classnames 导入重命名为 cls,保持了代码库内部的命名一致性。


88-95: 类型定义清晰且符合语义化设计

新增的 SemanticName 类型和 TableProps 接口扩展设计合理,使用 Partial<Record<...>> 允许用户只指定需要的部分,提高了 API 的灵活性。


196-197: 属性解构位置适当

在组件属性解构中适当位置添加了 classNamesstyles 属性,便于后续使用。


663-667: 样式合并实现优雅

表格体(body)部分的自定义样式合并实现优雅,既保留了原有的滚动样式,又允许用户自定义样式覆盖。使用 cls 函数合并类名也很合理。


707-708: 表头样式应用方式与其他部分一致

表头部分的样式应用方式与其他表格部分保持一致,保持了代码的一致性和可预测性。


749-751: 内容区域样式应用合理

表格内容区域样式应用方式与其他部分一致,同时保留了原有的滚动样式特性。


784-784: 类名合并使用 cls 保持一致性

将原有的 classnames 函数调用改为使用重命名后的 cls,保持了代码一致性。


803-807: 标题和页脚组件样式应用完整

标题和页脚组件应用样式的实现细致全面,同时处理了类名和内联样式,并保持了组件的原有功能。


823-824: 在上下文中添加样式属性

在 TableContextValue 中添加 classNames 和 styles 属性,使得这些样式配置可以传递给子组件,这是实现全局样式定制的关键。

Copy link

codecov bot commented Apr 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.08%. Comparing base (c02189e) to head (16e497a).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1261      +/-   ##
==========================================
+ Coverage   98.03%   98.08%   +0.04%     
==========================================
  Files          76       77       +1     
  Lines        7425     7609     +184     
  Branches     1146     1164      +18     
==========================================
+ Hits         7279     7463     +184     
  Misses        140      140              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

vercel bot commented May 19, 2025

@thinkasany is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/Body/BodyRow.tsx (1)

89-225: 关于样式层次结构的建议

整体实现逻辑清晰,但可以考虑进一步优化样式的应用方式。目前的实现在行级别应用了rowType特定的样式,但没有为嵌套的展开行提供相同的样式定制能力。

可以考虑在ExpandedRow组件中也添加基于rowType的样式支持,使样式定制更加一致和完整。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fd21ea and 4040edf.

📒 Files selected for processing (9)
  • docs/examples/components.tsx (1 hunks)
  • src/Body/BodyRow.tsx (6 hunks)
  • src/Body/index.tsx (5 hunks)
  • src/Cell/index.tsx (4 hunks)
  • src/Header/Header.tsx (2 hunks)
  • src/Header/HeaderRow.tsx (2 hunks)
  • src/Table.tsx (8 hunks)
  • src/context/TableContext.tsx (2 hunks)
  • tests/semantic.spec.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/context/TableContext.tsx
  • tests/semantic.spec.tsx
  • src/Cell/index.tsx
  • src/Table.tsx
🔇 Additional comments (18)
docs/examples/components.tsx (1)

27-38: 添加自定义样式类支持

这里示范了如何为表格不同部分提供自定义的类名。此实现允许开发者精细控制表格的样式,包括对表格主体和表头的包装器、单元格和行分别定制样式。

这是一个很好的示例,展示了新增功能的使用方法,使开发者能够清晰了解如何自定义表格各部分的样式。

src/Header/HeaderRow.tsx (2)

35-41: 正确地从上下文中提取样式信息

通过从 TableContext 中提取 stylesclassNames,然后安全地解构出特定于表头的样式和类名,实现了样式的灵活传递和应用。这种方式遵循了 React 的最佳实践。

特别赞同使用了可选链操作符 (?.),这样即使 classNamesstyles 为空,代码也不会出错。


53-53: 将样式应用到表头行元素

这里正确地将提取的样式和类名应用到了表头行组件上,使自定义样式能够生效。

此实现与 PR 目标很好地契合,为表格组件提供了灵活的样式定制能力。

src/Header/Header.tsx (3)

14-14: 引入 classnames 工具

引入 cls (classnames) 工具用于组合多个类名,这是 React 生态系统中处理条件类名的标准做法。


101-108: 从上下文中提取样式配置

代码正确地从 TableContext 中提取了 classNamesstyles,并且解构出特定于表头的样式配置。这种实现方式与其他组件保持一致,有助于维护代码的一致性和可预测性。


116-119: 将样式应用到表头包装器组件

这里通过 cls 工具组合了默认类名和自定义类名,同时应用了自定义样式,实现了对表头包装器的样式定制。

使用 cls 工具确保了类名的正确合并,这是处理多个类名的推荐方式。同时,通过条件访问保证了即使没有提供自定义样式也不会出错。

src/Body/index.tsx (4)

12-12: 引入 classnames 工具

引入 cls (classnames) 工具用于组合类名,保持了与 Header.tsx 文件相同的模式,确保了代码风格的一致性。


35-50: 提取和解构表格主体样式配置

从 TableContext 中提取 classNamesstyles,并正确地解构出特定于表格主体的样式和类名。使用了空值合并操作符提供默认值,确保了代码的健壮性。

这种实现与整个 PR 中的其他组件保持一致,维护了代码库的一致性。


76-76: 添加行类型属性

为 BodyRow 组件添加 rowType="body" 属性,这有助于在 Cell 组件中区分表头行和表格主体行,从而应用不同的样式。这是一个很好的设计决策,增强了组件的语义化和样式的灵活性。


108-111: 将样式应用到表格主体包装器

通过 cls 工具组合默认类名和自定义类名,同时应用自定义样式,实现了对表格主体包装器的样式定制。

这种实现与表头组件中的样式应用保持一致,确保了整个表格样式系统的一致性和可预测性。

src/Body/BodyRow.tsx (8)

1-1: 导入变更和新增上下文支持

classnames 重命名为 cls,并引入 useContextTableContext,以支持从上下文获取样式配置。这是一个合理的变更,为组件提供了使用上下文API访问表格相关上下文值的能力。

Also applies to: 4-5


23-23: 适当的类型定义扩展

添加了可选的 rowType 属性,允许指定行的类型('header' | 'body' | 'footer')。这是一个良好的改进,使得组件能够根据行类型应用不同的样式。


106-106: 从props中解构新增的rowType属性

正确地从props中解构了rowType属性,为后续条件渲染做准备。


108-110: 使用上下文API访问样式配置

通过useContextTableContext中获取classNamesstyles,并进一步解构出body和header特定的类和样式。这是实现自定义样式支持的关键步骤。


141-151: 条件应用类名

基于rowType条件性地应用类名,使用cls代替原来的classNames进行类名拼接。当rowType === 'header'时添加headerCls?.row类,当rowType === 'body'时添加bodyCls?.row类。

增加了可选链操作符(?.)确保即使headerClsbodyCls为空时也不会出错,这是一个很好的防御性编程实践。


152-157: 条件应用样式

基于rowType条件性地应用样式,当rowType === 'header'时添加headerStyles?.row样式,当rowType === 'body'时添加bodyStyles?.row样式。这与类名应用的逻辑保持一致,实现了完整的样式定制能力。


172-172: 为Cell组件固定rowType属性

Cell组件添加了固定的rowType="body"属性。这确保了单元格能够正确应用基于行类型的样式。


203-207: 更新ExpandedRow组件的类名拼接

ExpandedRow组件的类名拼接从使用classNames更改为cls,保持了整个组件的一致性。

opt
rm
@@ -90,10 +93,11 @@ function BodyRow<RecordType extends { children?: readonly RecordType[] }>(
if (process.env.NODE_ENV !== 'production') {
devRenderTimes(props);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种空行尽量保留,代码合一起不太容易看

opt

export interface BodyRowProps<RecordType> {
record: RecordType;
index: number;
renderIndex: number;
className?: string;
style?: React.CSSProperties;
classNames?: TableProps['classNames']['body'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个定义没改…………是必选的

src/Table.tsx Outdated
@@ -85,11 +85,21 @@ const EMPTY_DATA = [];
// Used for customize scroll
const EMPTY_SCROLL_TARGET = {};

export type SemanticName = 'section' | 'title' | 'footer' | 'content' | 'cell';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table 里的元素是不用的,不是说 item 改成 cell。而是不要这个 cell

@@ -20,6 +21,8 @@ export interface RowProps<RecordType> {
cellComponent: CustomizeComponent;
onHeaderRow: GetComponentProps<readonly ColumnType<RecordType>[]>;
index: number;
classNames?: TableProps['classNames']['header'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一样的,这里是必选的

rm
@zombieJ zombieJ merged commit b10f4d4 into react-component:master May 20, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants