Fixed:
- Removed arrow functions from UMD builds to support older browsers. Thanks @rburak for contributing!
Changed:
- Using react hooks internally. Breaking: React peer dependency is now 16.8.0
- 4.x.x branch will continue to release patches, etc. for older versions of React
- Smaller bundle!
Added:
Add typescript definitions and rewrite library with typescript.
Fixed:
- An internal bug was preventing subscriptions from unsubscribing due to
behaviorStore
not returning the unsubscribe function. This bug was introduced in4.2.0
. Thanks @quietshu for the fix!
Improved:
- Wrapped
valoo
store to store current value so that subscribers can replay the latest event (and have the current state) regardless of component render order. This will also help with async react.
Added:
changeInputValue
function is now a named export from the library. This will trigger changing theInputFilter
input value as well as affect the renderedFilterResults
. eg.changeInputValue("new input")
Changed:
Added:
- Added support for React ^15.5 by using
prop-types
package and prepares for deprecation of PropTypes from React.
Added:
- Allow updating
initialSearch
prop. This provides an escape hook in situations where theinitialSearch
might not be known until right after the first render.
Changed:
- Updated API to remove props and simplify usage.
FilterResults
now expects a function as a child, which receives the matching items as an argument. This provides more flexibility without needing to pass "configuration props".
Removed:
- Removed the following props in the API change:
classPrefix
,wrapper
,wrapperProps
, andrenderContainer
.
Added:
- Added
debounceTime
prop toInputFilter
. This specifies the time in milliseconds to debounce theonChange
event on the input field. 196de58
Added:
- Added
prefilters
prop toFilterResults
. Enables prefiltering the items on matching regular expressions. The return of the callback is the list of items to fuzzy search on. This enables "commands" that toggle state or change what is being fuzzy searched on. bb7d688
Added:
renderContainer
callback function onFilterResults
receives a second argument with the raw filtered items. commit
Changed:
- Removed
initialSearch
prop fromFilterResults
. It now syncs withinitialSearch
prop fromInputFilter
. commit onChange
callback forInputFilter
now can optionally return a string (instead of a boolean). The string overrides the search value passed toFilterResults
. commit
Added:
- Optional prop,
renderContainer
added toFilterResults
component. This is an alternative to usingwrapper
/wrapperProps
and provides more fine grained control over what is ultimately rendered fromFilterResults
. commit
Initial release