- @lion/checkbox-group@0.11.8 - @lion/fieldset@0.14.1 - @lion/form-core@0.3.1 - @lion/form-integrations@0.2.1 - @lion/form@0.6.15 - @lion/input-amount@0.7.15 - @lion/input-date@0.7.15 - @lion/input-datepicker@0.14.19 - @lion/input-email@0.8.15 - @lion/input-iban@0.9.15 - @lion/input-range@0.4.15 - @lion/input@0.8.1 - @lion/radio-group@0.11.8 - @lion/select-rich@0.19.1 - @lion/select@0.7.15 - @lion/switch@0.10.16 - @lion/textarea@0.7.15 - @lion/validate-messages@0.2.7 |
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| translations | ||
| CHANGELOG.md | ||
| index.js | ||
| package.json | ||
| README.md | ||
Validation Messages
A set of localized messages for default Validators. One method loadDefaultFeedbackMessages is
called, it will make sure that all validators provided in @lion/form-core will have a default
error message.
It uses the @lion/localize system to provide these translations and has support for more than
15 locales.
import { html } from 'lit-html';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import { Required } from '@lion/form-core';
import '@lion/form-core/lion-field.js';
loadDefaultFeedbackMessages();
export default {
title: 'Forms/ValidateMessages',
};
export const main = () =>
html`
<lion-field name="value" label="label" fieldName="value" .validators="${[new Required()]}"
><input slot="input"
/></lion-field>
`;
Features
- Sets default error messages for validators supported by
@lion/form-core
How to use
Installation
npm i --save @lion/validate-messages
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';