centripetum / toolkit

A component toolkit to be used with the Centripetum platform. https://github.com/orgs/centripetum/projects/1
MIT License
0 stars 0 forks source link

Number field #21

Open reubenberghan opened 5 years ago

reubenberghan commented 5 years ago

This field expects numbers. It should be configurable to permit one or more of the following:

You should be able to set min and/or max values. You might want to allow configuration of the number of decimal places.

ritikasrivastava1509 commented 5 years ago

This number field expects numbers. As user input in this field, it should not allow entering anything leading to non-number.

Acceptance Criteria:

  1. If the entered key is permitted, the state will change: the key will be added to the text string.

  2. The new string will be validated by isNumber, if pass, nothing happens. If not, a visual warning should indicate the string is not a number.

  3. The new string will compare with Max and Min set values. If over the boundary, a visual warning should indicate the Max or Min value that is violated.

walkcoolboy commented 5 years ago

States:

  1. list of permitted characters
  2. current value of the field
  3. warning colour
  4. warning content
walkcoolboy commented 5 years ago

To Do List:

[This Week]

  1. Max and min values are configurable to set boundaries. If min is larger or equal to 0, then the negative sign is removed from the permitted list.

  2. Maximum Decimal places should be configurable as non-negative integers to indicate integer or float. If Maximum Decimal places set to 0, the dot is removed from the permitted list.

~The number field's appearance (font size, style etc) can be customized.~

[Next Week]

  1. The new string will be validated by isNumber, if pass, nothing happens. If not, a visual warning should indicate the string is not a number.

  2. The new string will compare with Max and Min set values. If over the boundary, a visual warning should indicate the Max or Min value that is violated.

  3. The visual warning is configurable, for example, changes the background colour (to red) or a flag displaying ‘not a valid number’