import { Story, Meta, html } from '@open-wc/demoing-storybook'; import { loadDefaultFeedbackMessages } from '@lion/validate'; import { IsCountryIBAN } from '../src/validators.js'; import '../lion-input-iban.js'; # Input IBAN `lion-input-iban` component is based on the generic text input field. Its purpose is to provide a way for users to fill in an IBAN (International Bank Account Number). {() => { loadDefaultFeedbackMessages(); return html` `; }} ```html ``` ## Features - Based on [lion-input](?path=/docs/forms-input--default-story) - Default label in different languages - Makes use of IBAN specific [validate](?path=/docs/forms-validation-overview--page) with corresponding error messages in different languages - IsIBAN (default) - IsCountryIBAN - Parses IBANs automatically - Formats IBANs automatically ## How to use ### Installation ```sh npm i --save @lion/input-amount ``` ```js import '@lion/input-amount/lion-input-amount.js'; ``` ## Examples ### Prefilled {html` `} ```html ``` ### Faulty Prefilled {html` `} ```html ``` ### Country Restrictions By default, we validate the input to ensure the IBAN is valid. To get the default feedback message for this default validator, use `loadDefaultFeedbackMessages` from `@lion/validate`. In the example below, we show how to use an additional validator that restricts the `input-iban` to IBANs from only certain countries. {html` `} ```js import { IsCountryIBAN } from '@lion/input-iban'; ``` ```html ```