Add NumericInputWidget for use with Buefy themes

uses a Vue.js component for better logic encapsulation
This commit is contained in:
Lance Edgar 2019-06-28 13:06:43 -05:00
parent 2abe589ef6
commit 3a53ffcc23
4 changed files with 66 additions and 0 deletions

View file

@ -58,6 +58,18 @@ class NumberInputWidget(dfwidget.TextInputWidget):
autocomplete = 'off'
class NumericInputWidget(NumberInputWidget):
"""
This widget only supports Buefy themes for now. It uses a
``<numeric-input>`` component, which will leverage the ``numeric.js``
functions to ensure user doesn't enter any non-numeric values. Note that
this still uses a normal "text" input on the HTML side, as opposed to a
"number" input, since the latter is a bit ugly IMHO.
"""
template = 'numericinput'
allow_enter = True
class PercentInputWidget(dfwidget.TextInputWidget):
"""
Custom text input widget, used for "percent" type fields. This widget