Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 6eda2b6

Browse files
committed
Updates for 0.7.1 / react 19
1 parent 4d35dc2 commit 6eda2b6

File tree

5 files changed

+11
-14
lines changed

5 files changed

+11
-14
lines changed

ag_grid_demo/ag_grid_demo/model_dm.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
from typing import Any
23

34
import faker
45
import reflex as rx
@@ -59,7 +60,7 @@ class AuthState(rx.State):
5960
_logged_in: bool = False
6061

6162
@rx.var(cache=True)
62-
def logged_in(self):
63+
def logged_in(self) -> bool:
6364
return self._logged_in
6465

6566
def toggle_login(self):
@@ -94,7 +95,7 @@ def _get_column_defs(self):
9495
col.sortable = False
9596
return cols
9697

97-
async def on_value_setter(self, row_data, field_name, value):
98+
async def on_value_setter(self, row_data: dict[str, Any], field_name: str, value: Any):
9899
auth_state = await self.get_state(AuthState)
99100
if not auth_state.logged_in:
100101
return # no modification for logged out users
@@ -104,7 +105,7 @@ async def _get_data(self, start, end, filter_model, sort_model):
104105
auth_state = await self.get_state(AuthState)
105106
if not auth_state.logged_in:
106107
return [] # no records for logged out users
107-
return super()._get_data(
108+
return await super()._get_data(
108109
start, end, filter_model=filter_model, sort_model=sort_model
109110
)
110111

custom_components/reflex_ag_grid/ag_grid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .datasource import Datasource, SSRMDatasource
1414

1515

16-
AG_GRID_VERSION = "32.1.0"
16+
AG_GRID_VERSION = "32.2.0"
1717

1818

1919
def callback_content(iterable: list[str]) -> str:
@@ -152,7 +152,7 @@ class AGRenderers(SimpleNamespace):
152152
("params",),
153153
rx.link(
154154
rx.Var("params.value"),
155-
href=rx.Var("params.value", _var_type=str),
155+
href=rx.Var("params.value?.toString()", _var_type=str),
156156
target="_blank",
157157
),
158158
)

custom_components/reflex_ag_grid/datasource.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ def _get_rows_function(self) -> str | rx.Var:
4040
"""
4141
% uri
4242
)
43-
return rx.Var.create_safe(
43+
return rx.Var(
4444
js_func.replace("\n", ""),
45-
_var_is_local=False,
46-
_var_is_string=False,
4745
_var_data=rx.vars.VarData(
4846
imports={
4947
"/utils/state": [
@@ -119,10 +117,8 @@ def _get_rows_function(self) -> str | rx.Var:
119117
"""
120118
% uri
121119
)
122-
return rx.Var.create_safe(
120+
return rx.Var(
123121
js_func.replace("\n", ""),
124-
_var_is_local=False,
125-
_var_is_string=False,
126122
_var_data=rx.vars.VarData(
127123
imports={
128124
"/utils/state": [

custom_components/reflex_ag_grid/wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
def _value_setter_signature(
2020
params: rx.Var[dict[str, Any]],
21-
) -> tuple[rx.Var[int], rx.Var[str], rx.Var[Any]]:
21+
) -> tuple[rx.Var[dict[str, Any]], rx.Var[str], rx.Var[Any]]:
2222
return (
2323
params["data"],
2424
params["colDef"].to(dict)["field"],
@@ -280,7 +280,7 @@ def on_selection_changed(self, rows, source, type):
280280
self._selected_items = [self._model_class(**row) for row in rows]
281281

282282
async def on_value_setter(
283-
self, row_data: dict[str, Any], field_name: str, value: Any
283+
self, row_data: dict[str, Any], field_name: str, value: Any,
284284
):
285285
if not await self._is_authorized(
286286
ModelWrapperActionType.UPDATE, row_data | {field_name: value}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "reflex-ag-grid"
7-
version = "0.0.10"
7+
version = "0.0.11"
88
description = "AGGrid wrapping for Reflex"
99
readme = "README.md"
1010
license = { text = "Apache-2.0" }

0 commit comments

Comments
 (0)