React controls using links from valuelink package
npm install linked-controlsThe reference implementation of React form controls using value links. Can be used as is or as a starting boilerplate for your custom controls with inlined validation errors.
Link can be bound to the any form control consuming value and onChange props, so linked controls from this package may be used but are not really required.
``javascript`
However, it's beneficial to create a custom form control wrappers encapsulating your markup patterns for a form layout and validation in order to take a full advantage of the value link.
npm install linked-controls --save-dev
##### useThrottle( fun, timeout, changes = [] )
Produce throttled version of the fun function, which will be executed after the given delay in msecs.changes
All external variabled used by fun must be listed in array to prevent race conditions.
The hook is used by the .
##### ,
Wrappers for standard and
These wrappers will add invalid class to enclosed HTML element if an error is present in the link.
`jsx`
#####
A cross-browser implementation of numeric input tag. It has following differences compared to :
- Keyboard input which obviously leads to invalid values (e.g. letters) are rejected.
- Value is being always converted to valid number.
- There are integer and positive boolean props controlling input rejection. They can be combined.
validates its value and adds invalid class to enclosed input element if it's not a number.
`jsx`
#####
Text input field updating the $value after the given timeout when user stopped typing (1 second by default).
`jsx`$3
#####
Wrapper for the standard . Directly binds boolean value with checkedLink property.
`jsx`
#####
Internally, it's
element which toggles selected class on click.
Thus, it can be easily styled.By default, it has
checkbox CSS class which can be overridden by passing className prop.It passes through anything else including
children.
`jsx
`$3
#####
Wrapper for standard
. Regular tags must be used. All props are passed through.`jsx
`#####
Wrapper for the standard . Directly binds boolean value with $checked property.Can be directly bound to the link of any type with
$value or $checked property.`jsx
`#####
Internally, it's
element which always sets selected class on click. Thus,
it can be easily styled. By default, it has
radio CSS class, which can be overridden by passing className prop.
It passes through anything else, including children.It must be used in conjunction with
$link.equals( 'value' ) method.`jsx
``