-
Notifications
You must be signed in to change notification settings - Fork 264
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 picker component #621
base: master
Are you sure you want to change the base?
feat: add picker component #621
Conversation
This’ll be a fun one. A few quick thoughts on very first read:
|
@meowgorithm thanks for the quick feedback! These commits fix the P.S. Flexible on the naming of stepping, jumping, etc. I just went with the first things that came to mind. Perhaps it would be better as:
|
Resolves #9.
Adds a new "picker" component. By default this component takes an implementation of the
State
interface and displays it in a horizontal picker manner (as requested in the issue). Thorough unit tests are included :)Notes
State
interface are included:ListState
takes a generic slice/list to display.IntState
allows you to set a maximum and minimum integer, or decide to ignore max or min.IntState
).IntState
you can enable this on a per-end basis. Meaning you can set a min of 0 and max of 5, and also ignore the max. Going above 5 will continue incrementing, but going below 0 will set the value to 5. This can of course be enabled or disable for both min and max.State
implementation to validate each step (ie. beyond max/min) and to handle cycling, etc.Model
to get the individual, styled display components (indicators and the value). This allows the user to build a visually different component (such as a vertical picker).Demo
The following can be put in a
main
package within the repo to test out the picker component: