- @lion/accordion@0.1.1 - @lion/ajax@0.4.3 - babel-plugin-extend-docs@0.2.2 - @lion/button@0.7.5 - @lion/calendar@0.9.4 - @lion/checkbox-group@0.10.6 - @lion/core@0.7.2 - @lion/dialog@0.7.4 - @lion/fieldset@0.13.6 - @lion/form-core@0.1.6 - @lion/form-integrations@0.1.8 - @lion/form@0.6.6 - @lion/helpers@0.5.2 - @lion/icon@0.6.4 - @lion/input-amount@0.7.6 - @lion/input-date@0.7.6 - @lion/input-datepicker@0.14.6 - @lion/input-email@0.8.6 - @lion/input-iban@0.9.6 - @lion/input-range@0.4.6 - @lion/input@0.7.6 - @lion/localize@0.12.1 - @lion/overlays@0.16.4 - @lion/radio-group@0.10.6 - remark-extend@0.2.1 - @lion/select-rich@0.18.7 - @lion/select@0.7.6 - singleton-manager@1.1.0 - @lion/steps@0.5.3 - @lion/switch@0.10.7 - @lion/tabs@0.4.4 - @lion/textarea@0.7.6 - @lion/tooltip@0.11.4 - @lion/validate-messages@0.1.6 |
||
|---|---|---|
| .. | ||
| 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';