Spaces:
Running
on
Zero
Running
on
Zero
File size: 656 Bytes
4487e5c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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.
""" |