mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-06 21:44:16 +02:00
0.9.0
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user