Skip to content
Merged

V35 #433

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 99 additions & 93 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dash-ag-grid",
"version": "33.3.3",
"version": "35.0.0rc0",
"description": "Dash wrapper around AG Grid, the best interactive data grid for the web.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,9 +34,9 @@
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.7",
"@mui/material": "^5.15.7",
"ag-grid-community": "33.3.2",
"ag-grid-enterprise": "33.3.2",
"ag-grid-react": "33.3.2",
"ag-grid-community": "35.0.0",
"ag-grid-enterprise": "35.0.0",
"ag-grid-react": "35.0.0",
"d3-format": "^3.1.0",
"d3-time": "^3.1.0",
"d3-time-format": "^4.1.0",
Expand Down
13 changes: 12 additions & 1 deletion src/lib/fragments/AgGrid.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
GRID_NESTED_FUNCTIONS,
OBJ_OF_FUNCTIONS,
COLUMN_NESTED_OR_OBJ_OF_FUNCTIONS,
COLUMN_NESTED_OR_OBJ_OF_FUNCTIONS_NO_PARAMS,
PASSTHRU_PROPS,
PROPS_NOT_FOR_AG_GRID,
GRID_DANGEROUS_FUNCTIONS,
Expand Down Expand Up @@ -534,7 +535,11 @@ export function DashAgGrid(props) {
}
}
return map((v) => {
if (typeof v === 'object') {
if (
typeof v === 'object' &&
v !== null &&
!Array.isArray(v)
) {
if (typeof v.function === 'string') {
return convertMaybeFunctionNoParams(v);
}
Expand All @@ -555,6 +560,12 @@ export function DashAgGrid(props) {
}
return convertCol(value);
}
if (COLUMN_NESTED_OR_OBJ_OF_FUNCTIONS_NO_PARAMS[target]) {
if (has('function', value)) {
return convertMaybeFunctionNoParams(value);
}
return convertCol(value);
}
// not one of those categories - pass it straight through
return value;
}, columnDef);
Expand Down
9 changes: 8 additions & 1 deletion src/lib/utils/propCategories.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,19 @@ export const COLUMN_NESTED_FUNCTIONS = {
* or may be functions themselves
**/
export const COLUMN_NESTED_OR_OBJ_OF_FUNCTIONS = {
filterParams: 1,
cellRendererParams: 1,
cellEditorParams: 1,
tooltipComponentParams: 1,
};

/**
* Container objects inside columnDefs that may have other functions
* or may be functions themselves no params passed
**/
export const COLUMN_NESTED_OR_OBJ_OF_FUNCTIONS_NO_PARAMS = {
filterParams: 1,
};

/**
* Container arrays of objects inside columnDefs that may have functions
* inside them, listed in other categories
Expand Down
2 changes: 2 additions & 0 deletions tests/test_cell_value_changed.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,14 @@ def test_cv001_cell_value_changed_multi(dash_duo):
grid.wait_for_cell_text(0, 0, "South Korea")

# Test single event.
grid.get_cell(0, 1).click()
grid.get_cell(0, 1).send_keys("50")
grid.get_cell(1, 2).click()
dash_duo.wait_for_text_to_equal('#log', "1")

# Test multi event.
grid.get_cell(0, 1).send_keys("20")
grid.get_cell_editing_input(0, 2).send_keys("20")
grid.get_cell(0, 2).click()
grid.get_cell(1, 2).click()
dash_duo.wait_for_text_to_equal('#log', "2")
1 change: 1 addition & 0 deletions tests/test_column_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"hide": False,
"pinned": None,
"sort": "asc",
"sortType": "default",
"sortIndex": None,
"aggFunc": None,
"rowGroup": False,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_infinite_scroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ def infinite_scroll(request):
grid.get_header_cell(0).click()
grid.wait_for_cell_text(0, 0, "9999")
grid.get_header_cell(1).click()
grid.wait_for_cell_text(1, 0, "3600")
grid.wait_for_cell_text(0, 1, "0-0-0")
grid.get_header_cell(1).click()
grid.wait_for_cell_text(0, 0, "7263")
grid.wait_for_cell_text(0, 1, "4-6-7")


def test_is002_infinite_scroll_styling(dash_duo):
Expand Down