Releases: formwerkjs/formwerk
Releases · formwerkjs/formwerk
v0.8.3
🚀 Features
- Add useFormContext to inject typed forms closes #143 - by @logaretm in #143 (38a03)
- Added handleReset fn on the form returns closes #141 - by @logaretm in #141 (accc2)
- Added constraint validation attribute support for date, calendar, and select fields - by @logaretm in #147 (ce583)
- date: Initialize the known segments if they have one possible value - by @logaretm in #145 (a7646)
🐞 Bug Fixes
- Use true as contenteditable value on firefox - by @logaretm (e969b)
- Prevent date segment from having invalid part value - by @logaretm (8a27e)
- Negative signs affecting number parsing with date segments - by @logaretm (c3f2b)
- Compare the key property as well for keyboard events - by @logaretm (df355)
- devtools: Unhighlight node after a short timer - by @logaretm (c6e18)
- types: Default checkbox value prop type to boolean closes #144 - by @logaretm in #144 (bb014)
View changes on GitHub
v0.8.2
v0.8.1
v0.8.0
This release marks a huge milestone as this was one of the critical fields needed in any UI library ✨
🆕 useCalendar
This new composable allows you to create custom calendar components with many features that your users expect available out of the box. Here are the higlights:
- ⌨️ Comprehensive keyboard navigation and shortcuts support.
- 🌐 Support for multiple locales and calendar systems.
- ✅ Validation with standard schemas.
- ♿️ First class a11y support.
- 📅 Support for different views (days, months, years)
And more, check the 📚 docs and examples.
🆕 useDateTimeField
This new composable allows you to create a custom date time field to let users enter date and time values using date time segments. Here are the highlights:
- ⌨️ Comprehensive keyboard navigation and shortcuts support.
- 🤖 Auto focus management and detection of whent he user is done entering a segment.
- 🌐 Support for multiple locales and calendar systems.
- ✅ Validation with standard schemas.
- ♿️ First class a11y support.
And more, check the 📚 docs and examples.
What's even cooler, you can combine both to build a date picker component that does both jobs!
🔗 Changelog | 📚 Documentation
v0.7.0
🚀 Features
💣 Breaking Changes
- Change form state
isValid
,isTouched
,isDirty
to be methods instead, these methods now accept a path to narrow down which path of the form to return the state for. by @genu #126 useForm
'sgetErrors
now return an array of strings rather than Issue collection objects by @genu #126
const { isTouched, setTouched, isDirty, isValid, getErrors, getError, setErrors } = useForm();
// Check if the form is touched
isTouched();
// Check if a field/path is touched
isTouched('field');
isTouched('address.city');
// Set the touched state of the form
setTouched(true);
// Set the touched state of a field/path
setTouched('field', true);
setTouched('address.city', true);
// Check if the form is dirty
isDirty();
// Check if a field/path is dirty
isDirty('field');
isDirty('address.city');
// Check if the form is valid
isValid();
// Check if a field/path is valid
isValid('field');
isValid('address.city');
// Get all the errors for the form
getErrors(); // string[]
// Get the errors for a field/path
getErrors('field'); // string[]
getErrors('address.city'); // string[]
// Set the errors for a field/path
setErrors('field', 'This is an error');
setErrors('address.city', 'This is another error');
setErrors('address.city', ['This is another error', 'This is another error 2']);
// Gets the first error for a field/path
getError('field'); // string
getError('address.city'); // string
🐞 Bug Fixes
- Manually track the dirty state - by @logaretm in #128 (3c955)
- types: Add explicit return type to setTouched - by @logaretm (9a6d6)
View changes on GitHub
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
🚀 Features
- combobox: