@mui/x-data-grid 9.7.0 → 9.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +249 -1
- package/DataGrid/DataGrid.js +7 -0
- package/DataGrid/DataGrid.mjs +7 -0
- package/components/GridColumnSortButton.d.mts +1 -1
- package/components/GridColumnSortButton.d.ts +1 -1
- package/components/GridColumnUnsortedIcon.d.mts +2 -1
- package/components/GridColumnUnsortedIcon.d.ts +2 -1
- package/components/GridHeader.d.mts +2 -1
- package/components/GridHeader.d.ts +2 -1
- package/components/GridHeaders.d.mts +1 -1
- package/components/GridHeaders.d.ts +1 -1
- package/components/GridPagination.d.mts +2 -1
- package/components/GridPagination.d.ts +2 -1
- package/components/GridRowDragAndDropOverlay.d.mts +1 -1
- package/components/GridRowDragAndDropOverlay.d.ts +1 -1
- package/components/GridScrollArea.d.mts +2 -1
- package/components/GridScrollArea.d.ts +2 -1
- package/components/GridScrollShadows.d.mts +2 -1
- package/components/GridScrollShadows.d.ts +2 -1
- package/components/GridScrollbarFillerCell.d.mts +1 -1
- package/components/GridScrollbarFillerCell.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.d.mts +1 -1
- package/components/base/GridFooterPlaceholder.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.js +1 -1
- package/components/base/GridFooterPlaceholder.mjs +1 -1
- package/components/base/GridOverlays.d.mts +1 -1
- package/components/base/GridOverlays.d.ts +1 -1
- package/components/cell/GridActionsCell.d.mts +2 -2
- package/components/cell/GridActionsCell.d.ts +2 -2
- package/components/cell/GridActionsCellItem.js +1 -58
- package/components/cell/GridActionsCellItem.mjs +1 -58
- package/components/cell/GridBooleanCell.d.mts +1 -1
- package/components/cell/GridBooleanCell.d.ts +1 -1
- package/components/cell/GridEditBooleanCell.d.mts +2 -2
- package/components/cell/GridEditBooleanCell.d.ts +2 -2
- package/components/cell/GridEditDateCell.d.mts +2 -2
- package/components/cell/GridEditDateCell.d.ts +2 -2
- package/components/cell/GridEditInputCell.d.mts +1 -1
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditLongTextCell.d.mts +2 -2
- package/components/cell/GridEditLongTextCell.d.ts +2 -2
- package/components/cell/GridEditSingleSelectCell.d.mts +3 -2
- package/components/cell/GridEditSingleSelectCell.d.ts +3 -2
- package/components/cell/GridFooterCell.d.mts +1 -1
- package/components/cell/GridFooterCell.d.ts +1 -1
- package/components/cell/GridLongTextCell.d.mts +2 -2
- package/components/cell/GridLongTextCell.d.ts +2 -2
- package/components/cell/GridSkeletonCell.d.mts +1 -1
- package/components/cell/GridSkeletonCell.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.mts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.mts +1 -1
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
- package/components/columnsManagement/GridColumnsManagement.d.mts +2 -1
- package/components/columnsManagement/GridColumnsManagement.d.ts +2 -1
- package/components/menu/GridMenu.d.mts +1 -1
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.mts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.mts +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -1
- package/components/panel/GridColumnsPanel.d.mts +1 -1
- package/components/panel/GridColumnsPanel.d.ts +1 -1
- package/components/panel/GridPanelContent.d.mts +1 -1
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContext.d.mts +1 -1
- package/components/panel/GridPanelContext.d.ts +1 -1
- package/components/panel/GridPanelFooter.d.mts +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelHeader.d.mts +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.d.mts +1 -1
- package/components/panel/GridPreferencesPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.d.mts +1 -98
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -98
- package/components/panel/filterPanel/GridFilterForm.js +9 -355
- package/components/panel/filterPanel/GridFilterForm.mjs +8 -354
- package/components/panel/filterPanel/GridFilterFormBase.d.mts +119 -0
- package/components/panel/filterPanel/GridFilterFormBase.d.ts +119 -0
- package/components/panel/filterPanel/GridFilterFormBase.js +497 -0
- package/components/panel/filterPanel/GridFilterFormBase.mjs +491 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputDate.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +21 -9
- package/components/panel/filterPanel/GridFilterInputDate.mjs +21 -9
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +6 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +6 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +6 -1
- package/components/panel/filterPanel/GridFilterInputValue.d.mts +2 -1
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +19 -8
- package/components/panel/filterPanel/GridFilterInputValue.mjs +19 -8
- package/components/panel/filterPanel/GridFilterPanel.d.mts +3 -40
- package/components/panel/filterPanel/GridFilterPanel.d.ts +3 -40
- package/components/panel/filterPanel/GridFilterPanel.js +19 -174
- package/components/panel/filterPanel/GridFilterPanel.mjs +14 -173
- package/components/panel/filterPanel/GridFilterPanelBase.d.mts +79 -0
- package/components/panel/filterPanel/GridFilterPanelBase.d.ts +79 -0
- package/components/panel/filterPanel/GridFilterPanelBase.js +304 -0
- package/components/panel/filterPanel/GridFilterPanelBase.mjs +297 -0
- package/components/panel/filterPanel/index.d.mts +3 -1
- package/components/panel/filterPanel/index.d.ts +3 -1
- package/components/panel/filterPanel/index.js +9 -1
- package/components/panel/filterPanel/index.mjs +3 -0
- package/components/quickFilter/QuickFilter.d.mts +1 -1
- package/components/quickFilter/QuickFilter.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.d.mts +2 -2
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarQuickFilter.d.mts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.d.ts +1 -1
- package/components/toolbarV8/GridToolbar.d.mts +3 -3
- package/components/toolbarV8/GridToolbar.d.ts +3 -3
- package/components/virtualization/GridBottomContainer.d.mts +1 -1
- package/components/virtualization/GridBottomContainer.d.ts +1 -1
- package/components/virtualization/GridTopContainer.d.mts +1 -1
- package/components/virtualization/GridTopContainer.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.d.mts +1 -1
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerFiller.d.mts +2 -1
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +2 -1
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/constants/dataGridPropsDefaultValues.mjs +1 -0
- package/context/GridContextProvider.d.mts +1 -1
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.mts +2 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +2 -2
- package/hooks/features/dataSource/useGridDataSourceBase.d.mts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +39 -10
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +39 -10
- package/hooks/features/editing/useGridCellEditing.js +14 -7
- package/hooks/features/editing/useGridCellEditing.mjs +14 -7
- package/hooks/features/filter/gridFilterUtils.d.mts +12 -0
- package/hooks/features/filter/gridFilterUtils.d.ts +12 -0
- package/hooks/features/filter/gridFilterUtils.js +56 -1
- package/hooks/features/filter/gridFilterUtils.mjs +52 -0
- package/hooks/features/filter/useGridFilter.js +4 -35
- package/hooks/features/filter/useGridFilter.mjs +5 -36
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/rows/gridRowsUtils.mjs +1 -1
- package/hooks/utils/useGridEvent.js +1 -1
- package/hooks/utils/useGridEvent.mjs +1 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/demo/TailwindDemoContainer.d.mts +1 -1
- package/internals/demo/TailwindDemoContainer.d.ts +1 -1
- package/locales/jaJP.js +4 -5
- package/locales/jaJP.mjs +4 -5
- package/models/gridFilterInputComponent.d.mts +5 -0
- package/models/gridFilterInputComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.mts +1 -1
- package/models/gridSlotsComponentsProps.d.ts +1 -1
- package/models/props/DataGridProps.d.mts +7 -0
- package/models/props/DataGridProps.d.ts +7 -0
- package/package.json +4 -4
- package/utils/css/context.d.mts +3 -3
- package/utils/css/context.d.ts +3 -3
|
@@ -5,6 +5,58 @@ import { GridLogicOperator } from "../../../models/index.mjs";
|
|
|
5
5
|
import { getDefaultGridFilterModel } from "./gridFilterState.mjs";
|
|
6
6
|
import { getPublicApiRef } from "../../../utils/getPublicApiRef.mjs";
|
|
7
7
|
import { gridColumnFieldsSelector, gridColumnLookupSelector, gridColumnVisibilityModelSelector } from "../columns/index.mjs";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Pure helpers computing a new filter model from an existing one.
|
|
11
|
+
* Shared by the imperative `apiRef` methods (`useGridFilter`) and the controlled
|
|
12
|
+
* filter panel (`GridFilterPanelBase`) so both paths produce identical models.
|
|
13
|
+
* Each helper returns the same model reference when nothing changes, so callers
|
|
14
|
+
* relying on referential equality can skip no-op updates.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export const upsertFilterItemInModel = (model, item) => {
|
|
18
|
+
const items = [...model.items];
|
|
19
|
+
const itemIndex = items.findIndex(filterItem => filterItem.id === item.id);
|
|
20
|
+
if (itemIndex === -1) {
|
|
21
|
+
items.push(item);
|
|
22
|
+
} else {
|
|
23
|
+
items[itemIndex] = item;
|
|
24
|
+
}
|
|
25
|
+
return _extends({}, model, {
|
|
26
|
+
items
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export const upsertFilterItemsInModel = (model, itemsToUpsert) => {
|
|
30
|
+
const items = [...model.items];
|
|
31
|
+
itemsToUpsert.forEach(item => {
|
|
32
|
+
const itemIndex = items.findIndex(filterItem => filterItem.id === item.id);
|
|
33
|
+
if (itemIndex === -1) {
|
|
34
|
+
items.push(item);
|
|
35
|
+
} else {
|
|
36
|
+
items[itemIndex] = item;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return _extends({}, model, {
|
|
40
|
+
items
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
export const deleteFilterItemFromModel = (model, itemToDelete) => {
|
|
44
|
+
const items = model.items.filter(item => item.id !== itemToDelete.id);
|
|
45
|
+
if (items.length === model.items.length) {
|
|
46
|
+
return model;
|
|
47
|
+
}
|
|
48
|
+
return _extends({}, model, {
|
|
49
|
+
items
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
export const setFilterLogicOperatorInModel = (model, logicOperator) => {
|
|
53
|
+
if (model.logicOperator === logicOperator) {
|
|
54
|
+
return model;
|
|
55
|
+
}
|
|
56
|
+
return _extends({}, model, {
|
|
57
|
+
logicOperator
|
|
58
|
+
});
|
|
59
|
+
};
|
|
8
60
|
let hasEval;
|
|
9
61
|
function getHasEval() {
|
|
10
62
|
if (hasEval !== undefined) {
|
|
@@ -89,41 +89,15 @@ const useGridFilter = (apiRef, props, configuration) => {
|
|
|
89
89
|
*/
|
|
90
90
|
const upsertFilterItem = React.useCallback(item => {
|
|
91
91
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
92
|
-
|
|
93
|
-
const itemIndex = items.findIndex(filterItem => filterItem.id === item.id);
|
|
94
|
-
if (itemIndex === -1) {
|
|
95
|
-
items.push(item);
|
|
96
|
-
} else {
|
|
97
|
-
items[itemIndex] = item;
|
|
98
|
-
}
|
|
99
|
-
apiRef.current.setFilterModel((0, _extends2.default)({}, filterModel, {
|
|
100
|
-
items
|
|
101
|
-
}), 'upsertFilterItem');
|
|
92
|
+
apiRef.current.setFilterModel((0, _gridFilterUtils.upsertFilterItemInModel)(filterModel, item), 'upsertFilterItem');
|
|
102
93
|
}, [apiRef]);
|
|
103
94
|
const upsertFilterItems = React.useCallback(items => {
|
|
104
95
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
105
|
-
|
|
106
|
-
items.forEach(item => {
|
|
107
|
-
const itemIndex = existingItems.findIndex(filterItem => filterItem.id === item.id);
|
|
108
|
-
if (itemIndex === -1) {
|
|
109
|
-
existingItems.push(item);
|
|
110
|
-
} else {
|
|
111
|
-
existingItems[itemIndex] = item;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
apiRef.current.setFilterModel((0, _extends2.default)({}, filterModel, {
|
|
115
|
-
items: existingItems
|
|
116
|
-
}), 'upsertFilterItems');
|
|
96
|
+
apiRef.current.setFilterModel((0, _gridFilterUtils.upsertFilterItemsInModel)(filterModel, items), 'upsertFilterItems');
|
|
117
97
|
}, [apiRef]);
|
|
118
98
|
const deleteFilterItem = React.useCallback(itemToDelete => {
|
|
119
99
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
120
|
-
|
|
121
|
-
if (items.length === filterModel.items.length) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
apiRef.current.setFilterModel((0, _extends2.default)({}, filterModel, {
|
|
125
|
-
items
|
|
126
|
-
}), 'deleteFilterItem');
|
|
100
|
+
apiRef.current.setFilterModel((0, _gridFilterUtils.deleteFilterItemFromModel)(filterModel, itemToDelete), 'deleteFilterItem');
|
|
127
101
|
}, [apiRef]);
|
|
128
102
|
const showFilterPanel = React.useCallback((targetColumnField, panelId, labelId) => {
|
|
129
103
|
logger.debug('Displaying filter panel');
|
|
@@ -178,12 +152,7 @@ const useGridFilter = (apiRef, props, configuration) => {
|
|
|
178
152
|
}, [apiRef, logger]);
|
|
179
153
|
const setFilterLogicOperator = React.useCallback(logicOperator => {
|
|
180
154
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
181
|
-
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
apiRef.current.setFilterModel((0, _extends2.default)({}, filterModel, {
|
|
185
|
-
logicOperator
|
|
186
|
-
}), 'changeLogicOperator');
|
|
155
|
+
apiRef.current.setFilterModel((0, _gridFilterUtils.setFilterLogicOperatorInModel)(filterModel, logicOperator), 'changeLogicOperator');
|
|
187
156
|
}, [apiRef]);
|
|
188
157
|
const setQuickFilterValues = React.useCallback(values => {
|
|
189
158
|
const filterModel = (0, _gridFilterSelector.gridFilterModelSelector)(apiRef);
|
|
@@ -15,7 +15,7 @@ import { useFirstRender } from "../../utils/useFirstRender.mjs";
|
|
|
15
15
|
import { gridRowsLookupSelector } from "../rows/index.mjs";
|
|
16
16
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
17
17
|
import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from "../../core/strategyProcessing/index.mjs";
|
|
18
|
-
import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns } from "./gridFilterUtils.mjs";
|
|
18
|
+
import { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel, cleanFilterItem, passFilterLogic, shouldQuickFilterExcludeHiddenColumns, upsertFilterItemInModel, upsertFilterItemsInModel, deleteFilterItemFromModel, setFilterLogicOperatorInModel } from "./gridFilterUtils.mjs";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
export const filterStateInitializer = (state, props, apiRef) => {
|
|
21
21
|
const filterModel = props.filterModel ?? props.initialState?.filter?.filterModel ?? getDefaultGridFilterModel();
|
|
@@ -80,41 +80,15 @@ export const useGridFilter = (apiRef, props, configuration) => {
|
|
|
80
80
|
*/
|
|
81
81
|
const upsertFilterItem = React.useCallback(item => {
|
|
82
82
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
83
|
-
|
|
84
|
-
const itemIndex = items.findIndex(filterItem => filterItem.id === item.id);
|
|
85
|
-
if (itemIndex === -1) {
|
|
86
|
-
items.push(item);
|
|
87
|
-
} else {
|
|
88
|
-
items[itemIndex] = item;
|
|
89
|
-
}
|
|
90
|
-
apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
91
|
-
items
|
|
92
|
-
}), 'upsertFilterItem');
|
|
83
|
+
apiRef.current.setFilterModel(upsertFilterItemInModel(filterModel, item), 'upsertFilterItem');
|
|
93
84
|
}, [apiRef]);
|
|
94
85
|
const upsertFilterItems = React.useCallback(items => {
|
|
95
86
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
96
|
-
|
|
97
|
-
items.forEach(item => {
|
|
98
|
-
const itemIndex = existingItems.findIndex(filterItem => filterItem.id === item.id);
|
|
99
|
-
if (itemIndex === -1) {
|
|
100
|
-
existingItems.push(item);
|
|
101
|
-
} else {
|
|
102
|
-
existingItems[itemIndex] = item;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
106
|
-
items: existingItems
|
|
107
|
-
}), 'upsertFilterItems');
|
|
87
|
+
apiRef.current.setFilterModel(upsertFilterItemsInModel(filterModel, items), 'upsertFilterItems');
|
|
108
88
|
}, [apiRef]);
|
|
109
89
|
const deleteFilterItem = React.useCallback(itemToDelete => {
|
|
110
90
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
111
|
-
|
|
112
|
-
if (items.length === filterModel.items.length) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
116
|
-
items
|
|
117
|
-
}), 'deleteFilterItem');
|
|
91
|
+
apiRef.current.setFilterModel(deleteFilterItemFromModel(filterModel, itemToDelete), 'deleteFilterItem');
|
|
118
92
|
}, [apiRef]);
|
|
119
93
|
const showFilterPanel = React.useCallback((targetColumnField, panelId, labelId) => {
|
|
120
94
|
logger.debug('Displaying filter panel');
|
|
@@ -169,12 +143,7 @@ export const useGridFilter = (apiRef, props, configuration) => {
|
|
|
169
143
|
}, [apiRef, logger]);
|
|
170
144
|
const setFilterLogicOperator = React.useCallback(logicOperator => {
|
|
171
145
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
172
|
-
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
176
|
-
logicOperator
|
|
177
|
-
}), 'changeLogicOperator');
|
|
146
|
+
apiRef.current.setFilterModel(setFilterLogicOperatorInModel(filterModel, logicOperator), 'changeLogicOperator');
|
|
178
147
|
}, [apiRef]);
|
|
179
148
|
const setQuickFilterValues = React.useCallback(values => {
|
|
180
149
|
const filterModel = gridFilterModelSelector(apiRef);
|
|
@@ -155,7 +155,7 @@ const isAutogeneratedRowNode = rowNode => rowNode.type === 'skeletonRow' || rowN
|
|
|
155
155
|
exports.isAutogeneratedRowNode = isAutogeneratedRowNode;
|
|
156
156
|
const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows, directChildrenOnly) => {
|
|
157
157
|
const node = tree[parentId];
|
|
158
|
-
if (node
|
|
158
|
+
if (node?.type !== 'group') {
|
|
159
159
|
return [];
|
|
160
160
|
}
|
|
161
161
|
const validDescendants = [];
|
|
@@ -137,7 +137,7 @@ export const isAutogeneratedRow = row => GRID_ID_AUTOGENERATED in row;
|
|
|
137
137
|
export const isAutogeneratedRowNode = rowNode => rowNode.type === 'skeletonRow' || rowNode.type === 'footer' || rowNode.type === 'group' && rowNode.isAutoGenerated || rowNode.type === 'pinnedRow' && rowNode.isAutoGenerated;
|
|
138
138
|
export const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows, directChildrenOnly) => {
|
|
139
139
|
const node = tree[parentId];
|
|
140
|
-
if (node
|
|
140
|
+
if (node?.type !== 'group') {
|
|
141
141
|
return [];
|
|
142
142
|
}
|
|
143
143
|
const validDescendants = [];
|
|
@@ -13,7 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _TimerBasedCleanupTracking = require("../../utils/cleanupTracking/TimerBasedCleanupTracking");
|
|
14
14
|
var _FinalizationRegistryBasedCleanupTracking = require("../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking");
|
|
15
15
|
// Based on https://github.com/Bnaya/use-dispose-uncommitted/blob/main/src/finalization-registry-based-impl.ts
|
|
16
|
-
// Check https://github.com/
|
|
16
|
+
// Check https://github.com/react/react/issues/15317 to get more information
|
|
17
17
|
|
|
18
18
|
// We use class to make it easier to detect in heap snapshots by name
|
|
19
19
|
class ObjectToBeRetainedByReact {
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { TimerBasedCleanupTracking } from "../../utils/cleanupTracking/TimerBasedCleanupTracking.mjs";
|
|
5
5
|
import { FinalizationRegistryBasedCleanupTracking } from "../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.mjs";
|
|
6
6
|
// Based on https://github.com/Bnaya/use-dispose-uncommitted/blob/main/src/finalization-registry-based-impl.ts
|
|
7
|
-
// Check https://github.com/
|
|
7
|
+
// Check https://github.com/react/react/issues/15317 to get more information
|
|
8
8
|
|
|
9
9
|
// We use class to make it easier to detect in heap snapshots by name
|
|
10
10
|
class ObjectToBeRetainedByReact {
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -7,5 +7,5 @@ interface TailwindDemoContainerProps {
|
|
|
7
7
|
* WARNING: This is an internal component used in documentation to inject the Tailwind script.
|
|
8
8
|
* Please do not use it in your application.
|
|
9
9
|
*/
|
|
10
|
-
export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
10
|
+
export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
11
11
|
export {};
|
|
@@ -7,5 +7,5 @@ interface TailwindDemoContainerProps {
|
|
|
7
7
|
* WARNING: This is an internal component used in documentation to inject the Tailwind script.
|
|
8
8
|
* Please do not use it in your application.
|
|
9
9
|
*/
|
|
10
|
-
export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> |
|
|
10
|
+
export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
11
11
|
export {};
|
package/locales/jaJP.js
CHANGED
|
@@ -10,8 +10,8 @@ const jaJPGrid = {
|
|
|
10
10
|
// Root
|
|
11
11
|
noRowsLabel: '行がありません。',
|
|
12
12
|
noResultsOverlayLabel: '結果がありません。',
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
noColumnsOverlayLabel: '列がありません。',
|
|
14
|
+
noColumnsOverlayManageColumns: '列管理',
|
|
15
15
|
// emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
|
|
16
16
|
|
|
17
17
|
// Density selector toolbar button text
|
|
@@ -56,8 +56,7 @@ const jaJPGrid = {
|
|
|
56
56
|
columnsManagementNoColumns: 'カラムなし',
|
|
57
57
|
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
58
58
|
columnsManagementReset: 'リセット',
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
columnsManagementDeleteIconLabel: 'クリア',
|
|
61
60
|
// Filter panel text
|
|
62
61
|
filterPanelAddFilter: 'フィルター追加',
|
|
63
62
|
filterPanelRemoveAll: 'すべて削除',
|
|
@@ -120,7 +119,7 @@ const jaJPGrid = {
|
|
|
120
119
|
filterValueFalse: '偽',
|
|
121
120
|
// Column menu text
|
|
122
121
|
columnMenuLabel: 'メニュー',
|
|
123
|
-
|
|
122
|
+
columnMenuAriaLabel: columnName => `${columnName} 列メニュー`,
|
|
124
123
|
columnMenuShowColumns: '列表示',
|
|
125
124
|
columnMenuManageColumns: '列管理',
|
|
126
125
|
columnMenuFilter: 'フィルター',
|
package/locales/jaJP.mjs
CHANGED
|
@@ -4,8 +4,8 @@ const jaJPGrid = {
|
|
|
4
4
|
// Root
|
|
5
5
|
noRowsLabel: '行がありません。',
|
|
6
6
|
noResultsOverlayLabel: '結果がありません。',
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
noColumnsOverlayLabel: '列がありません。',
|
|
8
|
+
noColumnsOverlayManageColumns: '列管理',
|
|
9
9
|
// emptyPivotOverlayLabel: 'Add fields to rows, columns, and values to create a pivot table',
|
|
10
10
|
|
|
11
11
|
// Density selector toolbar button text
|
|
@@ -50,8 +50,7 @@ const jaJPGrid = {
|
|
|
50
50
|
columnsManagementNoColumns: 'カラムなし',
|
|
51
51
|
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
52
52
|
columnsManagementReset: 'リセット',
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
columnsManagementDeleteIconLabel: 'クリア',
|
|
55
54
|
// Filter panel text
|
|
56
55
|
filterPanelAddFilter: 'フィルター追加',
|
|
57
56
|
filterPanelRemoveAll: 'すべて削除',
|
|
@@ -114,7 +113,7 @@ const jaJPGrid = {
|
|
|
114
113
|
filterValueFalse: '偽',
|
|
115
114
|
// Column menu text
|
|
116
115
|
columnMenuLabel: 'メニュー',
|
|
117
|
-
|
|
116
|
+
columnMenuAriaLabel: columnName => `${columnName} 列メニュー`,
|
|
118
117
|
columnMenuShowColumns: '列表示',
|
|
119
118
|
columnMenuManageColumns: '列管理',
|
|
120
119
|
columnMenuFilter: 'フィルター',
|
|
@@ -26,6 +26,11 @@ export type GridFilterInputValueProps<T extends GridFilterInputSlotProps = GridF
|
|
|
26
26
|
tabIndex?: number;
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, filter value changes are applied immediately without debouncing.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disableDebounce?: boolean;
|
|
29
34
|
slotProps?: {
|
|
30
35
|
root: T;
|
|
31
36
|
};
|
|
@@ -26,6 +26,11 @@ export type GridFilterInputValueProps<T extends GridFilterInputSlotProps = GridF
|
|
|
26
26
|
tabIndex?: number;
|
|
27
27
|
disabled?: boolean;
|
|
28
28
|
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, filter value changes are applied immediately without debouncing.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
disableDebounce?: boolean;
|
|
29
34
|
slotProps?: {
|
|
30
35
|
root: T;
|
|
31
36
|
};
|
|
@@ -3,7 +3,7 @@ import type { GridToolbarProps } from "../components/toolbar/GridToolbar.mjs";
|
|
|
3
3
|
import type { ColumnHeaderFilterIconButtonProps } from "../components/columnHeaders/GridColumnHeaderFilterIconButton.mjs";
|
|
4
4
|
import type { GridColumnMenuProps } from "../components/menu/columnMenu/GridColumnMenuProps.mjs";
|
|
5
5
|
import type { GridColumnsPanelProps } from "../components/panel/GridColumnsPanel.mjs";
|
|
6
|
-
import type { GridFilterPanelProps } from "../components/panel/filterPanel/
|
|
6
|
+
import type { GridFilterPanelProps } from "../components/panel/filterPanel/GridFilterPanelBase.mjs";
|
|
7
7
|
import type { GridFooterContainerProps } from "../components/containers/GridFooterContainer.mjs";
|
|
8
8
|
import type { GridOverlayProps } from "../components/containers/GridOverlay.mjs";
|
|
9
9
|
import type { GridPanelProps } from "../components/panel/GridPanel.mjs";
|
|
@@ -3,7 +3,7 @@ import type { GridToolbarProps } from "../components/toolbar/GridToolbar.js";
|
|
|
3
3
|
import type { ColumnHeaderFilterIconButtonProps } from "../components/columnHeaders/GridColumnHeaderFilterIconButton.js";
|
|
4
4
|
import type { GridColumnMenuProps } from "../components/menu/columnMenu/GridColumnMenuProps.js";
|
|
5
5
|
import type { GridColumnsPanelProps } from "../components/panel/GridColumnsPanel.js";
|
|
6
|
-
import type { GridFilterPanelProps } from "../components/panel/filterPanel/
|
|
6
|
+
import type { GridFilterPanelProps } from "../components/panel/filterPanel/GridFilterPanelBase.js";
|
|
7
7
|
import type { GridFooterContainerProps } from "../components/containers/GridFooterContainer.js";
|
|
8
8
|
import type { GridOverlayProps } from "../components/containers/GridOverlay.js";
|
|
9
9
|
import type { GridPanelProps } from "../components/panel/GridPanel.js";
|
|
@@ -341,6 +341,13 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
341
341
|
* @default 0
|
|
342
342
|
*/
|
|
343
343
|
dataSourceRevalidateMs: number;
|
|
344
|
+
/**
|
|
345
|
+
* If `true`, the previously displayed rows are kept visible while new rows are being fetched after pagination, sorting, or filtering changes.
|
|
346
|
+
* The loading overlay is rendered on top of the previous rows.
|
|
347
|
+
* Only applies to flat data; tree data and row grouping always reset the rows on refetch to keep the order consistent with the new response.
|
|
348
|
+
* @default false
|
|
349
|
+
*/
|
|
350
|
+
dataSourceKeepPreviousData: boolean;
|
|
344
351
|
/**
|
|
345
352
|
* If `true`, reordering columns is disabled.
|
|
346
353
|
* @default false
|
|
@@ -341,6 +341,13 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
|
|
|
341
341
|
* @default 0
|
|
342
342
|
*/
|
|
343
343
|
dataSourceRevalidateMs: number;
|
|
344
|
+
/**
|
|
345
|
+
* If `true`, the previously displayed rows are kept visible while new rows are being fetched after pagination, sorting, or filtering changes.
|
|
346
|
+
* The loading overlay is rendered on top of the previous rows.
|
|
347
|
+
* Only applies to flat data; tree data and row grouping always reset the rows on refetch to keep the order consistent with the new response.
|
|
348
|
+
* @default false
|
|
349
|
+
*/
|
|
350
|
+
dataSourceKeepPreviousData: boolean;
|
|
344
351
|
/**
|
|
345
352
|
* If `true`, reordering columns is disabled.
|
|
346
353
|
* @default false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Community plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.29.7",
|
|
41
41
|
"@base-ui/utils": "^0.3.0",
|
|
42
|
-
"@mui/utils": "^9.
|
|
42
|
+
"@mui/utils": "^9.2.0",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"prop-types": "^15.8.1",
|
|
45
45
|
"use-sync-external-store": "^1.6.0",
|
|
46
|
-
"@mui/x-internals": "^9.
|
|
47
|
-
"@mui/x-virtualizer": "0.
|
|
46
|
+
"@mui/x-internals": "^9.9.0",
|
|
47
|
+
"@mui/x-virtualizer": "0.6.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@emotion/react": "^11.9.0",
|
package/utils/css/context.d.mts
CHANGED
|
@@ -2,13 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
export declare function useCSSVariablesClass(): string;
|
|
3
3
|
export declare function useCSSVariablesContext(): {
|
|
4
4
|
className: string;
|
|
5
|
-
tag:
|
|
5
|
+
tag: React.JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
export declare function GridPortalWrapper({
|
|
8
8
|
children
|
|
9
9
|
}: {
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
}):
|
|
11
|
+
}): React.JSX.Element;
|
|
12
12
|
export declare function GridCSSVariablesContext(props: {
|
|
13
13
|
children: any;
|
|
14
|
-
}):
|
|
14
|
+
}): React.JSX.Element;
|
package/utils/css/context.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import * as React from 'react';
|
|
|
2
2
|
export declare function useCSSVariablesClass(): string;
|
|
3
3
|
export declare function useCSSVariablesContext(): {
|
|
4
4
|
className: string;
|
|
5
|
-
tag:
|
|
5
|
+
tag: React.JSX.Element;
|
|
6
6
|
};
|
|
7
7
|
export declare function GridPortalWrapper({
|
|
8
8
|
children
|
|
9
9
|
}: {
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
}):
|
|
11
|
+
}): React.JSX.Element;
|
|
12
12
|
export declare function GridCSSVariablesContext(props: {
|
|
13
13
|
children: any;
|
|
14
|
-
}):
|
|
14
|
+
}): React.JSX.Element;
|