feat: dropdown combobox option (#2991)

* Removed default variable as true

* added combobox to dropdown

* Fixed types on strRenderComponents

* Added type of combobox

* Created combobox option on backend

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Lucas Oliveira 2024-07-26 14:50:01 -03:00 • committed by GitHub
commit a857868b7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 3 deletions

View file

@ -20,6 +20,7 @@ FIELD_FORMAT_ATTRIBUTES = [
"required",
"list",
"multiline",
"combobox",
"fileTypes",
"password",
"input_types",

View file

@ -141,6 +141,11 @@ class MultilineMixin(BaseModel):
multiline: CoalesceBool = True
class ComboboxMixin(BaseModel):
combobox: CoalesceBool = False
"""Variable that defines if the user can insert custom values in the dropdown."""
class TableMixin(BaseModel):
table_schema: Optional[TableSchema | list[Column]] = None

View file

@ -11,6 +11,7 @@ from .input_mixin import (
BaseInputMixin,
DatabaseLoadMixin,
DropDownMixin,
ComboboxMixin,
FieldTypes,
FileMixin,
InputTraceMixin,
@ -292,7 +293,7 @@ class DictInput(BaseInputMixin, ListableInputMixin, InputTraceMixin):
value: Optional[dict] = {}
class DropdownInput(BaseInputMixin, DropDownMixin, MetadataTraceMixin):
class DropdownInput(BaseInputMixin, DropDownMixin, MetadataTraceMixin, ComboboxMixin):
"""
Represents a dropdown input field.
@ -307,6 +308,7 @@ class DropdownInput(BaseInputMixin, DropDownMixin, MetadataTraceMixin):
field_type: Optional[SerializableFieldTypes] = FieldTypes.TEXT
options: list[str] = Field(default_factory=list)
combobox: CoalesceBool = False
class MultiselectInput(BaseInputMixin, ListableInputMixin, DropDownMixin, MetadataTraceMixin):