@mui/x-data-grid 8.0.0-alpha.4 → 8.0.0-alpha.6
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 +182 -0
- package/DataGrid/DataGrid.js +6 -9
- package/DataGrid/useDataGridProps.js +3 -3
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +5 -3
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +15 -3
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +4 -3
- package/components/cell/GridActionsCellItem.d.ts +1 -1
- package/components/cell/GridActionsCellItem.js +7 -8
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +72 -3
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +1 -1
- package/components/containers/GridRoot.js +5 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +3 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -1
- package/components/panel/filterPanel/index.js +1 -1
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +4 -4
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/components/toolbar/GridToolbarFilterButton.d.ts +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +4 -3
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/index.js +1 -1
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/locales/koKR.js +45 -49
- package/locales/nlNL.js +5 -6
- package/material/index.js +36 -4
- package/models/gridBaseSlots.d.ts +36 -0
- package/models/gridBaseSlots.js +1 -0
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +38 -5
- package/models/props/DataGridProps.d.ts +0 -5
- package/modern/DataGrid/DataGrid.js +6 -9
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +5 -3
- package/modern/components/GridRow.js +15 -3
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
- package/modern/components/cell/GridActionsCellItem.js +7 -8
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditInputCell.js +72 -3
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +5 -3
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/modern/components/panel/GridPanel.js +3 -2
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +4 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/modern/components/virtualization/GridMainContainer.js +4 -3
- package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/index.js +1 -1
- package/modern/internals/utils/index.js +0 -1
- package/modern/locales/koKR.js +45 -49
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +36 -4
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +6 -9
- package/node/DataGrid/useDataGridProps.js +2 -2
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +5 -3
- package/node/components/GridRow.js +15 -3
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +4 -3
- package/node/components/cell/GridActionsCellItem.js +6 -7
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditInputCell.js +72 -3
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/node/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +5 -3
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/node/components/panel/GridPanel.js +3 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +10 -11
- package/node/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -11
- package/node/components/toolbar/GridToolbar.js +4 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/node/components/virtualization/GridMainContainer.js +4 -3
- package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/index.js +1 -1
- package/node/internals/utils/index.js +0 -11
- package/node/locales/koKR.js +45 -49
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +37 -4
- package/node/models/gridBaseSlots.js +5 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { unstable_useForkRef as useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, unstable_capitalize as capitalize, unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
9
|
import { GridRootStyles } from "./GridRootStyles.js";
|
|
9
10
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
10
11
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
@@ -23,7 +24,7 @@ const useUtilityClasses = (ownerState, density) => {
|
|
|
23
24
|
};
|
|
24
25
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
26
|
};
|
|
26
|
-
const GridRoot =
|
|
27
|
+
const GridRoot = forwardRef(function GridRoot(props, ref) {
|
|
27
28
|
const rootProps = useGridRootProps();
|
|
28
29
|
const {
|
|
29
30
|
className
|
|
@@ -45,10 +46,11 @@ const GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {
|
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
47
48
|
return /*#__PURE__*/_jsx(GridRootStyles, _extends({
|
|
48
|
-
ref: handleRef,
|
|
49
49
|
className: clsx(classes.root, className),
|
|
50
50
|
ownerState: ownerState
|
|
51
|
-
}, other
|
|
51
|
+
}, other, {
|
|
52
|
+
ref: handleRef
|
|
53
|
+
}));
|
|
52
54
|
});
|
|
53
55
|
process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
|
|
54
56
|
// ----------------------------- Warning --------------------------------
|
|
@@ -3,7 +3,7 @@ import { SxProps, Theme } from '@mui/system';
|
|
|
3
3
|
export type GridToolbarContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
sx?: SxProps<Theme>;
|
|
5
5
|
};
|
|
6
|
-
declare const GridToolbarContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
declare const GridToolbarContainer: React.ForwardRefExoticComponent<GridToolbarContainerProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
sx?: SxProps<Theme>;
|
|
8
8
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export { GridToolbarContainer };
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import clsx from 'clsx';
|
|
7
7
|
import { styled } from '@mui/system';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
10
11
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -31,7 +32,7 @@ const GridToolbarContainerRoot = styled('div', {
|
|
|
31
32
|
gap: theme.spacing(1),
|
|
32
33
|
padding: theme.spacing(0.5, 0.5, 0)
|
|
33
34
|
}));
|
|
34
|
-
const GridToolbarContainer =
|
|
35
|
+
const GridToolbarContainer = forwardRef(function GridToolbarContainer(props, ref) {
|
|
35
36
|
const {
|
|
36
37
|
className,
|
|
37
38
|
children
|
|
@@ -43,10 +44,10 @@ const GridToolbarContainer = /*#__PURE__*/React.forwardRef(function GridToolbarC
|
|
|
43
44
|
return null;
|
|
44
45
|
}
|
|
45
46
|
return /*#__PURE__*/_jsx(GridToolbarContainerRoot, _extends({
|
|
46
|
-
ref: ref,
|
|
47
47
|
className: clsx(classes.root, className),
|
|
48
48
|
ownerState: rootProps
|
|
49
49
|
}, other, {
|
|
50
|
+
ref: ref,
|
|
50
51
|
children: children
|
|
51
52
|
}));
|
|
52
53
|
});
|
|
@@ -19,6 +19,6 @@ export declare const GRID_COLUMN_MENU_SLOT_PROPS: {
|
|
|
19
19
|
displayOrder: number;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
declare const GridGenericColumnMenu: React.ForwardRefExoticComponent<GridGenericColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
23
|
-
declare const GridColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
22
|
+
declare const GridGenericColumnMenu: React.ForwardRefExoticComponent<GridGenericColumnMenuProps> | React.ForwardRefExoticComponent<GridGenericColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
23
|
+
declare const GridColumnMenu: React.ForwardRefExoticComponent<GridColumnMenuProps> | React.ForwardRefExoticComponent<GridColumnMenuProps & React.RefAttributes<HTMLUListElement>>;
|
|
24
24
|
export { GridColumnMenu, GridGenericColumnMenu };
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["defaultSlots", "defaultSlotProps", "slots", "slotProps"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
6
7
|
import { useGridColumnMenuSlots } from "../../../hooks/features/columnMenu/useGridColumnMenuSlots.js";
|
|
7
8
|
import { GridColumnMenuContainer } from "./GridColumnMenuContainer.js";
|
|
8
9
|
import { GridColumnMenuColumnsItem } from "./menuItems/GridColumnMenuColumnsItem.js";
|
|
@@ -25,7 +26,7 @@ export const GRID_COLUMN_MENU_SLOT_PROPS = {
|
|
|
25
26
|
displayOrder: 30
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
|
-
const GridGenericColumnMenu =
|
|
29
|
+
const GridGenericColumnMenu = forwardRef(function GridGenericColumnMenu(props, ref) {
|
|
29
30
|
const {
|
|
30
31
|
defaultSlots,
|
|
31
32
|
defaultSlotProps,
|
|
@@ -39,9 +40,8 @@ const GridGenericColumnMenu = /*#__PURE__*/React.forwardRef(function GridGeneric
|
|
|
39
40
|
slots,
|
|
40
41
|
slotProps
|
|
41
42
|
}));
|
|
42
|
-
return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({
|
|
43
|
-
ref: ref
|
|
44
|
-
}, other, {
|
|
43
|
+
return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({}, other, {
|
|
44
|
+
ref: ref,
|
|
45
45
|
children: orderedSlots.map(([Component, otherProps], index) => /*#__PURE__*/_jsx(Component, _extends({}, otherProps), index))
|
|
46
46
|
}));
|
|
47
47
|
});
|
|
@@ -77,7 +77,7 @@ process.env.NODE_ENV !== "production" ? GridGenericColumnMenu.propTypes = {
|
|
|
77
77
|
*/
|
|
78
78
|
slots: PropTypes.object
|
|
79
79
|
} : void 0;
|
|
80
|
-
const GridColumnMenu =
|
|
80
|
+
const GridColumnMenu = forwardRef(function GridColumnMenu(props, ref) {
|
|
81
81
|
return /*#__PURE__*/_jsx(GridGenericColumnMenu, _extends({}, props, {
|
|
82
82
|
ref: ref,
|
|
83
83
|
defaultSlots: GRID_COLUMN_MENU_SLOTS,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GridColumnMenuContainerProps } from './GridColumnMenuProps';
|
|
3
|
-
declare const GridColumnMenuContainer: React.ForwardRefExoticComponent<GridColumnMenuContainerProps & React.RefAttributes<HTMLUListElement>>;
|
|
3
|
+
declare const GridColumnMenuContainer: React.ForwardRefExoticComponent<GridColumnMenuContainerProps> | React.ForwardRefExoticComponent<GridColumnMenuContainerProps & React.RefAttributes<HTMLUListElement>>;
|
|
4
4
|
export { GridColumnMenuContainer };
|
|
@@ -6,13 +6,14 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import MenuList from '@mui/material/MenuList';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
10
|
import { isHideMenuKey } from "../../../utils/keyboardUtils.js";
|
|
10
11
|
import { gridClasses } from "../../../constants/gridClasses.js";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
const StyledMenuList = styled(MenuList)(() => ({
|
|
13
14
|
minWidth: 248
|
|
14
15
|
}));
|
|
15
|
-
const GridColumnMenuContainer =
|
|
16
|
+
const GridColumnMenuContainer = forwardRef(function GridColumnMenuContainer(props, ref) {
|
|
16
17
|
const {
|
|
17
18
|
hideMenu,
|
|
18
19
|
id,
|
|
@@ -32,12 +33,12 @@ const GridColumnMenuContainer = /*#__PURE__*/React.forwardRef(function GridColum
|
|
|
32
33
|
}, [hideMenu]);
|
|
33
34
|
return /*#__PURE__*/_jsx(StyledMenuList, _extends({
|
|
34
35
|
id: id,
|
|
35
|
-
ref: ref,
|
|
36
36
|
className: clsx(gridClasses.menuList, className),
|
|
37
37
|
"aria-labelledby": labelledby,
|
|
38
38
|
onKeyDown: handleListKeyDown,
|
|
39
39
|
autoFocus: open
|
|
40
40
|
}, other, {
|
|
41
|
+
ref: ref,
|
|
41
42
|
children: children
|
|
42
43
|
}));
|
|
43
44
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
6
4
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
7
|
-
import { jsx as _jsx
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
function GridColumnMenuFilterItem(props) {
|
|
9
7
|
const {
|
|
10
8
|
colDef,
|
|
@@ -19,15 +17,12 @@ function GridColumnMenuFilterItem(props) {
|
|
|
19
17
|
if (rootProps.disableColumnFilter || !colDef.filterable) {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
23
21
|
onClick: showFilter,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
29
|
-
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
30
|
-
})]
|
|
22
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuFilterIcon, {
|
|
23
|
+
fontSize: "small"
|
|
24
|
+
}),
|
|
25
|
+
children: apiRef.current.getLocaleText('columnMenuFilter')
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
process.env.NODE_ENV !== "production" ? GridColumnMenuFilterItem.propTypes = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
6
4
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
7
5
|
import { gridVisibleColumnDefinitionsSelector } from "../../../../hooks/features/columns/index.js";
|
|
8
|
-
import { jsx as _jsx
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
function GridColumnMenuHideItem(props) {
|
|
10
8
|
const {
|
|
11
9
|
colDef,
|
|
@@ -35,16 +33,13 @@ function GridColumnMenuHideItem(props) {
|
|
|
35
33
|
if (colDef.hideable === false) {
|
|
36
34
|
return null;
|
|
37
35
|
}
|
|
38
|
-
return /*#__PURE__*/
|
|
36
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
39
37
|
onClick: toggleColumn,
|
|
40
38
|
disabled: disabled,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
46
|
-
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
47
|
-
})]
|
|
39
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuHideIcon, {
|
|
40
|
+
fontSize: "small"
|
|
41
|
+
}),
|
|
42
|
+
children: apiRef.current.getLocaleText('columnMenuHideColumn')
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
45
|
process.env.NODE_ENV !== "production" ? GridColumnMenuHideItem.propTypes = {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { GridPreferencePanelsValue } from "../../../../hooks/features/preferencesPanel/gridPreferencePanelsValue.js";
|
|
6
4
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
7
5
|
import { useGridRootProps } from "../../../../hooks/utils/useGridRootProps.js";
|
|
8
|
-
import { jsx as _jsx
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
function GridColumnMenuManageItem(props) {
|
|
10
8
|
const {
|
|
11
9
|
onClick
|
|
@@ -19,15 +17,12 @@ function GridColumnMenuManageItem(props) {
|
|
|
19
17
|
if (rootProps.disableColumnSelector) {
|
|
20
18
|
return null;
|
|
21
19
|
}
|
|
22
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
23
21
|
onClick: showColumns,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
29
|
-
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
30
|
-
})]
|
|
22
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuManageColumnsIcon, {
|
|
23
|
+
fontSize: "small"
|
|
24
|
+
}),
|
|
25
|
+
children: apiRef.current.getLocaleText('columnMenuManageColumns')
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
28
|
process.env.NODE_ENV !== "production" ? GridColumnMenuManageItem.propTypes = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
4
|
-
import ListItemText from '@mui/material/ListItemText';
|
|
5
3
|
import { useGridSelector } from "../../../../hooks/utils/useGridSelector.js";
|
|
6
4
|
import { gridSortModelSelector } from "../../../../hooks/features/sorting/gridSortingSelector.js";
|
|
7
5
|
import { useGridApiContext } from "../../../../hooks/utils/useGridApiContext.js";
|
|
@@ -36,31 +34,24 @@ function GridColumnMenuSortItem(props) {
|
|
|
36
34
|
return typeof label === 'function' ? label(colDef) : label;
|
|
37
35
|
};
|
|
38
36
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
39
|
-
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/
|
|
37
|
+
children: [sortingOrder.includes('asc') && sortDirection !== 'asc' ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
40
38
|
onClick: onSortMenuItemClick,
|
|
41
39
|
"data-value": "asc",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
children: getLabel('columnMenuSortAsc')
|
|
48
|
-
})]
|
|
49
|
-
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
|
|
40
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortAscendingIcon, {
|
|
41
|
+
fontSize: "small"
|
|
42
|
+
}),
|
|
43
|
+
children: getLabel('columnMenuSortAsc')
|
|
44
|
+
}) : null, sortingOrder.includes('desc') && sortDirection !== 'desc' ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
50
45
|
onClick: onSortMenuItemClick,
|
|
51
46
|
"data-value": "desc",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children: getLabel('columnMenuSortDesc')
|
|
58
|
-
})]
|
|
59
|
-
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsxs(rootProps.slots.baseMenuItem, {
|
|
47
|
+
iconStart: /*#__PURE__*/_jsx(rootProps.slots.columnMenuSortDescendingIcon, {
|
|
48
|
+
fontSize: "small"
|
|
49
|
+
}),
|
|
50
|
+
children: getLabel('columnMenuSortDesc')
|
|
51
|
+
}) : null, sortingOrder.includes(null) && sortDirection != null ? /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, {
|
|
60
52
|
onClick: onSortMenuItemClick,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})]
|
|
53
|
+
iconStart: "",
|
|
54
|
+
children: apiRef.current.getLocaleText('columnMenuUnsort')
|
|
64
55
|
}) : null]
|
|
65
56
|
});
|
|
66
57
|
}
|
|
@@ -19,5 +19,5 @@ export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
|
|
|
19
19
|
declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
20
20
|
ownerState: OwnerState;
|
|
21
21
|
}, {}, {}>;
|
|
22
|
-
declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const GridPanel: React.ForwardRefExoticComponent<GridPanelProps> | React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
23
|
export { GridPanel };
|
|
@@ -9,6 +9,7 @@ import { unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/
|
|
|
9
9
|
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
10
10
|
import Paper from '@mui/material/Paper';
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
12
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
12
13
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
13
14
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -36,7 +37,7 @@ const GridPaperRoot = styled(Paper, {
|
|
|
36
37
|
maxWidth: `calc(100vw - ${theme.spacing(0.5)})`,
|
|
37
38
|
overflow: 'auto'
|
|
38
39
|
}));
|
|
39
|
-
const GridPanel =
|
|
40
|
+
const GridPanel = forwardRef((props, ref) => {
|
|
40
41
|
const {
|
|
41
42
|
children,
|
|
42
43
|
className
|
|
@@ -82,13 +83,13 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
82
83
|
return null;
|
|
83
84
|
}
|
|
84
85
|
return /*#__PURE__*/_jsx(GridPanelRoot, _extends({
|
|
85
|
-
ref: ref,
|
|
86
86
|
placement: "bottom-start",
|
|
87
87
|
className: clsx(classes.panel, className),
|
|
88
88
|
ownerState: rootProps,
|
|
89
89
|
anchorEl: anchorEl,
|
|
90
90
|
modifiers: modifiers
|
|
91
91
|
}, other, {
|
|
92
|
+
ref: ref,
|
|
92
93
|
children: /*#__PURE__*/_jsx(ClickAwayListener, {
|
|
93
94
|
mouseEvent: "onMouseUp",
|
|
94
95
|
onClickAway: handleClickAway,
|
|
@@ -7,5 +7,5 @@ export interface GridPanelWrapperProps extends React.PropsWithChildren<React.HTM
|
|
|
7
7
|
TrapFocus?: TrapFocusProps;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
declare const GridPanelWrapper: React.ForwardRefExoticComponent<GridPanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const GridPanelWrapper: React.ForwardRefExoticComponent<GridPanelWrapperProps> | React.ForwardRefExoticComponent<GridPanelWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export { GridPanelWrapper };
|
|
@@ -7,6 +7,7 @@ import clsx from 'clsx';
|
|
|
7
7
|
import FocusTrap from '@mui/material/Unstable_TrapFocus';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
11
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
11
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -32,7 +33,7 @@ const GridPanelWrapperRoot = styled('div', {
|
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
const isEnabled = () => true;
|
|
35
|
-
const GridPanelWrapper =
|
|
36
|
+
const GridPanelWrapper = forwardRef(function GridPanelWrapper(props, ref) {
|
|
36
37
|
const {
|
|
37
38
|
className,
|
|
38
39
|
slotProps = {}
|
|
@@ -46,11 +47,12 @@ const GridPanelWrapper = /*#__PURE__*/React.forwardRef(function GridPanelWrapper
|
|
|
46
47
|
isEnabled: isEnabled
|
|
47
48
|
}, slotProps.TrapFocus, {
|
|
48
49
|
children: /*#__PURE__*/_jsx(GridPanelWrapperRoot, _extends({
|
|
49
|
-
ref: ref,
|
|
50
50
|
tabIndex: -1,
|
|
51
51
|
className: clsx(classes.root, className),
|
|
52
52
|
ownerState: rootProps
|
|
53
|
-
}, other
|
|
53
|
+
}, other, {
|
|
54
|
+
ref: ref
|
|
55
|
+
}))
|
|
54
56
|
}));
|
|
55
57
|
});
|
|
56
58
|
process.env.NODE_ENV !== "production" ? GridPanelWrapper.propTypes = {
|
|
@@ -96,7 +96,7 @@ export interface GridFilterFormProps {
|
|
|
96
96
|
*/
|
|
97
97
|
children?: React.ReactNode;
|
|
98
98
|
}
|
|
99
|
-
declare const GridFilterForm: React.ForwardRefExoticComponent<GridFilterFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
99
|
+
declare const GridFilterForm: React.ForwardRefExoticComponent<GridFilterFormProps> | React.ForwardRefExoticComponent<GridFilterFormProps & React.RefAttributes<HTMLDivElement>>;
|
|
100
100
|
/**
|
|
101
101
|
* Demos:
|
|
102
102
|
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
@@ -7,6 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
11
|
import { gridFilterableColumnDefinitionsSelector, gridColumnLookupSelector } from "../../../hooks/features/columns/gridColumnsSelector.js";
|
|
11
12
|
import { gridFilterModelSelector } from "../../../hooks/features/filter/gridFilterSelector.js";
|
|
12
13
|
import { useGridSelector } from "../../../hooks/utils/useGridSelector.js";
|
|
@@ -90,7 +91,7 @@ const getLogicOperatorLocaleKey = logicOperator => {
|
|
|
90
91
|
};
|
|
91
92
|
const getColumnLabel = col => col.headerName || col.field;
|
|
92
93
|
const collator = new Intl.Collator();
|
|
93
|
-
const GridFilterForm =
|
|
94
|
+
const GridFilterForm = forwardRef(function GridFilterForm(props, ref) {
|
|
94
95
|
const {
|
|
95
96
|
item,
|
|
96
97
|
hasMultipleFilters,
|
|
@@ -250,11 +251,11 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
250
251
|
}
|
|
251
252
|
}), [currentOperator]);
|
|
252
253
|
return /*#__PURE__*/_jsxs(GridFilterFormRoot, _extends({
|
|
253
|
-
ref: ref,
|
|
254
254
|
className: classes.root,
|
|
255
255
|
"data-id": item.id,
|
|
256
256
|
ownerState: rootProps
|
|
257
257
|
}, other, {
|
|
258
|
+
ref: ref,
|
|
258
259
|
children: [/*#__PURE__*/_jsx(FilterFormDeleteIcon, _extends({
|
|
259
260
|
as: rootProps.slots.baseFormControl
|
|
260
261
|
}, baseFormControlProps, deleteIconProps, {
|
|
@@ -9,9 +9,9 @@ export type GridFilterInputBooleanProps = GridFilterInputValueProps & TextFieldP
|
|
|
9
9
|
*/
|
|
10
10
|
isFilterActive?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const sanitizeFilterItemValue: (value: any) => boolean | undefined;
|
|
13
12
|
declare function GridFilterInputBoolean(props: GridFilterInputBooleanProps): React.JSX.Element;
|
|
14
13
|
declare namespace GridFilterInputBoolean {
|
|
15
14
|
var propTypes: any;
|
|
16
15
|
}
|
|
16
|
+
export declare function sanitizeFilterItemValue(value: any): boolean | undefined;
|
|
17
17
|
export { GridFilterInputBoolean };
|
|
@@ -7,15 +7,6 @@ import { refType, unstable_useId as useId } from '@mui/utils';
|
|
|
7
7
|
import { styled } from '@mui/material/styles';
|
|
8
8
|
import { useGridRootProps } from "../../../hooks/utils/useGridRootProps.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
export const sanitizeFilterItemValue = value => {
|
|
11
|
-
if (String(value).toLowerCase() === 'true') {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (String(value).toLowerCase() === 'false') {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
};
|
|
19
10
|
const BooleanOperatorContainer = styled('div')({
|
|
20
11
|
display: 'flex',
|
|
21
12
|
alignItems: 'center',
|
|
@@ -94,6 +85,15 @@ function GridFilterInputBoolean(props) {
|
|
|
94
85
|
}), clearButton]
|
|
95
86
|
});
|
|
96
87
|
}
|
|
88
|
+
export function sanitizeFilterItemValue(value) {
|
|
89
|
+
if (String(value).toLowerCase() === 'true') {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (String(value).toLowerCase() === 'false') {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
97
|
process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
98
98
|
// ----------------------------- Warning --------------------------------
|
|
99
99
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -22,19 +22,17 @@ function GridFilterInputValue(props) {
|
|
|
22
22
|
} = props,
|
|
23
23
|
others = _objectWithoutPropertiesLoose(props, _excluded);
|
|
24
24
|
const filterTimeout = useTimeout();
|
|
25
|
-
const [filterValueState, setFilterValueState] = React.useState(item.value
|
|
25
|
+
const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value, type));
|
|
26
26
|
const [applying, setIsApplying] = React.useState(false);
|
|
27
27
|
const id = useId();
|
|
28
28
|
const rootProps = useGridRootProps();
|
|
29
29
|
const onFilterChange = React.useCallback(event => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
} = event.target;
|
|
33
|
-
setFilterValueState(String(value));
|
|
30
|
+
const value = sanitizeFilterItemValue(event.target.value, type);
|
|
31
|
+
setFilterValueState(value);
|
|
34
32
|
setIsApplying(true);
|
|
35
33
|
filterTimeout.start(rootProps.filterDebounceMs, () => {
|
|
36
34
|
const newItem = _extends({}, item, {
|
|
37
|
-
value
|
|
35
|
+
value,
|
|
38
36
|
fromInput: id
|
|
39
37
|
});
|
|
40
38
|
applyValue(newItem);
|
|
@@ -43,15 +41,15 @@ function GridFilterInputValue(props) {
|
|
|
43
41
|
}, [filterTimeout, rootProps.filterDebounceMs, item, type, id, applyValue]);
|
|
44
42
|
React.useEffect(() => {
|
|
45
43
|
const itemPlusTag = item;
|
|
46
|
-
if (itemPlusTag.fromInput !== id || item.value
|
|
47
|
-
setFilterValueState(
|
|
44
|
+
if (itemPlusTag.fromInput !== id || item.value == null) {
|
|
45
|
+
setFilterValueState(sanitizeFilterItemValue(item.value, type));
|
|
48
46
|
}
|
|
49
|
-
}, [id, item]);
|
|
47
|
+
}, [id, item, type]);
|
|
50
48
|
return /*#__PURE__*/_jsx(rootProps.slots.baseTextField, _extends({
|
|
51
49
|
id: id,
|
|
52
50
|
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
53
51
|
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
54
|
-
value: filterValueState,
|
|
52
|
+
value: filterValueState === undefined ? '' : String(filterValueState),
|
|
55
53
|
onChange: onFilterChange,
|
|
56
54
|
variant: variant,
|
|
57
55
|
type: type || 'text',
|
|
@@ -73,6 +71,15 @@ function GridFilterInputValue(props) {
|
|
|
73
71
|
inputRef: focusElementRef
|
|
74
72
|
}, others, rootProps.slotProps?.baseTextField));
|
|
75
73
|
}
|
|
74
|
+
function sanitizeFilterItemValue(value, type) {
|
|
75
|
+
if (value == null || value === '') {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
if (type === 'number') {
|
|
79
|
+
return Number(value);
|
|
80
|
+
}
|
|
81
|
+
return String(value);
|
|
82
|
+
}
|
|
76
83
|
process.env.NODE_ENV !== "production" ? GridFilterInputValue.propTypes = {
|
|
77
84
|
// ----------------------------- Warning --------------------------------
|
|
78
85
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -38,7 +38,7 @@ export interface GridFilterPanelProps extends Pick<GridFilterFormProps, 'logicOp
|
|
|
38
38
|
children?: React.ReactNode;
|
|
39
39
|
}
|
|
40
40
|
declare const getGridFilter: (col: GridStateColDef) => GridFilterItem;
|
|
41
|
-
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
declare const GridFilterPanel: React.ForwardRefExoticComponent<GridFilterPanelProps> | React.ForwardRefExoticComponent<GridFilterPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
42
|
/**
|
|
43
43
|
* Demos:
|
|
44
44
|
* - [Filtering - overview](https://mui.com/x/react-data-grid/filtering/)
|
|
@@ -3,6 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["logicOperators", "columnsSort", "filterFormProps", "getColumnForNewFilter", "children", "disableAddFilterButton", "disableRemoveAllButton"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
6
7
|
import { GridLogicOperator } from "../../../models/gridFilterItem.js";
|
|
7
8
|
import { useGridApiContext } from "../../../hooks/utils/useGridApiContext.js";
|
|
8
9
|
import { GridPanelContent } from "../GridPanelContent.js";
|
|
@@ -19,7 +20,7 @@ const getGridFilter = col => ({
|
|
|
19
20
|
operator: col.filterOperators[0].value,
|
|
20
21
|
id: Math.round(Math.random() * 1e5)
|
|
21
22
|
});
|
|
22
|
-
const GridFilterPanel =
|
|
23
|
+
const GridFilterPanel = forwardRef(function GridFilterPanel(props, ref) {
|
|
23
24
|
const apiRef = useGridApiContext();
|
|
24
25
|
const rootProps = useGridRootProps();
|
|
25
26
|
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
@@ -141,9 +142,8 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
141
142
|
lastFilterRef.current.focus();
|
|
142
143
|
}
|
|
143
144
|
}, [validFilters.length]);
|
|
144
|
-
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
145
|
-
ref: ref
|
|
146
|
-
}, other, {
|
|
145
|
+
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({}, other, {
|
|
146
|
+
ref: ref,
|
|
147
147
|
children: [/*#__PURE__*/_jsxs(GridPanelContent, {
|
|
148
148
|
children: [readOnlyFilters.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({
|
|
149
149
|
item: item,
|
|
@@ -2,7 +2,8 @@ export * from './GridFilterForm';
|
|
|
2
2
|
export * from './GridFilterInputValue';
|
|
3
3
|
export * from './GridFilterInputDate';
|
|
4
4
|
export * from './GridFilterInputSingleSelect';
|
|
5
|
-
export
|
|
5
|
+
export { GridFilterInputBoolean } from './GridFilterInputBoolean';
|
|
6
|
+
export type { GridFilterInputBooleanProps } from './GridFilterInputBoolean';
|
|
6
7
|
export * from './GridFilterInputValueProps';
|
|
7
8
|
export { GridFilterPanel } from './GridFilterPanel';
|
|
8
9
|
export type { GetColumnForNewFilterArgs } from './GridFilterPanel';
|
|
@@ -2,7 +2,7 @@ export * from "./GridFilterForm.js";
|
|
|
2
2
|
export * from "./GridFilterInputValue.js";
|
|
3
3
|
export * from "./GridFilterInputDate.js";
|
|
4
4
|
export * from "./GridFilterInputSingleSelect.js";
|
|
5
|
-
export
|
|
5
|
+
export { GridFilterInputBoolean } from "./GridFilterInputBoolean.js";
|
|
6
6
|
export * from "./GridFilterInputValueProps.js";
|
|
7
7
|
export { GridFilterPanel } from "./GridFilterPanel.js";
|
|
8
8
|
export * from "./GridFilterInputMultipleValue.js";
|
|
@@ -13,5 +13,5 @@ export interface GridToolbarProps extends GridToolbarContainerProps, GridToolbar
|
|
|
13
13
|
*/
|
|
14
14
|
quickFilterProps?: GridToolbarQuickFilterProps;
|
|
15
15
|
}
|
|
16
|
-
declare const GridToolbar: React.ForwardRefExoticComponent<GridToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const GridToolbar: React.ForwardRefExoticComponent<GridToolbarProps> | React.ForwardRefExoticComponent<GridToolbarProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
17
|
export { GridToolbar };
|