2222 path .abspath (path .dirname (path .dirname (__file__ ))), "templates"
2323)
2424
25- LABEL_STYLE = {
26- "fontSize" : "0.875rem" ,
27- "marginBottom" : "0.3333em"
28- }
25+ LABEL_STYLE = {"fontSize" : "0.875rem" , "marginBottom" : "0.3333em" }
2926
3027HEADER_STYLE = {
3128 "fontSize" : "1rem" ,
3229 "fontWeight" : "bold" ,
3330 "margin" : "2rem 0 1rem" ,
3431}
3532
33+
3634def read_localization_yml (file : str , language : str ) -> Dict [str , Any ]:
3735 """Reads localization template.
3836
@@ -119,7 +117,11 @@ def cast_type(val):
119117
120118
121119def create_number_input (
122- idx : str , data : Dict [str , Any ], content : Dict [str , str ], defaults : Parameters
120+ idx : str ,
121+ data : Dict [str , Any ],
122+ content : Dict [str , str ],
123+ defaults : Parameters ,
124+ debounce : bool = True ,
123125):
124126 """Returns number formgroup for given form data.
125127
@@ -128,6 +130,7 @@ def create_number_input(
128130 data: Input form kwargs.
129131 content: Localization text
130132 defaults: Parameters to infer defaults
133+ debounce: Trigger callback on enter or unfocus
131134 """
132135 input_kwargs = data .copy ()
133136 input_kwargs .pop ("percent" , None )
@@ -139,7 +142,7 @@ def create_number_input(
139142 return FormGroup (
140143 children = [
141144 Label (html_for = idx , children = content [idx ], style = LABEL_STYLE ),
142- Input (id = idx , ** input_kwargs ),
145+ Input (id = idx , debounce = debounce , ** input_kwargs ),
143146 ]
144147 )
145148
0 commit comments