@mui/x-data-grid 8.0.0-alpha.3 → 8.0.0-alpha.5
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 +377 -0
- package/DataGrid/DataGrid.js +7 -11
- package/DataGrid/useDataGridProps.js +3 -3
- package/README.md +1 -1
- package/components/GridRow.js +13 -2
- package/components/cell/GridActionsCell.js +8 -1
- package/components/cell/GridActionsCellItem.js +4 -6
- package/components/cell/GridCell.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanelContent.js +7 -3
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +4 -3
- package/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
- package/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/components/virtualization/GridMainContainer.js +1 -1
- package/constants/dataGridPropsDefaultValues.js +1 -1
- package/hooks/core/useGridStateInitialization.js +3 -3
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/filter/useGridFilter.js +1 -1
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/overlays/useGridOverlays.js +3 -1
- package/hooks/features/pagination/gridPaginationSelector.d.ts +15 -9
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/hooks/features/rowSelection/utils.d.ts +1 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/hooks/features/rows/gridRowsSelector.d.ts +23 -12
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/hooks/features/rows/useGridRows.js +5 -5
- package/hooks/features/sorting/gridSortingSelector.d.ts +10 -5
- package/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/hooks/features/sorting/index.d.ts +2 -1
- package/hooks/features/sorting/index.js +1 -1
- package/hooks/features/sorting/useGridSorting.js +1 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/hooks/utils/useGridSelector.d.ts +4 -6
- package/hooks/utils/useGridSelector.js +6 -44
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/locales/koKR.js +45 -49
- package/locales/roRO.js +18 -20
- package/material/index.js +30 -4
- package/models/api/gridStateApi.d.ts +1 -1
- package/models/controlStateItem.d.ts +2 -2
- package/models/gridBaseSlots.d.ts +21 -0
- package/models/gridBaseSlots.js +1 -0
- package/models/gridSlotsComponentsProps.d.ts +25 -5
- package/models/props/DataGridProps.d.ts +1 -6
- package/modern/DataGrid/DataGrid.js +7 -11
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/components/GridRow.js +13 -2
- package/modern/components/cell/GridActionsCell.js +8 -1
- package/modern/components/cell/GridActionsCellItem.js +4 -6
- package/modern/components/cell/GridCell.js +1 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/modern/components/panel/GridColumnsPanel.js +1 -2
- package/modern/components/panel/GridPanelContent.js +7 -3
- package/modern/components/panel/GridPanelFooter.js +4 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/modern/components/virtualization/GridMainContainer.js +1 -1
- package/modern/constants/dataGridPropsDefaultValues.js +1 -1
- package/modern/hooks/core/useGridStateInitialization.js +3 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/filter/useGridFilter.js +1 -1
- package/modern/hooks/features/overlays/useGridOverlays.js +3 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/modern/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/modern/hooks/features/rows/useGridRows.js +5 -5
- package/modern/hooks/features/sorting/gridSortingSelector.js +11 -0
- package/modern/hooks/features/sorting/index.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/modern/hooks/utils/useGridSelector.js +6 -44
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/internals/utils/index.js +0 -1
- package/modern/locales/koKR.js +45 -49
- package/modern/locales/roRO.js +18 -20
- package/modern/material/index.js +30 -4
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/utils/createSelector.js +1 -120
- package/node/DataGrid/DataGrid.js +7 -11
- package/node/DataGrid/useDataGridProps.js +2 -2
- package/node/components/GridRow.js +13 -2
- package/node/components/cell/GridActionsCell.js +8 -1
- package/node/components/cell/GridActionsCellItem.js +3 -5
- package/node/components/cell/GridCell.js +1 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/node/components/panel/GridColumnsPanel.js +1 -2
- package/node/components/panel/GridPanelContent.js +7 -3
- package/node/components/panel/GridPanelFooter.js +5 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +15 -15
- package/node/components/toolbar/GridToolbarDensitySelector.js +3 -5
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -0
- package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/node/components/virtualization/GridMainContainer.js +1 -1
- package/node/constants/dataGridPropsDefaultValues.js +1 -1
- package/node/hooks/core/useGridStateInitialization.js +3 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/filter/useGridFilter.js +1 -1
- package/node/hooks/features/overlays/useGridOverlays.js +3 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +5 -4
- package/node/hooks/features/rows/useGridRowSpanning.js +16 -8
- package/node/hooks/features/rows/useGridRows.js +5 -5
- package/node/hooks/features/sorting/gridSortingSelector.js +12 -1
- package/node/hooks/features/sorting/index.js +24 -16
- package/node/hooks/features/sorting/useGridSorting.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
- package/node/hooks/utils/useGridSelector.js +8 -47
- package/node/index.js +1 -1
- package/node/internals/index.js +8 -22
- package/node/internals/utils/index.js +0 -11
- package/node/locales/koKR.js +45 -49
- package/node/locales/roRO.js +18 -20
- package/node/material/index.js +31 -4
- package/node/models/gridBaseSlots.js +5 -0
- package/node/utils/createSelector.js +4 -125
- package/package.json +2 -2
- package/utils/createSelector.d.ts +4 -16
- package/utils/createSelector.js +1 -120
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
|
@@ -38,7 +38,7 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
38
38
|
style: props.style,
|
|
39
39
|
sx: props.sx,
|
|
40
40
|
ref: ref
|
|
41
|
-
}, props.
|
|
41
|
+
}, props.slotProps?.root, {
|
|
42
42
|
children: [/*#__PURE__*/_jsx(GridHeader, {}), /*#__PURE__*/_jsx(GridBody, {}), /*#__PURE__*/_jsx(GridFooterPlaceholder, {})]
|
|
43
43
|
}))
|
|
44
44
|
});
|
|
@@ -95,6 +95,7 @@ DataGridRaw.propTypes = {
|
|
|
95
95
|
*/
|
|
96
96
|
autosizeOptions: PropTypes.shape({
|
|
97
97
|
columns: PropTypes.arrayOf(PropTypes.string),
|
|
98
|
+
disableColumnVirtualization: PropTypes.bool,
|
|
98
99
|
expand: PropTypes.bool,
|
|
99
100
|
includeHeaders: PropTypes.bool,
|
|
100
101
|
includeOutliers: PropTypes.bool,
|
|
@@ -248,11 +249,6 @@ DataGridRaw.propTypes = {
|
|
|
248
249
|
quickFilterLogicOperator: PropTypes.oneOf(['and', 'or']),
|
|
249
250
|
quickFilterValues: PropTypes.array
|
|
250
251
|
}),
|
|
251
|
-
/**
|
|
252
|
-
* Forwarded props for the Data Grid root element.
|
|
253
|
-
* @ignore - do not document.
|
|
254
|
-
*/
|
|
255
|
-
forwardedProps: PropTypes.object,
|
|
256
252
|
/**
|
|
257
253
|
* Function that applies CSS classes dynamically on cells.
|
|
258
254
|
* @param {GridCellParams} params With all properties from [[GridCellParams]].
|
|
@@ -701,6 +697,11 @@ DataGridRaw.propTypes = {
|
|
|
701
697
|
* @default "margin"
|
|
702
698
|
*/
|
|
703
699
|
rowSpacingType: PropTypes.oneOf(['border', 'margin']),
|
|
700
|
+
/**
|
|
701
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
702
|
+
* @default false
|
|
703
|
+
*/
|
|
704
|
+
rowSpanning: PropTypes.bool,
|
|
704
705
|
/**
|
|
705
706
|
* Override the height/width of the Data Grid inner scrollbar.
|
|
706
707
|
*/
|
|
@@ -746,11 +747,6 @@ DataGridRaw.propTypes = {
|
|
|
746
747
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
747
748
|
*/
|
|
748
749
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
749
|
-
/**
|
|
750
|
-
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
751
|
-
* @default false
|
|
752
|
-
*/
|
|
753
|
-
unstable_rowSpanning: PropTypes.bool,
|
|
754
750
|
/**
|
|
755
751
|
* If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
|
|
756
752
|
* By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useThemeProps } from '@mui/material/styles';
|
|
4
4
|
import { GRID_DEFAULT_LOCALE_TEXT } from "../constants/index.js";
|
|
5
5
|
import { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
|
|
6
|
-
import { computeSlots
|
|
6
|
+
import { computeSlots } from "../internals/utils/index.js";
|
|
7
7
|
import { DATA_GRID_PROPS_DEFAULT_VALUES } from "../constants/dataGridPropsDefaultValues.js";
|
|
8
8
|
const DATA_GRID_FORCED_PROPS = {
|
|
9
9
|
disableMultipleColumnsFiltering: true,
|
|
@@ -19,12 +19,12 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
19
19
|
};
|
|
20
20
|
const defaultSlots = DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
21
21
|
export const useDataGridProps = inProps => {
|
|
22
|
-
const themedProps =
|
|
22
|
+
const themedProps =
|
|
23
23
|
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
24
24
|
useThemeProps({
|
|
25
25
|
props: inProps,
|
|
26
26
|
name: 'MuiDataGrid'
|
|
27
|
-
})
|
|
27
|
+
});
|
|
28
28
|
const localeText = React.useMemo(() => _extends({}, GRID_DEFAULT_LOCALE_TEXT, themedProps.localeText), [themedProps.localeText]);
|
|
29
29
|
const slots = React.useMemo(() => computeSlots({
|
|
30
30
|
defaultSlots,
|
|
@@ -25,6 +25,7 @@ import { GridScrollbarFillerCell as ScrollbarFiller } from "./GridScrollbarFille
|
|
|
25
25
|
import { getPinnedCellOffset } from "../internals/utils/getPinnedCellOffset.js";
|
|
26
26
|
import { useGridConfiguration } from "../hooks/utils/useGridConfiguration.js";
|
|
27
27
|
import { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
28
|
+
import { gridVirtualizationColumnEnabledSelector } from "../hooks/index.js";
|
|
28
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
30
|
const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
30
31
|
const {
|
|
@@ -68,6 +69,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
68
69
|
const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
|
|
69
70
|
const editing = apiRef.current.getRowMode(rowId) === GridRowModes.Edit;
|
|
70
71
|
const editable = rootProps.editMode === GridEditModes.Row;
|
|
72
|
+
const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
71
73
|
const hasFocusCell = focusedColumnIndex !== undefined;
|
|
72
74
|
const hasVirtualFocusCellLeft = hasFocusCell && focusedColumnIndex >= pinnedColumns.left.length && focusedColumnIndex < renderContext.firstColumnIndex;
|
|
73
75
|
const hasVirtualFocusCellRight = hasFocusCell && focusedColumnIndex < visibleColumns.length - pinnedColumns.right.length && focusedColumnIndex >= renderContext.lastColumnIndex;
|
|
@@ -144,7 +146,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
144
146
|
disableColumnReorder
|
|
145
147
|
} = rootProps;
|
|
146
148
|
const rowReordering = rootProps.rowReordering;
|
|
147
|
-
const heightEntry = useGridSelector(apiRef, () => _extends({}, apiRef.current.getRowHeightEntry(rowId)), objectShallowCompare);
|
|
149
|
+
const heightEntry = useGridSelector(apiRef, () => _extends({}, apiRef.current.getRowHeightEntry(rowId)), undefined, objectShallowCompare);
|
|
148
150
|
const style = React.useMemo(() => {
|
|
149
151
|
if (isNotVisible) {
|
|
150
152
|
return {
|
|
@@ -249,7 +251,16 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
249
251
|
if (hasVirtualFocusCellLeft) {
|
|
250
252
|
cells.push(getCell(visibleColumns[focusedColumnIndex], focusedColumnIndex - pinnedColumns.left.length, focusedColumnIndex, middleColumnsLength, PinnedPosition.VIRTUAL));
|
|
251
253
|
}
|
|
252
|
-
|
|
254
|
+
let firstColumnIndex;
|
|
255
|
+
let lastColumnIndex;
|
|
256
|
+
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
257
|
+
firstColumnIndex = 0;
|
|
258
|
+
lastColumnIndex = visibleColumns.length;
|
|
259
|
+
} else {
|
|
260
|
+
firstColumnIndex = renderContext.firstColumnIndex;
|
|
261
|
+
lastColumnIndex = renderContext.lastColumnIndex;
|
|
262
|
+
}
|
|
263
|
+
for (let i = firstColumnIndex; i < lastColumnIndex; i += 1) {
|
|
253
264
|
const column = visibleColumns[i];
|
|
254
265
|
const indexInSection = i - pinnedColumns.left.length;
|
|
255
266
|
if (!column) {
|
|
@@ -89,6 +89,13 @@ function GridActionsCell(props) {
|
|
|
89
89
|
const hideMenu = () => {
|
|
90
90
|
setOpen(false);
|
|
91
91
|
};
|
|
92
|
+
const toggleMenu = () => {
|
|
93
|
+
if (open) {
|
|
94
|
+
hideMenu();
|
|
95
|
+
} else {
|
|
96
|
+
showMenu();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
92
99
|
const handleTouchRippleRef = index => instance => {
|
|
93
100
|
touchRippleRefs.current[index] = instance;
|
|
94
101
|
};
|
|
@@ -159,7 +166,7 @@ function GridActionsCell(props) {
|
|
|
159
166
|
"aria-controls": open ? menuId : undefined,
|
|
160
167
|
role: "menuitem",
|
|
161
168
|
size: "small",
|
|
162
|
-
onClick:
|
|
169
|
+
onClick: toggleMenu,
|
|
163
170
|
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
164
171
|
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
165
172
|
}, rootProps.slotProps?.baseIconButton, {
|
|
@@ -4,9 +4,8 @@ const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
|
4
4
|
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
8
7
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
-
import { jsx as _jsx
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
9
|
const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
10
|
const rootProps = useGridRootProps();
|
|
12
11
|
if (!props.showInMenu) {
|
|
@@ -46,13 +45,12 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
46
45
|
closeMenu?.();
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({
|
|
50
49
|
ref: ref
|
|
51
50
|
}, other, {
|
|
52
51
|
onClick: handleClick,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}), label]
|
|
52
|
+
iconStart: icon,
|
|
53
|
+
children: label
|
|
56
54
|
}));
|
|
57
55
|
});
|
|
58
56
|
process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
|
|
@@ -120,7 +120,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
120
120
|
const result = apiRef.current.getCellParams(rowId, field);
|
|
121
121
|
result.api = apiRef.current;
|
|
122
122
|
return result;
|
|
123
|
-
}, objectShallowCompare);
|
|
123
|
+
}, undefined, objectShallowCompare);
|
|
124
124
|
const isSelected = useGridSelector(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
125
125
|
id: rowId,
|
|
126
126
|
field
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
6
4
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
7
|
-
import { jsx as _jsx
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
function GridColumnMenuFilterItem(props) {
|
|
9
7
|
const {
|
|
10
8
|
colDef,
|
|
@@ -19,15 +17,12 @@ function GridColumnMenuFilterItem(props) {
|
|
|
19
17
|
if (rootProps.disableColumnFilter || !colDef.filterable) {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
23
21
|
onClick: showFilter,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
29
|
-
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
30
|
-
})]
|
|
22
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuFilterIcon, {
|
|
23
|
+
fontSize: "small"
|
|
24
|
+
}),
|
|
25
|
+
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
process.env.NODE_ENV !== "production" ? GridColumnMenuFilterItem.propTypes = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
6
4
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
7
5
|
import { gridVisibleColumnDefinitionsSelector } from "../../../../hooks/features/columns/index.js";
|
|
8
|
-
import { jsx as _jsx
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
function GridColumnMenuHideItem(props) {
|
|
10
8
|
const {
|
|
11
9
|
colDef,
|
|
@@ -35,16 +33,13 @@ function GridColumnMenuHideItem(props) {
|
|
|
35
33
|
if (colDef.hideable === false) {
|
|
36
34
|
return null;
|
|
37
35
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
39
37
|
onClick: toggleColumn,
|
|
40
38
|
disabled: disabled,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
46
|
-
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
47
|
-
})]
|
|
39
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuHideIcon, {
|
|
40
|
+
fontSize: "small"
|
|
41
|
+
}),
|
|
42
|
+
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
45
|
process.env.NODE_ENV !== "production" ? GridColumnMenuHideItem.propTypes = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { GridPreferencePanelsValue } from "../../../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
6
4
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
7
5
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
8
|
-
import { jsx as _jsx
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
function GridColumnMenuManageItem(props) {
|
|
10
8
|
const {
|
|
11
9
|
onClick
|
|
@@ -19,15 +17,12 @@ function GridColumnMenuManageItem(props) {
|
|
|
19
17
|
if (rootProps.disableColumnSelector) {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
23
21
|
onClick: showColumns,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
29
|
-
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
30
|
-
})]
|
|
22
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuManageColumnsIcon, {
|
|
23
|
+
fontSize: "small"
|
|
24
|
+
}),
|
|
25
|
+
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
process.env.NODE_ENV !== "production" ? GridColumnMenuManageItem.propTypes = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridSelector } from "../../../../hooks/utils/useGridSelector.js";
|
|
6
4
|
import { gridSortModelSelector } from "../../../../hooks/features/sorting/gridSortingSelector.js";
|
|
7
5
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
@@ -36,31 +34,24 @@ function GridColumnMenuSortItem(props) {
|
|
|
36
34
|
return typeof label === 'function' ? label(colDef) : label;
|
|
37
35
|
};
|
|
38
36
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
39
|
-
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/
|
|
37
|
+
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
40
38
|
onClick: onSortMenuItemClick,
|
|
41
39
|
"data-value": "asc",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
children: getLabel('columnMenuSortAsc')
|
|
48
|
-
})]
|
|
49
|
-
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
|
|
40
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortAscendingIcon, {
|
|
41
|
+
fontSize: "small"
|
|
42
|
+
}),
|
|
43
|
+
children: getLabel('columnMenuSortAsc')
|
|
44
|
+
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
50
45
|
onClick: onSortMenuItemClick,
|
|
51
46
|
"data-value": "desc",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children: getLabel('columnMenuSortDesc')
|
|
58
|
-
})]
|
|
59
|
-
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
|
|
47
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortDescendingIcon, {
|
|
48
|
+
fontSize: "small"
|
|
49
|
+
}),
|
|
50
|
+
children: getLabel('columnMenuSortDesc')
|
|
51
|
+
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
60
52
|
onClick: onSortMenuItemClick,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})]
|
|
53
|
+
iconStart: "",
|
|
54
|
+
children: apiRef.current.getLocaleText('columnMenuUnsort')
|
|
64
55
|
}) : null]
|
|
65
56
|
});
|
|
66
57
|
}
|
|
@@ -2,13 +2,12 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { GridPanelWrapper } from "./GridPanelWrapper.js";
|
|
5
|
-
import { GridColumnsManagement } from "../columnsManagement/index.js";
|
|
6
5
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
function GridColumnsPanel(props) {
|
|
9
8
|
const rootProps = useGridRootProps();
|
|
10
9
|
return /*#__PURE__*/_jsx(GridPanelWrapper, _extends({}, props, {
|
|
11
|
-
children: /*#__PURE__*/_jsx(
|
|
10
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnsManagement, _extends({}, rootProps.slotProps?.columnsManagement))
|
|
12
11
|
}));
|
|
13
12
|
}
|
|
14
13
|
process.env.NODE_ENV !== "production" ? GridColumnsPanel.propTypes = {
|
|
@@ -22,13 +22,17 @@ const GridPanelContentRoot = styled('div', {
|
|
|
22
22
|
name: 'MuiDataGrid',
|
|
23
23
|
slot: 'PanelContent',
|
|
24
24
|
overridesResolver: (props, styles) => styles.panelContent
|
|
25
|
-
})({
|
|
25
|
+
})(({
|
|
26
|
+
theme
|
|
27
|
+
}) => ({
|
|
26
28
|
display: 'flex',
|
|
27
29
|
flexDirection: 'column',
|
|
28
30
|
overflow: 'auto',
|
|
29
31
|
flex: '1 1',
|
|
30
|
-
maxHeight: 400
|
|
31
|
-
|
|
32
|
+
maxHeight: 400,
|
|
33
|
+
padding: theme.spacing(2.5, 1.5, 2, 1),
|
|
34
|
+
gap: theme.spacing(2.5)
|
|
35
|
+
}));
|
|
32
36
|
function GridPanelContent(props) {
|
|
33
37
|
const {
|
|
34
38
|
className
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/material/styles';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
9
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -25,9 +25,10 @@ const GridPanelFooterRoot = styled('div', {
|
|
|
25
25
|
})(({
|
|
26
26
|
theme
|
|
27
27
|
}) => ({
|
|
28
|
-
padding: theme.spacing(
|
|
28
|
+
padding: theme.spacing(1),
|
|
29
29
|
display: 'flex',
|
|
30
|
-
justifyContent: 'space-between'
|
|
30
|
+
justifyContent: 'space-between',
|
|
31
|
+
borderTop: `1px solid ${theme.palette.divider}`
|
|
31
32
|
}));
|
|
32
33
|
function GridPanelFooter(props) {
|
|
33
34
|
const {
|
|
@@ -39,27 +39,22 @@ const GridFilterFormRoot = styled('div', {
|
|
|
39
39
|
theme
|
|
40
40
|
}) => ({
|
|
41
41
|
display: 'flex',
|
|
42
|
-
|
|
42
|
+
gap: theme.spacing(1.5)
|
|
43
43
|
}));
|
|
44
44
|
const FilterFormDeleteIcon = styled('div', {
|
|
45
45
|
name: 'MuiDataGrid',
|
|
46
46
|
slot: 'FilterFormDeleteIcon',
|
|
47
47
|
overridesResolver: (_, styles) => styles.filterFormDeleteIcon
|
|
48
|
-
})(
|
|
49
|
-
theme
|
|
50
|
-
}) => ({
|
|
48
|
+
})({
|
|
51
49
|
flexShrink: 0,
|
|
52
|
-
justifyContent: '
|
|
53
|
-
|
|
54
|
-
marginBottom: theme.spacing(0.2)
|
|
55
|
-
}));
|
|
50
|
+
justifyContent: 'center'
|
|
51
|
+
});
|
|
56
52
|
const FilterFormLogicOperatorInput = styled('div', {
|
|
57
53
|
name: 'MuiDataGrid',
|
|
58
54
|
slot: 'FilterFormLogicOperatorInput',
|
|
59
55
|
overridesResolver: (_, styles) => styles.filterFormLogicOperatorInput
|
|
60
56
|
})({
|
|
61
|
-
minWidth:
|
|
62
|
-
marginRight: 5,
|
|
57
|
+
minWidth: 75,
|
|
63
58
|
justifyContent: 'end'
|
|
64
59
|
});
|
|
65
60
|
const FilterFormColumnInput = styled('div', {
|
|
@@ -261,7 +256,6 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
261
256
|
ownerState: rootProps
|
|
262
257
|
}, other, {
|
|
263
258
|
children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({
|
|
264
|
-
variant: "standard",
|
|
265
259
|
as: rootProps.slots.baseFormControl
|
|
266
260
|
}, baseFormControlProps, deleteIconProps, {
|
|
267
261
|
className: clsx(classes.deleteIcon, baseFormControlProps.className, deleteIconProps.className),
|
|
@@ -278,7 +272,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
278
272
|
})
|
|
279
273
|
}))
|
|
280
274
|
})), /*#__PURE__*/_jsx(FilterFormLogicOperatorInput, _extends({
|
|
281
|
-
variant: "
|
|
275
|
+
variant: "outlined",
|
|
276
|
+
size: "small",
|
|
282
277
|
as: rootProps.slots.baseFormControl
|
|
283
278
|
}, baseFormControlProps, logicOperatorInputProps, {
|
|
284
279
|
sx: [hasLogicOperatorColumn ? {
|
|
@@ -308,7 +303,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
308
303
|
}), apiRef.current.getLocaleText(getLogicOperatorLocaleKey(logicOperator))))
|
|
309
304
|
}))
|
|
310
305
|
})), /*#__PURE__*/_jsxs(FilterFormColumnInput, _extends({
|
|
311
|
-
variant: "
|
|
306
|
+
variant: "outlined",
|
|
307
|
+
size: "small",
|
|
312
308
|
as: rootProps.slots.baseFormControl
|
|
313
309
|
}, baseFormControlProps, columnInputProps, {
|
|
314
310
|
className: clsx(classes.columnInput, baseFormControlProps.className, columnInputProps.className),
|
|
@@ -333,7 +329,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
333
329
|
}), getColumnLabel(col)))
|
|
334
330
|
}))]
|
|
335
331
|
})), /*#__PURE__*/_jsxs(FilterFormOperatorInput, _extends({
|
|
336
|
-
variant: "
|
|
332
|
+
variant: "outlined",
|
|
333
|
+
size: "small",
|
|
337
334
|
as: rootProps.slots.baseFormControl
|
|
338
335
|
}, baseFormControlProps, operatorInputProps, {
|
|
339
336
|
className: clsx(classes.operatorInput, baseFormControlProps.className, operatorInputProps.className),
|
|
@@ -359,12 +356,15 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
359
356
|
}), operator.label || apiRef.current.getLocaleText(`filterOperator${capitalize(operator.value)}`)))
|
|
360
357
|
}))]
|
|
361
358
|
})), /*#__PURE__*/_jsx(FilterFormValueInput, _extends({
|
|
362
|
-
variant: "
|
|
359
|
+
variant: "outlined",
|
|
360
|
+
size: "small",
|
|
363
361
|
as: rootProps.slots.baseFormControl
|
|
364
362
|
}, baseFormControlProps, valueInputPropsOther, {
|
|
365
363
|
className: clsx(classes.valueInput, baseFormControlProps.className, valueInputPropsOther.className),
|
|
366
364
|
ownerState: rootProps,
|
|
367
365
|
children: currentOperator?.InputComponent ? /*#__PURE__*/_jsx(currentOperator.InputComponent, _extends({
|
|
366
|
+
variant: "outlined",
|
|
367
|
+
size: "small",
|
|
368
368
|
apiRef: apiRef,
|
|
369
369
|
item: item,
|
|
370
370
|
applyValue: applyFilterChanges,
|
|
@@ -2,7 +2,6 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
5
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
6
5
|
import { gridDensitySelector } from "../../hooks/features/density/densitySelector.js";
|
|
7
6
|
import { isHideMenuKey } from "../../utils/keyboardUtils.js";
|
|
8
7
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
@@ -72,12 +71,11 @@ const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridTo
|
|
|
72
71
|
if (rootProps.disableDensitySelector) {
|
|
73
72
|
return null;
|
|
74
73
|
}
|
|
75
|
-
const densityElements = densityOptions.map((option, index) => /*#__PURE__*/
|
|
74
|
+
const densityElements = densityOptions.map((option, index) => /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
76
75
|
onClick: () => handleDensityUpdate(option.value),
|
|
77
76
|
selected: option.value === density,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}), option.label]
|
|
77
|
+
iconStart: option.icon,
|
|
78
|
+
children: option.label
|
|
81
79
|
}, index));
|
|
82
80
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
83
81
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
@@ -31,6 +31,9 @@ const GridToolbarFilterListRoot = styled('ul', {
|
|
|
31
31
|
margin: theme.spacing(1, 1, 0.5),
|
|
32
32
|
padding: theme.spacing(0, 1)
|
|
33
33
|
}));
|
|
34
|
+
|
|
35
|
+
// FIXME(v8:romgrk): override slotProps
|
|
36
|
+
|
|
34
37
|
const GridToolbarFilterButton = /*#__PURE__*/React.forwardRef(function GridToolbarFilterButton(props, ref) {
|
|
35
38
|
const {
|
|
36
39
|
slotProps = {}
|
|
@@ -8,6 +8,7 @@ import TextField from '@mui/material/TextField';
|
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import { unstable_debounce as debounce } from '@mui/utils';
|
|
10
10
|
import composeClasses from '@mui/utils/composeClasses';
|
|
11
|
+
import { outlinedInputClasses } from '@mui/material/OutlinedInput';
|
|
11
12
|
import { getDataGridUtilityClass } from "../../constants/index.js";
|
|
12
13
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
13
14
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
@@ -31,13 +32,8 @@ const GridToolbarQuickFilterRoot = styled(TextField, {
|
|
|
31
32
|
})(({
|
|
32
33
|
theme
|
|
33
34
|
}) => ({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'& input': {
|
|
37
|
-
marginLeft: theme.spacing(0.5)
|
|
38
|
-
},
|
|
39
|
-
'& .MuiInput-underline:before': {
|
|
40
|
-
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
35
|
+
[`.${outlinedInputClasses.root}`]: {
|
|
36
|
+
fontSize: theme.typography.body2.fontSize
|
|
41
37
|
},
|
|
42
38
|
[`& input[type="search"]::-webkit-search-decoration,
|
|
43
39
|
& input[type="search"]::-webkit-search-cancel-button,
|
|
@@ -91,7 +87,8 @@ function GridToolbarQuickFilter(props) {
|
|
|
91
87
|
return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({
|
|
92
88
|
as: rootProps.slots.baseTextField,
|
|
93
89
|
ownerState: rootProps,
|
|
94
|
-
variant: "
|
|
90
|
+
variant: "outlined",
|
|
91
|
+
size: "small",
|
|
95
92
|
value: searchValue,
|
|
96
93
|
onChange: handleSearchValueChange,
|
|
97
94
|
className: clsx(classes.root, className),
|
|
@@ -100,23 +97,30 @@ function GridToolbarQuickFilter(props) {
|
|
|
100
97
|
type: "search"
|
|
101
98
|
}, other, {
|
|
102
99
|
InputProps: _extends({
|
|
103
|
-
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
107
|
-
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
108
|
-
size: "small",
|
|
109
|
-
sx: [searchValue ? {
|
|
110
|
-
visibility: 'visible'
|
|
111
|
-
} : {
|
|
112
|
-
visibility: 'hidden'
|
|
113
|
-
}],
|
|
114
|
-
onClick: handleSearchReset
|
|
115
|
-
}, rootProps.slotProps?.baseIconButton, {
|
|
116
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
100
|
+
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {
|
|
101
|
+
position: "start",
|
|
102
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {
|
|
117
103
|
fontSize: "small"
|
|
118
104
|
})
|
|
119
|
-
})
|
|
105
|
+
}),
|
|
106
|
+
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {
|
|
107
|
+
position: "end",
|
|
108
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
109
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
110
|
+
size: "small",
|
|
111
|
+
edge: "end",
|
|
112
|
+
sx: [searchValue ? {
|
|
113
|
+
visibility: 'visible'
|
|
114
|
+
} : {
|
|
115
|
+
visibility: 'hidden'
|
|
116
|
+
}],
|
|
117
|
+
onClick: handleSearchReset
|
|
118
|
+
}, rootProps.slotProps?.baseIconButton, {
|
|
119
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
120
|
+
fontSize: "small"
|
|
121
|
+
})
|
|
122
|
+
}))
|
|
123
|
+
})
|
|
120
124
|
}, other.InputProps)
|
|
121
125
|
}, rootProps.slotProps?.baseTextField));
|
|
122
126
|
}
|
|
@@ -30,7 +30,7 @@ export const GridMainContainer = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
30
30
|
ownerState: rootProps,
|
|
31
31
|
className: props.className,
|
|
32
32
|
tabIndex: -1
|
|
33
|
-
}, ariaAttributes, {
|
|
33
|
+
}, ariaAttributes, rootProps.slotProps?.main, {
|
|
34
34
|
children: [/*#__PURE__*/_jsx(GridPanelAnchor, {
|
|
35
35
|
role: "presentation",
|
|
36
36
|
"data-id": "gridPanelAnchor"
|
|
@@ -48,11 +48,11 @@ export const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
48
48
|
rows: [],
|
|
49
49
|
rowSelection: true,
|
|
50
50
|
rowSpacingType: 'margin',
|
|
51
|
+
rowSpanning: false,
|
|
51
52
|
showCellVerticalBorder: false,
|
|
52
53
|
showColumnVerticalBorder: false,
|
|
53
54
|
sortingMode: 'client',
|
|
54
55
|
sortingOrder: ['asc', 'desc', null],
|
|
55
56
|
throttleRowsMs: 0,
|
|
56
|
-
unstable_rowSpanning: false,
|
|
57
57
|
virtualizeColumnsWithAutoRowHeight: false
|
|
58
58
|
};
|
|
@@ -24,8 +24,8 @@ export const useGridStateInitialization = apiRef => {
|
|
|
24
24
|
const updatedControlStateIds = [];
|
|
25
25
|
Object.keys(controlStateMapRef.current).forEach(stateId => {
|
|
26
26
|
const controlState = controlStateMapRef.current[stateId];
|
|
27
|
-
const oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);
|
|
28
|
-
const newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);
|
|
27
|
+
const oldSubState = controlState.stateSelector(apiRef.current.state, undefined, apiRef.current.instanceId);
|
|
28
|
+
const newSubState = controlState.stateSelector(newState, undefined, apiRef.current.instanceId);
|
|
29
29
|
if (newSubState === oldSubState) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
@@ -57,7 +57,7 @@ export const useGridStateInitialization = apiRef => {
|
|
|
57
57
|
hasPropChanged
|
|
58
58
|
} = updatedControlStateIds[0];
|
|
59
59
|
const controlState = controlStateMapRef.current[stateId];
|
|
60
|
-
const model = controlState.stateSelector(newState, apiRef.current.instanceId);
|
|
60
|
+
const model = controlState.stateSelector(newState, undefined, apiRef.current.instanceId);
|
|
61
61
|
if (controlState.propOnChange && hasPropChanged) {
|
|
62
62
|
controlState.propOnChange(model, {
|
|
63
63
|
reason,
|