PEEB / utils /old_gradio_class.py
Peijie's picture
add deprecated gradio class
4487e5c
raw
history blame
656 Bytes
from gradio.helpers import EventData
from gradio.blocks import Block
from typing import Any
class SelectData(EventData):
def __init__(self, target: Block | None, data: Any):
super().__init__(target, data)
self.index: int | tuple[int, int] = data["index"]
"""
The index of the selected item. Is a tuple if the component is two dimensional or selection is a range.
"""
self.value: Any = data["value"]
"""
The value of the selected item.
"""
self.selected: bool = data.get("selected", True)
"""
True if the item was selected, False if deselected.
"""