Pārlūkot izejas kodu

Add input element addons left/right (#1335)

Alek Petuskey 1 gadu atpakaļ
vecāks
revīzija
f79ba97ce3

+ 2 - 0
reflex/components/__init__.py

@@ -108,6 +108,8 @@ input = Input.create
 input_group = InputGroup.create
 input_left_addon = InputLeftAddon.create
 input_right_addon = InputRightAddon.create
+input_left_element = InputLeftElement.create
+input_right_element = InputRightElement.create
 multi_select = MultiSelect
 multi_select_option = MultiSelectOption
 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 .form import Form, FormControl, FormErrorMessage, FormHelperText, FormLabel
 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 Select as MultiSelect
 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."""
 
     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"