@mui/x-data-grid 7.0.0-beta.1 → 7.0.0-beta.2
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 +159 -1
- package/DataGrid/DataGrid.d.ts +1 -1
- package/DataGrid/DataGrid.js +1 -1
- package/DataGrid/useDataGridProps.js +3 -1
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +12 -2
- package/components/GridRow.js +7 -5
- package/components/GridScrollbarFillerCell.js +0 -3
- package/components/base/GridFooterPlaceholder.js +1 -1
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridActionsCellItem.d.ts +13 -1
- package/components/cell/GridActionsCellItem.js +27 -15
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnsManagement/utils.d.ts +1 -1
- package/components/containers/GridRootStyles.js +10 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/features/rows/gridRowsUtils.js +1 -1
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/index.js +1 -1
- package/internals/utils/propValidation.js +1 -1
- package/joy/joySlots.js +2 -2
- package/legacy/DataGrid/DataGrid.js +1 -1
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/components/GridPagination.js +10 -2
- package/legacy/components/GridRow.js +7 -5
- package/legacy/components/GridScrollbarFillerCell.js +1 -3
- package/legacy/components/base/GridFooterPlaceholder.js +1 -1
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridActionsCellItem.js +30 -17
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/legacy/components/containers/GridRootStyles.js +9 -3
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/features/rows/gridRowsUtils.js +1 -1
- package/legacy/hooks/features/rows/useGridRows.js +2 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/legacy/index.js +1 -1
- package/legacy/internals/utils/propValidation.js +1 -1
- package/legacy/joy/joySlots.js +2 -2
- package/legacy/locales/daDK.js +12 -12
- package/locales/daDK.js +12 -12
- package/models/api/gridApiCommon.d.ts +1 -1
- package/models/api/gridFilterApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +3 -3
- package/models/events/gridEventLookup.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +34 -36
- package/models/gridSlotsComponentsProps.d.ts +73 -54
- package/models/props/DataGridProps.d.ts +2 -2
- package/modern/DataGrid/DataGrid.js +1 -1
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/components/GridPagination.js +12 -2
- package/modern/components/GridRow.js +6 -5
- package/modern/components/GridScrollbarFillerCell.js +0 -3
- package/modern/components/base/GridFooterPlaceholder.js +1 -1
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridActionsCellItem.js +27 -15
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/modern/components/containers/GridRootStyles.js +10 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/modern/index.js +1 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/joy/joySlots.js +2 -2
- package/modern/locales/daDK.js +12 -12
- package/node/DataGrid/DataGrid.js +1 -1
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/components/GridPagination.js +12 -2
- package/node/components/GridRow.js +6 -5
- package/node/components/GridScrollbarFillerCell.js +0 -3
- package/node/components/base/GridFooterPlaceholder.js +1 -1
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridActionsCellItem.js +27 -15
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridRootStyles.js +10 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +2 -2
- package/node/hooks/features/rows/useGridRows.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +9 -10
- package/node/index.js +1 -1
- package/node/internals/utils/propValidation.js +1 -1
- package/node/joy/joySlots.js +2 -2
- package/node/locales/daDK.js +12 -12
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["label", "icon", "showInMenu", "onClick"]
|
|
3
|
+
const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
4
|
+
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import PropTypes from 'prop-types';
|
|
6
7
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -9,20 +10,17 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
12
|
const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
-
const {
|
|
13
|
-
label,
|
|
14
|
-
icon,
|
|
15
|
-
showInMenu,
|
|
16
|
-
onClick
|
|
17
|
-
} = props,
|
|
18
|
-
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
19
13
|
const rootProps = useGridRootProps();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
if (!props.showInMenu) {
|
|
15
|
+
const {
|
|
16
|
+
label,
|
|
17
|
+
icon,
|
|
18
|
+
onClick
|
|
19
|
+
} = props,
|
|
20
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
21
|
+
const handleClick = event => {
|
|
22
|
+
onClick?.(event);
|
|
23
|
+
};
|
|
26
24
|
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
27
25
|
ref: ref,
|
|
28
26
|
size: "small",
|
|
@@ -36,10 +34,24 @@ const GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
36
34
|
})
|
|
37
35
|
}));
|
|
38
36
|
}
|
|
37
|
+
const {
|
|
38
|
+
label,
|
|
39
|
+
icon,
|
|
40
|
+
onClick,
|
|
41
|
+
closeMenuOnClick = true,
|
|
42
|
+
closeMenu
|
|
43
|
+
} = props,
|
|
44
|
+
other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
45
|
+
const handleClick = event => {
|
|
46
|
+
onClick?.(event);
|
|
47
|
+
if (closeMenuOnClick) {
|
|
48
|
+
closeMenu?.();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
39
51
|
return /*#__PURE__*/_jsxs(MenuItem, _extends({
|
|
40
52
|
ref: ref
|
|
41
53
|
}, other, {
|
|
42
|
-
onClick:
|
|
54
|
+
onClick: handleClick,
|
|
43
55
|
children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
|
|
44
56
|
children: icon
|
|
45
57
|
}), label]
|
|
@@ -84,7 +84,7 @@ const GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCe
|
|
|
84
84
|
},
|
|
85
85
|
onKeyDown: handleKeyDown,
|
|
86
86
|
disabled: !isSelectable,
|
|
87
|
-
touchRippleRef: rippleRef
|
|
87
|
+
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
88
88
|
}, rootProps.slotProps?.baseCheckbox, other));
|
|
89
89
|
});
|
|
90
90
|
process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
@@ -240,6 +240,12 @@ export const GridRootStyles = styled('div', {
|
|
|
240
240
|
[`& .${c.cell} > *`]: {
|
|
241
241
|
overflow: 'visible !important',
|
|
242
242
|
whiteSpace: 'nowrap'
|
|
243
|
+
},
|
|
244
|
+
[`& .${c.groupingCriteriaCell}`]: {
|
|
245
|
+
width: 'unset'
|
|
246
|
+
},
|
|
247
|
+
[`& .${c.treeDataGroupingCell}`]: {
|
|
248
|
+
width: 'unset'
|
|
243
249
|
}
|
|
244
250
|
},
|
|
245
251
|
[`& .${c.columnHeader}, & .${c.cell}`]: {
|
|
@@ -554,8 +560,10 @@ export const GridRootStyles = styled('div', {
|
|
|
554
560
|
}
|
|
555
561
|
}
|
|
556
562
|
},
|
|
557
|
-
[`& .${c.
|
|
558
|
-
|
|
563
|
+
[`& .${c.cellOffsetLeft}`]: {
|
|
564
|
+
flex: '0 0 auto',
|
|
565
|
+
display: 'inline-block',
|
|
566
|
+
width: 'var(--DataGrid-offsetLeft)'
|
|
559
567
|
},
|
|
560
568
|
[`& .${c.columnHeaderDraggableContainer}`]: {
|
|
561
569
|
display: 'flex',
|
|
@@ -66,7 +66,7 @@ function GridFilterInputBoolean(props) {
|
|
|
66
66
|
ref: focusElementRef,
|
|
67
67
|
tabIndex
|
|
68
68
|
}
|
|
69
|
-
}, others
|
|
69
|
+
}, others /* FIXME: typing error */, baseSelectProps, {
|
|
70
70
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
71
71
|
native: isSelectNative,
|
|
72
72
|
value: "",
|
|
@@ -106,7 +106,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
106
106
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
107
107
|
},
|
|
108
108
|
native: isSelectNative
|
|
109
|
-
}, others
|
|
109
|
+
}, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {
|
|
110
110
|
children: renderSingleSelectOptions({
|
|
111
111
|
column: resolvedColumn,
|
|
112
112
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -130,7 +130,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
130
130
|
}
|
|
131
131
|
return apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
132
132
|
items: readOnlyFilters
|
|
133
|
-
}));
|
|
133
|
+
}), 'removeAllFilterItems');
|
|
134
134
|
}, [apiRef, readOnlyFilters, filterModel, validFilters]);
|
|
135
135
|
React.useEffect(() => {
|
|
136
136
|
if (logicOperators.length > 0 && filterModel.logicOperator && !logicOperators.includes(filterModel.logicOperator)) {
|
|
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClasses as generateUtilityClasses, unstable_gen
|
|
|
2
2
|
export function getDataGridUtilityClass(slot) {
|
|
3
3
|
return generateUtilityClass('MuiDataGrid', slot);
|
|
4
4
|
}
|
|
5
|
-
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellContent', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
5
|
+
export const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellContent', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { gridPinnedRowsSelector } from './gridRowsSelector';
|
|
3
|
-
import { gridDimensionsSelector } from '../dimensions';
|
|
3
|
+
import { gridDimensionsSelector } from '../dimensions/gridDimensionsSelectors';
|
|
4
4
|
export const GRID_ROOT_GROUP_ID = `auto-generated-group-node-root`;
|
|
5
5
|
export const GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');
|
|
6
6
|
export const buildRootGroup = () => ({
|
|
@@ -121,7 +121,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
121
121
|
}, [logger, props.getRowId, props.loading, props.rowCount, throttledRowsChange, apiRef]);
|
|
122
122
|
const updateRows = React.useCallback(updates => {
|
|
123
123
|
if (props.signature === GridSignature.DataGrid && updates.length > 1) {
|
|
124
|
-
throw new Error([
|
|
124
|
+
throw new Error(['MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
125
125
|
}
|
|
126
126
|
const nonPinnedRowsUpdates = [];
|
|
127
127
|
updates.forEach(update => {
|
|
@@ -246,7 +246,7 @@ export const useGridRows = (apiRef, props) => {
|
|
|
246
246
|
}, [apiRef, logger]);
|
|
247
247
|
const replaceRows = React.useCallback((firstRowToRender, newRows) => {
|
|
248
248
|
if (props.signature === GridSignature.DataGrid && newRows.length > 1) {
|
|
249
|
-
throw new Error([
|
|
249
|
+
throw new Error(['MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.', 'You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature.'].join('\n'));
|
|
250
250
|
}
|
|
251
251
|
if (newRows.length === 0) {
|
|
252
252
|
return;
|
|
@@ -46,7 +46,6 @@ export const useGridVirtualScroller = () => {
|
|
|
46
46
|
const gridRootRef = apiRef.current.rootElementRef;
|
|
47
47
|
const mainRef = apiRef.current.mainElementRef;
|
|
48
48
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
49
|
-
const renderZoneRef = React.useRef(null);
|
|
50
49
|
const scrollbarVerticalRef = React.useRef(null);
|
|
51
50
|
const scrollbarHorizontalRef = React.useRef(null);
|
|
52
51
|
const contentHeight = dimensions.contentSize.height;
|
|
@@ -244,6 +243,14 @@ export const useGridVirtualScroller = () => {
|
|
|
244
243
|
id,
|
|
245
244
|
model
|
|
246
245
|
} = renderedRows[i];
|
|
246
|
+
const rowIndexInPage = (currentPage?.range?.firstRowIndex || 0) + firstRowToRender + i;
|
|
247
|
+
let index = rowIndexOffset + rowIndexInPage;
|
|
248
|
+
if (isRowWithFocusedCellNotInRange && cellFocus?.id === id) {
|
|
249
|
+
index = indexOfRowWithFocusedCell;
|
|
250
|
+
isRowWithFocusedCellRendered = true;
|
|
251
|
+
} else if (isRowWithFocusedCellRendered) {
|
|
252
|
+
index -= 1;
|
|
253
|
+
}
|
|
247
254
|
const isRowNotVisible = isRowWithFocusedCellNotInRange && cellFocus.id === id;
|
|
248
255
|
const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
249
256
|
let isSelected;
|
|
@@ -254,7 +261,7 @@ export const useGridVirtualScroller = () => {
|
|
|
254
261
|
}
|
|
255
262
|
let isFirstVisible = false;
|
|
256
263
|
if (params.position === undefined) {
|
|
257
|
-
isFirstVisible =
|
|
264
|
+
isFirstVisible = rowIndexInPage === 0;
|
|
258
265
|
}
|
|
259
266
|
let isLastVisible = false;
|
|
260
267
|
if (isLastSection) {
|
|
@@ -276,13 +283,6 @@ export const useGridVirtualScroller = () => {
|
|
|
276
283
|
const cellParams = apiRef.current.getCellParams(id, cellTabIndex.field);
|
|
277
284
|
tabbableCell = cellParams.cellMode === 'view' ? cellTabIndex.field : null;
|
|
278
285
|
}
|
|
279
|
-
let index = rowIndexOffset + (currentPage?.range?.firstRowIndex || 0) + firstRowToRender + i;
|
|
280
|
-
if (isRowWithFocusedCellNotInRange && cellFocus?.id === id) {
|
|
281
|
-
index = indexOfRowWithFocusedCell;
|
|
282
|
-
isRowWithFocusedCellRendered = true;
|
|
283
|
-
} else if (isRowWithFocusedCellRendered) {
|
|
284
|
-
index -= 1;
|
|
285
|
-
}
|
|
286
286
|
rows.push( /*#__PURE__*/_jsx(rootProps.slots.row, _extends({
|
|
287
287
|
row: model,
|
|
288
288
|
rowId: id,
|
|
@@ -383,7 +383,6 @@ export const useGridVirtualScroller = () => {
|
|
|
383
383
|
role: 'presentation'
|
|
384
384
|
}),
|
|
385
385
|
getRenderZoneProps: () => ({
|
|
386
|
-
ref: renderZoneRef,
|
|
387
386
|
role: 'rowgroup'
|
|
388
387
|
}),
|
|
389
388
|
getScrollbarVerticalProps: () => ({
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You
|
|
1
|
+
export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined];
|
|
2
2
|
const warnedOnceMap = new Set();
|
|
3
3
|
const warnOnce = message => {
|
|
4
4
|
if (!warnedOnceMap.has(message)) {
|
package/modern/joy/joySlots.js
CHANGED
|
@@ -398,8 +398,8 @@ const joySlots = _extends({}, joyIconSlots, {
|
|
|
398
398
|
baseSelect: Select,
|
|
399
399
|
baseSelectOption: Option,
|
|
400
400
|
baseInputLabel: InputLabel,
|
|
401
|
-
baseFormControl: JoyFormControl
|
|
402
|
-
baseTooltip: JoyTooltip
|
|
401
|
+
baseFormControl: JoyFormControl /* FIXME: typing error */,
|
|
402
|
+
baseTooltip: JoyTooltip /* FIXME: typing error */,
|
|
403
403
|
pagination: Pagination,
|
|
404
404
|
loadingOverlay: LoadingOverlay
|
|
405
405
|
});
|
package/modern/locales/daDK.js
CHANGED
|
@@ -11,8 +11,8 @@ const daDKGrid = {
|
|
|
11
11
|
toolbarDensityStandard: 'Standard',
|
|
12
12
|
toolbarDensityComfortable: 'Luftig',
|
|
13
13
|
// Columns selector toolbar button text
|
|
14
|
-
toolbarColumns: '
|
|
15
|
-
toolbarColumnsLabel: 'Vælg
|
|
14
|
+
toolbarColumns: 'Kolonner',
|
|
15
|
+
toolbarColumnsLabel: 'Vælg kolonner',
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filtre',
|
|
18
18
|
toolbarFiltersLabel: 'Vis filtre',
|
|
@@ -39,12 +39,12 @@ const daDKGrid = {
|
|
|
39
39
|
filterPanelRemoveAll: 'Fjern alle',
|
|
40
40
|
filterPanelDeleteIconLabel: 'Slet',
|
|
41
41
|
filterPanelLogicOperator: 'Logisk operator',
|
|
42
|
-
filterPanelOperator: '
|
|
42
|
+
filterPanelOperator: 'Operator',
|
|
43
43
|
filterPanelOperatorAnd: 'Og',
|
|
44
44
|
filterPanelOperatorOr: 'Eller',
|
|
45
|
-
filterPanelColumns: '
|
|
45
|
+
filterPanelColumns: 'Kolonner',
|
|
46
46
|
filterPanelInputLabel: 'Værdi',
|
|
47
|
-
filterPanelInputPlaceholder: '
|
|
47
|
+
filterPanelInputPlaceholder: 'Filterværdi',
|
|
48
48
|
// Filter operators text
|
|
49
49
|
filterOperatorContains: 'indeholder',
|
|
50
50
|
filterOperatorEquals: 'lig med',
|
|
@@ -91,10 +91,10 @@ const daDKGrid = {
|
|
|
91
91
|
filterValueFalse: 'negativ',
|
|
92
92
|
// Column menu text
|
|
93
93
|
columnMenuLabel: 'Menu',
|
|
94
|
-
columnMenuShowColumns: 'Vis
|
|
94
|
+
columnMenuShowColumns: 'Vis kolonner',
|
|
95
95
|
columnMenuManageColumns: 'Administrer kolonner',
|
|
96
|
-
columnMenuFilter: '
|
|
97
|
-
columnMenuHideColumn: 'Skjul',
|
|
96
|
+
columnMenuFilter: 'Filtrer',
|
|
97
|
+
columnMenuHideColumn: 'Skjul kolonne',
|
|
98
98
|
columnMenuUnsort: 'Fjern sortering',
|
|
99
99
|
columnMenuSortAsc: 'Sorter stigende',
|
|
100
100
|
columnMenuSortDesc: 'Sorter faldende',
|
|
@@ -124,13 +124,13 @@ const daDKGrid = {
|
|
|
124
124
|
pinToRight: 'Fastgør til højre',
|
|
125
125
|
unpin: 'Frigiv',
|
|
126
126
|
// Tree Data
|
|
127
|
-
treeDataGroupingHeaderName: '
|
|
127
|
+
treeDataGroupingHeaderName: 'Gruppe',
|
|
128
128
|
treeDataExpand: 'Vis underelementer',
|
|
129
129
|
treeDataCollapse: 'Skjul underelementer',
|
|
130
130
|
// Grouping columns
|
|
131
|
-
groupingColumnHeaderName: '
|
|
131
|
+
groupingColumnHeaderName: 'Gruppe',
|
|
132
132
|
groupColumn: name => `Gruppér efter ${name}`,
|
|
133
|
-
unGroupColumn: name => `Fjern
|
|
133
|
+
unGroupColumn: name => `Fjern gruppering efter ${name}`,
|
|
134
134
|
// Master/detail
|
|
135
135
|
detailPanelToggle: 'Udvid/kollaps detaljepanel',
|
|
136
136
|
expandDetailPanel: 'Udvid',
|
|
@@ -138,7 +138,7 @@ const daDKGrid = {
|
|
|
138
138
|
// Row reordering text
|
|
139
139
|
rowReorderingHeaderName: 'Omarrangering af rækker',
|
|
140
140
|
// Aggregation
|
|
141
|
-
aggregationMenuItemHeader: '
|
|
141
|
+
aggregationMenuItemHeader: 'Aggregering',
|
|
142
142
|
aggregationFunctionLabelSum: 'sum',
|
|
143
143
|
aggregationFunctionLabelAvg: 'gns',
|
|
144
144
|
aggregationFunctionLabelMin: 'min',
|
|
@@ -313,7 +313,7 @@ DataGridRaw.propTypes = {
|
|
|
313
313
|
loading: _propTypes.default.bool,
|
|
314
314
|
/**
|
|
315
315
|
* Set the locale text of the Data Grid.
|
|
316
|
-
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/
|
|
316
|
+
* You can find all the translation keys supported in [the source](https://github.com/mui/mui-x/blob/HEAD/packages/x-data-grid/src/constants/localeTextConstants.ts) in the GitHub repository.
|
|
317
317
|
*/
|
|
318
318
|
localeText: _propTypes.default.object,
|
|
319
319
|
/**
|
|
@@ -83,7 +83,9 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
83
83
|
};
|
|
84
84
|
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
85
85
|
const useDataGridProps = inProps => {
|
|
86
|
-
const themedProps = (0, _utils.useProps)(
|
|
86
|
+
const themedProps = (0, _utils.useProps)(
|
|
87
|
+
// eslint-disable-next-line material-ui/mui-name-matches-component-name
|
|
88
|
+
(0, _styles.useThemeProps)({
|
|
87
89
|
props: inProps,
|
|
88
90
|
name: 'MuiDataGrid'
|
|
89
91
|
}));
|
|
@@ -33,13 +33,19 @@ const GridPaginationRoot = (0, _styles.styled)(_TablePagination.default)(({
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}));
|
|
36
|
+
|
|
37
|
+
// A mutable version of a readonly array.
|
|
38
|
+
|
|
36
39
|
const GridPagination = exports.GridPagination = /*#__PURE__*/React.forwardRef(function GridPagination(props, ref) {
|
|
37
40
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
38
41
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
39
42
|
const paginationModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridPaginationSelector.gridPaginationModelSelector);
|
|
40
43
|
const visibleTopLevelRowCount = (0, _useGridSelector.useGridSelector)(apiRef, _filter.gridFilteredTopLevelRowCountSelector);
|
|
41
44
|
const rowCount = React.useMemo(() => rootProps.rowCount ?? visibleTopLevelRowCount ?? 0, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
42
|
-
const lastPage = React.useMemo(() =>
|
|
45
|
+
const lastPage = React.useMemo(() => {
|
|
46
|
+
const calculatedValue = Math.ceil(rowCount / (paginationModel.pageSize || 1)) - 1;
|
|
47
|
+
return Math.max(0, calculatedValue);
|
|
48
|
+
}, [rowCount, paginationModel.pageSize]);
|
|
43
49
|
const handlePageSizeChange = React.useCallback(event => {
|
|
44
50
|
const pageSize = Number(event.target.value);
|
|
45
51
|
apiRef.current.setPageSize(pageSize);
|
|
@@ -74,7 +80,11 @@ const GridPagination = exports.GridPagination = /*#__PURE__*/React.forwardRef(fu
|
|
|
74
80
|
ref: ref,
|
|
75
81
|
component: "div",
|
|
76
82
|
count: rowCount,
|
|
77
|
-
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
83
|
+
page: paginationModel.page <= lastPage ? paginationModel.page : lastPage
|
|
84
|
+
// TODO: Remove the cast once the type is fixed in Material UI and that the min Material UI version
|
|
85
|
+
// for x-data-grid is past the fix.
|
|
86
|
+
// Note that Material UI will not mutate the array, so this is safe.
|
|
87
|
+
,
|
|
78
88
|
rowsPerPageOptions: pageSizeOptions,
|
|
79
89
|
rowsPerPage: paginationModel.pageSize,
|
|
80
90
|
onPageChange: handlePageChange,
|
|
@@ -45,9 +45,7 @@ const useUtilityClasses = ownerState => {
|
|
|
45
45
|
classes
|
|
46
46
|
} = ownerState;
|
|
47
47
|
const slots = {
|
|
48
|
-
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
49
|
-
pinnedLeft: ['pinnedLeft'],
|
|
50
|
-
pinnedRight: ['pinnedRight']
|
|
48
|
+
root: ['row', selected && 'selected', editable && 'row--editable', editing && 'row--editing', isFirstVisible && 'row--firstVisible', isLastVisible && 'row--lastVisible', rowHeight === 'auto' && 'row--dynamicHeight']
|
|
51
49
|
};
|
|
52
50
|
return (0, _utils.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
53
51
|
};
|
|
@@ -281,7 +279,7 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
281
279
|
width: width,
|
|
282
280
|
contentWidth: contentWidth,
|
|
283
281
|
field: column.field,
|
|
284
|
-
align: column.align
|
|
282
|
+
align: column.align ?? 'left'
|
|
285
283
|
}, column.field);
|
|
286
284
|
}
|
|
287
285
|
const {
|
|
@@ -369,7 +367,10 @@ const GridRow = /*#__PURE__*/React.forwardRef(function GridRow(props, refProp) {
|
|
|
369
367
|
"aria-selected": selected,
|
|
370
368
|
style: style
|
|
371
369
|
}, eventHandlers, other, {
|
|
372
|
-
children: [leftCells,
|
|
370
|
+
children: [leftCells, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
371
|
+
className: _gridClasses.gridClasses.cellOffsetLeft,
|
|
372
|
+
role: "presentation"
|
|
373
|
+
}), cells, emptyCellWidth > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(EmptyCell, {
|
|
373
374
|
width: emptyCellWidth
|
|
374
375
|
}), rightCells.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
375
376
|
role: "presentation",
|
|
@@ -30,9 +30,6 @@ const Style = (0, _styles.styled)('div')({
|
|
|
30
30
|
[`&.${classes.pinnedRight}:not(.${classes.header})`]: {
|
|
31
31
|
position: 'sticky',
|
|
32
32
|
right: 0
|
|
33
|
-
},
|
|
34
|
-
[`&:not(.${classes.header}):not(.${classes.pinnedRight})`]: {
|
|
35
|
-
transform: 'translate3d(var(--DataGrid-offsetLeft), 0, 0)'
|
|
36
33
|
}
|
|
37
34
|
});
|
|
38
35
|
function GridScrollbarFillerCell({
|
|
@@ -16,5 +16,5 @@ function GridFooterPlaceholder() {
|
|
|
16
16
|
if (rootProps.hideFooter) {
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.footer, (0, _extends2.default)({}, rootProps.slotProps?.footer));
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.footer, (0, _extends2.default)({}, rootProps.slotProps?.footer /* FIXME: typing error */));
|
|
20
20
|
}
|
|
@@ -145,7 +145,7 @@ function GridActionsCell(props) {
|
|
|
145
145
|
if (event.key === 'Tab') {
|
|
146
146
|
event.preventDefault();
|
|
147
147
|
}
|
|
148
|
-
if (['Tab', '
|
|
148
|
+
if (['Tab', 'Escape'].includes(event.key)) {
|
|
149
149
|
hideMenu();
|
|
150
150
|
}
|
|
151
151
|
};
|
|
@@ -182,7 +182,6 @@ function GridActionsCell(props) {
|
|
|
182
182
|
target: buttonRef.current,
|
|
183
183
|
position: position,
|
|
184
184
|
onClose: hideMenu,
|
|
185
|
-
onClick: hideMenu,
|
|
186
185
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuList.default, {
|
|
187
186
|
id: menuId,
|
|
188
187
|
className: _gridClasses.gridClasses.menuList,
|
|
@@ -191,7 +190,8 @@ function GridActionsCell(props) {
|
|
|
191
190
|
variant: "menu",
|
|
192
191
|
autoFocusItem: true,
|
|
193
192
|
children: menuButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {
|
|
194
|
-
key: index
|
|
193
|
+
key: index,
|
|
194
|
+
closeMenu: hideMenu
|
|
195
195
|
}))
|
|
196
196
|
})
|
|
197
197
|
})]
|
|
@@ -13,24 +13,22 @@ var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
|
13
13
|
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
14
14
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
const _excluded = ["label", "icon", "showInMenu", "onClick"]
|
|
16
|
+
const _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
17
|
+
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
17
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
20
|
const GridActionsCellItem = exports.GridActionsCellItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
20
|
-
const {
|
|
21
|
-
label,
|
|
22
|
-
icon,
|
|
23
|
-
showInMenu,
|
|
24
|
-
onClick
|
|
25
|
-
} = props,
|
|
26
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
27
21
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
if (!props.showInMenu) {
|
|
23
|
+
const {
|
|
24
|
+
label,
|
|
25
|
+
icon,
|
|
26
|
+
onClick
|
|
27
|
+
} = props,
|
|
28
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
29
|
+
const handleClick = event => {
|
|
30
|
+
onClick?.(event);
|
|
31
|
+
};
|
|
34
32
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
35
33
|
ref: ref,
|
|
36
34
|
size: "small",
|
|
@@ -44,10 +42,24 @@ const GridActionsCellItem = exports.GridActionsCellItem = /*#__PURE__*/React.for
|
|
|
44
42
|
})
|
|
45
43
|
}));
|
|
46
44
|
}
|
|
45
|
+
const {
|
|
46
|
+
label,
|
|
47
|
+
icon,
|
|
48
|
+
onClick,
|
|
49
|
+
closeMenuOnClick = true,
|
|
50
|
+
closeMenu
|
|
51
|
+
} = props,
|
|
52
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
53
|
+
const handleClick = event => {
|
|
54
|
+
onClick?.(event);
|
|
55
|
+
if (closeMenuOnClick) {
|
|
56
|
+
closeMenu?.();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
47
59
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MenuItem.default, (0, _extends2.default)({
|
|
48
60
|
ref: ref
|
|
49
61
|
}, other, {
|
|
50
|
-
onClick:
|
|
62
|
+
onClick: handleClick,
|
|
51
63
|
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemIcon.default, {
|
|
52
64
|
children: icon
|
|
53
65
|
}), label]
|
|
@@ -93,7 +93,7 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = /*#__PUR
|
|
|
93
93
|
},
|
|
94
94
|
onKeyDown: handleKeyDown,
|
|
95
95
|
disabled: !isSelectable,
|
|
96
|
-
touchRippleRef: rippleRef
|
|
96
|
+
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
97
97
|
}, rootProps.slotProps?.baseCheckbox, other));
|
|
98
98
|
});
|
|
99
99
|
process.env.NODE_ENV !== "production" ? GridCellCheckboxForwardRef.propTypes = {
|
|
@@ -247,6 +247,12 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
247
247
|
[`& .${_gridClasses.gridClasses.cell} > *`]: {
|
|
248
248
|
overflow: 'visible !important',
|
|
249
249
|
whiteSpace: 'nowrap'
|
|
250
|
+
},
|
|
251
|
+
[`& .${_gridClasses.gridClasses.groupingCriteriaCell}`]: {
|
|
252
|
+
width: 'unset'
|
|
253
|
+
},
|
|
254
|
+
[`& .${_gridClasses.gridClasses.treeDataGroupingCell}`]: {
|
|
255
|
+
width: 'unset'
|
|
250
256
|
}
|
|
251
257
|
},
|
|
252
258
|
[`& .${_gridClasses.gridClasses.columnHeader}, & .${_gridClasses.gridClasses.cell}`]: {
|
|
@@ -561,8 +567,10 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
561
567
|
}
|
|
562
568
|
}
|
|
563
569
|
},
|
|
564
|
-
[`& .${_gridClasses.gridClasses.
|
|
565
|
-
|
|
570
|
+
[`& .${_gridClasses.gridClasses.cellOffsetLeft}`]: {
|
|
571
|
+
flex: '0 0 auto',
|
|
572
|
+
display: 'inline-block',
|
|
573
|
+
width: 'var(--DataGrid-offsetLeft)'
|
|
566
574
|
},
|
|
567
575
|
[`& .${_gridClasses.gridClasses.columnHeaderDraggableContainer}`]: {
|
|
568
576
|
display: 'flex',
|
|
@@ -74,7 +74,7 @@ function GridFilterInputBoolean(props) {
|
|
|
74
74
|
ref: focusElementRef,
|
|
75
75
|
tabIndex
|
|
76
76
|
}
|
|
77
|
-
}, others
|
|
77
|
+
}, others /* FIXME: typing error */, baseSelectProps, {
|
|
78
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
|
|
79
79
|
native: isSelectNative,
|
|
80
80
|
value: "",
|
|
@@ -114,7 +114,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
114
114
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
115
115
|
},
|
|
116
116
|
native: isSelectNative
|
|
117
|
-
}, others
|
|
117
|
+
}, others /* FIXME: typing error */, rootProps.slotProps?.baseSelect, {
|
|
118
118
|
children: renderSingleSelectOptions({
|
|
119
119
|
column: resolvedColumn,
|
|
120
120
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -139,7 +139,7 @@ const GridFilterPanel = exports.GridFilterPanel = /*#__PURE__*/React.forwardRef(
|
|
|
139
139
|
}
|
|
140
140
|
return apiRef.current.setFilterModel((0, _extends2.default)({}, filterModel, {
|
|
141
141
|
items: readOnlyFilters
|
|
142
|
-
}));
|
|
142
|
+
}), 'removeAllFilterItems');
|
|
143
143
|
}, [apiRef, readOnlyFilters, filterModel, validFilters]);
|
|
144
144
|
React.useEffect(() => {
|
|
145
145
|
if (logicOperators.length > 0 && filterModel.logicOperator && !logicOperators.includes(filterModel.logicOperator)) {
|
|
@@ -9,4 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getDataGridUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiDataGrid', slot);
|
|
11
11
|
}
|
|
12
|
-
const gridClasses = exports.gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellContent', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|
|
12
|
+
const gridClasses = exports.gridClasses = (0, _utils.unstable_generateUtilityClasses)('MuiDataGrid', ['actionsCell', 'aggregationColumnHeader', 'aggregationColumnHeader--alignLeft', 'aggregationColumnHeader--alignCenter', 'aggregationColumnHeader--alignRight', 'aggregationColumnHeaderLabel', 'autoHeight', 'autosizing', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell--rangeTop', 'cell--rangeBottom', 'cell--rangeLeft', 'cell--rangeRight', 'cell--pinnedLeft', 'cell--pinnedRight', 'cell--selectionMode', 'cell', 'cellContent', 'cellCheckbox', 'cellEmpty', 'cellSkeleton', 'cellOffsetLeft', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnGroupHeader', 'columnHeader--filledGroup', 'columnHeader--emptyGroup', 'columnHeader--showColumnBorder', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsManagement', 'columnsManagementRow', 'columnsManagementHeader', 'columnsManagementFooter', 'container--top', 'container--bottom', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'footerCell', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filler', 'filler--pinnedLeft', 'filler--pinnedRight', 'filterForm', 'filterFormDeleteIcon', 'filterFormLogicOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'headerFilterRow', 'iconButtonContainer', 'iconSeparator', 'main', 'main--hasPinnedRight', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'overlayWrapper', 'overlayWrapperInner', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'root--disableUserSelection', 'row', 'row--editable', 'row--editing', 'row--firstVisible', 'row--lastVisible', 'row--dragging', 'row--dynamicHeight', 'row--detailPanelExpanded', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'scrollbar', 'scrollbar--vertical', 'scrollbar--horizontal', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withVerticalBorder', 'withBorderColor', 'cell--withRightBorder', 'cell--withLeftBorder', 'columnHeader--withRightBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle', 'pinnedRows', 'pinnedRows--top', 'pinnedRows--bottom', 'pinnedRowsRenderZone']);
|