- @lion/ajax@0.4.2 - @lion/button@0.7.3 - @lion/calendar@0.9.2 - @lion/checkbox-group@0.10.2 - @lion/core@0.7.1 - @lion/dialog@0.7.2 - @lion/fieldset@0.13.2 - @lion/form-core@0.1.2 - @lion/form-integrations@0.1.4 - @lion/form@0.6.2 - @lion/helpers@0.5.1 - @lion/icon@0.6.2 - @lion/input-amount@0.7.2 - @lion/input-date@0.7.2 - @lion/input-datepicker@0.14.2 - @lion/input-email@0.8.2 - @lion/input-iban@0.9.2 - @lion/input-range@0.4.2 - @lion/input@0.7.2 - @lion/localize@0.11.2 - @lion/overlays@0.16.2 - @lion/radio-group@0.10.2 - @lion/select-rich@0.18.3 - @lion/select@0.7.2 - @lion/steps@0.5.2 - @lion/switch@0.10.3 - @lion/tabs@0.4.2 - @lion/textarea@0.7.2 - @lion/tooltip@0.11.2 - @lion/validate-messages@0.1.2 |
||
|---|---|---|
| .. | ||
| 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';