lion/packages/input-amount
2019-11-26 18:00:58 +01:00
..
src fix(input-amount): prefer language while parsing 2019-11-26 18:00:58 +01:00
stories feat: finalize validation and adopt it everywhere 2019-11-18 15:30:08 +01:00
test fix(input-amount): prefer language while parsing 2019-11-26 18:00:58 +01:00
CHANGELOG.md chore: release new versions 2019-11-26 08:39:12 +00:00
index.js feat: release inital public lion version 2019-04-26 10:37:57 +02:00
lion-input-amount.js feat: release inital public lion version 2019-04-26 10:37:57 +02:00
package.json chore: release new versions 2019-11-26 08:39:12 +00:00
README.md feat: finalize validation and adopt it everywhere 2019-11-18 15:30:08 +01:00

Input Amount

lion-input-amount component is based on the generic text input field. Its purpose is to provide a way for users to fill in an amount.

Features

  • based on lion-input
  • makes use of formatNumber for formatting and parsing.
  • option to show currency as a suffix
  • option to override locale to change the formatting and parsing
  • option to provide additional format options overrides
  • default label in different languages
  • can make use of number specific validators with corresponding error messages in different languages
    • IsNumber (default)
    • MinNumber
    • MaxNumber
    • MinMaxNumber

How to use

Installation

npm i --save @lion/input-amount
import '@lion/input-amount/lion-input-amount.js';

// validator import example
import { Required, MinNumber } from '@lion/validate';

Example

<lion-input-amount
  name="amount"
  currency="USD"
  .validators="${[new Required(), new MinNumber(100)]}"
></lion-input-amount>