This commit is contained in:
Vinícius Moreira
2020-04-13 11:49:28 -03:00
parent 83aab1ff55
commit 01a60ea686
165 changed files with 12778 additions and 6171 deletions

View File

@@ -75,7 +75,8 @@ class SelectViewType(Enum):
class SingleSelectComponent(InputViewComponent):
def __init__(self, type_: SelectViewType, label: str, options: List[InputOption], default_option: InputOption = None,
max_per_line: int = 1, tooltip: str = None, max_width: int = -1, id_: str = None):
max_per_line: int = 1, tooltip: str = None, max_width: int = -1, id_: str = None,
capitalize_label: bool = True):
super(SingleSelectComponent, self).__init__(id_=id_)
self.type = type_
self.label = label
@@ -84,6 +85,7 @@ class SingleSelectComponent(InputViewComponent):
self.max_per_line = max_per_line
self.tooltip = tooltip
self.max_width = max_width
self.capitalize_label = capitalize_label
def get_selected(self):
if self.value:
@@ -119,11 +121,12 @@ class MultipleSelectComponent(InputViewComponent):
class TextComponent(ViewComponent):
def __init__(self, html: str, max_width: int = -1, tooltip: str = None, id_: str = None):
def __init__(self, html: str, max_width: int = -1, tooltip: str = None, id_: str = None, size: int = None):
super(TextComponent, self).__init__(id_=id_)
self.value = html
self.max_width = max_width
self.tooltip = tooltip
self.size = size
class TwoStateButtonComponent(ViewComponent):
@@ -156,8 +159,10 @@ class TextInputComponent(ViewComponent):
def get_int_value(self) -> int:
if self.value is not None:
return int(self.value)
return None
val = self.value.strip() if isinstance(self.value, str) else self.value
if val:
return int(self.value)
class FormComponent(ViewComponent):