base.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. from typing import Union, Optional
  2. from reflex.components.el.element import Element
  3. from reflex.vars import Var as Var
  4. class BaseHTML(Element):
  5. """Base class for common attributes."""
  6. # Provides a hint for generating a keyboard shortcut for the current element.
  7. access_key: Optional[Var[Union[str, int, bool]]] = None
  8. # Controls whether and how text input is automatically capitalized as it is entered/edited by the user.
  9. auto_capitalize: Optional[Var[Union[str, int, bool]]] = None
  10. # Indicates whether the element's content is editable.
  11. content_editable: Optional[Var[Union[str, int, bool]]] = None
  12. # Defines the ID of a <menu> element which will serve as the element's context menu.
  13. context_menu: Optional[Var[Union[str, int, bool]]] = None
  14. # Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
  15. dir: Optional[Var[Union[str, int, bool]]] = None
  16. # Defines whether the element can be dragged.
  17. draggable: Optional[Var[Union[str, int, bool]]] = None
  18. # Hints what media types the media element is able to play.
  19. enter_key_hint: Optional[Var[Union[str, int, bool]]] = None
  20. # Defines whether the element is hidden.
  21. hidden: Optional[Var[Union[str, int, bool]]] = None
  22. # Defines the type of the element.
  23. input_mode: Optional[Var[Union[str, int, bool]]] = None
  24. # Defines the name of the element for metadata purposes.
  25. item_prop: Optional[Var[Union[str, int, bool]]] = None
  26. # Defines the language used in the element.
  27. lang: Optional[Var[Union[str, int, bool]]] = None
  28. # Defines the role of the element.
  29. role: Optional[Var[Union[str, int, bool]]] = None
  30. # Assigns a slot in a shadow DOM shadow tree to an element.
  31. slot: Optional[Var[Union[str, int, bool]]] = None
  32. # Defines whether the element may be checked for spelling errors.
  33. spell_check: Optional[Var[Union[str, int, bool]]] = None
  34. # Defines the position of the current element in the tabbing order.
  35. tab_index: Optional[Var[Union[str, int, bool]]] = None
  36. # Defines a tooltip for the element.
  37. title: Optional[Var[Union[str, int, bool]]] = None