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.
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: