scottlogic / finput Goto Github PK
View Code? Open in Web Editor NEWA vanilla-JS financial amount input control
Home Page: http://scottlogic.github.io/finput
License: MIT License
A vanilla-JS financial amount input control
Home Page: http://scottlogic.github.io/finput
License: MIT License
If I select 6,000,000 and hit the letter K, I expect the value to be 1,000 rather than 6,000,000,000.
When you have an entire selection, the native behaviour is to replace that selection with whatever value is entered.
Reproduction Steps:
When I attempt to insert a pound symbol (shift key + number 3) the number 3 is inserted into the input field.
Instead, nothing should be entered into the input field as the £ key is invalid.
This is also the case for other shift-key related special characters
It would be nice to get the E2E tests running on various browsers, using browserstack
Some users do not want the field to select the entire text on focus, provide a configuration option to turn this behaviour off
At the moment we use a combination of grunt and npm scripts. Might be nicer to have a consistent approach so we only need to use one command line tool when developing testing (see running tests).
When i focus in on the input field and press f5 my refresh is blocked since preventDefault blocks all keypresses rather than just ones that would affect the field value.
https://github.com/semantic-release/semantic-release
See d3fc for an example
E.g. currently missing GitHub details
E.g.
k => 000
m => 000000
b => 000000000
See title...
Would give more appropriate on-screen keyboard, if the component user specified that on the input. Or use the step attribute for the up/down arrow native behaviour.
However, that type doesn't support selections so at the moment it gives an error.
When entering digits into particular numbers, the caret position is shifted to an incorrect location.
Example
Note: | symbolises caret position
Just a simple getting started and the API from #21.
Rather than callbacks
Can we get a new build including #35 released to npm plz?
I think this is because we manually check to see if ctrl key is pressed before preventing defaults.
When fixing this we should look at the 10 tests that fail on macOS. They all specify the use of the ctrl key. I guess we either need to select modifier key based on the OS or come up with a more generic way to do this (use right click menu?).
Specifically Android 7.1.1
Steps to reproduce:
The amount control should support cut/copy/paste actions by the user.
Requirements:
Some feedback needs to be given when the user is blocked from adding invalid input.
Possibly a very small vertical/horizontal shake? Some investigation will be needed to see what other things out there do!
It would be nice if there was a manual function call to allow for setting of options at a later date, without having to tear down and recreating a finput
. This would be useful if, for example, you are displaying an amount in relation to a currency pair (so the number of decimals is pertinent). If the user then changes a currency pair, this could result in the number of decimals needing to be changed.
A simple setOptions
would suffice :)
I want to enter 12
I press 1
The input formats immediately, resulting in "1.00" with the cursor at the end
In Chrome/FF, formatting only happens when I leave the field.
Steps to reproduce:
Some clients wish to observe when the user attempts to add an invalid character into finput.
An API endpoint should be exposed to allow clients to easily listen in on when such an event occurs.
They should have the flexibility to handle this event however they wish (e.g. shake animation).
Using chrome 47.0.2526.80 and e.key is not defined.
i want to be able to do nothing on focus or pass in a function to do whatever i want
e.g. selecting just the first digit
Just follow the formatting conventions defined by the API.
Sign up for an opensource account and add the normal folk to the account
The amount control should allow the user to drag and drop values into/out of the input field.
Leave this up to users.
Restrictions
scale
attempts to modify value to have more decimals digits than this are ignored default 2
range
-
all
no restriction defaultpositive
attempts to enter a negative value are ignoredFormatting
fixed
after focus is lost -
true
value is formatted to scale
number of decimals defaultfalse
to leave as entereddecimal
the character used for the decimal point default .
thousands
the separator used for thousands default ,
Other
shortcuts
object of character
to multiplier
default { k: 1000, m: 1000000, b: 1000000000 }
The amount control should support the usage of the following deletion methods:
Pressing the backspace key should remove the previous digit or skip over the previous delimiter
Pressing the delete key should remove the digit ahead of it, or skip over the delimiter ahead
Release process is currently outdated and opaque
Just to run the build
Pressing the up/down arrow on the keyboard should increment/decrement the amount in the field by one
The finput github page (http://scottlogic.github.io/finput/) is looking rather basic and still states it is maintained by Ali at the bottom.
Give this page a new lick of paint and update any relevant outdated areas
Cleanup obsolete code
Different countries use different thousands and decimal delimiters.
Steps to reproduce:
Just a nice consistent way of adding documentation.
The amount control should support a user performing the undo/redo action
We should look at investigating updating our development dependencies to see what benefits it would provide
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.