- @lion/ajax@0.4.0 - babel-plugin-extend-docs@0.2.0 - @lion/button@0.7.0 - @lion/calendar@0.9.0 - @lion/checkbox-group@0.10.0 - @lion/dialog@0.7.0 - @lion/fieldset@0.13.0 - @lion/form-core@0.1.0 - @lion/form-integrations@0.1.0 - @lion/form@0.6.0 - @lion/icon@0.6.0 - @lion/input-amount@0.7.0 - @lion/input-date@0.7.0 - @lion/input-datepicker@0.14.0 - @lion/input-email@0.8.0 - @lion/input-iban@0.9.0 - @lion/input-range@0.4.0 - @lion/input@0.7.0 - @lion/localize@0.11.0 - @lion/overlays@0.16.0 - @lion/radio-group@0.10.0 - @lion/select-rich@0.18.0 - @lion/select@0.7.0 - @lion/steps@0.5.0 - @lion/switch@0.10.0 - @lion/tabs@0.4.0 - @lion/textarea@0.7.0 - @lion/tooltip@0.11.0 - @lion/validate-messages@0.1.0 |
||
|---|---|---|
| .. | ||
| 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';