GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
86 stars 25 forks source link

numericFormatter review #1316

Closed dbauszus-glx closed 6 days ago

dbauszus-glx commented 2 weeks ago

The numericFormatter wants to be reviewed. This is not an element method since it doesn't return an element.

This should be moved to the ui.utils.

The numericInput element method should make use of the numericFormatter if configured.

The numeric entry method should not return either a numericInput element without the formatter or a input element with formatter and onFocus, onBlur, handleKeyUp methods defined in the numeric entry method.

dbauszus-glx commented 2 weeks ago

There should be one numericInput element method which returns an element based on the entry argument parameters.

The default for the formatterParams should include a locale [string].

It must be possible to null this.

eg. formatterParams: null in this case no formatting should be applied to the numeric display value.

min/max checks should always apply regardless of formatting.

Formatting should be shown [on]input.

It should be possible to input via key or paste.

It should be possible to input paste a formatted value and retrieve the numeric value from the string.

dbauszus-glx commented 2 weeks ago

From the codeside there should be just one module numericInput which has all the input event methods and does the formatting.

This element module should be called from either tabulator or numeric entry type.