v1.6
v1.6.0
Features
useValidationcomposable is introduced to allow custom form validationsuseDefaultValidationcomposable is included out of the box that checks for required valuesFormPageandSimpleFormutilizesuseValidationto enable form validation, you may add custom validations throughFormPage.ValidationsandSimpleForm.Validationsrespectively
FormPageandSimpleFormvalidation messages can now be displayed in the submit button's tooltip- To enable/disable this behavior, use
ShowValidationSummaryproperty
- To enable/disable this behavior, use
Validationutility component is now available to render an input with a validation message componentmessageslot is available to override the message component underneath<template #message="{ validation }">{{ validation.message }}</template>
LabelintroducesShowOptionalityto indicate required or optional fieldsLabelernow renders with red border when inner input is not validBake.vuenow inlines 400 responses of data and action requests to make it easier to relate the error and the component that causes it- Other status codes are still handled via the existing
errorHandlingplugin context.injectErrorandcontext.provideErrorare introduced to pass a data or an action error to childuseBakeErrorcomposable is introduced to handle and format a data or action error occured inBake.vue<template> <span v-if="error"> {{ error.title }} - {{ error.detail }} </span> </template> <script setup> const { handle: handleError } = useBakeError(); const { error } = handleError(); </script>useDataMounternow supports inline error display viauseDataMounter{ defaultInlineError: true }option to enable it page-wide, ormount({ inlineError: true })to enable it individuallyAppDescriptor.InlineErroris introduced to customize error display for components that don't handle their inline errors by injectingInlineErrorcomponent is introduced to help rendering inline error schema in app descriptor
ErrorPopovercomponent is introduced to show an error within a popover when there is no place to show the error in the baked component, e.g., buttons, forms
- Other status codes are still handled via the existing
Breaking Changes
ILabelerproperties are now grouped underLabelschemaLabel->Label.TextLabelMode->Label.ModeLabelVariant->Label.Variant- You must change your label conventions from
InputtoLabel// old builder.Conventions.AddParameterSchemaConfiguration<Input>( where: cc => cc.Path.EndsWith(...), schema: (i, c, cc) => { if (i.Component.Schema is not ILabeler labeler) { return; } labeler.LabelIfta(labeler.Label ?? "..."); } ); // new builder.Conventions.AddParameterSchemaConfiguration<Label>( where: cc => cc.Path.EndsWith(..., "*", nameof(ILabeler.Label)), schema: (label, c, cc) => label.Ifta(() => "...") );
ISelect.LocalizeLabelis renamed asISelect.LocalizeOptionLabelsfor clarity- Locale files has changed to include API validation errors, update your locale files with the latest locale files in baked project
- Every
locale.{lang}.restextfile requires an entry per parameter inPascalCasenaming, e.g., fornamea locale file should have aName=...entry
Improvements
AwaitLoadingnow supports multi-children and handles inlined errors automatically- You can now pass multiple children to
#default,#loadingand#errorslots to be wrapped automatically by adivwhen there are more two or more children - Has an
#errorslot that allows you customize data loading errors - Automatically sets error as handled, to disable this behavior set the
no-errorflag
- You can now pass multiple children to
FormPageandSimpleForm(when in dialog mode) now displays 400 errors at the top of the formMessagewas not loading styles due to transition, fixedMessagenow supportscontentslot for additional content renderingToastis wider and sticky by default inerrorHandlingplugin- API model validation now uses localization for error messages as well as parameter names
Library Upgrades
| NuGet Package | Old Version | New Version |
|---|---|---|
| Microsoft.AspNetCore.Authentication.JwtBearer | 10.0.7 | 10.0.8 |
| Microsoft.AspNetCore.Mvc.NewtonsoftJson | 10.0.7 | 10.0.8 |
| Microsoft.AspNetCore.Mvc.Testing | 10.0.7 | 10.0.8 |
| Microsoft.Data.Sqlite.Core | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.Caching.Abstractions | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.Configuration.Abstractions | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.Configuration.Binder | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.FileProviders.Abstractions | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.Localization.Abstractions | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.Logging.Abstractions | 10.0.7 | 10.0.8 |
| Microsoft.Extensions.TimeProvider.Testing | 10.5.0 | 10.6.0 |
| Microsoft.NET.Test.Sdk | 18.5.1 | 18.6.0 |
| Microsoft.Testing.Extensions.CodeCoverage | 18.6.2 | 18.7.0 |
| Microsoft.Testing.Extensions.TrxReport | 2.2.2 | 2.2.3 |
| NHibernate | 5.6.0 | 5.6.1 |
| NUnit | 4.6.0 | 4.6.1 |
| Npgsql | 10.0.2 | 10.0.3 |
| SQLitePCLRaw.bundle_e_sqlite3 | 3.0.2 | 3.0.3 |
| npm Package | Old Version | New Version |
|---|---|---|
| @nuxtjs/i18n | 10.3.0 | 10.4.0 |