-
Notifications
You must be signed in to change notification settings - Fork 280
feat: radio adaptation #2721
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
feat: radio adaptation #2721
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,6 +1,16 @@ | ||
import { Radio } from './radio.taro' | ||
import React from 'react' | ||
import { Radio, RadioProps } from './radio.taro' | ||
import { RadioGroup } from '../radiogroup/radiogroup.taro' | ||
|
||
export type { RadioProps } from './radio.taro' | ||
export type { RadioShape, RadioPosition } from './types' | ||
|
||
export default Radio | ||
type CompoundedComponent = React.FC< | ||
Partial<RadioProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> | ||
> & { | ||
Group: typeof RadioGroup | ||
} | ||
const InnerRadio = Radio as CompoundedComponent | ||
InnerRadio.Group = RadioGroup | ||
|
||
export default InnerRadio |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,15 @@ | ||
import { Radio } from './radio' | ||
import React from 'react' | ||
import { Radio, RadioProps } from './radio' | ||
import { RadioGroup } from '../radiogroup/radiogroup' | ||
|
||
export type { RadioProps } from './radio' | ||
export type { RadioShape, RadioPosition } from './types' | ||
export default Radio | ||
type CompoundedComponent = React.FC< | ||
Partial<RadioProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> | ||
> & { | ||
Group: typeof RadioGroup | ||
} | ||
const InnerRadio = Radio as CompoundedComponent | ||
InnerRadio.Group = RadioGroup | ||
|
||
export default InnerRadio |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
需要完成剩余的View组件替换
在代码库中发现还有未替换的
div
元素:src/packages/radio/radio.tsx
中有3处需要替换:<div className={labelcls}>{children}</div>
<div className={buttoncls}>{children}</div>
<div className={cls} style={style} onClick={handleClick} {...rest}>
src/packages/radio/demo.tsx
中有1处需要替换:<div className="demo">
为确保Taro跨平台兼容性,这些
div
元素也需要替换为View
组件。🔗 Analysis chain
验证View组件替换的兼容性
将
div
元素替换为Taro的View
组件是必要的改动,但需要确保在不同平台上的表现一致。Also applies to: 130-130, 152-152
Let's check the content of these files to understand if there are any remaining
div
elements that need to be replaced.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 88
Script:
Length of output: 755