remove some pyright ignores
This commit is contained in:
parent
98dcd3dc7e
commit
1196b5727b
@ -46,10 +46,26 @@ def render_multiple_pages(app, num: int):
|
|||||||
class State(rx.State):
|
class State(rx.State):
|
||||||
"""The app state."""
|
"""The app state."""
|
||||||
|
|
||||||
position: str
|
position: rx.Field[str]
|
||||||
college: str
|
college: rx.Field[str]
|
||||||
age: Tuple[int, int] = (18, 50)
|
age: rx.Field[Tuple[int, int]] = rx.field((18, 50))
|
||||||
salary: Tuple[int, int] = (0, 25000000)
|
salary: rx.Field[Tuple[int, int]] = rx.field((0, 25000000))
|
||||||
|
|
||||||
|
@rx.event
|
||||||
|
def set_position(self, value: str):
|
||||||
|
self.position = value
|
||||||
|
|
||||||
|
@rx.event
|
||||||
|
def set_college(self, value: str):
|
||||||
|
self.college = value
|
||||||
|
|
||||||
|
@rx.event
|
||||||
|
def set_age(self, value: list[int]):
|
||||||
|
self.age = (value[0], value[1])
|
||||||
|
|
||||||
|
@rx.event
|
||||||
|
def set_salary(self, value: list[int]):
|
||||||
|
self.salary = (value[0], value[1])
|
||||||
|
|
||||||
comp1 = rx.center(
|
comp1 = rx.center(
|
||||||
rx.theme_panel(),
|
rx.theme_panel(),
|
||||||
@ -74,13 +90,13 @@ def render_multiple_pages(app, num: int):
|
|||||||
rx.select(
|
rx.select(
|
||||||
["C", "PF", "SF", "PG", "SG"],
|
["C", "PF", "SF", "PG", "SG"],
|
||||||
placeholder="Select a position. (All)",
|
placeholder="Select a position. (All)",
|
||||||
on_change=State.set_position, # pyright: ignore [reportAttributeAccessIssue]
|
on_change=State.set_position,
|
||||||
size="3",
|
size="3",
|
||||||
),
|
),
|
||||||
rx.select(
|
rx.select(
|
||||||
college,
|
college,
|
||||||
placeholder="Select a college. (All)",
|
placeholder="Select a college. (All)",
|
||||||
on_change=State.set_college, # pyright: ignore [reportAttributeAccessIssue]
|
on_change=State.set_college,
|
||||||
size="3",
|
size="3",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -95,7 +111,7 @@ def render_multiple_pages(app, num: int):
|
|||||||
default_value=[18, 50],
|
default_value=[18, 50],
|
||||||
min=18,
|
min=18,
|
||||||
max=50,
|
max=50,
|
||||||
on_value_commit=State.set_age, # pyright: ignore [reportAttributeAccessIssue]
|
on_value_commit=State.set_age,
|
||||||
),
|
),
|
||||||
align_items="left",
|
align_items="left",
|
||||||
width="100%",
|
width="100%",
|
||||||
@ -110,7 +126,7 @@ def render_multiple_pages(app, num: int):
|
|||||||
default_value=[0, 25000000],
|
default_value=[0, 25000000],
|
||||||
min=0,
|
min=0,
|
||||||
max=25000000,
|
max=25000000,
|
||||||
on_value_commit=State.set_salary, # pyright: ignore [reportAttributeAccessIssue]
|
on_value_commit=State.set_salary,
|
||||||
),
|
),
|
||||||
align_items="left",
|
align_items="left",
|
||||||
width="100%",
|
width="100%",
|
||||||
|
@ -20,7 +20,7 @@ def BackgroundTask():
|
|||||||
class State(rx.State):
|
class State(rx.State):
|
||||||
counter: int = 0
|
counter: int = 0
|
||||||
_task_id: int = 0
|
_task_id: int = 0
|
||||||
iterations: int = 10
|
iterations: rx.Field[int] = rx.field(10)
|
||||||
|
|
||||||
@rx.event
|
@rx.event
|
||||||
def set_iterations(self, value: str):
|
def set_iterations(self, value: str):
|
||||||
@ -129,8 +129,8 @@ def BackgroundTask():
|
|||||||
rx.input(
|
rx.input(
|
||||||
id="iterations",
|
id="iterations",
|
||||||
placeholder="Iterations",
|
placeholder="Iterations",
|
||||||
value=State.iterations.to_string(), # pyright: ignore [reportAttributeAccessIssue]
|
value=State.iterations.to_string(),
|
||||||
on_change=State.set_iterations, # pyright: ignore [reportAttributeAccessIssue]
|
on_change=State.set_iterations,
|
||||||
),
|
),
|
||||||
rx.button(
|
rx.button(
|
||||||
"Delayed Increment",
|
"Delayed Increment",
|
||||||
|
Loading…
Reference in New Issue
Block a user