-
-
Notifications
You must be signed in to change notification settings - Fork 183
refactor: refactor with Baseinput #570
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
36e72f8
refactor: refactor with Baseinput
MuxinFeng 5a97c9e
chore: update package json
MuxinFeng ff4bb17
test: add tests
MuxinFeng 0d67842
feat: add classes
MuxinFeng 3cabbe0
chore: bump rc-input
MuxinFeng 259d9e3
fix: fix props type
MuxinFeng d1cba04
feat: add triggerFocus
MuxinFeng fd43a55
fix: delete suffix prop
MuxinFeng f6efec5
test: update snapshot
MuxinFeng 18678c9
fix: cal classNames
MuxinFeng 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,185 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`baseInput addon should render properly 1`] = ` | ||
| <div> | ||
| <div> | ||
| <div | ||
| class="rc-input-group-wrapper" | ||
| > | ||
| <div | ||
| class="rc-input-wrapper rc-input-group" | ||
| > | ||
| <div | ||
| class="rc-input-group-addon" | ||
| > | ||
| <span> | ||
| Addon Before | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="rc-input" | ||
| > | ||
| <div | ||
| class="rc-input-handler-wrap" | ||
| > | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Increase Value" | ||
| class="rc-input-handler rc-input-handler-up" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-up-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Decrease Value" | ||
| class="rc-input-handler rc-input-handler-down" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-down-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="rc-input-input-wrap" | ||
| > | ||
| <input | ||
| autocomplete="off" | ||
| class="rc-input-input" | ||
| role="spinbutton" | ||
| step="1" | ||
| value="" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <br /> | ||
| <br /> | ||
| <div | ||
| class="rc-input-group-wrapper" | ||
| > | ||
| <div | ||
| class="rc-input-wrapper rc-input-group" | ||
| > | ||
| <div | ||
| class="rc-input" | ||
| > | ||
| <div | ||
| class="rc-input-handler-wrap" | ||
| > | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Increase Value" | ||
| class="rc-input-handler rc-input-handler-up" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-up-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Decrease Value" | ||
| class="rc-input-handler rc-input-handler-down" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-down-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="rc-input-input-wrap" | ||
| > | ||
| <input | ||
| autocomplete="off" | ||
| class="rc-input-input" | ||
| role="spinbutton" | ||
| step="1" | ||
| value="" | ||
| /> | ||
| </div> | ||
| </div> | ||
| <div | ||
| class="rc-input-group-addon" | ||
| > | ||
| <span> | ||
| Addon After | ||
| </span> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `; | ||
|
|
||
| exports[`baseInput prefix should render properly 1`] = ` | ||
| <div> | ||
| <div | ||
| class="rc-input-affix-wrapper" | ||
| > | ||
| <span | ||
| class="rc-input-prefix" | ||
| > | ||
| <span> | ||
| Prefix | ||
| </span> | ||
| </span> | ||
| <div | ||
| class="rc-input" | ||
| > | ||
| <div | ||
| class="rc-input-handler-wrap" | ||
| > | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Increase Value" | ||
| class="rc-input-handler rc-input-handler-up" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-up-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| <span | ||
| aria-disabled="false" | ||
| aria-label="Decrease Value" | ||
| class="rc-input-handler rc-input-handler-down" | ||
| role="button" | ||
| unselectable="on" | ||
| > | ||
| <span | ||
| class="rc-input-handler-down-inner" | ||
| unselectable="on" | ||
| /> | ||
| </span> | ||
| </div> | ||
| <div | ||
| class="rc-input-input-wrap" | ||
| > | ||
| <input | ||
| autocomplete="off" | ||
| class="rc-input-input" | ||
| role="spinbutton" | ||
| step="1" | ||
| value="" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `; |
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 |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { render } from '@testing-library/react'; | ||
| import InputNumber from '../src'; | ||
|
|
||
| describe('baseInput', () => { | ||
| it('prefix should render properly', () => { | ||
| const prefix = <span>Prefix</span>; | ||
|
|
||
| const { container } = render(<InputNumber prefixCls="rc-input" prefix={prefix} />); | ||
| expect(container).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| it('addon should render properly', () => { | ||
| const addonBefore = <span>Addon Before</span>; | ||
| const addonAfter = <span>Addon After</span>; | ||
|
|
||
| const { container } = render( | ||
| <div> | ||
| <InputNumber prefixCls="rc-input" addonBefore={addonBefore} /> | ||
| <br /> | ||
| <br /> | ||
| <InputNumber prefixCls="rc-input" addonAfter={addonAfter} /> | ||
| </div>, | ||
| ); | ||
| expect(container).toMatchSnapshot(); | ||
| }); | ||
| }); |
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.
暂时不支持 suffix
Uh oh!
There was an error while loading. Please reload this page.
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.
这里是准备放 feedbackIcon 的,antd 的 InputNumber 并没有暴露 suffix 。
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.
很细,我都忘记了