@mui/x-data-grid 6.0.0-beta.5 → 6.0.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 +130 -29
- package/DataGrid/DataGrid.js +0 -2
- package/components/GridColumnHeaders.d.ts +7 -0
- package/components/GridColumnHeaders.js +108 -0
- package/components/GridFooter.d.ts +1 -1
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridNoResultsOverlay.d.ts +1 -1
- package/components/GridNoRowsOverlay.d.ts +1 -1
- package/components/GridRow.d.ts +13 -7
- package/components/GridRow.js +48 -30
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +1 -1
- package/components/GridScrollArea.js +1 -1
- package/components/GridSelectedRowCount.d.ts +1 -1
- package/components/GridSelectedRowCount.js +1 -1
- package/components/base/GridBody.d.ts +1 -4
- package/components/base/GridBody.js +43 -5
- package/components/base/GridOverlays.js +1 -1
- package/components/cell/GridCell.d.ts +2 -5
- package/components/cell/GridCell.js +14 -12
- package/components/cell/GridEditInputCell.js +1 -2
- package/components/cell/GridEditSingleSelectCell.js +7 -6
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +7 -0
- package/{modern/components/columnHeaders/GridColumnHeaders.js → components/columnHeaders/GridBaseColumnHeaders.js} +11 -15
- package/components/columnHeaders/GridColumnHeaderTitle.js +4 -6
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +7 -10
- package/components/containers/GridMainContainer.js +1 -1
- package/components/containers/GridOverlay.d.ts +1 -2
- package/components/containers/GridOverlay.js +4 -6
- package/components/containers/GridRootStyles.js +7 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/index.d.ts +1 -1
- package/components/index.js +1 -1
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +32 -30
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -9
- package/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +30 -13
- package/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/components/panel/filterPanel/GridFilterPanel.d.ts +3 -3
- package/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/components/virtualization/GridVirtualScroller.d.ts +1 -1
- package/components/virtualization/GridVirtualScroller.js +1 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/constants/defaultGridSlotsComponents.js +5 -56
- package/hooks/core/useGridLocaleText.js +2 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +22 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/hooks/features/statePersistence/gridStatePersistenceInterface.d.ts +2 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +35 -18
- package/index.d.ts +3 -0
- package/index.js +5 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +0 -2
- package/legacy/components/GridColumnHeaders.js +106 -0
- package/legacy/components/GridRow.js +46 -30
- package/legacy/components/GridRowCount.js +1 -1
- package/legacy/components/GridScrollArea.js +1 -1
- package/legacy/components/GridSelectedRowCount.js +1 -1
- package/legacy/components/base/GridBody.js +43 -5
- package/legacy/components/base/GridOverlays.js +1 -1
- package/legacy/components/cell/GridCell.js +14 -12
- package/legacy/components/cell/GridEditInputCell.js +1 -2
- package/legacy/components/cell/GridEditSingleSelectCell.js +7 -6
- package/legacy/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +11 -14
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +6 -9
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/legacy/components/containers/GridFooterContainer.js +7 -10
- package/legacy/components/containers/GridMainContainer.js +1 -1
- package/legacy/components/containers/GridOverlay.js +9 -12
- package/legacy/components/containers/GridRootStyles.js +7 -3
- package/legacy/components/containers/GridToolbarContainer.js +1 -1
- package/legacy/components/index.js +1 -1
- package/legacy/components/panel/GridColumnsPanel.js +1 -2
- package/legacy/components/panel/GridPanelContent.js +1 -1
- package/legacy/components/panel/GridPanelFooter.js +1 -1
- package/legacy/components/panel/GridPanelHeader.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterForm.js +32 -30
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +12 -9
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +29 -13
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/legacy/components/virtualization/GridVirtualScroller.js +1 -1
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/legacy/constants/defaultGridSlotsComponents.js +5 -56
- package/legacy/hooks/core/useGridLocaleText.js +2 -4
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +33 -16
- package/legacy/index.js +5 -1
- package/legacy/internals/index.js +1 -1
- package/legacy/locales/arSD.js +14 -19
- package/legacy/locales/csCZ.js +25 -33
- package/legacy/locales/esES.js +1 -1
- package/legacy/material/components/MUISelectOption.js +14 -0
- package/legacy/material/index.js +65 -0
- package/legacy/models/gridFilterItem.js +2 -0
- package/legacy/models/params/gridRowParams.js +4 -0
- package/locales/arSD.js +14 -19
- package/locales/csCZ.js +24 -32
- package/locales/esES.js +1 -1
- package/material/components/MUISelectOption.d.ts +3 -0
- package/material/components/MUISelectOption.js +16 -0
- package/material/index.d.ts +57 -0
- package/material/index.js +65 -0
- package/material/package.json +6 -0
- package/models/colDef/gridColDef.d.ts +6 -0
- package/models/gridExport.d.ts +4 -0
- package/models/gridFilterItem.d.ts +2 -0
- package/models/gridFilterItem.js +2 -0
- package/models/gridFilterModel.d.ts +2 -0
- package/models/gridFilterOperator.d.ts +2 -0
- package/models/gridIconSlotsComponent.d.ts +10 -0
- package/models/gridSlotsComponent.d.ts +15 -0
- package/models/gridSlotsComponentsProps.d.ts +103 -23
- package/models/params/gridRowParams.d.ts +6 -0
- package/models/params/gridRowParams.js +4 -0
- package/modern/DataGrid/DataGrid.js +0 -2
- package/modern/components/GridColumnHeaders.js +108 -0
- package/modern/components/GridRow.js +48 -27
- package/modern/components/GridRowCount.js +1 -1
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/GridSelectedRowCount.js +1 -1
- package/modern/components/base/GridBody.js +43 -5
- package/modern/components/base/GridOverlays.js +1 -1
- package/modern/components/cell/GridCell.js +14 -12
- package/modern/components/cell/GridEditInputCell.js +1 -2
- package/modern/components/cell/GridEditSingleSelectCell.js +6 -6
- package/{components/columnHeaders/GridColumnHeaders.js → modern/components/columnHeaders/GridBaseColumnHeaders.js} +11 -15
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +4 -6
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/modern/components/columnHeaders/GridIconButtonContainer.js +1 -1
- package/modern/components/containers/GridFooterContainer.js +7 -10
- package/modern/components/containers/GridMainContainer.js +1 -1
- package/modern/components/containers/GridOverlay.js +4 -6
- package/modern/components/containers/GridRootStyles.js +7 -3
- package/modern/components/containers/GridToolbarContainer.js +1 -1
- package/modern/components/index.js +1 -1
- package/modern/components/panel/GridColumnsPanel.js +1 -2
- package/modern/components/panel/GridPanelContent.js +1 -1
- package/modern/components/panel/GridPanelFooter.js +1 -1
- package/modern/components/panel/GridPanelHeader.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterForm.js +27 -25
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -6
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +27 -10
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/modern/components/virtualization/GridVirtualScroller.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +1 -1
- package/modern/constants/defaultGridSlotsComponents.js +5 -56
- package/modern/hooks/core/useGridLocaleText.js +2 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +17 -26
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +33 -17
- package/modern/index.js +5 -1
- package/modern/internals/index.js +1 -1
- package/modern/locales/arSD.js +14 -19
- package/modern/locales/csCZ.js +24 -32
- package/modern/locales/esES.js +1 -1
- package/modern/material/components/MUISelectOption.js +16 -0
- package/modern/material/index.js +65 -0
- package/modern/models/gridFilterItem.js +2 -0
- package/modern/models/params/gridRowParams.js +4 -0
- package/node/DataGrid/DataGrid.js +0 -2
- package/node/components/GridColumnHeaders.js +116 -0
- package/node/components/GridRow.js +48 -27
- package/node/components/GridRowCount.js +2 -2
- package/node/components/GridScrollArea.js +2 -2
- package/node/components/GridSelectedRowCount.js +2 -2
- package/node/components/base/GridBody.js +43 -5
- package/node/components/base/GridOverlays.js +3 -3
- package/node/components/cell/GridCell.js +14 -11
- package/node/components/cell/GridEditInputCell.js +1 -2
- package/node/components/cell/GridEditSingleSelectCell.js +5 -6
- package/node/components/columnHeaders/{GridColumnHeaders.js → GridBaseColumnHeaders.js} +14 -18
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -7
- package/node/components/columnHeaders/GridColumnHeadersInner.js +2 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +2 -2
- package/node/components/containers/GridFooterContainer.js +8 -11
- package/node/components/containers/GridMainContainer.js +2 -2
- package/node/components/containers/GridOverlay.js +5 -7
- package/node/components/containers/GridRootStyles.js +7 -3
- package/node/components/containers/GridToolbarContainer.js +2 -2
- package/node/components/index.js +1 -1
- package/node/components/panel/GridColumnsPanel.js +1 -2
- package/node/components/panel/GridPanelContent.js +2 -2
- package/node/components/panel/GridPanelFooter.js +2 -2
- package/node/components/panel/GridPanelHeader.js +2 -2
- package/node/components/panel/filterPanel/GridFilterForm.js +26 -25
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +9 -6
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +26 -10
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -2
- package/node/components/panel/filterPanel/GridFilterPanel.js +8 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerContent.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -2
- package/node/constants/defaultGridSlotsComponents.js +4 -55
- package/node/hooks/core/useGridLocaleText.js +2 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +19 -28
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +32 -15
- package/node/index.js +9 -1
- package/node/internals/index.js +4 -4
- package/node/locales/arSD.js +14 -19
- package/node/locales/csCZ.js +24 -32
- package/node/locales/esES.js +1 -1
- package/node/{components/DataGridColumnHeaders.js → material/components/MUISelectOption.js} +13 -35
- package/node/material/index.js +73 -0
- package/node/models/gridFilterItem.js +2 -0
- package/node/models/params/gridRowParams.js +4 -0
- package/package.json +1 -1
- package/components/DataGridColumnHeaders.d.ts +0 -6
- package/components/DataGridColumnHeaders.js +0 -38
- package/components/columnHeaders/GridColumnHeaders.d.ts +0 -7
- package/legacy/components/DataGridColumnHeaders.js +0 -36
- package/modern/components/DataGridColumnHeaders.js +0 -38
- /package/legacy/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/legacy/{components → material}/icons/index.js +0 -0
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.d.ts +0 -0
- /package/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/{components → material}/icons/index.d.ts +0 -0
- /package/{components → material}/icons/index.js +0 -0
- /package/modern/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/modern/{components → material}/icons/index.js +0 -0
- /package/node/{components/columnHeaders → material/icons}/GridColumnUnsortedIcon.js +0 -0
- /package/node/{components → material}/icons/index.js +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnPositions", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "densityFactor", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { useGridColumnHeaders } from '../hooks/features/columnHeaders/useGridColumnHeaders';
|
|
7
|
+
import { GridScrollArea } from './GridScrollArea';
|
|
8
|
+
import { GridBaseColumnHeaders } from './columnHeaders/GridBaseColumnHeaders';
|
|
9
|
+
import { GridColumnHeadersInner } from './columnHeaders/GridColumnHeadersInner';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeaders(props, ref) {
|
|
13
|
+
const {
|
|
14
|
+
innerRef,
|
|
15
|
+
visibleColumns,
|
|
16
|
+
sortColumnLookup,
|
|
17
|
+
filterColumnLookup,
|
|
18
|
+
columnPositions,
|
|
19
|
+
columnHeaderTabIndexState,
|
|
20
|
+
columnGroupHeaderTabIndexState,
|
|
21
|
+
columnHeaderFocus,
|
|
22
|
+
columnGroupHeaderFocus,
|
|
23
|
+
densityFactor,
|
|
24
|
+
headerGroupingMaxDepth,
|
|
25
|
+
columnMenuState,
|
|
26
|
+
columnVisibility,
|
|
27
|
+
columnGroupsHeaderStructure,
|
|
28
|
+
hasOtherElementInTabSequence
|
|
29
|
+
} = props,
|
|
30
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
+
const {
|
|
32
|
+
isDragging,
|
|
33
|
+
getRootProps,
|
|
34
|
+
getInnerProps,
|
|
35
|
+
getColumnHeaders,
|
|
36
|
+
getColumnGroupHeaders
|
|
37
|
+
} = useGridColumnHeaders({
|
|
38
|
+
innerRef,
|
|
39
|
+
visibleColumns,
|
|
40
|
+
sortColumnLookup,
|
|
41
|
+
filterColumnLookup,
|
|
42
|
+
columnPositions,
|
|
43
|
+
columnHeaderTabIndexState,
|
|
44
|
+
columnGroupHeaderTabIndexState,
|
|
45
|
+
columnHeaderFocus,
|
|
46
|
+
columnGroupHeaderFocus,
|
|
47
|
+
densityFactor,
|
|
48
|
+
headerGroupingMaxDepth,
|
|
49
|
+
columnMenuState,
|
|
50
|
+
columnVisibility,
|
|
51
|
+
columnGroupsHeaderStructure,
|
|
52
|
+
hasOtherElementInTabSequence
|
|
53
|
+
});
|
|
54
|
+
return /*#__PURE__*/_jsxs(GridBaseColumnHeaders, _extends({
|
|
55
|
+
ref: ref
|
|
56
|
+
}, getRootProps(other), {
|
|
57
|
+
children: [/*#__PURE__*/_jsx(GridScrollArea, {
|
|
58
|
+
scrollDirection: "left"
|
|
59
|
+
}), /*#__PURE__*/_jsxs(GridColumnHeadersInner, _extends({
|
|
60
|
+
isDragging: isDragging
|
|
61
|
+
}, getInnerProps(), {
|
|
62
|
+
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
63
|
+
})), /*#__PURE__*/_jsx(GridScrollArea, {
|
|
64
|
+
scrollDirection: "right"
|
|
65
|
+
})]
|
|
66
|
+
}));
|
|
67
|
+
});
|
|
68
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
69
|
+
// ----------------------------- Warning --------------------------------
|
|
70
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
72
|
+
// ----------------------------------------------------------------------
|
|
73
|
+
columnGroupHeaderFocus: PropTypes.shape({
|
|
74
|
+
depth: PropTypes.number.isRequired,
|
|
75
|
+
field: PropTypes.string.isRequired
|
|
76
|
+
}),
|
|
77
|
+
columnGroupHeaderTabIndexState: PropTypes.shape({
|
|
78
|
+
depth: PropTypes.number.isRequired,
|
|
79
|
+
field: PropTypes.string.isRequired
|
|
80
|
+
}),
|
|
81
|
+
columnGroupsHeaderStructure: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.shape({
|
|
82
|
+
columnFields: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
83
|
+
groupId: PropTypes.string
|
|
84
|
+
}))).isRequired,
|
|
85
|
+
columnHeaderFocus: PropTypes.shape({
|
|
86
|
+
field: PropTypes.string.isRequired
|
|
87
|
+
}),
|
|
88
|
+
columnHeaderTabIndexState: PropTypes.shape({
|
|
89
|
+
field: PropTypes.string.isRequired
|
|
90
|
+
}),
|
|
91
|
+
columnMenuState: PropTypes.shape({
|
|
92
|
+
field: PropTypes.string,
|
|
93
|
+
open: PropTypes.bool.isRequired
|
|
94
|
+
}).isRequired,
|
|
95
|
+
columnPositions: PropTypes.arrayOf(PropTypes.number).isRequired,
|
|
96
|
+
columnVisibility: PropTypes.object.isRequired,
|
|
97
|
+
densityFactor: PropTypes.number.isRequired,
|
|
98
|
+
filterColumnLookup: PropTypes.object.isRequired,
|
|
99
|
+
hasOtherElementInTabSequence: PropTypes.bool.isRequired,
|
|
100
|
+
headerGroupingMaxDepth: PropTypes.number.isRequired,
|
|
101
|
+
innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
102
|
+
current: PropTypes.object
|
|
103
|
+
})]),
|
|
104
|
+
minColumnIndex: PropTypes.number,
|
|
105
|
+
sortColumnLookup: PropTypes.object.isRequired,
|
|
106
|
+
visibleColumns: PropTypes.arrayOf(PropTypes.object).isRequired
|
|
107
|
+
} : void 0;
|
|
108
|
+
export { GridColumnHeaders };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "
|
|
3
|
+
const _excluded = ["selected", "rowId", "row", "index", "style", "position", "rowHeight", "className", "visibleColumns", "renderedColumns", "containerWidth", "firstColumnToRender", "lastColumnToRender", "isLastVisible", "focusedCell", "tabbableCell", "onClick", "onDoubleClick", "onMouseEnter", "onMouseLeave"],
|
|
4
4
|
_excluded2 = ["changeReason"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
@@ -21,6 +21,7 @@ import { gridSortModelSelector } from '../hooks/features/sorting/gridSortingSele
|
|
|
21
21
|
import { gridRowMaximumTreeDepthSelector } from '../hooks/features/rows/gridRowsSelector';
|
|
22
22
|
import { gridColumnGroupsHeaderMaxDepthSelector } from '../hooks/features/columnGrouping/gridColumnGroupsSelector';
|
|
23
23
|
import { randomNumberBetween } from '../utils/utils';
|
|
24
|
+
import { gridEditRowsStateSelector } from '../hooks/features/editing/gridEditingSelectors';
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
26
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
@@ -65,10 +66,9 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
65
66
|
renderedColumns,
|
|
66
67
|
containerWidth,
|
|
67
68
|
firstColumnToRender,
|
|
68
|
-
cellFocus,
|
|
69
|
-
cellTabIndex,
|
|
70
|
-
editRowsState,
|
|
71
69
|
isLastVisible = false,
|
|
70
|
+
focusedCell,
|
|
71
|
+
tabbableCell,
|
|
72
72
|
onClick,
|
|
73
73
|
onDoubleClick,
|
|
74
74
|
onMouseEnter,
|
|
@@ -83,6 +83,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
83
83
|
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
|
|
84
84
|
const treeDepth = useGridSelector(apiRef, gridRowMaximumTreeDepthSelector);
|
|
85
85
|
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
86
|
+
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
86
87
|
const handleRef = useForkRef(ref, refProp);
|
|
87
88
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
88
89
|
|
|
@@ -179,13 +180,22 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
179
180
|
}
|
|
180
181
|
publish('rowClick', onClick)(event);
|
|
181
182
|
}, [apiRef, onClick, publish, rowId]);
|
|
183
|
+
const {
|
|
184
|
+
slots,
|
|
185
|
+
slotProps,
|
|
186
|
+
classes: rootClasses,
|
|
187
|
+
disableColumnReorder,
|
|
188
|
+
getCellClassName
|
|
189
|
+
} = rootProps;
|
|
190
|
+
const rowReordering = rootProps.rowReordering;
|
|
191
|
+
const CellComponent = slots.cell;
|
|
182
192
|
const getCell = React.useCallback((column, cellProps) => {
|
|
183
193
|
const cellParams = apiRef.current.getCellParams(rowId, column.field);
|
|
184
194
|
const classNames = apiRef.current.unstable_applyPipeProcessors('cellClassName', [], {
|
|
185
195
|
id: rowId,
|
|
186
196
|
field: column.field
|
|
187
197
|
});
|
|
188
|
-
const disableDragEvents =
|
|
198
|
+
const disableDragEvents = disableColumnReorder && column.disableReorder || !rowReordering && !!sortModel.length && treeDepth > 1 && Object.keys(editRowsState).length > 0;
|
|
189
199
|
if (column.cellClassName) {
|
|
190
200
|
classNames.push(clsx(typeof column.cellClassName === 'function' ? column.cellClassName(cellParams) : column.cellClassName));
|
|
191
201
|
}
|
|
@@ -196,7 +206,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
196
206
|
api: apiRef.current
|
|
197
207
|
}));
|
|
198
208
|
// TODO move to GridCell
|
|
199
|
-
classNames.push(clsx(gridClasses['cell--withRenderer'],
|
|
209
|
+
classNames.push(clsx(gridClasses['cell--withRenderer'], rootClasses?.['cell--withRenderer']));
|
|
200
210
|
}
|
|
201
211
|
if (editCellState != null && column.renderEditCell) {
|
|
202
212
|
const updatedRow = apiRef.current.getRowWithUpdatedValues(rowId, column.field);
|
|
@@ -208,19 +218,19 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
208
218
|
});
|
|
209
219
|
content = column.renderEditCell(params);
|
|
210
220
|
// TODO move to GridCell
|
|
211
|
-
classNames.push(clsx(gridClasses['cell--editing'],
|
|
221
|
+
classNames.push(clsx(gridClasses['cell--editing'], rootClasses?.['cell--editing']));
|
|
212
222
|
}
|
|
213
|
-
if (
|
|
223
|
+
if (getCellClassName) {
|
|
214
224
|
// TODO move to GridCell
|
|
215
|
-
classNames.push(
|
|
225
|
+
classNames.push(getCellClassName(cellParams));
|
|
216
226
|
}
|
|
217
|
-
const hasFocus =
|
|
218
|
-
const tabIndex =
|
|
227
|
+
const hasFocus = focusedCell === column.field;
|
|
228
|
+
const tabIndex = tabbableCell === column.field ? 0 : -1;
|
|
219
229
|
const isSelected = apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
220
230
|
id: rowId,
|
|
221
231
|
field: column.field
|
|
222
232
|
});
|
|
223
|
-
return /*#__PURE__*/_jsx(
|
|
233
|
+
return /*#__PURE__*/_jsx(CellComponent, _extends({
|
|
224
234
|
value: cellParams.value,
|
|
225
235
|
field: column.field,
|
|
226
236
|
width: cellProps.width,
|
|
@@ -238,10 +248,10 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
238
248
|
className: clsx(classNames),
|
|
239
249
|
colSpan: cellProps.colSpan,
|
|
240
250
|
disableDragEvents: disableDragEvents
|
|
241
|
-
},
|
|
251
|
+
}, slotProps?.cell, {
|
|
242
252
|
children: content
|
|
243
253
|
}), column.field);
|
|
244
|
-
}, [apiRef,
|
|
254
|
+
}, [apiRef, rowId, disableColumnReorder, rowReordering, sortModel.length, treeDepth, editRowsState, getCellClassName, focusedCell, tabbableCell, CellComponent, rowHeight, slotProps?.cell, rootClasses]);
|
|
245
255
|
const sizes = apiRef.current.unstable_getRowInternalSizes(rowId);
|
|
246
256
|
let minHeight = rowHeight;
|
|
247
257
|
if (minHeight === 'auto' && sizes) {
|
|
@@ -351,24 +361,35 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
351
361
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
352
362
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
353
363
|
// ----------------------------------------------------------------------
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
364
|
+
containerWidth: PropTypes.number,
|
|
365
|
+
firstColumnToRender: PropTypes.number,
|
|
366
|
+
/**
|
|
367
|
+
* Determines which cell has focus.
|
|
368
|
+
* If `null`, no cell in this row has focus.
|
|
369
|
+
*/
|
|
370
|
+
focusedCell: PropTypes.string,
|
|
359
371
|
/**
|
|
360
372
|
* Index of the row in the whole sorted and filtered dataset.
|
|
361
373
|
* If some rows above have expanded children, this index also take those children into account.
|
|
362
374
|
*/
|
|
363
|
-
index: PropTypes.number
|
|
375
|
+
index: PropTypes.number,
|
|
364
376
|
isLastVisible: PropTypes.bool,
|
|
365
|
-
lastColumnToRender: PropTypes.number
|
|
366
|
-
|
|
367
|
-
|
|
377
|
+
lastColumnToRender: PropTypes.number,
|
|
378
|
+
onClick: PropTypes.func,
|
|
379
|
+
onDoubleClick: PropTypes.func,
|
|
380
|
+
onMouseEnter: PropTypes.func,
|
|
381
|
+
onMouseLeave: PropTypes.func,
|
|
382
|
+
position: PropTypes.oneOf(['center', 'left', 'right']),
|
|
383
|
+
renderedColumns: PropTypes.arrayOf(PropTypes.object),
|
|
368
384
|
row: PropTypes.object,
|
|
369
|
-
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number])
|
|
370
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
371
|
-
selected: PropTypes.bool
|
|
372
|
-
|
|
385
|
+
rowHeight: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
386
|
+
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
387
|
+
selected: PropTypes.bool,
|
|
388
|
+
/**
|
|
389
|
+
* Determines which cell should be tabbable by having tabIndex=0.
|
|
390
|
+
* If `null`, no cell in this row is in the tab sequence.
|
|
391
|
+
*/
|
|
392
|
+
tabbableCell: PropTypes.string,
|
|
393
|
+
visibleColumns: PropTypes.arrayOf(PropTypes.object)
|
|
373
394
|
} : void 0;
|
|
374
395
|
export { GridRow };
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
10
10
|
import { getDataGridUtilityClass } from '../constants/gridClasses';
|
|
11
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
6
|
-
import { styled } from '@mui/
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
7
|
import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
|
|
8
8
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
9
9
|
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
10
10
|
import { getDataGridUtilityClass } from '../constants/gridClasses';
|
|
11
11
|
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
@@ -1,19 +1,43 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import { useGridPrivateApiContext } from '../../hooks/utils/useGridPrivateApiContext';
|
|
5
|
+
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
4
6
|
import { GridMainContainer } from '../containers/GridMainContainer';
|
|
5
7
|
import { GridAutoSizer } from '../GridAutoSizer';
|
|
6
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
|
+
import { gridColumnPositionsSelector, gridColumnVisibilityModelSelector, gridVisibleColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';
|
|
10
|
+
import { gridFilterActiveItemsLookupSelector } from '../../hooks/features/filter/gridFilterSelector';
|
|
11
|
+
import { gridSortColumnLookupSelector } from '../../hooks/features/sorting/gridSortingSelector';
|
|
12
|
+
import { gridTabIndexColumnHeaderSelector, gridTabIndexCellSelector, gridFocusColumnHeaderSelector, unstable_gridTabIndexColumnGroupHeaderSelector, unstable_gridFocusColumnGroupHeaderSelector } from '../../hooks/features/focus/gridFocusStateSelector';
|
|
13
|
+
import { gridDensityFactorSelector } from '../../hooks/features/density/densitySelector';
|
|
14
|
+
import { gridColumnGroupsHeaderMaxDepthSelector, gridColumnGroupsHeaderStructureSelector } from '../../hooks/features/columnGrouping/gridColumnGroupsSelector';
|
|
15
|
+
import { gridColumnMenuSelector } from '../../hooks/features/columnMenu/columnMenuSelector';
|
|
7
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
18
|
function GridBody(props) {
|
|
10
19
|
const {
|
|
11
20
|
children,
|
|
12
21
|
VirtualScrollerComponent,
|
|
13
|
-
|
|
22
|
+
ColumnHeadersProps
|
|
14
23
|
} = props;
|
|
15
24
|
const apiRef = useGridPrivateApiContext();
|
|
16
25
|
const rootProps = useGridRootProps();
|
|
26
|
+
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
27
|
+
const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);
|
|
28
|
+
const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);
|
|
29
|
+
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
30
|
+
const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);
|
|
31
|
+
const cellTabIndexState = useGridSelector(apiRef, gridTabIndexCellSelector);
|
|
32
|
+
const columnGroupHeaderTabIndexState = useGridSelector(apiRef, unstable_gridTabIndexColumnGroupHeaderSelector);
|
|
33
|
+
const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);
|
|
34
|
+
const columnGroupHeaderFocus = useGridSelector(apiRef, unstable_gridFocusColumnGroupHeaderSelector);
|
|
35
|
+
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
36
|
+
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
37
|
+
const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);
|
|
38
|
+
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
39
|
+
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
40
|
+
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
17
41
|
const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);
|
|
18
42
|
const disableVirtualization = React.useCallback(() => {
|
|
19
43
|
setIsVirtualizationDisabled(true);
|
|
@@ -45,10 +69,24 @@ function GridBody(props) {
|
|
|
45
69
|
apiRef.current.publishEvent('resize', size);
|
|
46
70
|
}, [apiRef]);
|
|
47
71
|
return /*#__PURE__*/_jsxs(GridMainContainer, {
|
|
48
|
-
children: [/*#__PURE__*/_jsx(
|
|
72
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.columnHeaders, _extends({
|
|
49
73
|
ref: columnsContainerRef,
|
|
50
|
-
innerRef: columnHeadersRef
|
|
51
|
-
|
|
74
|
+
innerRef: columnHeadersRef,
|
|
75
|
+
visibleColumns: visibleColumns,
|
|
76
|
+
filterColumnLookup: filterColumnLookup,
|
|
77
|
+
sortColumnLookup: sortColumnLookup,
|
|
78
|
+
columnPositions: columnPositions,
|
|
79
|
+
columnHeaderTabIndexState: columnHeaderTabIndexState,
|
|
80
|
+
columnGroupHeaderTabIndexState: columnGroupHeaderTabIndexState,
|
|
81
|
+
columnHeaderFocus: columnHeaderFocus,
|
|
82
|
+
columnGroupHeaderFocus: columnGroupHeaderFocus,
|
|
83
|
+
densityFactor: densityFactor,
|
|
84
|
+
headerGroupingMaxDepth: headerGroupingMaxDepth,
|
|
85
|
+
columnMenuState: columnMenuState,
|
|
86
|
+
columnVisibility: columnVisibility,
|
|
87
|
+
columnGroupsHeaderStructure: columnGroupsHeaderStructure,
|
|
88
|
+
hasOtherElementInTabSequence: hasOtherElementInTabSequence
|
|
89
|
+
}, ColumnHeadersProps)), /*#__PURE__*/_jsx(GridAutoSizer, {
|
|
52
90
|
nonce: rootProps.nonce,
|
|
53
91
|
disableHeight: rootProps.autoHeight,
|
|
54
92
|
onResize: handleResize,
|
|
@@ -65,7 +103,7 @@ process.env.NODE_ENV !== "production" ? GridBody.propTypes = {
|
|
|
65
103
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
66
104
|
// ----------------------------------------------------------------------
|
|
67
105
|
children: PropTypes.node,
|
|
68
|
-
|
|
106
|
+
ColumnHeadersProps: PropTypes.object,
|
|
69
107
|
VirtualScrollerComponent: PropTypes.elementType.isRequired
|
|
70
108
|
} : void 0;
|
|
71
109
|
export { GridBody };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { styled } from '@mui/
|
|
3
|
+
import { styled } from '@mui/system';
|
|
4
4
|
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
@@ -5,7 +5,7 @@ const _excluded = ["align", "children", "colIndex", "colDef", "cellMode", "field
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
|
+
import { unstable_useForkRef as useForkRef, unstable_composeClasses as composeClasses, unstable_ownerDocument as ownerDocument, unstable_capitalize as capitalize } from '@mui/utils';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { GridCellModes } from '../../models';
|
|
11
11
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -40,7 +40,7 @@ const useUtilityClasses = ownerState => {
|
|
|
40
40
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
41
41
|
};
|
|
42
42
|
let warnedOnce = false;
|
|
43
|
-
|
|
43
|
+
const GridCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
44
44
|
const {
|
|
45
45
|
align,
|
|
46
46
|
children,
|
|
@@ -73,6 +73,7 @@ function GridCell(props) {
|
|
|
73
73
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
74
74
|
const valueToRender = formattedValue == null ? value : formattedValue;
|
|
75
75
|
const cellRef = React.useRef(null);
|
|
76
|
+
const handleRef = useForkRef(ref, cellRef);
|
|
76
77
|
const focusElementRef = React.useRef(null);
|
|
77
78
|
const apiRef = useGridApiContext();
|
|
78
79
|
const rootProps = useGridRootProps();
|
|
@@ -174,7 +175,7 @@ function GridCell(props) {
|
|
|
174
175
|
onDragOver: publish('cellDragOver', onDragOver)
|
|
175
176
|
};
|
|
176
177
|
return /*#__PURE__*/_jsx("div", _extends({
|
|
177
|
-
ref:
|
|
178
|
+
ref: handleRef,
|
|
178
179
|
className: clsx(className, classes.root),
|
|
179
180
|
role: "cell",
|
|
180
181
|
"data-field": field,
|
|
@@ -194,23 +195,24 @@ function GridCell(props) {
|
|
|
194
195
|
onFocus: handleFocus,
|
|
195
196
|
children: renderChildren()
|
|
196
197
|
}));
|
|
197
|
-
}
|
|
198
|
+
});
|
|
199
|
+
const MemoizedCell = /*#__PURE__*/React.memo(GridCell);
|
|
198
200
|
process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
199
201
|
// ----------------------------- Warning --------------------------------
|
|
200
202
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
201
203
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
202
204
|
// ----------------------------------------------------------------------
|
|
203
|
-
align: PropTypes.oneOf(['center', 'left', 'right'])
|
|
205
|
+
align: PropTypes.oneOf(['center', 'left', 'right']),
|
|
204
206
|
cellMode: PropTypes.oneOf(['edit', 'view']),
|
|
205
207
|
children: PropTypes.node,
|
|
206
208
|
className: PropTypes.string,
|
|
207
|
-
colIndex: PropTypes.number
|
|
209
|
+
colIndex: PropTypes.number,
|
|
208
210
|
colSpan: PropTypes.number,
|
|
209
211
|
disableDragEvents: PropTypes.bool,
|
|
210
|
-
field: PropTypes.string
|
|
212
|
+
field: PropTypes.string,
|
|
211
213
|
formattedValue: PropTypes.any,
|
|
212
214
|
hasFocus: PropTypes.bool,
|
|
213
|
-
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number])
|
|
215
|
+
height: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]),
|
|
214
216
|
isEditable: PropTypes.bool,
|
|
215
217
|
isSelected: PropTypes.bool,
|
|
216
218
|
onClick: PropTypes.func,
|
|
@@ -220,10 +222,10 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
220
222
|
onKeyDown: PropTypes.func,
|
|
221
223
|
onMouseDown: PropTypes.func,
|
|
222
224
|
onMouseUp: PropTypes.func,
|
|
223
|
-
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
225
|
+
rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
224
226
|
showRightBorder: PropTypes.bool,
|
|
225
|
-
tabIndex: PropTypes.oneOf([-1, 0])
|
|
227
|
+
tabIndex: PropTypes.oneOf([-1, 0]),
|
|
226
228
|
value: PropTypes.any,
|
|
227
|
-
width: PropTypes.number
|
|
229
|
+
width: PropTypes.number
|
|
228
230
|
} : void 0;
|
|
229
|
-
export { GridCell };
|
|
231
|
+
export { MemoizedCell as GridCell };
|
|
@@ -8,7 +8,6 @@ import { styled } from '@mui/material/styles';
|
|
|
8
8
|
import InputBase from '@mui/material/InputBase';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
|
-
import { GridLoadIcon } from '../icons/index';
|
|
12
11
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
const useUtilityClasses = ownerState => {
|
|
@@ -89,7 +88,7 @@ const GridEditInputCell = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
89
88
|
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
90
89
|
value: valueState ?? '',
|
|
91
90
|
onChange: handleChange,
|
|
92
|
-
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(
|
|
91
|
+
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {}) : undefined
|
|
93
92
|
}, other));
|
|
94
93
|
});
|
|
95
94
|
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
@@ -4,12 +4,12 @@ const _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowN
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
7
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
8
7
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
9
8
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
9
|
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
11
10
|
import { getValueFromValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
|
|
12
11
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
|
+
import { createElement as _createElement } from "react";
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
function isKeyboardEvent(event) {
|
|
15
15
|
return !!event.key;
|
|
@@ -95,7 +95,6 @@ function GridEditSingleSelectCell(props) {
|
|
|
95
95
|
}
|
|
96
96
|
setOpen(true);
|
|
97
97
|
};
|
|
98
|
-
const OptionComponent = isSelectNative ? 'option' : MenuItem;
|
|
99
98
|
if (!valueOptions || !colDef) {
|
|
100
99
|
return null;
|
|
101
100
|
}
|
|
@@ -115,10 +114,11 @@ function GridEditSingleSelectCell(props) {
|
|
|
115
114
|
}, other, rootProps.slotProps?.baseSelect, {
|
|
116
115
|
children: valueOptions.map(valueOption => {
|
|
117
116
|
const value = getOptionValue(valueOption);
|
|
118
|
-
return /*#__PURE__*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, rootProps.slotProps?.baseSelectOption || {}, {
|
|
118
|
+
native: isSelectNative,
|
|
119
|
+
key: value,
|
|
120
|
+
value: value
|
|
121
|
+
}), getOptionLabel(valueOption));
|
|
122
122
|
})
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,21 +21,17 @@ const GridColumnHeadersRoot = styled('div', {
|
|
|
21
21
|
name: 'MuiDataGrid',
|
|
22
22
|
slot: 'ColumnHeaders',
|
|
23
23
|
overridesResolver: (props, styles) => styles.columnHeaders
|
|
24
|
-
})(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
borderBottom: '1px solid',
|
|
34
|
-
borderTopLeftRadius: theme.shape.borderRadius,
|
|
35
|
-
borderTopRightRadius: theme.shape.borderRadius
|
|
36
|
-
};
|
|
24
|
+
})({
|
|
25
|
+
position: 'relative',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
borderBottom: '1px solid',
|
|
31
|
+
borderTopLeftRadius: 'var(--unstable_DataGrid-radius)',
|
|
32
|
+
borderTopRightRadius: 'var(--unstable_DataGrid-radius)'
|
|
37
33
|
});
|
|
38
|
-
export const
|
|
34
|
+
export const GridBaseColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
39
35
|
const {
|
|
40
36
|
className
|
|
41
37
|
} = props,
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { isOverflown } from '../../utils/domUtils';
|
|
10
10
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
11
11
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
@@ -23,14 +23,12 @@ const GridColumnHeaderTitleRoot = styled('div', {
|
|
|
23
23
|
name: 'MuiDataGrid',
|
|
24
24
|
slot: 'ColumnHeaderTitle',
|
|
25
25
|
overridesResolver: (props, styles) => styles.columnHeaderTitle
|
|
26
|
-
})(
|
|
27
|
-
theme
|
|
28
|
-
}) => ({
|
|
26
|
+
})({
|
|
29
27
|
textOverflow: 'ellipsis',
|
|
30
28
|
overflow: 'hidden',
|
|
31
29
|
whiteSpace: 'nowrap',
|
|
32
|
-
fontWeight:
|
|
33
|
-
})
|
|
30
|
+
fontWeight: 'var(--unstable_DataGrid-headWeight)'
|
|
31
|
+
});
|
|
34
32
|
const ColumnHeaderInnerTitle = /*#__PURE__*/React.forwardRef(function ColumnHeaderInnerTitle(props, ref) {
|
|
35
33
|
const {
|
|
36
34
|
className
|
|
@@ -4,7 +4,7 @@ const _excluded = ["isDragging", "className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { gridClasses, getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
@@ -4,7 +4,7 @@ const _excluded = ["className"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { styled } from '@mui/
|
|
7
|
+
import { styled } from '@mui/system';
|
|
8
8
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
9
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
9
|
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
10
10
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -22,15 +22,12 @@ const GridFooterContainerRoot = styled('div', {
|
|
|
22
22
|
name: 'MuiDataGrid',
|
|
23
23
|
slot: 'FooterContainer',
|
|
24
24
|
overridesResolver: (props, styles) => styles.footerContainer
|
|
25
|
-
})(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
// Match TablePagination min height
|
|
32
|
-
borderTop: '1px solid'
|
|
33
|
-
};
|
|
25
|
+
})({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
minHeight: 52,
|
|
30
|
+
borderTop: '1px solid'
|
|
34
31
|
});
|
|
35
32
|
const GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {
|
|
36
33
|
const {
|