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

feat: Input.TextArea support rootClassName #44058

Merged
merged 4 commits into from Aug 7, 2023

Conversation

kiner-tang
Copy link
Member

@kiner-tang kiner-tang commented Aug 6, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Input.TextArea support rootClassName
🇨🇳 Chinese 文本域支持 rootClassName

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 92514f5

This pull request adds a new prop rootClassName to the Input.TextArea component, which allows users to customize the class name of the wrapper element. It also updates the unit tests and the documentation in both English and Chinese for the new prop.

🔍 Walkthrough

🤖 Generated by Copilot at 92514f5

  • Add a new optional prop rootClassName to the TextArea component, which allows users to customize the className of the root element (link, link, link)
  • Update the TextArea.tsx file to apply the className and rootClassName props to the inner and outer elements, using the classNames function (link)
  • Add a new test case to the textarea.test.tsx file, which checks that the rootClassName prop works as expected with different values and scenarios (link)
  • Add a new entry to the documentation tables of the Input.TextArea component in the index.en-US.md and index.zh-CN.md files, describing the rootClassName prop, its type, default value, and version (link, link)

@stackblitz
Copy link

stackblitz bot commented Aug 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 386.68 KB (+15 B 🔺)
./dist/antd-with-locales.min.js 445.81 KB (+12 B 🔺)

@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (6ca1b6d) 100.00% compared to head (9608681) 100.00%.
Report is 29 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #44058   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          658       658           
  Lines        11166     11223   +57     
  Branches      3024      3045   +21     
=========================================
+ Hits         11166     11223   +57     
Files Changed Coverage Δ
components/_util/wave/index.ts 100.00% <ø> (ø)
components/_util/wave/style.ts 100.00% <ø> (ø)
components/anchor/style/index.ts 100.00% <ø> (ø)
components/checkbox/style/index.ts 100.00% <ø> (ø)
components/config-provider/context.ts 100.00% <ø> (ø)
...date-picker/generatePicker/generateRangePicker.tsx 100.00% <ø> (ø)
...ate-picker/generatePicker/generateSinglePicker.tsx 100.00% <ø> (ø)
components/drawer/style/index.ts 100.00% <ø> (ø)
components/input-number/style/index.ts 100.00% <ø> (ø)
components/input/TextArea.tsx 100.00% <ø> (ø)
... and 13 more

... and 2 files with indirect coverage changes

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

@MadCcc
Copy link
Member

MadCcc commented Aug 7, 2023

TextArea 的 rootClassName 应该和 className 一个作用

@kiner-tang
Copy link
Member Author

TextArea 的 rootClassName 应该和 className 一个作用

感觉是不是也支持一下 rootClassName 保持心智上的统一会好一点,要是以后 textarea 重构,className 不再指向根节点了,我们还有一个一定指向根节点的 rootClassName

@@ -21,6 +21,7 @@ export interface TextAreaProps extends Omit<RcTextAreaProps, 'suffix'> {
bordered?: boolean;
size?: SizeType;
status?: InputStatus;
rootClassName?: string;
Copy link
Member

Choose a reason for hiding this comment

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

这个原来不支持的么?demo test 里加个 TextArea 的测试~~

Copy link
Member Author

Choose a reason for hiding this comment

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

image 不支持,之前因为没有加 test 所以没检测出来,我加一下 test

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

3 participants