Skip to content

Util

ALL_TEXT_AREA_AUTO_EXPAND_SCRIPT = rx.script('\n const tx = document.getElementsByTagName("textarea");\n for (let i = 0; i < tx.length; i++) {\n tx[i].setAttribute("style", "height:" + (tx[i].scrollHeight) + "px;overflow-y:auto;");\n tx[i].addEventListener("input", OnInput, false);\n }\n\n function OnInput() {\n this.style.height = \'auto\';\n this.style.height = (this.scrollHeight) + "px";\n }\n ') module-attribute

ASSETS_DIR = Path(__file__).parent.parent / 'assets' module-attribute

BaseStateType = TypeVar('BaseStateType', bound=BaseState) module-attribute

CallableHandlerType = LAMBDA_OR_STATE module-attribute

EVENT_HANDLER_TYPES = reflex.event.EventType module-attribute

HandlerType = EventType[BASE_STATE] module-attribute

PossibleVar = T | rx.Var[T] module-attribute

PropertyAttrType = Callable[[], T | rx.Var[T]] module-attribute

REFLEX_UI_DIR = Path(__file__).parent module-attribute

StateAttr = Union[T, rx.Var[T], PropertyAttrType, MutableProxy] module-attribute

StateAttrOnlyType = rx.Var | MutableProxy module-attribute

StateType = TypeVar('StateType', bound=rx.State) module-attribute

T = TypeVar('T') module-attribute

MyState

Bases: State

get_state(state_cls) async

Get instance of state class.

Overriding just for type hinting purposes.

get_state(current, desired) async

load_md_text(filename)

Load the contents of a markdown file by filename.

Note: filename must be unique because this will search through all project directories.

text_area_auto_expand_script(textarea_id)