@mui/x-data-grid 7.21.0 → 7.22.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 +142 -0
- package/components/GridRow.js +1 -1
- package/components/cell/GridBooleanCell.d.ts +3 -3
- package/components/cell/GridBooleanCell.js +13 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/containers/GridRootStyles.js +4 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/components/toolbar/GridToolbar.js +2 -3
- package/components/toolbar/GridToolbarExport.js +1 -13
- package/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/components/virtualization/GridBottomContainer.js +0 -17
- package/components/virtualization/GridMainContainer.js +2 -1
- package/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -0
- package/constants/gridClasses.d.ts +5 -0
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +4 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/hooks/features/focus/useGridFocus.js +18 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -4
- package/hooks/features/listView/useGridListView.d.ts +1 -1
- package/hooks/features/listView/useGridListView.js +8 -2
- package/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/hooks/features/scroll/useGridScroll.js +3 -7
- package/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/index.js +1 -1
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +3 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +2 -1
- package/internals/utils/gridRowGroupingUtils.d.ts +2 -0
- package/internals/utils/gridRowGroupingUtils.js +9 -0
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/joy/joySlots.js +45 -27
- package/locales/daDK.js +5 -6
- package/locales/itIT.js +27 -28
- package/locales/ptBR.js +4 -4
- package/material/index.js +4 -0
- package/models/gridExport.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +10 -0
- package/models/gridSlotsComponentsProps.d.ts +9 -0
- package/modern/components/GridRow.js +1 -1
- package/modern/components/cell/GridBooleanCell.js +13 -2
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/modern/components/containers/GridRootStyles.js +4 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/modern/components/toolbar/GridToolbar.js +2 -3
- package/modern/components/toolbar/GridToolbarExport.js +1 -13
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/modern/components/virtualization/GridBottomContainer.js +0 -17
- package/modern/components/virtualization/GridMainContainer.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/modern/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/modern/hooks/features/focus/useGridFocus.js +18 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -4
- package/modern/hooks/features/listView/useGridListView.js +8 -2
- package/modern/hooks/features/pagination/gridPaginationSelector.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +1 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/modern/hooks/features/scroll/useGridScroll.js +3 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +3 -0
- package/modern/internals/index.js +2 -1
- package/modern/internals/utils/gridRowGroupingUtils.js +9 -0
- package/modern/internals/utils/index.js +2 -1
- package/modern/joy/joySlots.js +45 -27
- package/modern/locales/daDK.js +5 -6
- package/modern/locales/itIT.js +27 -28
- package/modern/locales/ptBR.js +4 -4
- package/modern/material/index.js +4 -0
- package/node/components/GridRow.js +2 -2
- package/node/components/cell/GridBooleanCell.js +13 -2
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +1 -2
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/node/components/containers/GridRootStyles.js +4 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +2 -2
- package/node/components/panel/filterPanel/GridFilterInputValue.js +2 -2
- package/node/components/toolbar/GridToolbar.js +2 -3
- package/node/components/toolbar/GridToolbarExport.js +1 -13
- package/node/components/toolbar/GridToolbarFilterButton.js +1 -2
- package/node/components/virtualization/GridBottomContainer.js +0 -17
- package/node/components/virtualization/GridMainContainer.js +2 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +1 -2
- package/node/hooks/features/columnMenu/useGridColumnMenuSlots.js +4 -3
- package/node/hooks/features/focus/useGridFocus.js +18 -3
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +4 -5
- package/node/hooks/features/listView/useGridListView.js +8 -2
- package/node/hooks/features/pagination/gridPaginationSelector.js +3 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/node/hooks/features/rows/useGridRowSpanning.js +3 -1
- package/node/hooks/features/scroll/useGridScroll.js +3 -7
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +3 -2
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -0
- package/node/internals/index.js +12 -0
- package/node/internals/utils/gridRowGroupingUtils.js +17 -0
- package/node/internals/utils/index.js +11 -0
- package/node/joy/joySlots.js +45 -27
- package/node/locales/daDK.js +5 -6
- package/node/locales/itIT.js +27 -28
- package/node/locales/ptBR.js +4 -4
- package/node/material/index.js +4 -0
- package/package.json +1 -1
- package/constants/gridDetailPanelToggleField.d.ts +0 -1
- package/constants/gridDetailPanelToggleField.js +0 -2
- package/modern/constants/gridDetailPanelToggleField.js +0 -2
- package/node/constants/gridDetailPanelToggleField.js +0 -8
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { warnOnce } from '@mui/x-internals/warning';
|
|
3
4
|
import { gridDimensionsSelector } from "../dimensions/index.js";
|
|
4
5
|
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
5
6
|
export const listViewStateInitializer = (state, props, apiRef) => _extends({}, state, {
|
|
6
|
-
listViewColumn: _extends({}, props.unstable_listColumn, {
|
|
7
|
+
listViewColumn: props.unstable_listColumn ? _extends({}, props.unstable_listColumn, {
|
|
7
8
|
computedWidth: getListColumnWidth(apiRef)
|
|
8
|
-
})
|
|
9
|
+
}) : undefined
|
|
9
10
|
});
|
|
10
11
|
export function useGridListView(apiRef, props) {
|
|
11
12
|
/*
|
|
@@ -48,6 +49,11 @@ export function useGridListView(apiRef, props) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
}, [apiRef, props.unstable_listColumn]);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (props.unstable_listView && !props.unstable_listColumn) {
|
|
54
|
+
warnOnce(['MUI X: The `unstable_listColumn` prop must be set if `unstable_listView` is enabled.', 'To fix, pass a column definition to the `unstable_listColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.', 'For more details, see https://mui.com/x/react-data-grid/list-view/']);
|
|
55
|
+
}
|
|
56
|
+
}, [props.unstable_listView, props.unstable_listColumn]);
|
|
51
57
|
}
|
|
52
58
|
function getListColumnWidth(apiRef) {
|
|
53
59
|
return gridDimensionsSelector(apiRef.current.state).viewportInnerSize.width;
|
|
@@ -2,6 +2,7 @@ import { createSelector, createSelectorMemoized } from "../../../utils/createSel
|
|
|
2
2
|
import { gridExpandedSortedRowEntriesSelector, gridExpandedSortedRowIdsSelector, gridFilteredSortedTopLevelRowEntriesSelector } from "../filter/gridFilterSelector.js";
|
|
3
3
|
import { gridRowMaximumTreeDepthSelector, gridRowTreeSelector } from "../rows/gridRowsSelector.js";
|
|
4
4
|
import { getPageCount } from "./gridPaginationUtils.js";
|
|
5
|
+
const ALL_RESULTS_PAGE_VALUE = -1;
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* @category Pagination
|
|
@@ -52,7 +53,7 @@ export const gridPageCountSelector = createSelector(gridPaginationModelSelector,
|
|
|
52
53
|
export const gridPaginationRowRangeSelector = createSelectorMemoized(gridPaginationModelSelector, gridRowTreeSelector, gridRowMaximumTreeDepthSelector, gridExpandedSortedRowEntriesSelector, gridFilteredSortedTopLevelRowEntriesSelector, (paginationModel, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {
|
|
53
54
|
const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;
|
|
54
55
|
const topLevelFirstRowIndex = Math.min(paginationModel.pageSize * paginationModel.page, visibleTopLevelRowCount - 1);
|
|
55
|
-
const topLevelLastRowIndex = Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);
|
|
56
|
+
const topLevelLastRowIndex = paginationModel.pageSize === ALL_RESULTS_PAGE_VALUE ? visibleTopLevelRowCount - 1 : Math.min(topLevelFirstRowIndex + paginationModel.pageSize - 1, visibleTopLevelRowCount - 1);
|
|
56
57
|
|
|
57
58
|
// The range contains no element
|
|
58
59
|
if (topLevelFirstRowIndex === -1 || topLevelLastRowIndex === -1) {
|
|
@@ -13,7 +13,7 @@ import { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from "../..
|
|
|
13
13
|
import { GridCellModes } from "../../../models/gridEditRowModel.js";
|
|
14
14
|
import { isKeyboardEvent, isNavigationKey } from "../../../utils/keyboardUtils.js";
|
|
15
15
|
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
16
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../constants
|
|
16
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
17
17
|
import { gridClasses } from "../../../constants/gridClasses.js";
|
|
18
18
|
import { isEventTargetInPortal } from "../../../utils/domUtils.js";
|
|
19
19
|
import { isMultipleRowSelectionEnabled, findRowsToSelect, findRowsToDeselect } from "./utils.js";
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
4
5
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
5
6
|
import { useGridVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
6
7
|
import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
|
|
7
8
|
import { useGridSelector } from "../../utils/useGridSelector.js";
|
|
8
9
|
import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
10
|
+
import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
9
11
|
const EMPTY_STATE = {
|
|
10
12
|
spannedCells: {},
|
|
11
13
|
hiddenCells: {},
|
|
@@ -15,7 +17,7 @@ const EMPTY_RANGE = {
|
|
|
15
17
|
firstRowIndex: 0,
|
|
16
18
|
lastRowIndex: 0
|
|
17
19
|
};
|
|
18
|
-
const skippedFields = new Set([
|
|
20
|
+
const skippedFields = new Set([GRID_CHECKBOX_SELECTION_FIELD, '__reorder__', GRID_DETAIL_PANEL_TOGGLE_FIELD]);
|
|
19
21
|
/**
|
|
20
22
|
* Default number of rows to process during state initialization to avoid flickering.
|
|
21
23
|
* Number `20` is arbitrarily chosen to be large enough to cover most of the cases without
|
|
@@ -48,8 +48,6 @@ export const useGridScroll = (apiRef, props) => {
|
|
|
48
48
|
const logger = useGridLogger(apiRef, 'useGridScroll');
|
|
49
49
|
const colRef = apiRef.current.columnHeadersContainerRef;
|
|
50
50
|
const virtualScrollerRef = apiRef.current.virtualScrollerRef;
|
|
51
|
-
const virtualScrollbarHorizontalRef = apiRef.current.virtualScrollbarHorizontalRef;
|
|
52
|
-
const virtualScrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
53
51
|
const visibleSortedRows = useGridSelector(apiRef, gridExpandedSortedRowEntriesSelector);
|
|
54
52
|
const scrollToIndexes = React.useCallback(params => {
|
|
55
53
|
const dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
@@ -103,20 +101,18 @@ export const useGridScroll = (apiRef, props) => {
|
|
|
103
101
|
return false;
|
|
104
102
|
}, [logger, apiRef, virtualScrollerRef, props.pagination, visibleSortedRows, props.unstable_listView]);
|
|
105
103
|
const scroll = React.useCallback(params => {
|
|
106
|
-
if (virtualScrollerRef.current &&
|
|
104
|
+
if (virtualScrollerRef.current && params.left !== undefined && colRef.current) {
|
|
107
105
|
const direction = isRtl ? -1 : 1;
|
|
108
106
|
colRef.current.scrollLeft = params.left;
|
|
109
107
|
virtualScrollerRef.current.scrollLeft = direction * params.left;
|
|
110
|
-
virtualScrollbarHorizontalRef.current.scrollLeft = direction * params.left;
|
|
111
108
|
logger.debug(`Scrolling left: ${params.left}`);
|
|
112
109
|
}
|
|
113
|
-
if (virtualScrollerRef.current &&
|
|
110
|
+
if (virtualScrollerRef.current && params.top !== undefined) {
|
|
114
111
|
virtualScrollerRef.current.scrollTop = params.top;
|
|
115
|
-
virtualScrollbarVerticalRef.current.scrollTop = params.top;
|
|
116
112
|
logger.debug(`Scrolling top: ${params.top}`);
|
|
117
113
|
}
|
|
118
114
|
logger.debug(`Scrolling, updating container, and viewport`);
|
|
119
|
-
}, [virtualScrollerRef,
|
|
115
|
+
}, [virtualScrollerRef, isRtl, colRef, logger]);
|
|
120
116
|
const getScrollPosition = React.useCallback(() => {
|
|
121
117
|
if (!virtualScrollerRef?.current) {
|
|
122
118
|
return {
|
|
@@ -378,10 +378,11 @@ export const useGridVirtualScroller = () => {
|
|
|
378
378
|
const contentSize = React.useMemo(() => {
|
|
379
379
|
const size = {
|
|
380
380
|
width: needsHorizontalScrollbar ? columnsTotalWidth : 'auto',
|
|
381
|
-
|
|
381
|
+
flexBasis: contentHeight,
|
|
382
|
+
flexShrink: 0
|
|
382
383
|
};
|
|
383
384
|
if (rootProps.autoHeight && currentPage.rows.length === 0) {
|
|
384
|
-
size.
|
|
385
|
+
size.flexBasis = getMinimalContentHeight(apiRef); // Give room to show the overlay when there no rows.
|
|
385
386
|
}
|
|
386
387
|
return size;
|
|
387
388
|
}, [apiRef, columnsTotalWidth, contentHeight, needsHorizontalScrollbar, rootProps.autoHeight, currentPage.rows.length]);
|
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -92,4 +92,5 @@ export type { GridApiCommunity } from '../models/api/gridApiCommunity';
|
|
|
92
92
|
export type { GridApiCaches } from '../models/gridApiCaches';
|
|
93
93
|
export { serializeCellValue } from '../hooks/features/export/serializers/csvSerializer';
|
|
94
94
|
export * from './utils';
|
|
95
|
+
export * from './constants';
|
|
95
96
|
export type { Localization } from '../utils/getGridLocalization';
|
package/internals/index.js
CHANGED
|
@@ -72,4 +72,5 @@ export * from "../utils/cellBorderUtils.js";
|
|
|
72
72
|
export { useGridPrivateApiContext } from "../hooks/utils/useGridPrivateApiContext.js";
|
|
73
73
|
export * from "../hooks/utils/index.js";
|
|
74
74
|
export { serializeCellValue } from "../hooks/features/export/serializers/csvSerializer.js";
|
|
75
|
-
export * from "./utils/index.js";
|
|
75
|
+
export * from "./utils/index.js";
|
|
76
|
+
export * from "./constants.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD } from "../constants.js";
|
|
2
|
+
export const getRowGroupingCriteriaFromGroupingField = groupingColDefField => {
|
|
3
|
+
const match = groupingColDefField.match(/^__row_group_by_columns_group_(.*)__$/);
|
|
4
|
+
if (!match) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return match[1];
|
|
8
|
+
};
|
|
9
|
+
export const isGroupingColumn = field => field === GRID_ROW_GROUPING_SINGLE_GROUPING_FIELD || getRowGroupingCriteriaFromGroupingField(field) !== null;
|
package/internals/utils/index.js
CHANGED
package/joy/joySlots.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
4
|
-
_excluded2 = ["
|
|
5
|
-
_excluded3 = ["
|
|
6
|
-
_excluded4 = ["color", "size", "sx", "
|
|
7
|
-
_excluded5 = ["
|
|
8
|
-
_excluded6 = ["native"],
|
|
9
|
-
_excluded7 = ["
|
|
3
|
+
const _excluded = ["slotProps", "variant", "color", "sx"],
|
|
4
|
+
_excluded2 = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"],
|
|
5
|
+
_excluded3 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
6
|
+
_excluded4 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
7
|
+
_excluded5 = ["color", "size", "sx", "touchRippleRef"],
|
|
8
|
+
_excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
9
|
+
_excluded7 = ["native"],
|
|
10
|
+
_excluded8 = ["shrink", "variant", "sx"];
|
|
10
11
|
import * as React from 'react';
|
|
12
|
+
import JoyBadge from '@mui/joy/Badge';
|
|
11
13
|
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
14
|
+
import JoyDivider from '@mui/joy/Divider';
|
|
12
15
|
import JoyInput from '@mui/joy/Input';
|
|
13
16
|
import JoyFormControl from '@mui/joy/FormControl';
|
|
14
17
|
import JoyFormLabel from '@mui/joy/FormLabel';
|
|
@@ -58,14 +61,27 @@ function convertVariant(variant, defaultVariant = 'plain') {
|
|
|
58
61
|
filled: 'soft'
|
|
59
62
|
}[variant] || defaultVariant;
|
|
60
63
|
}
|
|
61
|
-
const
|
|
64
|
+
const Badge = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
65
|
+
let {
|
|
66
|
+
color,
|
|
67
|
+
sx
|
|
68
|
+
} = _ref,
|
|
69
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
70
|
+
return /*#__PURE__*/_jsx(JoyBadge, _extends({}, props, {
|
|
71
|
+
color: convertColor(color),
|
|
72
|
+
variant: "plain",
|
|
73
|
+
sx: sx,
|
|
74
|
+
ref: ref
|
|
75
|
+
}));
|
|
76
|
+
});
|
|
77
|
+
const Checkbox = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
62
78
|
let {
|
|
63
79
|
inputProps,
|
|
64
80
|
onChange,
|
|
65
81
|
checked,
|
|
66
82
|
inputRef
|
|
67
|
-
} =
|
|
68
|
-
props = _objectWithoutPropertiesLoose(
|
|
83
|
+
} = _ref2,
|
|
84
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
69
85
|
return /*#__PURE__*/_jsx(JoyCheckbox, _extends({}, props, {
|
|
70
86
|
slotProps: {
|
|
71
87
|
input: _extends({}, inputProps, {
|
|
@@ -77,7 +93,7 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
77
93
|
onChange: onChange
|
|
78
94
|
}));
|
|
79
95
|
});
|
|
80
|
-
const TextField = /*#__PURE__*/React.forwardRef((
|
|
96
|
+
const TextField = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
81
97
|
let {
|
|
82
98
|
onChange,
|
|
83
99
|
label,
|
|
@@ -87,8 +103,8 @@ const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
87
103
|
type,
|
|
88
104
|
size,
|
|
89
105
|
variant
|
|
90
|
-
} =
|
|
91
|
-
props = _objectWithoutPropertiesLoose(
|
|
106
|
+
} = _ref3,
|
|
107
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
92
108
|
const rootRef = useForkRef(ref, props.InputProps?.ref);
|
|
93
109
|
const inputForkRef = useForkRef(inputRef, props?.inputProps?.ref);
|
|
94
110
|
const {
|
|
@@ -116,7 +132,7 @@ const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
116
132
|
})]
|
|
117
133
|
});
|
|
118
134
|
});
|
|
119
|
-
const Button = /*#__PURE__*/React.forwardRef(function Button(
|
|
135
|
+
const Button = /*#__PURE__*/React.forwardRef(function Button(_ref4, ref) {
|
|
120
136
|
let {
|
|
121
137
|
startIcon,
|
|
122
138
|
color,
|
|
@@ -124,8 +140,8 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
|
|
|
124
140
|
size,
|
|
125
141
|
sx,
|
|
126
142
|
variant
|
|
127
|
-
} =
|
|
128
|
-
props = _objectWithoutPropertiesLoose(
|
|
143
|
+
} = _ref4,
|
|
144
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
129
145
|
return /*#__PURE__*/_jsx(JoyButton, _extends({}, props, {
|
|
130
146
|
size: convertSize(size),
|
|
131
147
|
color: convertColor(color),
|
|
@@ -136,13 +152,13 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
|
|
|
136
152
|
sx: sx
|
|
137
153
|
}));
|
|
138
154
|
});
|
|
139
|
-
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(
|
|
155
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref5, ref) {
|
|
140
156
|
let {
|
|
141
157
|
color,
|
|
142
158
|
size,
|
|
143
159
|
sx
|
|
144
|
-
} =
|
|
145
|
-
props = _objectWithoutPropertiesLoose(
|
|
160
|
+
} = _ref5,
|
|
161
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
146
162
|
return /*#__PURE__*/_jsx(JoyIconButton, _extends({}, props, {
|
|
147
163
|
size: convertSize(size),
|
|
148
164
|
color: convertColor(color) ?? 'neutral',
|
|
@@ -151,7 +167,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
151
167
|
sx: sx
|
|
152
168
|
}));
|
|
153
169
|
});
|
|
154
|
-
const Select = /*#__PURE__*/React.forwardRef((
|
|
170
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
155
171
|
let {
|
|
156
172
|
open,
|
|
157
173
|
onOpen,
|
|
@@ -163,8 +179,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
|
163
179
|
MenuProps,
|
|
164
180
|
inputRef,
|
|
165
181
|
labelId
|
|
166
|
-
} =
|
|
167
|
-
props = _objectWithoutPropertiesLoose(
|
|
182
|
+
} = _ref6,
|
|
183
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
168
184
|
const handleChange = (event, newValue) => {
|
|
169
185
|
if (event && onChange) {
|
|
170
186
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -215,17 +231,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
|
215
231
|
}
|
|
216
232
|
}));
|
|
217
233
|
});
|
|
218
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
219
|
-
let props = _objectWithoutPropertiesLoose(
|
|
234
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
235
|
+
let props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
220
236
|
return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
|
|
221
237
|
ref: ref
|
|
222
238
|
}));
|
|
223
239
|
});
|
|
224
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
240
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
225
241
|
let {
|
|
226
242
|
sx
|
|
227
|
-
} =
|
|
228
|
-
props = _objectWithoutPropertiesLoose(
|
|
243
|
+
} = _ref8,
|
|
244
|
+
props = _objectWithoutPropertiesLoose(_ref8, _excluded8);
|
|
229
245
|
return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
|
|
230
246
|
ref: ref,
|
|
231
247
|
sx: sx
|
|
@@ -351,7 +367,9 @@ const LoadingOverlay = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
351
367
|
}));
|
|
352
368
|
});
|
|
353
369
|
const joySlots = _extends({}, joyIconSlots, {
|
|
370
|
+
baseBadge: Badge,
|
|
354
371
|
baseCheckbox: Checkbox,
|
|
372
|
+
baseDivider: JoyDivider,
|
|
355
373
|
baseTextField: TextField,
|
|
356
374
|
baseButton: Button,
|
|
357
375
|
baseIconButton: IconButton,
|
package/locales/daDK.js
CHANGED
|
@@ -33,8 +33,7 @@ const daDKGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: 'Søg',
|
|
34
34
|
columnsManagementNoColumns: 'Ingen søjler',
|
|
35
35
|
columnsManagementShowHideAllText: 'Vis/Skjul Alle',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'Nulstil',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Tilføj filter',
|
|
40
39
|
filterPanelRemoveAll: 'Fjern alle',
|
|
@@ -48,9 +47,9 @@ const daDKGrid = {
|
|
|
48
47
|
filterPanelInputPlaceholder: 'Filterværdi',
|
|
49
48
|
// Filter operators text
|
|
50
49
|
filterOperatorContains: 'indeholder',
|
|
51
|
-
|
|
50
|
+
filterOperatorDoesNotContain: 'indeholder ikke',
|
|
52
51
|
filterOperatorEquals: 'lig med',
|
|
53
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: 'ikke lig med',
|
|
54
53
|
filterOperatorStartsWith: 'begynder med',
|
|
55
54
|
filterOperatorEndsWith: 'ender med',
|
|
56
55
|
filterOperatorIs: 'er lig med',
|
|
@@ -70,9 +69,9 @@ const daDKGrid = {
|
|
|
70
69
|
'filterOperator<=': '<=',
|
|
71
70
|
// Header filter operators text
|
|
72
71
|
headerFilterOperatorContains: 'Indeholder',
|
|
73
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Indeholder ikke',
|
|
74
73
|
headerFilterOperatorEquals: 'Lig med',
|
|
75
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Ikke lig med',
|
|
76
75
|
headerFilterOperatorStartsWith: 'Begynder med',
|
|
77
76
|
headerFilterOperatorEndsWith: 'Ender med',
|
|
78
77
|
headerFilterOperatorIs: 'Er lig med',
|
package/locales/itIT.js
CHANGED
|
@@ -30,11 +30,10 @@ const itITGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Stampa',
|
|
31
31
|
toolbarExportExcel: 'Scarica come Excel',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
columnsManagementSearchTitle: 'Cerca',
|
|
34
|
+
columnsManagementNoColumns: 'Nessuna colonna',
|
|
35
|
+
columnsManagementShowHideAllText: 'Mostra/Nascondi Tutto',
|
|
36
|
+
columnsManagementReset: 'Resetta',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Aggiungi un filtro',
|
|
40
39
|
filterPanelRemoveAll: 'Rimuovi filtri',
|
|
@@ -48,13 +47,13 @@ const itITGrid = {
|
|
|
48
47
|
filterPanelInputPlaceholder: 'Filtra il valore',
|
|
49
48
|
// Filter operators text
|
|
50
49
|
filterOperatorContains: 'contiene',
|
|
51
|
-
|
|
50
|
+
filterOperatorDoesNotContain: 'non contiene',
|
|
52
51
|
filterOperatorEquals: 'uguale a',
|
|
53
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: 'diverso da',
|
|
54
53
|
filterOperatorStartsWith: 'comincia per',
|
|
55
54
|
filterOperatorEndsWith: 'termina per',
|
|
56
55
|
filterOperatorIs: 'uguale a',
|
|
57
|
-
filterOperatorNot: '
|
|
56
|
+
filterOperatorNot: 'diverso da',
|
|
58
57
|
filterOperatorAfter: 'dopo il',
|
|
59
58
|
filterOperatorOnOrAfter: 'a partire dal',
|
|
60
59
|
filterOperatorBefore: 'prima del',
|
|
@@ -70,26 +69,26 @@ const itITGrid = {
|
|
|
70
69
|
'filterOperator<=': '<=',
|
|
71
70
|
// Header filter operators text
|
|
72
71
|
headerFilterOperatorContains: 'Contiene',
|
|
73
|
-
|
|
74
|
-
headerFilterOperatorEquals: '
|
|
75
|
-
|
|
76
|
-
headerFilterOperatorStartsWith: '
|
|
77
|
-
headerFilterOperatorEndsWith: '
|
|
78
|
-
headerFilterOperatorIs: '
|
|
79
|
-
headerFilterOperatorNot: '
|
|
80
|
-
headerFilterOperatorAfter: '
|
|
81
|
-
headerFilterOperatorOnOrAfter: '
|
|
82
|
-
headerFilterOperatorBefore: '
|
|
83
|
-
headerFilterOperatorOnOrBefore: '
|
|
84
|
-
headerFilterOperatorIsEmpty: '
|
|
85
|
-
headerFilterOperatorIsNotEmpty: '
|
|
86
|
-
headerFilterOperatorIsAnyOf: '
|
|
87
|
-
'headerFilterOperator=': '
|
|
88
|
-
'headerFilterOperator!=': '
|
|
89
|
-
'headerFilterOperator>': '
|
|
90
|
-
'headerFilterOperator>=': '
|
|
91
|
-
'headerFilterOperator<': '
|
|
92
|
-
'headerFilterOperator<=': '
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Non contiene',
|
|
73
|
+
headerFilterOperatorEquals: 'Uguale a',
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Diverso da',
|
|
75
|
+
headerFilterOperatorStartsWith: 'Comincia per',
|
|
76
|
+
headerFilterOperatorEndsWith: 'Termina per',
|
|
77
|
+
headerFilterOperatorIs: 'Uguale a',
|
|
78
|
+
headerFilterOperatorNot: 'Diverso da',
|
|
79
|
+
headerFilterOperatorAfter: 'Dopo il',
|
|
80
|
+
headerFilterOperatorOnOrAfter: 'A partire dal',
|
|
81
|
+
headerFilterOperatorBefore: 'Prima del',
|
|
82
|
+
headerFilterOperatorOnOrBefore: 'Fino al',
|
|
83
|
+
headerFilterOperatorIsEmpty: 'È vuoto',
|
|
84
|
+
headerFilterOperatorIsNotEmpty: 'Non è vuoto',
|
|
85
|
+
headerFilterOperatorIsAnyOf: 'È uno tra',
|
|
86
|
+
'headerFilterOperator=': 'Uguale a',
|
|
87
|
+
'headerFilterOperator!=': 'Diverso da',
|
|
88
|
+
'headerFilterOperator>': 'Maggiore di',
|
|
89
|
+
'headerFilterOperator>=': 'Maggiore o uguale a',
|
|
90
|
+
'headerFilterOperator<': 'Minore di',
|
|
91
|
+
'headerFilterOperator<=': 'Minore o uguale a',
|
|
93
92
|
// Filter values text
|
|
94
93
|
filterValueAny: 'qualunque',
|
|
95
94
|
filterValueTrue: 'vero',
|
package/locales/ptBR.js
CHANGED
|
@@ -47,9 +47,9 @@ const ptBRGrid = {
|
|
|
47
47
|
filterPanelInputPlaceholder: 'Filtrar valor',
|
|
48
48
|
// Filter operators text
|
|
49
49
|
filterOperatorContains: 'contém',
|
|
50
|
-
|
|
50
|
+
filterOperatorDoesNotContain: 'não contém',
|
|
51
51
|
filterOperatorEquals: 'é igual a',
|
|
52
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: 'não é igual a',
|
|
53
53
|
filterOperatorStartsWith: 'começa com',
|
|
54
54
|
filterOperatorEndsWith: 'termina com',
|
|
55
55
|
filterOperatorIs: 'é',
|
|
@@ -69,9 +69,9 @@ const ptBRGrid = {
|
|
|
69
69
|
'filterOperator<=': 'menor ou igual que',
|
|
70
70
|
// Header filter operators text
|
|
71
71
|
headerFilterOperatorContains: 'Contém',
|
|
72
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Não contém',
|
|
73
73
|
headerFilterOperatorEquals: 'Igual',
|
|
74
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Não é igual a',
|
|
75
75
|
headerFilterOperatorStartsWith: 'Começa com',
|
|
76
76
|
headerFilterOperatorEndsWith: 'Termina com',
|
|
77
77
|
headerFilterOperatorIs: 'É',
|
package/material/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import MUIBadge from '@mui/material/Badge';
|
|
2
3
|
import MUICheckbox from '@mui/material/Checkbox';
|
|
4
|
+
import MUIDivider from '@mui/material/Divider';
|
|
3
5
|
import MUITextField from '@mui/material/TextField';
|
|
4
6
|
import MUIFormControl from '@mui/material/FormControl';
|
|
5
7
|
import MUISelect from '@mui/material/Select';
|
|
@@ -51,7 +53,9 @@ const iconSlots = {
|
|
|
51
53
|
columnReorderIcon: GridDragIcon
|
|
52
54
|
};
|
|
53
55
|
const materialSlots = _extends({}, iconSlots, {
|
|
56
|
+
baseBadge: MUIBadge,
|
|
54
57
|
baseCheckbox: MUICheckbox,
|
|
58
|
+
baseDivider: MUIDivider,
|
|
55
59
|
baseTextField: MUITextField,
|
|
56
60
|
baseFormControl: MUIFormControl,
|
|
57
61
|
baseSelect: MUISelect,
|
package/models/gridExport.d.ts
CHANGED
|
@@ -141,7 +141,7 @@ export interface GridPrintExportOptions extends GridExportOptions {
|
|
|
141
141
|
/**
|
|
142
142
|
* Provide Print specific styles to the print window.
|
|
143
143
|
*/
|
|
144
|
-
pageStyle?: string |
|
|
144
|
+
pageStyle?: string | (() => string);
|
|
145
145
|
/**
|
|
146
146
|
* Function that returns the list of row ids to export in the order they should be exported.
|
|
147
147
|
* @param {GridPrintGetRowsToExportParams} params With all properties from [[GridPrintGetRowsToExportParams]].
|
|
@@ -3,6 +3,11 @@ import type { GridSlotProps } from './gridSlotsComponentsProps';
|
|
|
3
3
|
import type { GridIconSlotsComponent } from './gridIconSlotsComponent';
|
|
4
4
|
export type { GridSlotProps } from './gridSlotsComponentsProps';
|
|
5
5
|
export interface GridBaseSlots {
|
|
6
|
+
/**
|
|
7
|
+
* The custom Badge component used in the grid for both header and cells.
|
|
8
|
+
* @default Badge
|
|
9
|
+
*/
|
|
10
|
+
baseBadge: React.JSXElementConstructor<GridSlotProps['baseBadge']>;
|
|
6
11
|
/**
|
|
7
12
|
* The custom Checkbox component used in the grid for both header and cells.
|
|
8
13
|
* @default Checkbox
|
|
@@ -13,6 +18,11 @@ export interface GridBaseSlots {
|
|
|
13
18
|
* @default Chip
|
|
14
19
|
*/
|
|
15
20
|
baseChip: React.JSXElementConstructor<GridSlotProps['baseChip']>;
|
|
21
|
+
/**
|
|
22
|
+
* The custom Divider component used in the grid.
|
|
23
|
+
* @default Divider
|
|
24
|
+
*/
|
|
25
|
+
baseDivider: React.JSXElementConstructor<GridSlotProps['baseDivider']>;
|
|
16
26
|
/**
|
|
17
27
|
* The custom InputAdornment component used in the grid.
|
|
18
28
|
* @default InputAdornment
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { BadgeProps } from '@mui/material/Badge';
|
|
2
3
|
import type { CheckboxProps } from '@mui/material/Checkbox';
|
|
3
4
|
import type { TextFieldProps } from '@mui/material/TextField';
|
|
4
5
|
import type { FormControlProps } from '@mui/material/FormControl';
|
|
@@ -30,8 +31,13 @@ import type { GridColumnsManagementProps } from '../components/columnsManagement
|
|
|
30
31
|
import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
|
|
31
32
|
import type { GridRowCountProps } from '../components/GridRowCount';
|
|
32
33
|
import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
|
|
34
|
+
type DividerProps = {};
|
|
35
|
+
export interface BaseBadgePropsOverrides {
|
|
36
|
+
}
|
|
33
37
|
export interface BaseCheckboxPropsOverrides {
|
|
34
38
|
}
|
|
39
|
+
export interface BaseDividerPropsOverrides {
|
|
40
|
+
}
|
|
35
41
|
export interface BaseTextFieldPropsOverrides {
|
|
36
42
|
}
|
|
37
43
|
export interface BaseFormControlPropsOverrides {
|
|
@@ -95,7 +101,9 @@ export interface SkeletonCellPropsOverrides {
|
|
|
95
101
|
export interface RowPropsOverrides {
|
|
96
102
|
}
|
|
97
103
|
export interface GridSlotProps {
|
|
104
|
+
baseBadge: BadgeProps & BaseBadgePropsOverrides;
|
|
98
105
|
baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
|
|
106
|
+
baseDivider: DividerProps & BaseDividerPropsOverrides;
|
|
99
107
|
baseTextField: TextFieldProps & BaseTextFieldPropsOverrides;
|
|
100
108
|
baseFormControl: FormControlProps & BaseFormControlPropsOverrides;
|
|
101
109
|
baseSelect: SelectProps & BaseSelectPropsOverrides;
|
|
@@ -139,3 +147,4 @@ export interface GridSlotProps {
|
|
|
139
147
|
export type GridSlotsComponentsProps = Partial<{
|
|
140
148
|
[K in keyof GridSlotProps]: Partial<GridSlotProps[K]>;
|
|
141
149
|
}>;
|
|
150
|
+
export {};
|
|
@@ -16,7 +16,7 @@ import { useGridVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
|
16
16
|
import { findParentElementFromClassName, isEventTargetInPortal } from "../utils/domUtils.js";
|
|
17
17
|
import { GRID_CHECKBOX_SELECTION_COL_DEF } from "../colDef/gridCheckboxSelectionColDef.js";
|
|
18
18
|
import { GRID_ACTIONS_COLUMN_TYPE } from "../colDef/gridActionsColDef.js";
|
|
19
|
-
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../constants
|
|
19
|
+
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../internals/constants.js";
|
|
20
20
|
import { gridSortModelSelector } from "../hooks/features/sorting/gridSortingSelector.js";
|
|
21
21
|
import { gridRowMaximumTreeDepthSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
22
22
|
import { gridEditRowsStateSelector } from "../hooks/features/editing/gridEditingSelectors.js";
|