@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
|
@@ -2,16 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as ReactDOM from 'react-dom';
|
|
4
4
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
5
|
-
import { styled, useTheme } from '@mui/
|
|
5
|
+
import { styled, useTheme } from '@mui/system';
|
|
6
6
|
import { defaultMemoize } from 'reselect';
|
|
7
7
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
8
|
-
import { useGridSelector } from '../../utils/useGridSelector';
|
|
9
|
-
import { gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, gridColumnVisibilityModelSelector } from '../columns/gridColumnsSelector';
|
|
10
|
-
import { gridTabIndexColumnHeaderSelector, gridTabIndexCellSelector, gridFocusColumnHeaderSelector, unstable_gridFocusColumnGroupHeaderSelector, unstable_gridTabIndexColumnGroupHeaderSelector } from '../focus/gridFocusStateSelector';
|
|
11
|
-
import { gridDensityFactorSelector } from '../density/densitySelector';
|
|
12
|
-
import { gridFilterActiveItemsLookupSelector } from '../filter/gridFilterSelector';
|
|
13
|
-
import { gridSortColumnLookupSelector } from '../sorting/gridSortingSelector';
|
|
14
|
-
import { gridColumnMenuSelector } from '../columnMenu/columnMenuSelector';
|
|
15
8
|
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
16
9
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
17
10
|
import { GridColumnHeaderItem } from '../../../components/columnHeaders/GridColumnHeaderItem';
|
|
@@ -19,7 +12,6 @@ import { getFirstColumnIndexToRender, getTotalHeaderHeight } from '../columns/gr
|
|
|
19
12
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
20
13
|
import { getRenderableIndexes } from '../virtualization/useGridVirtualScroller';
|
|
21
14
|
import { GridColumnGroupHeader } from '../../../components/columnHeaders/GridColumnGroupHeader';
|
|
22
|
-
import { gridColumnGroupsHeaderMaxDepthSelector, gridColumnGroupsHeaderStructureSelector } from '../columnGrouping/gridColumnGroupsSelector';
|
|
23
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
16
|
const GridColumnHeaderRow = styled('div', {
|
|
25
17
|
name: 'MuiDataGrid',
|
|
@@ -34,26 +26,26 @@ function isUIEvent(event) {
|
|
|
34
26
|
export const useGridColumnHeaders = props => {
|
|
35
27
|
const {
|
|
36
28
|
innerRef: innerRefProp,
|
|
37
|
-
minColumnIndex = 0
|
|
29
|
+
minColumnIndex = 0,
|
|
30
|
+
visibleColumns,
|
|
31
|
+
sortColumnLookup,
|
|
32
|
+
filterColumnLookup,
|
|
33
|
+
columnPositions,
|
|
34
|
+
columnHeaderTabIndexState,
|
|
35
|
+
columnGroupHeaderTabIndexState,
|
|
36
|
+
columnHeaderFocus,
|
|
37
|
+
columnGroupHeaderFocus,
|
|
38
|
+
densityFactor,
|
|
39
|
+
headerGroupingMaxDepth,
|
|
40
|
+
columnMenuState,
|
|
41
|
+
columnVisibility,
|
|
42
|
+
columnGroupsHeaderStructure,
|
|
43
|
+
hasOtherElementInTabSequence
|
|
38
44
|
} = props;
|
|
39
45
|
const theme = useTheme();
|
|
40
46
|
const [dragCol, setDragCol] = React.useState('');
|
|
41
47
|
const [resizeCol, setResizeCol] = React.useState('');
|
|
42
48
|
const apiRef = useGridPrivateApiContext();
|
|
43
|
-
const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
44
|
-
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
45
|
-
const columnHeaderTabIndexState = useGridSelector(apiRef, gridTabIndexColumnHeaderSelector);
|
|
46
|
-
const cellTabIndexState = useGridSelector(apiRef, gridTabIndexCellSelector);
|
|
47
|
-
const columnGroupHeaderTabIndexState = useGridSelector(apiRef, unstable_gridTabIndexColumnGroupHeaderSelector);
|
|
48
|
-
const columnHeaderFocus = useGridSelector(apiRef, gridFocusColumnHeaderSelector);
|
|
49
|
-
const columnGroupHeaderFocus = useGridSelector(apiRef, unstable_gridFocusColumnGroupHeaderSelector);
|
|
50
|
-
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
51
|
-
const headerGroupingMaxDepth = useGridSelector(apiRef, gridColumnGroupsHeaderMaxDepthSelector);
|
|
52
|
-
const filterColumnLookup = useGridSelector(apiRef, gridFilterActiveItemsLookupSelector);
|
|
53
|
-
const sortColumnLookup = useGridSelector(apiRef, gridSortColumnLookupSelector);
|
|
54
|
-
const columnMenuState = useGridSelector(apiRef, gridColumnMenuSelector);
|
|
55
|
-
const columnVisibility = useGridSelector(apiRef, gridColumnVisibilityModelSelector);
|
|
56
|
-
const columnGroupsHeaderStructure = useGridSelector(apiRef, gridColumnGroupsHeaderStructureSelector);
|
|
57
49
|
const rootProps = useGridRootProps();
|
|
58
50
|
const innerRef = React.useRef(null);
|
|
59
51
|
const handleInnerRef = useForkRef(innerRefProp, innerRef);
|
|
@@ -198,8 +190,7 @@ export const useGridColumnHeaders = props => {
|
|
|
198
190
|
const colDef = renderedColumns[i];
|
|
199
191
|
const columnIndex = firstColumnToRender + i;
|
|
200
192
|
const isFirstColumn = columnIndex === 0;
|
|
201
|
-
const
|
|
202
|
-
const tabIndex = columnHeaderTabIndexState !== null && columnHeaderTabIndexState.field === colDef.field || isFirstColumn && !hasTabbableElement ? 0 : -1;
|
|
193
|
+
const tabIndex = columnHeaderTabIndexState !== null && columnHeaderTabIndexState.field === colDef.field || isFirstColumn && !hasOtherElementInTabSequence ? 0 : -1;
|
|
203
194
|
const hasFocus = columnHeaderFocus !== null && columnHeaderFocus.field === colDef.field;
|
|
204
195
|
const open = columnMenuState.open && columnMenuState.field === colDef.field;
|
|
205
196
|
columns.push( /*#__PURE__*/_jsx(GridColumnHeaderItem, _extends({}, sortColumnLookup[colDef.field], {
|
|
@@ -7,12 +7,12 @@ import * as React from 'react';
|
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
8
8
|
import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
9
9
|
import { useTheme } from '@mui/material/styles';
|
|
10
|
+
import { defaultMemoize } from 'reselect';
|
|
10
11
|
import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
|
|
11
12
|
import { useGridRootProps } from '../../utils/useGridRootProps';
|
|
12
13
|
import { useGridSelector } from '../../utils/useGridSelector';
|
|
13
14
|
import { gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector, gridColumnPositionsSelector } from '../columns/gridColumnsSelector';
|
|
14
15
|
import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
|
|
15
|
-
import { gridEditRowsStateSelector } from '../editing/gridEditingSelectors';
|
|
16
16
|
import { useGridVisibleRows } from '../../utils/useGridVisibleRows';
|
|
17
17
|
import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
|
|
18
18
|
import { clamp } from '../../../utils/utils';
|
|
@@ -20,9 +20,8 @@ import { selectedIdsLookupSelector } from '../rowSelection/gridRowSelectionSelec
|
|
|
20
20
|
import { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';
|
|
21
21
|
import { getFirstNonSpannedColumnToRender } from '../columns/gridColumnsUtils';
|
|
22
22
|
import { getMinimalContentHeight } from '../rows/gridRowsUtils';
|
|
23
|
-
|
|
24
|
-
// Uses binary search to avoid looping through all possible positions
|
|
25
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
// Uses binary search to avoid looping through all possible positions
|
|
26
25
|
export function binarySearch(offset, positions, sliceStart = 0, sliceEnd = positions.length) {
|
|
27
26
|
if (positions.length <= 0) {
|
|
28
27
|
return -1;
|
|
@@ -75,7 +74,6 @@ export const useGridVirtualScroller = props => {
|
|
|
75
74
|
const cellFocus = useGridSelector(apiRef, gridFocusCellSelector);
|
|
76
75
|
const cellTabIndex = useGridSelector(apiRef, gridTabIndexCellSelector);
|
|
77
76
|
const rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);
|
|
78
|
-
const editRowsState = useGridSelector(apiRef, gridEditRowsStateSelector);
|
|
79
77
|
const selectedRowsLookup = useGridSelector(apiRef, selectedIdsLookupSelector);
|
|
80
78
|
const currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
81
79
|
const renderZoneRef = React.useRef(null);
|
|
@@ -92,6 +90,12 @@ export const useGridVirtualScroller = props => {
|
|
|
92
90
|
height: null
|
|
93
91
|
});
|
|
94
92
|
const prevTotalWidth = React.useRef(columnsTotalWidth);
|
|
93
|
+
const rowStyleCache = React.useRef({});
|
|
94
|
+
const prevGetRowProps = React.useRef();
|
|
95
|
+
const prevRootRowStyle = React.useRef();
|
|
96
|
+
const getRenderedColumnsRef = React.useRef(defaultMemoize((columns, firstColumnToRender, lastColumnToRender) => {
|
|
97
|
+
return columns.slice(firstColumnToRender, lastColumnToRender);
|
|
98
|
+
}));
|
|
95
99
|
const getNearestIndexToRender = React.useCallback(offset => {
|
|
96
100
|
const lastMeasuredIndexRelativeToAllRows = apiRef.current.getLastMeasuredRowIndex();
|
|
97
101
|
let allRowsMeasured = lastMeasuredIndexRelativeToAllRows === Infinity;
|
|
@@ -359,7 +363,16 @@ export const useGridVirtualScroller = props => {
|
|
|
359
363
|
lastRowToRender,
|
|
360
364
|
visibleRows: currentPage.rows
|
|
361
365
|
});
|
|
362
|
-
const renderedColumns =
|
|
366
|
+
const renderedColumns = getRenderedColumnsRef.current(visibleColumns, firstColumnToRender, lastColumnToRender);
|
|
367
|
+
const _ref = rootProps.slotProps?.row || {},
|
|
368
|
+
{
|
|
369
|
+
style: rootRowStyle
|
|
370
|
+
} = _ref,
|
|
371
|
+
rootRowProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
372
|
+
const invalidatesCachedRowStyle = prevGetRowProps.current !== getRowProps || prevRootRowStyle.current !== rootRowStyle;
|
|
373
|
+
if (invalidatesCachedRowStyle) {
|
|
374
|
+
rowStyleCache.current = {};
|
|
375
|
+
}
|
|
363
376
|
const rows = [];
|
|
364
377
|
for (let i = 0; i < renderedRows.length; i += 1) {
|
|
365
378
|
const {
|
|
@@ -374,26 +387,27 @@ export const useGridVirtualScroller = props => {
|
|
|
374
387
|
} else {
|
|
375
388
|
isSelected = apiRef.current.isRowSelectable(id);
|
|
376
389
|
}
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
390
|
+
const focusedCell = cellFocus !== null && cellFocus.id === id ? cellFocus.field : null;
|
|
391
|
+
let tabbableCell = null;
|
|
392
|
+
if (cellTabIndex !== null && cellTabIndex.id === id) {
|
|
393
|
+
const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
|
|
394
|
+
tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
|
|
395
|
+
}
|
|
382
396
|
const _ref2 = typeof getRowProps === 'function' && getRowProps(id, model) || {},
|
|
383
397
|
{
|
|
384
398
|
style: rowStyle
|
|
385
399
|
} = _ref2,
|
|
386
400
|
rowProps = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
401
|
+
if (!rowStyleCache.current[id]) {
|
|
402
|
+
const style = _extends({}, rowStyle, rootRowStyle);
|
|
403
|
+
rowStyleCache.current[id] = style;
|
|
404
|
+
}
|
|
387
405
|
rows.push( /*#__PURE__*/_jsx(rootProps.slots.row, _extends({
|
|
388
406
|
row: model,
|
|
389
407
|
rowId: id,
|
|
390
408
|
rowHeight: baseRowHeight,
|
|
391
|
-
|
|
392
|
-
,
|
|
393
|
-
cellTabIndex: cellTabIndex // TODO move to inside the row
|
|
394
|
-
,
|
|
395
|
-
editRowsState: editRowsState // TODO move to inside the row
|
|
396
|
-
,
|
|
409
|
+
focusedCell: focusedCell,
|
|
410
|
+
tabbableCell: tabbableCell,
|
|
397
411
|
renderedColumns: renderedColumns,
|
|
398
412
|
visibleColumns: visibleColumns,
|
|
399
413
|
firstColumnToRender: firstColumnToRender,
|
|
@@ -404,9 +418,11 @@ export const useGridVirtualScroller = props => {
|
|
|
404
418
|
isLastVisible: lastVisibleRowIndex,
|
|
405
419
|
position: position
|
|
406
420
|
}, rowProps, rootRowProps, {
|
|
407
|
-
style:
|
|
421
|
+
style: rowStyleCache.current[id]
|
|
408
422
|
}), id));
|
|
409
423
|
}
|
|
424
|
+
prevGetRowProps.current = getRowProps;
|
|
425
|
+
prevRootRowStyle.current = rootRowStyle;
|
|
410
426
|
return rows;
|
|
411
427
|
};
|
|
412
428
|
const needsHorizontalScrollbar = containerDimensions.width && columnsTotalWidth > containerDimensions.width;
|
package/modern/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-data-grid v6.0.0
|
|
2
|
+
* @mui/x-data-grid v6.0.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -17,6 +17,8 @@ export * from './models';
|
|
|
17
17
|
export * from './context';
|
|
18
18
|
export * from './colDef';
|
|
19
19
|
export * from './utils';
|
|
20
|
+
export { GridColumnHeaders } from './components/GridColumnHeaders';
|
|
21
|
+
|
|
20
22
|
/**
|
|
21
23
|
* Reexportable components.
|
|
22
24
|
*/
|
|
@@ -24,4 +26,6 @@ export { GridColumnMenu, GRID_COLUMN_MENU_COMPONENTS, GRID_COLUMN_MENU_COMPONENT
|
|
|
24
26
|
|
|
25
27
|
/**
|
|
26
28
|
* The full grid API.
|
|
29
|
+
* @demos
|
|
30
|
+
* - [API object](/x/react-data-grid/api-object/)
|
|
27
31
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { GridVirtualScroller } from '../components/virtualization/GridVirtualScroller';
|
|
2
2
|
export { GridVirtualScrollerContent } from '../components/virtualization/GridVirtualScrollerContent';
|
|
3
3
|
export { GridVirtualScrollerRenderZone } from '../components/virtualization/GridVirtualScrollerRenderZone';
|
|
4
|
-
export {
|
|
4
|
+
export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColumnHeaders';
|
|
5
5
|
export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
|
|
6
6
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
7
7
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
package/modern/locales/arSD.js
CHANGED
|
@@ -20,17 +20,15 @@ const arSDGrid = {
|
|
|
20
20
|
toolbarFiltersTooltipShow: 'اظهر المرشِحات',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count !== 1 ? `${count} من المرشِحات النشطة` : `مرشِح نشط`,
|
|
22
22
|
// Quick filter toolbar field
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
toolbarQuickFilterPlaceholder: 'بحث...',
|
|
24
|
+
toolbarQuickFilterLabel: 'بحث',
|
|
25
|
+
toolbarQuickFilterDeleteIconLabel: 'أزال',
|
|
27
26
|
// Export selector toolbar button text
|
|
28
27
|
toolbarExport: 'تصدير',
|
|
29
28
|
toolbarExportLabel: 'تصدير',
|
|
30
29
|
toolbarExportCSV: 'تنزيل كملف CSV',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
toolbarExportPrint: 'طباعة',
|
|
31
|
+
toolbarExportExcel: 'تحميل كملف الإكسل',
|
|
34
32
|
// Columns panel text
|
|
35
33
|
columnsPanelTextFieldLabel: 'البحث عن العمود',
|
|
36
34
|
columnsPanelTextFieldPlaceholder: 'عنوان العمود',
|
|
@@ -109,20 +107,17 @@ const arSDGrid = {
|
|
|
109
107
|
groupColumn: name => `تجميع حسب ${name}`,
|
|
110
108
|
unGroupColumn: name => `إيقاف التجميع حسب ${name}`,
|
|
111
109
|
// Master/detail
|
|
112
|
-
|
|
110
|
+
detailPanelToggle: 'اظهار/اخفاء لوحة التفاصيل',
|
|
113
111
|
expandDetailPanel: 'توسيع',
|
|
114
|
-
collapseDetailPanel: 'طوي'
|
|
115
|
-
|
|
112
|
+
collapseDetailPanel: 'طوي',
|
|
116
113
|
// Row reordering text
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
rowReorderingHeaderName: 'أعادة ترتيب الصفوف',
|
|
119
115
|
// Aggregation
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
aggregationMenuItemHeader: 'الدلالات الحسابية',
|
|
117
|
+
aggregationFunctionLabelSum: 'مجموع',
|
|
118
|
+
aggregationFunctionLabelAvg: 'معدل',
|
|
119
|
+
aggregationFunctionLabelMin: 'الحد الادنى',
|
|
120
|
+
aggregationFunctionLabelMax: 'الحد الاقصى',
|
|
121
|
+
aggregationFunctionLabelSize: 'الحجم'
|
|
126
122
|
};
|
|
127
|
-
|
|
128
123
|
export const arSD = getGridLocalization(arSDGrid, arSDCore);
|
package/modern/locales/csCZ.js
CHANGED
|
@@ -28,17 +28,15 @@ const csCZGrid = {
|
|
|
28
28
|
return `${count} ${pluralForm}`;
|
|
29
29
|
},
|
|
30
30
|
// Quick filter toolbar field
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
toolbarQuickFilterPlaceholder: 'Vyhledávat…',
|
|
32
|
+
toolbarQuickFilterLabel: 'Vyhledat',
|
|
33
|
+
toolbarQuickFilterDeleteIconLabel: 'Vymazat',
|
|
35
34
|
// Export selector toolbar button text
|
|
36
35
|
toolbarExport: 'Export',
|
|
37
36
|
toolbarExportLabel: 'Export',
|
|
38
37
|
toolbarExportCSV: 'Stáhnout jako CSV',
|
|
39
38
|
toolbarExportPrint: 'Vytisknout',
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
toolbarExportExcel: 'Stáhnout jako Excel',
|
|
42
40
|
// Columns panel text
|
|
43
41
|
columnsPanelTextFieldLabel: 'Najít sloupec',
|
|
44
42
|
columnsPanelTextFieldPlaceholder: 'Název sloupce',
|
|
@@ -47,9 +45,9 @@ const csCZGrid = {
|
|
|
47
45
|
columnsPanelHideAllButton: 'Skrýt vše',
|
|
48
46
|
// Filter panel text
|
|
49
47
|
filterPanelAddFilter: 'Přidat filtr',
|
|
50
|
-
|
|
48
|
+
filterPanelRemoveAll: 'Odstranit vše',
|
|
51
49
|
filterPanelDeleteIconLabel: 'Odstranit',
|
|
52
|
-
|
|
50
|
+
filterPanelLogicOperator: 'Logický operátor',
|
|
53
51
|
filterPanelOperator: 'Operátory',
|
|
54
52
|
filterPanelOperatorAnd: 'A',
|
|
55
53
|
filterPanelOperatorOr: 'Nebo',
|
|
@@ -69,8 +67,7 @@ const csCZGrid = {
|
|
|
69
67
|
filterOperatorOnOrBefore: 'je na nebo dříve',
|
|
70
68
|
filterOperatorIsEmpty: 'je prázdný',
|
|
71
69
|
filterOperatorIsNotEmpty: 'není prázdný',
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
filterOperatorIsAnyOf: 'je jeden z',
|
|
74
71
|
// Filter values text
|
|
75
72
|
filterValueAny: 'jakýkoliv',
|
|
76
73
|
filterValueTrue: 'ano',
|
|
@@ -78,7 +75,7 @@ const csCZGrid = {
|
|
|
78
75
|
// Column menu text
|
|
79
76
|
columnMenuLabel: 'Menu',
|
|
80
77
|
columnMenuShowColumns: 'Zobrazit sloupce',
|
|
81
|
-
|
|
78
|
+
columnMenuManageColumns: 'Spravovat sloupce',
|
|
82
79
|
columnMenuFilter: 'Filtr',
|
|
83
80
|
columnMenuHideColumn: 'Skrýt',
|
|
84
81
|
columnMenuUnsort: 'Zrušit filtry',
|
|
@@ -117,11 +114,10 @@ const csCZGrid = {
|
|
|
117
114
|
},
|
|
118
115
|
// Checkbox selection text
|
|
119
116
|
checkboxSelectionHeaderName: 'Výběr řádku',
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
117
|
+
checkboxSelectionSelectAllRows: 'Označit všechny řádky',
|
|
118
|
+
checkboxSelectionUnselectAllRows: 'Odznačit všechny řádky',
|
|
119
|
+
checkboxSelectionSelectRow: 'Označit řádek',
|
|
120
|
+
checkboxSelectionUnselectRow: 'Odznačit řádek',
|
|
125
121
|
// Boolean cell text
|
|
126
122
|
booleanCellTrueLabel: 'ano',
|
|
127
123
|
booleanCellFalseLabel: 'ne',
|
|
@@ -137,24 +133,20 @@ const csCZGrid = {
|
|
|
137
133
|
treeDataCollapse: 'skrýt potomky',
|
|
138
134
|
// Grouping columns
|
|
139
135
|
groupingColumnHeaderName: 'Skupina',
|
|
140
|
-
groupColumn: name => `
|
|
141
|
-
unGroupColumn: name => `Přestat
|
|
142
|
-
|
|
136
|
+
groupColumn: name => `Zeskupit podle ${name}`,
|
|
137
|
+
unGroupColumn: name => `Přestat zeskupovat podle ${name}`,
|
|
143
138
|
// Master/detail
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
139
|
+
detailPanelToggle: 'Přepnout detail panelu',
|
|
140
|
+
expandDetailPanel: 'Rozbalit',
|
|
141
|
+
collapseDetailPanel: 'Sbalit',
|
|
148
142
|
// Row reordering text
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
rowReorderingHeaderName: 'Přeuspořádávání řádků',
|
|
151
144
|
// Aggregation
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
145
|
+
aggregationMenuItemHeader: 'Seskupování',
|
|
146
|
+
aggregationFunctionLabelSum: 'součet',
|
|
147
|
+
aggregationFunctionLabelAvg: 'průměr',
|
|
148
|
+
aggregationFunctionLabelMin: 'min',
|
|
149
|
+
aggregationFunctionLabelMax: 'max',
|
|
150
|
+
aggregationFunctionLabelSize: 'počet'
|
|
158
151
|
};
|
|
159
|
-
|
|
160
152
|
export const csCZ = getGridLocalization(csCZGrid, csCZCore);
|
package/modern/locales/esES.js
CHANGED
|
@@ -32,7 +32,7 @@ const esESGrid = {
|
|
|
32
32
|
// Columns panel text
|
|
33
33
|
columnsPanelTextFieldLabel: 'Columna de búsqueda',
|
|
34
34
|
columnsPanelTextFieldPlaceholder: 'Título de columna',
|
|
35
|
-
columnsPanelDragIconLabel: '
|
|
35
|
+
columnsPanelDragIconLabel: 'Reordenar columna',
|
|
36
36
|
columnsPanelShowAllButton: 'Mostrar todo',
|
|
37
37
|
columnsPanelHideAllButton: 'Ocultar todo',
|
|
38
38
|
// Filter panel text
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["native"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import MUIMenuItem from '@mui/material/MenuItem';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export default function MUISelectOption(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
native
|
|
10
|
+
} = _ref,
|
|
11
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
|
+
if (native) {
|
|
13
|
+
return /*#__PURE__*/_jsx("option", _extends({}, props));
|
|
14
|
+
}
|
|
15
|
+
return /*#__PURE__*/_jsx(MUIMenuItem, _extends({}, props));
|
|
16
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import MUICheckbox from '@mui/material/Checkbox';
|
|
3
|
+
import MUITextField from '@mui/material/TextField';
|
|
4
|
+
import MUIFormControl from '@mui/material/FormControl';
|
|
5
|
+
import MUISelect from '@mui/material/Select';
|
|
6
|
+
import MUISwitch from '@mui/material/Switch';
|
|
7
|
+
import MUIButton from '@mui/material/Button';
|
|
8
|
+
import MUIIconButton from '@mui/material/IconButton';
|
|
9
|
+
import MUITooltip from '@mui/material/Tooltip';
|
|
10
|
+
import MUIPopper from '@mui/material/Popper';
|
|
11
|
+
import MUIInputLabel from '@mui/material/InputLabel';
|
|
12
|
+
import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
13
|
+
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
14
|
+
import MUISelectOption from './components/MUISelectOption';
|
|
15
|
+
const iconSlots = {
|
|
16
|
+
BooleanCellTrueIcon: GridCheckIcon,
|
|
17
|
+
BooleanCellFalseIcon: GridCloseIcon,
|
|
18
|
+
ColumnMenuIcon: GridTripleDotsVerticalIcon,
|
|
19
|
+
OpenFilterButtonIcon: GridFilterListIcon,
|
|
20
|
+
FilterPanelDeleteIcon: GridCloseIcon,
|
|
21
|
+
ColumnFilteredIcon: GridFilterAltIcon,
|
|
22
|
+
ColumnSelectorIcon: GridColumnIcon,
|
|
23
|
+
ColumnUnsortedIcon: GridColumnUnsortedIcon,
|
|
24
|
+
ColumnSortedAscendingIcon: GridArrowUpwardIcon,
|
|
25
|
+
ColumnSortedDescendingIcon: GridArrowDownwardIcon,
|
|
26
|
+
ColumnResizeIcon: GridSeparatorIcon,
|
|
27
|
+
DensityCompactIcon: GridViewHeadlineIcon,
|
|
28
|
+
DensityStandardIcon: GridTableRowsIcon,
|
|
29
|
+
DensityComfortableIcon: GridViewStreamIcon,
|
|
30
|
+
ExportIcon: GridSaveAltIcon,
|
|
31
|
+
MoreActionsIcon: GridMoreVertIcon,
|
|
32
|
+
TreeDataCollapseIcon: GridExpandMoreIcon,
|
|
33
|
+
TreeDataExpandIcon: GridKeyboardArrowRight,
|
|
34
|
+
GroupingCriteriaCollapseIcon: GridExpandMoreIcon,
|
|
35
|
+
GroupingCriteriaExpandIcon: GridKeyboardArrowRight,
|
|
36
|
+
DetailPanelExpandIcon: GridAddIcon,
|
|
37
|
+
DetailPanelCollapseIcon: GridRemoveIcon,
|
|
38
|
+
RowReorderIcon: GridDragIcon,
|
|
39
|
+
QuickFilterIcon: GridSearchIcon,
|
|
40
|
+
QuickFilterClearIcon: GridCloseIcon,
|
|
41
|
+
ColumnMenuHideIcon: GridVisibilityOffIcon,
|
|
42
|
+
ColumnMenuSortAscendingIcon: GridArrowUpwardIcon,
|
|
43
|
+
ColumnMenuSortDescendingIcon: GridArrowDownwardIcon,
|
|
44
|
+
ColumnMenuFilterIcon: GridFilterAltIcon,
|
|
45
|
+
ColumnMenuManageColumnsIcon: GridViewColumnIcon,
|
|
46
|
+
ColumnMenuClearIcon: GridClearIcon,
|
|
47
|
+
LoadIcon: GridLoadIcon,
|
|
48
|
+
FilterPanelAddIcon: GridAddIcon,
|
|
49
|
+
FilterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
50
|
+
ColumnReorderIcon: GridDragIcon
|
|
51
|
+
};
|
|
52
|
+
const materialSlots = _extends({}, iconSlots, {
|
|
53
|
+
BaseCheckbox: MUICheckbox,
|
|
54
|
+
BaseTextField: MUITextField,
|
|
55
|
+
BaseFormControl: MUIFormControl,
|
|
56
|
+
BaseSelect: MUISelect,
|
|
57
|
+
BaseSwitch: MUISwitch,
|
|
58
|
+
BaseButton: MUIButton,
|
|
59
|
+
BaseIconButton: MUIIconButton,
|
|
60
|
+
BaseTooltip: MUITooltip,
|
|
61
|
+
BasePopper: MUIPopper,
|
|
62
|
+
BaseInputLabel: MUIInputLabel,
|
|
63
|
+
BaseSelectOption: MUISelectOption
|
|
64
|
+
});
|
|
65
|
+
export default materialSlots;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Object passed as parameter in the row callbacks.
|
|
3
|
+
* @demos
|
|
4
|
+
* - [Master detail](/x/react-data-grid/master-detail/)
|
|
3
5
|
*/
|
|
4
6
|
/**
|
|
5
7
|
* Object passed as parameter in the row `getRowClassName` callback prop.
|
|
8
|
+
* @demos
|
|
9
|
+
* - [Styling rows](/x/react-data-grid/style/#styling-rows)
|
|
6
10
|
*/
|
|
7
11
|
/**
|
|
8
12
|
* Object passed as parameter in the row `getRowHeight` callback prop.
|
|
@@ -13,7 +13,6 @@ var _GridContextProvider = require("../context/GridContextProvider");
|
|
|
13
13
|
var _useDataGridComponent = require("./useDataGridComponent");
|
|
14
14
|
var _useDataGridProps = require("./useDataGridProps");
|
|
15
15
|
var _DataGridVirtualScroller = require("../components/DataGridVirtualScroller");
|
|
16
|
-
var _DataGridColumnHeaders = require("../components/DataGridColumnHeaders");
|
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -29,7 +28,6 @@ const DataGridRaw = /*#__PURE__*/React.forwardRef(function DataGrid(inProps, ref
|
|
|
29
28
|
sx: props.sx,
|
|
30
29
|
ref: ref,
|
|
31
30
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridBody, {
|
|
32
|
-
ColumnHeadersComponent: _DataGridColumnHeaders.DataGridColumnHeaders,
|
|
33
31
|
VirtualScrollerComponent: _DataGridVirtualScroller.DataGridVirtualScroller
|
|
34
32
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.GridFooterPlaceholder, {})]
|
|
35
33
|
})
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GridColumnHeaders = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColumnHeaders");
|
|
13
|
+
var _GridScrollArea = require("./GridScrollArea");
|
|
14
|
+
var _GridBaseColumnHeaders = require("./columnHeaders/GridBaseColumnHeaders");
|
|
15
|
+
var _GridColumnHeadersInner = require("./columnHeaders/GridColumnHeadersInner");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const _excluded = ["innerRef", "className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnPositions", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "densityFactor", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnsHeaders(props, ref) {
|
|
21
|
+
const {
|
|
22
|
+
innerRef,
|
|
23
|
+
visibleColumns,
|
|
24
|
+
sortColumnLookup,
|
|
25
|
+
filterColumnLookup,
|
|
26
|
+
columnPositions,
|
|
27
|
+
columnHeaderTabIndexState,
|
|
28
|
+
columnGroupHeaderTabIndexState,
|
|
29
|
+
columnHeaderFocus,
|
|
30
|
+
columnGroupHeaderFocus,
|
|
31
|
+
densityFactor,
|
|
32
|
+
headerGroupingMaxDepth,
|
|
33
|
+
columnMenuState,
|
|
34
|
+
columnVisibility,
|
|
35
|
+
columnGroupsHeaderStructure,
|
|
36
|
+
hasOtherElementInTabSequence
|
|
37
|
+
} = props,
|
|
38
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
39
|
+
const {
|
|
40
|
+
isDragging,
|
|
41
|
+
getRootProps,
|
|
42
|
+
getInnerProps,
|
|
43
|
+
getColumnHeaders,
|
|
44
|
+
getColumnGroupHeaders
|
|
45
|
+
} = (0, _useGridColumnHeaders.useGridColumnHeaders)({
|
|
46
|
+
innerRef,
|
|
47
|
+
visibleColumns,
|
|
48
|
+
sortColumnLookup,
|
|
49
|
+
filterColumnLookup,
|
|
50
|
+
columnPositions,
|
|
51
|
+
columnHeaderTabIndexState,
|
|
52
|
+
columnGroupHeaderTabIndexState,
|
|
53
|
+
columnHeaderFocus,
|
|
54
|
+
columnGroupHeaderFocus,
|
|
55
|
+
densityFactor,
|
|
56
|
+
headerGroupingMaxDepth,
|
|
57
|
+
columnMenuState,
|
|
58
|
+
columnVisibility,
|
|
59
|
+
columnGroupsHeaderStructure,
|
|
60
|
+
hasOtherElementInTabSequence
|
|
61
|
+
});
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridBaseColumnHeaders.GridBaseColumnHeaders, (0, _extends2.default)({
|
|
63
|
+
ref: ref
|
|
64
|
+
}, getRootProps(other), {
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridScrollArea.GridScrollArea, {
|
|
66
|
+
scrollDirection: "left"
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridColumnHeadersInner.GridColumnHeadersInner, (0, _extends2.default)({
|
|
68
|
+
isDragging: isDragging
|
|
69
|
+
}, getInnerProps(), {
|
|
70
|
+
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
71
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridScrollArea.GridScrollArea, {
|
|
72
|
+
scrollDirection: "right"
|
|
73
|
+
})]
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
exports.GridColumnHeaders = GridColumnHeaders;
|
|
77
|
+
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
78
|
+
// ----------------------------- Warning --------------------------------
|
|
79
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
80
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
81
|
+
// ----------------------------------------------------------------------
|
|
82
|
+
columnGroupHeaderFocus: _propTypes.default.shape({
|
|
83
|
+
depth: _propTypes.default.number.isRequired,
|
|
84
|
+
field: _propTypes.default.string.isRequired
|
|
85
|
+
}),
|
|
86
|
+
columnGroupHeaderTabIndexState: _propTypes.default.shape({
|
|
87
|
+
depth: _propTypes.default.number.isRequired,
|
|
88
|
+
field: _propTypes.default.string.isRequired
|
|
89
|
+
}),
|
|
90
|
+
columnGroupsHeaderStructure: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.shape({
|
|
91
|
+
columnFields: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
92
|
+
groupId: _propTypes.default.string
|
|
93
|
+
}))).isRequired,
|
|
94
|
+
columnHeaderFocus: _propTypes.default.shape({
|
|
95
|
+
field: _propTypes.default.string.isRequired
|
|
96
|
+
}),
|
|
97
|
+
columnHeaderTabIndexState: _propTypes.default.shape({
|
|
98
|
+
field: _propTypes.default.string.isRequired
|
|
99
|
+
}),
|
|
100
|
+
columnMenuState: _propTypes.default.shape({
|
|
101
|
+
field: _propTypes.default.string,
|
|
102
|
+
open: _propTypes.default.bool.isRequired
|
|
103
|
+
}).isRequired,
|
|
104
|
+
columnPositions: _propTypes.default.arrayOf(_propTypes.default.number).isRequired,
|
|
105
|
+
columnVisibility: _propTypes.default.object.isRequired,
|
|
106
|
+
densityFactor: _propTypes.default.number.isRequired,
|
|
107
|
+
filterColumnLookup: _propTypes.default.object.isRequired,
|
|
108
|
+
hasOtherElementInTabSequence: _propTypes.default.bool.isRequired,
|
|
109
|
+
headerGroupingMaxDepth: _propTypes.default.number.isRequired,
|
|
110
|
+
innerRef: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
111
|
+
current: _propTypes.default.object
|
|
112
|
+
})]),
|
|
113
|
+
minColumnIndex: _propTypes.default.number,
|
|
114
|
+
sortColumnLookup: _propTypes.default.object.isRequired,
|
|
115
|
+
visibleColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
|
|
116
|
+
} : void 0;
|