Преглед на файлове

Add input element addons left/right (#1335)

Alek Petuskey преди 1 година
родител
ревизия
f79ba97ce3
променени са 3 файла, в които са добавени 22 реда и са изтрити 1 реда
  1. 2 0
      reflex/components/__init__.py
  2. 8 1
      reflex/components/forms/__init__.py
  3. 12 0
      reflex/components/forms/input.py

+ 2 - 0
reflex/components/__init__.py

@@ -108,6 +108,8 @@ input = Input.create
 input_group = InputGroup.create
 input_group = InputGroup.create
 input_left_addon = InputLeftAddon.create
 input_left_addon = InputLeftAddon.create
 input_right_addon = InputRightAddon.create
 input_right_addon = InputRightAddon.create
+input_left_element = InputLeftElement.create
+input_right_element = InputRightElement.create
 multi_select = MultiSelect
 multi_select = MultiSelect
 multi_select_option = MultiSelectOption
 multi_select_option = MultiSelectOption
 number_decrement_stepper = NumberDecrementStepper.create
 number_decrement_stepper = NumberDecrementStepper.create

+ 8 - 1
reflex/components/forms/__init__.py

@@ -15,7 +15,14 @@ from .editable import Editable, EditableInput, EditablePreview, EditableTextarea
 from .email import Email
 from .email import Email
 from .form import Form, FormControl, FormErrorMessage, FormHelperText, FormLabel
 from .form import Form, FormControl, FormErrorMessage, FormHelperText, FormLabel
 from .iconbutton import IconButton
 from .iconbutton import IconButton
-from .input import Input, InputGroup, InputLeftAddon, InputRightAddon
+from .input import (
+    Input,
+    InputGroup,
+    InputLeftAddon,
+    InputLeftElement,
+    InputRightAddon,
+    InputRightElement,
+)
 from .multiselect import Option as MultiSelectOption
 from .multiselect import Option as MultiSelectOption
 from .multiselect import Select as MultiSelect
 from .multiselect import Select as MultiSelect
 from .numberinput import (
 from .numberinput import (

+ 12 - 0
reflex/components/forms/input.py

@@ -86,3 +86,15 @@ class InputRightAddon(ChakraComponent):
     """The InputRightAddon component is a component that is used to add an addon to the right of an input."""
     """The InputRightAddon component is a component that is used to add an addon to the right of an input."""
 
 
     tag = "InputRightAddon"
     tag = "InputRightAddon"
+
+
+class InputLeftElement(ChakraComponent):
+    """The InputLeftElement component is a component that is used to add an element to the left of an input."""
+
+    tag = "InputLeftElement"
+
+
+class InputRightElement(ChakraComponent):
+    """The InputRightElement component is a component that is used to add an element to the right of an input."""
+
+    tag = "InputRightElement"