@mui/x-data-grid 8.5.0 → 8.5.1
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 +112 -0
- package/components/columnsPanel/ColumnsPanelTrigger.d.ts +1 -1
- package/components/columnsPanel/ColumnsPanelTrigger.js +2 -2
- package/components/containers/GridRootStyles.d.ts +1 -1
- package/components/containers/GridRootStyles.js +6 -0
- package/components/export/ExportCsv.d.ts +1 -1
- package/components/export/ExportCsv.js +2 -2
- package/components/export/ExportPrint.d.ts +1 -1
- package/components/export/ExportPrint.js +2 -2
- package/components/filterPanel/FilterPanelTrigger.d.ts +1 -1
- package/components/filterPanel/FilterPanelTrigger.js +2 -2
- package/components/quickFilter/QuickFilter.d.ts +1 -1
- package/components/quickFilter/QuickFilter.js +2 -2
- package/components/quickFilter/QuickFilterClear.d.ts +1 -1
- package/components/quickFilter/QuickFilterClear.js +2 -2
- package/components/quickFilter/QuickFilterControl.d.ts +1 -1
- package/components/quickFilter/QuickFilterControl.js +2 -2
- package/components/quickFilter/QuickFilterTrigger.d.ts +1 -1
- package/components/quickFilter/QuickFilterTrigger.js +2 -2
- package/components/toolbarV8/Toolbar.d.ts +1 -1
- package/components/toolbarV8/Toolbar.js +2 -2
- package/components/toolbarV8/ToolbarButton.d.ts +1 -1
- package/components/toolbarV8/ToolbarButton.js +2 -2
- package/esm/components/columnsPanel/ColumnsPanelTrigger.d.ts +1 -1
- package/esm/components/columnsPanel/ColumnsPanelTrigger.js +2 -2
- package/esm/components/containers/GridRootStyles.d.ts +1 -1
- package/esm/components/containers/GridRootStyles.js +6 -0
- package/esm/components/export/ExportCsv.d.ts +1 -1
- package/esm/components/export/ExportCsv.js +2 -2
- package/esm/components/export/ExportPrint.d.ts +1 -1
- package/esm/components/export/ExportPrint.js +2 -2
- package/esm/components/filterPanel/FilterPanelTrigger.d.ts +1 -1
- package/esm/components/filterPanel/FilterPanelTrigger.js +2 -2
- package/esm/components/quickFilter/QuickFilter.d.ts +1 -1
- package/esm/components/quickFilter/QuickFilter.js +2 -2
- package/esm/components/quickFilter/QuickFilterClear.d.ts +1 -1
- package/esm/components/quickFilter/QuickFilterClear.js +2 -2
- package/esm/components/quickFilter/QuickFilterControl.d.ts +1 -1
- package/esm/components/quickFilter/QuickFilterControl.js +2 -2
- package/esm/components/quickFilter/QuickFilterTrigger.d.ts +1 -1
- package/esm/components/quickFilter/QuickFilterTrigger.js +2 -2
- package/esm/components/toolbarV8/Toolbar.d.ts +1 -1
- package/esm/components/toolbarV8/Toolbar.js +2 -2
- package/esm/components/toolbarV8/ToolbarButton.d.ts +1 -1
- package/esm/components/toolbarV8/ToolbarButton.js +2 -2
- package/esm/hooks/core/pipeProcessing/useGridPipeProcessing.js +3 -3
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/esm/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +9 -5
- package/esm/hooks/utils/index.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +0 -1
- package/esm/internals/index.js +0 -1
- package/esm/locales/arSD.js +5 -6
- package/esm/locales/ptPT.js +4 -4
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +3 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +9 -5
- package/hooks/utils/index.d.ts +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +0 -1
- package/internals/index.js +0 -8
- package/locales/arSD.js +5 -6
- package/locales/ptPT.js +4 -4
- package/package.json +4 -4
- package/esm/hooks/utils/useGridComponentRenderer.d.ts +0 -12
- package/esm/hooks/utils/useGridComponentRenderer.js +0 -36
- package/hooks/utils/useGridComponentRenderer.d.ts +0 -12
- package/hooks/utils/useGridComponentRenderer.js +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RenderProp } from
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
3
|
import type { GridSlotProps } from "../../models/index.js";
|
|
4
4
|
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
5
5
|
export type QuickFilterClearProps = Omit<GridSlotProps['baseIconButton'], 'className'> & {
|
|
@@ -4,8 +4,8 @@ const _excluded = ["render", "className", "onClick"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
7
8
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
8
|
-
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
9
9
|
import { useQuickFilterContext } from "./QuickFilterContext.js";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
/**
|
|
@@ -37,7 +37,7 @@ const QuickFilterClear = forwardRef(function QuickFilterClear(props, ref) {
|
|
|
37
37
|
clearValue();
|
|
38
38
|
onClick?.(event);
|
|
39
39
|
};
|
|
40
|
-
const element =
|
|
40
|
+
const element = useComponentRenderer(rootProps.slots.baseIconButton, render, _extends({}, rootProps.slotProps?.baseIconButton, {
|
|
41
41
|
className: resolvedClassName,
|
|
42
42
|
tabIndex: -1
|
|
43
43
|
}, other, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RenderProp } from
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
3
|
import type { GridSlotProps } from "../../models/index.js";
|
|
4
4
|
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
5
5
|
export type QuickFilterControlProps = Omit<GridSlotProps['baseTextField'], 'className'> & {
|
|
@@ -5,8 +5,8 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import useForkRef from '@mui/utils/useForkRef';
|
|
7
7
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
8
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
-
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
10
10
|
import { useQuickFilterContext } from "./QuickFilterContext.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
@@ -64,7 +64,7 @@ const QuickFilterControl = forwardRef(function QuickFilterControl(props, ref) {
|
|
|
64
64
|
onValueChange(event);
|
|
65
65
|
onChange?.(event);
|
|
66
66
|
};
|
|
67
|
-
const element =
|
|
67
|
+
const element = useComponentRenderer(rootProps.slots.baseTextField, render, _extends({}, rootProps.slotProps?.baseTextField, {
|
|
68
68
|
slotProps: _extends({
|
|
69
69
|
htmlInput: _extends({
|
|
70
70
|
role: 'searchbox',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RenderProp } from
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
3
|
import type { GridSlotProps } from "../../models/index.js";
|
|
4
4
|
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
5
5
|
export type QuickFilterTriggerProps = Omit<GridSlotProps['baseButton'], 'className'> & {
|
|
@@ -4,9 +4,9 @@ const _excluded = ["render", "className", "onClick"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
7
8
|
import useForkRef from '@mui/utils/useForkRef';
|
|
8
9
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
-
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
10
10
|
import { useQuickFilterContext } from "./QuickFilterContext.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
@@ -41,7 +41,7 @@ const QuickFilterTrigger = forwardRef(function QuickFilterTrigger(props, ref) {
|
|
|
41
41
|
onExpandedChange(!state.expanded);
|
|
42
42
|
onClick?.(event);
|
|
43
43
|
};
|
|
44
|
-
const element =
|
|
44
|
+
const element = useComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
|
|
45
45
|
className: resolvedClassName,
|
|
46
46
|
'aria-controls': controlId,
|
|
47
47
|
'aria-expanded': state.expanded
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RenderProp } from
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
3
|
export type ToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
4
|
/**
|
|
5
5
|
* A function to customize rendering of the component.
|
|
@@ -7,9 +7,9 @@ import { styled } from '@mui/system';
|
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
11
|
import { vars } from "../../constants/cssVariables.js";
|
|
11
12
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
12
|
-
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
13
13
|
import { ToolbarContext } from "./ToolbarContext.js";
|
|
14
14
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
15
15
|
import { sortByDocumentPosition } from "./utils.js";
|
|
@@ -179,7 +179,7 @@ const Toolbar = forwardRef(function Toolbar(props, ref) {
|
|
|
179
179
|
onItemFocus,
|
|
180
180
|
onItemDisabled
|
|
181
181
|
}), [focusableItemId, registerItem, unregisterItem, onItemKeyDown, onItemFocus, onItemDisabled]);
|
|
182
|
-
const element =
|
|
182
|
+
const element = useComponentRenderer(ToolbarRoot, render, _extends({
|
|
183
183
|
role: 'toolbar',
|
|
184
184
|
'aria-orientation': 'horizontal',
|
|
185
185
|
'aria-label': rootProps.label || undefined,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RenderProp } from
|
|
2
|
+
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
3
3
|
import type { GridSlotProps } from "../../models/index.js";
|
|
4
4
|
export type ToolbarButtonProps = GridSlotProps['baseIconButton'] & {
|
|
5
5
|
/**
|
|
@@ -6,8 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import useForkRef from '@mui/utils/useForkRef';
|
|
7
7
|
import useId from '@mui/utils/useId';
|
|
8
8
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
9
|
+
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
9
10
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
10
|
-
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
11
11
|
import { useToolbarContext } from "./ToolbarContext.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
@@ -70,7 +70,7 @@ const ToolbarButton = forwardRef(function ToolbarButton(props, ref) {
|
|
|
70
70
|
}
|
|
71
71
|
previousAriaDisabled.current = ariaDisabled;
|
|
72
72
|
}, [ariaDisabled, id, onItemDisabled]);
|
|
73
|
-
const element =
|
|
73
|
+
const element = useComponentRenderer(rootProps.slots.baseIconButton, render, _extends({}, rootProps.slotProps?.baseIconButton, {
|
|
74
74
|
tabIndex: focusableItemId === id ? 0 : -1
|
|
75
75
|
}, other, {
|
|
76
76
|
disabled,
|
|
@@ -56,12 +56,12 @@ export const useGridPipeProcessing = apiRef => {
|
|
|
56
56
|
const oldProcessor = groupCache.processors.get(id);
|
|
57
57
|
if (oldProcessor !== processor) {
|
|
58
58
|
groupCache.processors.set(id, processor);
|
|
59
|
-
groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());
|
|
59
|
+
groupCache.processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
|
|
60
60
|
runAppliers(groupCache);
|
|
61
61
|
}
|
|
62
62
|
return () => {
|
|
63
|
-
cache.current[group].processors.
|
|
64
|
-
cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());
|
|
63
|
+
cache.current[group].processors.set(id, null);
|
|
64
|
+
cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
|
|
65
65
|
};
|
|
66
66
|
}, [runAppliers]);
|
|
67
67
|
const registerPipeApplier = React.useCallback((group, id, applier) => {
|
|
@@ -29,7 +29,7 @@ export interface GetHeadersParams {
|
|
|
29
29
|
maxLastColumn?: number;
|
|
30
30
|
}
|
|
31
31
|
type OwnerState = DataGridProcessedProps;
|
|
32
|
-
export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
32
|
+
export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
33
33
|
ownerState: OwnerState;
|
|
34
34
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
35
35
|
export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
|
|
@@ -28,17 +28,21 @@ export const useGridRowSelectionPreProcessors = (apiRef, props) => {
|
|
|
28
28
|
headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')
|
|
29
29
|
});
|
|
30
30
|
const shouldHaveSelectionColumn = props.checkboxSelection;
|
|
31
|
-
const
|
|
32
|
-
if (shouldHaveSelectionColumn && !
|
|
31
|
+
const hasSelectionColumn = columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] != null;
|
|
32
|
+
if (shouldHaveSelectionColumn && !hasSelectionColumn) {
|
|
33
33
|
columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;
|
|
34
34
|
columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];
|
|
35
|
-
} else if (!shouldHaveSelectionColumn &&
|
|
35
|
+
} else if (!shouldHaveSelectionColumn && hasSelectionColumn) {
|
|
36
36
|
delete columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD];
|
|
37
37
|
columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD);
|
|
38
|
-
} else if (shouldHaveSelectionColumn &&
|
|
38
|
+
} else if (shouldHaveSelectionColumn && hasSelectionColumn) {
|
|
39
39
|
columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD] = _extends({}, selectionColumn, columnsState.lookup[GRID_CHECKBOX_SELECTION_FIELD]);
|
|
40
|
+
// If the column is not in the columns array (not a custom selection column), move it to the beginning of the column order
|
|
41
|
+
if (!props.columns.some(col => col.field === GRID_CHECKBOX_SELECTION_FIELD)) {
|
|
42
|
+
columnsState.orderedFields = [GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields.filter(field => field !== GRID_CHECKBOX_SELECTION_FIELD)];
|
|
43
|
+
}
|
|
40
44
|
}
|
|
41
45
|
return columnsState;
|
|
42
|
-
}, [apiRef, classes, props.checkboxSelection]);
|
|
46
|
+
}, [apiRef, classes, props.columns, props.checkboxSelection]);
|
|
43
47
|
useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);
|
|
44
48
|
};
|
|
@@ -6,4 +6,4 @@ export * from "./useGridNativeEventListener.js";
|
|
|
6
6
|
export * from "./useFirstRender.js";
|
|
7
7
|
export * from "./useOnMount.js";
|
|
8
8
|
export * from "./useRunOnce.js";
|
|
9
|
-
export type { RenderProp } from
|
|
9
|
+
export type { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
package/esm/index.js
CHANGED
package/esm/internals/index.d.ts
CHANGED
|
@@ -77,7 +77,6 @@ export * from "../hooks/features/virtualization/index.js";
|
|
|
77
77
|
export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
|
|
78
78
|
export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
|
|
79
79
|
export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
|
|
80
|
-
export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
|
|
81
80
|
export { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
82
81
|
export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
83
82
|
export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -63,7 +63,6 @@ export * from "../hooks/features/virtualization/index.js";
|
|
|
63
63
|
export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
|
|
64
64
|
export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
|
|
65
65
|
export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
|
|
66
|
-
export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
|
|
67
66
|
export { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
68
67
|
export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
69
68
|
export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
|
package/esm/locales/arSD.js
CHANGED
|
@@ -39,12 +39,11 @@ const arSDGrid = {
|
|
|
39
39
|
// toolbarAssistant: 'AI Assistant',
|
|
40
40
|
|
|
41
41
|
// Columns management text
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
columnsManagementSearchTitle: 'بحث',
|
|
43
|
+
columnsManagementNoColumns: 'لا يوجد أعمدة',
|
|
44
|
+
columnsManagementShowHideAllText: 'عرض/إخفاء الكل',
|
|
45
|
+
columnsManagementReset: 'إعادة ضبط',
|
|
46
|
+
columnsManagementDeleteIconLabel: 'مسح',
|
|
48
47
|
// Filter panel text
|
|
49
48
|
filterPanelAddFilter: 'إضافة مرشِح',
|
|
50
49
|
filterPanelRemoveAll: 'حذف الكل',
|
package/esm/locales/ptPT.js
CHANGED
|
@@ -10,7 +10,7 @@ const ptPTGrid = {
|
|
|
10
10
|
// Density selector toolbar button text
|
|
11
11
|
toolbarDensity: 'Densidade',
|
|
12
12
|
toolbarDensityLabel: 'Densidade',
|
|
13
|
-
toolbarDensityCompact: '
|
|
13
|
+
toolbarDensityCompact: 'Compacto',
|
|
14
14
|
toolbarDensityStandard: 'Padrão',
|
|
15
15
|
toolbarDensityComfortable: 'Confortável',
|
|
16
16
|
// Columns selector toolbar button text
|
|
@@ -25,7 +25,7 @@ const ptPTGrid = {
|
|
|
25
25
|
// Quick filter toolbar field
|
|
26
26
|
toolbarQuickFilterPlaceholder: 'Procurar…',
|
|
27
27
|
toolbarQuickFilterLabel: 'Procurar',
|
|
28
|
-
toolbarQuickFilterDeleteIconLabel: '
|
|
28
|
+
toolbarQuickFilterDeleteIconLabel: 'Limpar',
|
|
29
29
|
// Export selector toolbar button text
|
|
30
30
|
toolbarExport: 'Exportar',
|
|
31
31
|
toolbarExportLabel: 'Exportar',
|
|
@@ -144,8 +144,8 @@ const ptPTGrid = {
|
|
|
144
144
|
unpin: 'Desafixar',
|
|
145
145
|
// Tree Data
|
|
146
146
|
treeDataGroupingHeaderName: 'Grupo',
|
|
147
|
-
treeDataExpand: '
|
|
148
|
-
treeDataCollapse: '
|
|
147
|
+
treeDataExpand: 'expandir',
|
|
148
|
+
treeDataCollapse: 'colapsar',
|
|
149
149
|
// Grouping columns
|
|
150
150
|
groupingColumnHeaderName: 'Grupo',
|
|
151
151
|
groupColumn: name => `Agrupar por ${name}`,
|
|
@@ -64,12 +64,12 @@ const useGridPipeProcessing = apiRef => {
|
|
|
64
64
|
const oldProcessor = groupCache.processors.get(id);
|
|
65
65
|
if (oldProcessor !== processor) {
|
|
66
66
|
groupCache.processors.set(id, processor);
|
|
67
|
-
groupCache.processorsAsArray = Array.from(cache.current[group].processors.values());
|
|
67
|
+
groupCache.processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
|
|
68
68
|
runAppliers(groupCache);
|
|
69
69
|
}
|
|
70
70
|
return () => {
|
|
71
|
-
cache.current[group].processors.
|
|
72
|
-
cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values());
|
|
71
|
+
cache.current[group].processors.set(id, null);
|
|
72
|
+
cache.current[group].processorsAsArray = Array.from(cache.current[group].processors.values()).filter(processorValue => processorValue !== null);
|
|
73
73
|
};
|
|
74
74
|
}, [runAppliers]);
|
|
75
75
|
const registerPipeApplier = React.useCallback((group, id, applier) => {
|
|
@@ -29,7 +29,7 @@ export interface GetHeadersParams {
|
|
|
29
29
|
maxLastColumn?: number;
|
|
30
30
|
}
|
|
31
31
|
type OwnerState = DataGridProcessedProps;
|
|
32
|
-
export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
32
|
+
export declare const GridColumnHeaderRow: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
33
33
|
ownerState: OwnerState;
|
|
34
34
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
35
35
|
export declare const useGridColumnHeaders: (props: UseGridColumnHeadersProps) => {
|
|
@@ -36,18 +36,22 @@ const useGridRowSelectionPreProcessors = (apiRef, props) => {
|
|
|
36
36
|
headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')
|
|
37
37
|
});
|
|
38
38
|
const shouldHaveSelectionColumn = props.checkboxSelection;
|
|
39
|
-
const
|
|
40
|
-
if (shouldHaveSelectionColumn && !
|
|
39
|
+
const hasSelectionColumn = columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] != null;
|
|
40
|
+
if (shouldHaveSelectionColumn && !hasSelectionColumn) {
|
|
41
41
|
columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] = selectionColumn;
|
|
42
42
|
columnsState.orderedFields = [_colDef.GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields];
|
|
43
|
-
} else if (!shouldHaveSelectionColumn &&
|
|
43
|
+
} else if (!shouldHaveSelectionColumn && hasSelectionColumn) {
|
|
44
44
|
delete columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD];
|
|
45
45
|
columnsState.orderedFields = columnsState.orderedFields.filter(field => field !== _colDef.GRID_CHECKBOX_SELECTION_FIELD);
|
|
46
|
-
} else if (shouldHaveSelectionColumn &&
|
|
46
|
+
} else if (shouldHaveSelectionColumn && hasSelectionColumn) {
|
|
47
47
|
columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD] = (0, _extends2.default)({}, selectionColumn, columnsState.lookup[_colDef.GRID_CHECKBOX_SELECTION_FIELD]);
|
|
48
|
+
// If the column is not in the columns array (not a custom selection column), move it to the beginning of the column order
|
|
49
|
+
if (!props.columns.some(col => col.field === _colDef.GRID_CHECKBOX_SELECTION_FIELD)) {
|
|
50
|
+
columnsState.orderedFields = [_colDef.GRID_CHECKBOX_SELECTION_FIELD, ...columnsState.orderedFields.filter(field => field !== _colDef.GRID_CHECKBOX_SELECTION_FIELD)];
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
return columnsState;
|
|
50
|
-
}, [apiRef, classes, props.checkboxSelection]);
|
|
54
|
+
}, [apiRef, classes, props.columns, props.checkboxSelection]);
|
|
51
55
|
(0, _pipeProcessing.useGridRegisterPipeProcessor)(apiRef, 'hydrateColumns', updateSelectionColumn);
|
|
52
56
|
};
|
|
53
57
|
exports.useGridRowSelectionPreProcessors = useGridRowSelectionPreProcessors;
|
package/hooks/utils/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export * from "./useGridNativeEventListener.js";
|
|
|
6
6
|
export * from "./useFirstRender.js";
|
|
7
7
|
export * from "./useOnMount.js";
|
|
8
8
|
export * from "./useRunOnce.js";
|
|
9
|
-
export type { RenderProp } from
|
|
9
|
+
export type { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -77,7 +77,6 @@ export * from "../hooks/features/virtualization/index.js";
|
|
|
77
77
|
export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
|
|
78
78
|
export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
|
|
79
79
|
export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
|
|
80
|
-
export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
|
|
81
80
|
export { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
82
81
|
export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
83
82
|
export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
|
package/internals/index.js
CHANGED
|
@@ -94,7 +94,6 @@ var _exportNames = {
|
|
|
94
94
|
ROW_SELECTION_PROPAGATION_DEFAULT: true,
|
|
95
95
|
useGridListView: true,
|
|
96
96
|
listViewStateInitializer: true,
|
|
97
|
-
useGridComponentRenderer: true,
|
|
98
97
|
useTimeout: true,
|
|
99
98
|
useGridVisibleRows: true,
|
|
100
99
|
getVisibleRows: true,
|
|
@@ -608,12 +607,6 @@ Object.defineProperty(exports, "useGridColumns", {
|
|
|
608
607
|
return _useGridColumns.useGridColumns;
|
|
609
608
|
}
|
|
610
609
|
});
|
|
611
|
-
Object.defineProperty(exports, "useGridComponentRenderer", {
|
|
612
|
-
enumerable: true,
|
|
613
|
-
get: function () {
|
|
614
|
-
return _useGridComponentRenderer.useGridComponentRenderer;
|
|
615
|
-
}
|
|
616
|
-
});
|
|
617
610
|
Object.defineProperty(exports, "useGridCsvExport", {
|
|
618
611
|
enumerable: true,
|
|
619
612
|
get: function () {
|
|
@@ -953,7 +946,6 @@ Object.keys(_virtualization).forEach(function (key) {
|
|
|
953
946
|
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
|
|
954
947
|
var _utils = require("../hooks/features/rowSelection/utils");
|
|
955
948
|
var _useGridListView = require("../hooks/features/listView/useGridListView");
|
|
956
|
-
var _useGridComponentRenderer = require("../hooks/utils/useGridComponentRenderer");
|
|
957
949
|
var _useTimeout = require("../hooks/utils/useTimeout");
|
|
958
950
|
var _useGridVisibleRows = require("../hooks/utils/useGridVisibleRows");
|
|
959
951
|
var _useGridInitializeState = require("../hooks/utils/useGridInitializeState");
|
package/locales/arSD.js
CHANGED
|
@@ -45,12 +45,11 @@ const arSDGrid = {
|
|
|
45
45
|
// toolbarAssistant: 'AI Assistant',
|
|
46
46
|
|
|
47
47
|
// Columns management text
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
columnsManagementSearchTitle: 'بحث',
|
|
49
|
+
columnsManagementNoColumns: 'لا يوجد أعمدة',
|
|
50
|
+
columnsManagementShowHideAllText: 'عرض/إخفاء الكل',
|
|
51
|
+
columnsManagementReset: 'إعادة ضبط',
|
|
52
|
+
columnsManagementDeleteIconLabel: 'مسح',
|
|
54
53
|
// Filter panel text
|
|
55
54
|
filterPanelAddFilter: 'إضافة مرشِح',
|
|
56
55
|
filterPanelRemoveAll: 'حذف الكل',
|
package/locales/ptPT.js
CHANGED
|
@@ -16,7 +16,7 @@ const ptPTGrid = {
|
|
|
16
16
|
// Density selector toolbar button text
|
|
17
17
|
toolbarDensity: 'Densidade',
|
|
18
18
|
toolbarDensityLabel: 'Densidade',
|
|
19
|
-
toolbarDensityCompact: '
|
|
19
|
+
toolbarDensityCompact: 'Compacto',
|
|
20
20
|
toolbarDensityStandard: 'Padrão',
|
|
21
21
|
toolbarDensityComfortable: 'Confortável',
|
|
22
22
|
// Columns selector toolbar button text
|
|
@@ -31,7 +31,7 @@ const ptPTGrid = {
|
|
|
31
31
|
// Quick filter toolbar field
|
|
32
32
|
toolbarQuickFilterPlaceholder: 'Procurar…',
|
|
33
33
|
toolbarQuickFilterLabel: 'Procurar',
|
|
34
|
-
toolbarQuickFilterDeleteIconLabel: '
|
|
34
|
+
toolbarQuickFilterDeleteIconLabel: 'Limpar',
|
|
35
35
|
// Export selector toolbar button text
|
|
36
36
|
toolbarExport: 'Exportar',
|
|
37
37
|
toolbarExportLabel: 'Exportar',
|
|
@@ -150,8 +150,8 @@ const ptPTGrid = {
|
|
|
150
150
|
unpin: 'Desafixar',
|
|
151
151
|
// Tree Data
|
|
152
152
|
treeDataGroupingHeaderName: 'Grupo',
|
|
153
|
-
treeDataExpand: '
|
|
154
|
-
treeDataCollapse: '
|
|
153
|
+
treeDataExpand: 'expandir',
|
|
154
|
+
treeDataCollapse: 'colapsar',
|
|
155
155
|
// Grouping columns
|
|
156
156
|
groupingColumnHeaderName: 'Grupo',
|
|
157
157
|
groupColumn: name => `Agrupar por ${name}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Community plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"directory": "packages/x-data-grid"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@babel/runtime": "^7.27.
|
|
43
|
-
"@mui/utils": "^7.
|
|
42
|
+
"@babel/runtime": "^7.27.4",
|
|
43
|
+
"@mui/utils": "^7.1.1",
|
|
44
44
|
"clsx": "^2.1.1",
|
|
45
45
|
"prop-types": "^15.8.1",
|
|
46
46
|
"reselect": "^5.1.1",
|
|
47
47
|
"use-sync-external-store": "^1.5.0",
|
|
48
|
-
"@mui/x-internals": "8.5.
|
|
48
|
+
"@mui/x-internals": "8.5.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
|
|
3
|
-
/**
|
|
4
|
-
* Resolves the rendering logic for a component.
|
|
5
|
-
* Handles three scenarios:
|
|
6
|
-
* 1. A render function that receives props and state
|
|
7
|
-
* 2. A React element
|
|
8
|
-
* 3. A default element
|
|
9
|
-
*
|
|
10
|
-
* @ignore - internal hook.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useGridComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
/**
|
|
5
|
-
* Resolves the rendering logic for a component.
|
|
6
|
-
* Handles three scenarios:
|
|
7
|
-
* 1. A render function that receives props and state
|
|
8
|
-
* 2. A React element
|
|
9
|
-
* 3. A default element
|
|
10
|
-
*
|
|
11
|
-
* @ignore - internal hook.
|
|
12
|
-
*/
|
|
13
|
-
export function useGridComponentRenderer(defaultElement, render, props, state = {}) {
|
|
14
|
-
if (typeof render === 'function') {
|
|
15
|
-
return render(props, state);
|
|
16
|
-
}
|
|
17
|
-
if (render) {
|
|
18
|
-
if (render.props.className) {
|
|
19
|
-
props.className = clsx(render.props.className, props.className);
|
|
20
|
-
}
|
|
21
|
-
if (render.props.style || props.style) {
|
|
22
|
-
props.style = _extends({}, props.style, render.props.style);
|
|
23
|
-
}
|
|
24
|
-
if (render.props.sx || props.sx) {
|
|
25
|
-
props.sx = mergeSx(props.sx, render.props.sx);
|
|
26
|
-
}
|
|
27
|
-
return /*#__PURE__*/React.cloneElement(render, props);
|
|
28
|
-
}
|
|
29
|
-
return /*#__PURE__*/React.createElement(defaultElement, props);
|
|
30
|
-
}
|
|
31
|
-
function mergeSx(sx1, sx2) {
|
|
32
|
-
if (!sx1 || !sx2) {
|
|
33
|
-
return sx1 || sx2;
|
|
34
|
-
}
|
|
35
|
-
return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
|
|
3
|
-
/**
|
|
4
|
-
* Resolves the rendering logic for a component.
|
|
5
|
-
* Handles three scenarios:
|
|
6
|
-
* 1. A render function that receives props and state
|
|
7
|
-
* 2. A React element
|
|
8
|
-
* 3. A default element
|
|
9
|
-
*
|
|
10
|
-
* @ignore - internal hook.
|
|
11
|
-
*/
|
|
12
|
-
export declare function useGridComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.useGridComponentRenderer = useGridComponentRenderer;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
-
/**
|
|
13
|
-
* Resolves the rendering logic for a component.
|
|
14
|
-
* Handles three scenarios:
|
|
15
|
-
* 1. A render function that receives props and state
|
|
16
|
-
* 2. A React element
|
|
17
|
-
* 3. A default element
|
|
18
|
-
*
|
|
19
|
-
* @ignore - internal hook.
|
|
20
|
-
*/
|
|
21
|
-
function useGridComponentRenderer(defaultElement, render, props, state = {}) {
|
|
22
|
-
if (typeof render === 'function') {
|
|
23
|
-
return render(props, state);
|
|
24
|
-
}
|
|
25
|
-
if (render) {
|
|
26
|
-
if (render.props.className) {
|
|
27
|
-
props.className = (0, _clsx.default)(render.props.className, props.className);
|
|
28
|
-
}
|
|
29
|
-
if (render.props.style || props.style) {
|
|
30
|
-
props.style = (0, _extends2.default)({}, props.style, render.props.style);
|
|
31
|
-
}
|
|
32
|
-
if (render.props.sx || props.sx) {
|
|
33
|
-
props.sx = mergeSx(props.sx, render.props.sx);
|
|
34
|
-
}
|
|
35
|
-
return /*#__PURE__*/React.cloneElement(render, props);
|
|
36
|
-
}
|
|
37
|
-
return /*#__PURE__*/React.createElement(defaultElement, props);
|
|
38
|
-
}
|
|
39
|
-
function mergeSx(sx1, sx2) {
|
|
40
|
-
if (!sx1 || !sx2) {
|
|
41
|
-
return sx1 || sx2;
|
|
42
|
-
}
|
|
43
|
-
return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
|
|
44
|
-
}
|