base.py 1.9 KB

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