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: Add min/max props into InputNumber #153

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

wiyota
Copy link
Contributor

@wiyota wiyota commented Mar 22, 2024

Hello @luoxiaozero

Added range with min/max props to InputNumber component.

When the input value reaches the limit, the plus/minus icon will be disabled.
If it goes out of range, the component will be invalid and will automatically fall within the range on blur.

Adding range into InputNumber component with min/max props
@luoxiaozero
Copy link
Collaborator

Thank you, great. Can you add relevant documentation to the demo_markdown\docs\input_number\mod.md file?

@luoxiaozero
Copy link
Collaborator

This is a breakthrough change, so I marked it 0.3.

@luoxiaozero luoxiaozero added this to the 0.3 milestone Mar 29, 2024
@wiyota
Copy link
Contributor Author

wiyota commented Mar 30, 2024

I am honored!

I have refactored the component and added the Min / Max section to docs, but where should I insert the demo and props?
I placed them at the end for now, but I think it would be clearer to put the props after the step and then the Min / Max section above the Disabled section.

@luoxiaozero
Copy link
Collaborator

but I think it would be clearer to put the props after the step and then the Min / Max section above the Disabled section.

It would be better

@wiyota
Copy link
Contributor Author

wiyota commented Mar 31, 2024

Then I will do so.

Also, the doc currently list num_traits::Bounded as a required trait for T (since that is the actual implementation), but I thought it would be clearer to mention num, which is the meta-crate for num_traits, so list it as num::Bounded.

I will make these changes to the doc and commit.

- Change min/max insertion position.
- Change the crate that is added to T impl for conciseness.
- Uniformity of expression: maximum for minimum.
@luoxiaozero luoxiaozero changed the base branch from main to thaw/v0.3 April 5, 2024 11:08
@luoxiaozero luoxiaozero merged commit e939cb1 into thaw-ui:thaw/v0.3 Apr 5, 2024
4 checks passed
@luoxiaozero
Copy link
Collaborator

thank you.

luoxiaozero pushed a commit that referenced this pull request Apr 5, 2024
* feat: Add min/max props into InputNumber

Adding range into InputNumber component with min/max props

* refactor: InputNumber component

* docs: Add Min / Max section into InputNumber

* docs: Improvement InputNumber

- Change min/max insertion position.
- Change the crate that is added to T impl for conciseness.
- Uniformity of expression: maximum for minimum.
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.

2 participants