0.0.10 • Published 3 years ago

@za-utils/input-number v0.0.10

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Simple number input

Install

npm install @za-utils/input-number

Usage

import InputNumber from '@za-utils/input-number';

const input = document.querySelector('input'); // your input node

const instance = new InputNumber(input); // creating instance

instance.setFixed(8); // can set max decimals precision
instance.setMin(0); // can set min amount value
instance.setMax(1000000000); // can set max amount value

// '12345' => amount (string or number)
// null => caret position (array of 2 items: [0, 1])
// true => save caret position (if current value 1234567890 and your set caret after 5, you can set value 1234567.890 caret will be seted after 5 )
instance.setValue('12345', null, true);

// graceful down
instance.destroy();
0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago