1.5.0 • Published 6 years ago

marracash v1.5.0

Weekly downloads
122
License
ISC
Repository
bitbucket
Last release
6 years ago

Marracash

Lightweight & easy to use react currency input component.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

React project

Installing

A step by step series of examples that tell you how to include and use the library in your javascript project

pull the repository to you local machine by running this command

npm i -S marracash

And voila you have the module in your node_modules

you only need to import the module to your project now by doing

//ES6 syntax
import Marracash from 'marracash';
or
//pure js syntax
const Marracash = require('marracash')

To add default component styles

//ES6 syntax
import 'marracash/dist/styles.css';

Usage

<Marracash />
Propsdefinitionrequiredtypedefault value
currencyObject containing precision, symbol, decimal and thousandfalseobject{ decimal: ",", thousand: ".", symbol: "€", precision: 2}
disableddisable or enable the inputfalsebooleanFALSE
showSymbolShow or hide the currency symbolfalsebooleanTRUE
idTo override default idfalsestringvx-price-input
stylesProvide inline styles to input elementfalseobject
placeholderProvide className to input elementfalsestring
classNameProvide placeholder to input elementfalsestring
onChangeFunction that sends back the price entered whenever a change is madefalseFunction0
AllowEmptyAbility to control what happens if price input gets clearedfalsebooleanTRUE
defaultValueDefault value provided to the input element in centsfalsenumber

Running the tests

Automated end to end tests are not yet available

Unit tests

To run a unit test run this command

npm run test:unit

Component tests

To run a unit test run this command

npm run test:cmp

Deployment

For deploying a fix please check with authors.

Built With

  • Accounting - used for formatting money and currency.
  • Mocha - Used for Unit testing.
  • Jest - Used for component testing.

Contributing

Please check with the authors

Versioning

We use npm for versioning

npm version patch/minor/major
1.5.0

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago