@mui/x-data-grid 7.0.0-beta.5 → 7.0.0-beta.7
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 +252 -50
- package/DataGrid/DataGrid.js +44 -0
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +3 -2
- package/components/GridColumnHeaders.d.ts +1 -2
- package/components/GridColumnHeaders.js +6 -17
- package/components/GridHeaders.js +1 -4
- package/components/GridPagination.js +2 -7
- package/components/GridPinnedRows.d.ts +1 -2
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +9 -26
- package/components/GridScrollArea.d.ts +10 -0
- package/components/GridScrollArea.js +150 -0
- package/components/cell/GridCell.d.ts +7 -2
- package/components/cell/GridCell.js +14 -10
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/components/containers/GridRootStyles.js +12 -22
- package/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/components/virtualization/GridVirtualScroller.js +11 -4
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/gridClasses.d.ts +6 -32
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.js +22 -20
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -99
- package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeState.js +1 -0
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/hooks/features/columnResize/index.d.ts +3 -0
- package/hooks/features/columnResize/index.js +3 -0
- package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
- package/hooks/features/columnResize/useGridColumnResize.js +563 -0
- package/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/hooks/features/dimensions/useGridDimensions.js +5 -5
- package/hooks/features/editing/useGridCellEditing.js +21 -2
- package/hooks/features/export/useGridPrintExport.js +8 -7
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +30 -7
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
- package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
- package/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/hooks/features/pagination/useGridPagination.d.ts +1 -6
- package/hooks/features/pagination/useGridPagination.js +9 -157
- package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
- package/hooks/features/pagination/useGridPaginationModel.js +170 -0
- package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
- package/hooks/features/pagination/useGridRowCount.js +97 -0
- package/hooks/features/rows/useGridParamsApi.js +6 -10
- package/hooks/features/scroll/useGridScroll.js +1 -1
- package/hooks/features/sorting/useGridSorting.js +2 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +6 -0
- package/hooks/utils/useLazyRef.d.ts +1 -2
- package/hooks/utils/useLazyRef.js +1 -11
- package/hooks/utils/useOnMount.d.ts +1 -2
- package/hooks/utils/useOnMount.js +1 -7
- package/hooks/utils/useTimeout.d.ts +1 -11
- package/hooks/utils/useTimeout.js +1 -36
- package/index.js +1 -1
- package/internals/index.d.ts +2 -2
- package/internals/index.js +2 -2
- package/internals/utils/getPinnedCellOffset.d.ts +3 -0
- package/internals/utils/getPinnedCellOffset.js +17 -0
- package/joy/joySlots.js +13 -52
- package/locales/jaJP.js +3 -4
- package/material/index.js +0 -2
- package/models/api/gridApiCommon.d.ts +2 -1
- package/models/api/gridCoreApi.d.ts +1 -5
- package/models/api/gridInfiniteLoaderApi.d.ts +6 -0
- package/models/api/gridInfiniteLoaderApi.js +1 -0
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/gridHeaderFilteringModel.d.ts +1 -0
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/params/gridScrollParams.d.ts +5 -3
- package/models/props/DataGridProps.d.ts +35 -1
- package/modern/DataGrid/DataGrid.js +44 -0
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +3 -2
- package/modern/components/GridColumnHeaders.js +6 -17
- package/modern/components/GridHeaders.js +1 -4
- package/modern/components/GridPagination.js +2 -4
- package/modern/components/GridRow.js +9 -26
- package/modern/components/GridScrollArea.js +150 -0
- package/modern/components/cell/GridCell.js +14 -10
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/modern/components/containers/GridRootStyles.js +12 -22
- package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/modern/components/virtualization/GridVirtualScroller.js +11 -4
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/pipeProcessing/useGridPipeProcessing.js +22 -20
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
- package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/modern/hooks/features/columnResize/index.js +3 -0
- package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +5 -5
- package/modern/hooks/features/editing/useGridCellEditing.js +21 -2
- package/modern/hooks/features/export/useGridPrintExport.js +8 -7
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/modern/hooks/features/pagination/useGridPagination.js +8 -149
- package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
- package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +6 -10
- package/modern/hooks/features/scroll/useGridScroll.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +2 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -0
- package/modern/hooks/utils/useLazyRef.js +1 -11
- package/modern/hooks/utils/useOnMount.js +1 -7
- package/modern/hooks/utils/useTimeout.js +1 -36
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -2
- package/modern/internals/utils/getPinnedCellOffset.js +17 -0
- package/modern/joy/joySlots.js +11 -50
- package/modern/locales/jaJP.js +3 -4
- package/modern/material/index.js +0 -2
- package/modern/models/api/gridInfiniteLoaderApi.js +1 -0
- package/modern/utils/cellBorderUtils.js +8 -0
- package/modern/utils/createSelector.js +12 -20
- package/modern/utils/domUtils.js +144 -0
- package/node/DataGrid/DataGrid.js +44 -0
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +3 -2
- package/node/components/GridColumnHeaders.js +6 -16
- package/node/components/GridHeaders.js +1 -4
- package/node/components/GridPagination.js +1 -3
- package/node/components/GridRow.js +8 -25
- package/node/components/GridScrollArea.js +158 -0
- package/node/components/cell/GridCell.js +15 -11
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/node/components/containers/GridRootStyles.js +12 -22
- package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/node/components/virtualization/GridVirtualScroller.js +11 -4
- package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/pipeProcessing/useGridPipeProcessing.js +22 -20
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
- package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
- package/node/hooks/features/columnResize/columnResizeState.js +5 -0
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
- package/node/hooks/features/columnResize/index.js +38 -0
- package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
- package/node/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +5 -5
- package/node/hooks/features/editing/useGridCellEditing.js +21 -2
- package/node/hooks/features/export/useGridPrintExport.js +8 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/node/hooks/features/pagination/useGridPagination.js +9 -153
- package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
- package/node/hooks/features/pagination/useGridRowCount.js +103 -0
- package/node/hooks/features/rows/useGridParamsApi.js +6 -10
- package/node/hooks/features/scroll/useGridScroll.js +1 -1
- package/node/hooks/features/sorting/useGridSorting.js +2 -2
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +5 -0
- package/node/hooks/utils/useLazyRef.js +7 -13
- package/node/hooks/utils/useOnMount.js +8 -10
- package/node/hooks/utils/useTimeout.js +7 -37
- package/node/index.js +1 -1
- package/node/internals/index.js +15 -15
- package/node/internals/utils/getPinnedCellOffset.js +24 -0
- package/node/joy/joySlots.js +11 -50
- package/node/locales/jaJP.js +3 -4
- package/node/material/index.js +0 -2
- package/node/models/api/gridInfiniteLoaderApi.js +5 -0
- package/node/utils/cellBorderUtils.js +16 -0
- package/node/utils/createSelector.js +14 -23
- package/node/utils/domUtils.js +155 -0
- package/package.json +2 -2
- package/utils/cellBorderUtils.d.ts +3 -0
- package/utils/cellBorderUtils.js +8 -0
- package/utils/createSelector.d.ts +0 -1
- package/utils/createSelector.js +12 -22
- package/utils/domUtils.d.ts +14 -1
- package/utils/domUtils.js +147 -0
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
- package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
|
@@ -1,36 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useLazyRef } from './useLazyRef';
|
|
4
|
-
import { useOnMount } from './useOnMount';
|
|
5
|
-
export class Timeout {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.currentId = null;
|
|
8
|
-
this.clear = () => {
|
|
9
|
-
if (this.currentId !== null) {
|
|
10
|
-
clearTimeout(this.currentId);
|
|
11
|
-
this.currentId = null;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
this.disposeEffect = () => {
|
|
15
|
-
return this.clear;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
static create() {
|
|
19
|
-
return new Timeout();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
23
|
-
*/
|
|
24
|
-
start(delay, fn) {
|
|
25
|
-
this.clear();
|
|
26
|
-
this.currentId = setTimeout(() => {
|
|
27
|
-
this.currentId = null;
|
|
28
|
-
fn();
|
|
29
|
-
}, delay);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
export function useTimeout() {
|
|
33
|
-
const timeout = useLazyRef(Timeout.create).current;
|
|
34
|
-
useOnMount(timeout.disposeEffect);
|
|
35
|
-
return timeout;
|
|
36
|
-
}
|
|
1
|
+
export { default as useTimeout } from '@mui/utils/useTimeout';
|
package/modern/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { GridVirtualScrollerContent } from '../components/virtualization/GridVir
|
|
|
3
3
|
export { GridVirtualScrollerRenderZone } from '../components/virtualization/GridVirtualScrollerRenderZone';
|
|
4
4
|
export { GridHeaders } from '../components/GridHeaders';
|
|
5
5
|
export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColumnHeaders';
|
|
6
|
-
export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
|
|
7
6
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
8
7
|
export { getGridFilter } from '../components/panel/filterPanel/GridFilterPanel';
|
|
9
8
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
@@ -49,12 +48,13 @@ export { dimensionsStateInitializer, useGridDimensions } from '../hooks/features
|
|
|
49
48
|
export { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
50
49
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS } from '../hooks/features/virtualization/useGridVirtualScroller';
|
|
51
50
|
export * from '../hooks/features/virtualization';
|
|
51
|
+
export { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
52
52
|
export { useTimeout } from '../hooks/utils/useTimeout';
|
|
53
53
|
export { useGridVisibleRows, getVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
54
54
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
55
55
|
export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
|
|
56
56
|
export * from '../utils/createControllablePromise';
|
|
57
|
-
export { createSelector, createSelectorMemoized
|
|
57
|
+
export { createSelector, createSelectorMemoized } from '../utils/createSelector';
|
|
58
58
|
export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal } from '../utils/domUtils';
|
|
59
59
|
export { isNavigationKey, isPasteShortcut } from '../utils/keyboardUtils';
|
|
60
60
|
export * from '../utils/utils';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../../hooks/features/columns';
|
|
2
|
+
export const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {
|
|
3
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
4
|
+
let pinnedOffset;
|
|
5
|
+
switch (pinnedPosition) {
|
|
6
|
+
case GridPinnedColumnPosition.LEFT:
|
|
7
|
+
pinnedOffset = columnPositions[columnIndex];
|
|
8
|
+
break;
|
|
9
|
+
case GridPinnedColumnPosition.RIGHT:
|
|
10
|
+
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
|
|
11
|
+
break;
|
|
12
|
+
default:
|
|
13
|
+
pinnedOffset = 0;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return pinnedOffset;
|
|
17
|
+
};
|
package/modern/joy/joySlots.js
CHANGED
|
@@ -4,10 +4,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
|
|
|
4
4
|
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
5
5
|
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
6
6
|
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
7
|
-
_excluded5 = ["
|
|
8
|
-
_excluded6 = ["
|
|
9
|
-
_excluded7 = ["
|
|
10
|
-
_excluded8 = ["shrink", "variant", "sx"];
|
|
7
|
+
_excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
8
|
+
_excluded6 = ["native"],
|
|
9
|
+
_excluded7 = ["shrink", "variant", "sx"];
|
|
11
10
|
import * as React from 'react';
|
|
12
11
|
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
13
12
|
import JoyInput from '@mui/joy/Input';
|
|
@@ -15,7 +14,6 @@ import JoyFormControl from '@mui/joy/FormControl';
|
|
|
15
14
|
import JoyFormLabel from '@mui/joy/FormLabel';
|
|
16
15
|
import JoyButton from '@mui/joy/Button';
|
|
17
16
|
import JoyIconButton from '@mui/joy/IconButton';
|
|
18
|
-
import JoySwitch from '@mui/joy/Switch';
|
|
19
17
|
import JoySelect from '@mui/joy/Select';
|
|
20
18
|
import JoyOption from '@mui/joy/Option';
|
|
21
19
|
import JoyBox from '@mui/joy/Box';
|
|
@@ -154,43 +152,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
154
152
|
sx: sx
|
|
155
153
|
}));
|
|
156
154
|
});
|
|
157
|
-
const
|
|
158
|
-
let {
|
|
159
|
-
name,
|
|
160
|
-
color: colorProp,
|
|
161
|
-
edge,
|
|
162
|
-
icon,
|
|
163
|
-
inputProps,
|
|
164
|
-
inputRef,
|
|
165
|
-
size,
|
|
166
|
-
sx,
|
|
167
|
-
onChange,
|
|
168
|
-
onClick
|
|
169
|
-
} = _ref5,
|
|
170
|
-
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
171
|
-
return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
|
|
172
|
-
onChange: onChange,
|
|
173
|
-
size: convertSize(size),
|
|
174
|
-
color: convertColor(colorProp),
|
|
175
|
-
ref: ref,
|
|
176
|
-
slotProps: {
|
|
177
|
-
input: _extends({}, inputProps, {
|
|
178
|
-
name,
|
|
179
|
-
onClick: onClick,
|
|
180
|
-
ref: inputRef
|
|
181
|
-
}),
|
|
182
|
-
thumb: {
|
|
183
|
-
children: icon
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
sx: [_extends({}, edge === 'start' && {
|
|
187
|
-
ml: '-8px'
|
|
188
|
-
}, edge === 'end' && {
|
|
189
|
-
mr: '-8px'
|
|
190
|
-
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
191
|
-
}));
|
|
192
|
-
});
|
|
193
|
-
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
155
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
194
156
|
let {
|
|
195
157
|
open,
|
|
196
158
|
onOpen,
|
|
@@ -202,8 +164,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
202
164
|
MenuProps,
|
|
203
165
|
inputRef,
|
|
204
166
|
labelId
|
|
205
|
-
} =
|
|
206
|
-
props = _objectWithoutPropertiesLoose(
|
|
167
|
+
} = _ref5,
|
|
168
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
207
169
|
const handleChange = (event, newValue) => {
|
|
208
170
|
if (event && onChange) {
|
|
209
171
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -254,17 +216,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
254
216
|
}
|
|
255
217
|
}));
|
|
256
218
|
});
|
|
257
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
258
|
-
let props = _objectWithoutPropertiesLoose(
|
|
219
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
220
|
+
let props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
259
221
|
return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
|
|
260
222
|
ref: ref
|
|
261
223
|
}));
|
|
262
224
|
});
|
|
263
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
225
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
264
226
|
let {
|
|
265
227
|
sx
|
|
266
|
-
} =
|
|
267
|
-
props = _objectWithoutPropertiesLoose(
|
|
228
|
+
} = _ref7,
|
|
229
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
268
230
|
return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
|
|
269
231
|
ref: ref,
|
|
270
232
|
sx: sx
|
|
@@ -394,7 +356,6 @@ const joySlots = _extends({}, joyIconSlots, {
|
|
|
394
356
|
baseTextField: TextField,
|
|
395
357
|
baseButton: Button,
|
|
396
358
|
baseIconButton: IconButton,
|
|
397
|
-
baseSwitch: Switch,
|
|
398
359
|
baseSelect: Select,
|
|
399
360
|
baseSelectOption: Option,
|
|
400
361
|
baseInputLabel: InputLabel,
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -30,10 +30,9 @@ const jaJPGrid = {
|
|
|
30
30
|
toolbarExportPrint: '印刷',
|
|
31
31
|
toolbarExportExcel: 'Excelダウンロード',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: '検索',
|
|
34
|
+
columnsManagementNoColumns: 'カラムなし',
|
|
35
|
+
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'フィルター追加',
|
|
39
38
|
filterPanelRemoveAll: 'すべて削除',
|
package/modern/material/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import MUICheckbox from '@mui/material/Checkbox';
|
|
|
3
3
|
import MUITextField from '@mui/material/TextField';
|
|
4
4
|
import MUIFormControl from '@mui/material/FormControl';
|
|
5
5
|
import MUISelect from '@mui/material/Select';
|
|
6
|
-
import MUISwitch from '@mui/material/Switch';
|
|
7
6
|
import MUIButton from '@mui/material/Button';
|
|
8
7
|
import MUIIconButton from '@mui/material/IconButton';
|
|
9
8
|
import MUIInputAdornment from '@mui/material/InputAdornment';
|
|
@@ -56,7 +55,6 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
56
55
|
baseTextField: MUITextField,
|
|
57
56
|
baseFormControl: MUIFormControl,
|
|
58
57
|
baseSelect: MUISelect,
|
|
59
|
-
baseSwitch: MUISwitch,
|
|
60
58
|
baseButton: MUIButton,
|
|
61
59
|
baseIconButton: MUIIconButton,
|
|
62
60
|
baseInputAdornment: MUIInputAdornment,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
+
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
3
|
+
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
4
|
+
return showCellVerticalBorderRootProp && (pinnedPosition !== GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell;
|
|
5
|
+
};
|
|
6
|
+
export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
7
|
+
return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
8
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { createSelector as reselectCreateSelector } from 'reselect';
|
|
2
2
|
import { buildWarning } from './warning';
|
|
3
|
-
const
|
|
4
|
-
cache: new WeakMap()
|
|
5
|
-
};
|
|
3
|
+
const cache = new WeakMap();
|
|
6
4
|
const missingInstanceIdWarning = buildWarning(['MUI X: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g. `mySelector(state, apiRef.current.instanceId)`.']);
|
|
7
5
|
function checkIsAPIRef(value) {
|
|
8
6
|
return 'current' in value && 'instanceId' in value.current;
|
|
@@ -75,8 +73,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
75
73
|
return selector;
|
|
76
74
|
};
|
|
77
75
|
export const createSelectorMemoized = (...args) => {
|
|
78
|
-
const selector = (
|
|
79
|
-
const [stateOrApiRef, instanceId] = selectorArgs;
|
|
76
|
+
const selector = (stateOrApiRef, instanceId) => {
|
|
80
77
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
81
78
|
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
|
|
82
79
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
@@ -85,29 +82,24 @@ export const createSelectorMemoized = (...args) => {
|
|
|
85
82
|
missingInstanceIdWarning();
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (
|
|
85
|
+
const cacheArgsInit = cache.get(cacheKey);
|
|
86
|
+
const cacheArgs = cacheArgsInit ?? new Map();
|
|
87
|
+
const cacheFn = cacheArgs?.get(args);
|
|
88
|
+
if (cacheArgs && cacheFn) {
|
|
92
89
|
// We pass the cache key because the called selector might have as
|
|
93
90
|
// dependency another selector created with this `createSelector`.
|
|
94
|
-
return
|
|
91
|
+
return cacheFn(state, cacheKey);
|
|
95
92
|
}
|
|
96
|
-
const
|
|
97
|
-
if (!
|
|
98
|
-
cache.set(cacheKey,
|
|
93
|
+
const fn = reselectCreateSelector(...args);
|
|
94
|
+
if (!cacheArgsInit) {
|
|
95
|
+
cache.set(cacheKey, cacheArgs);
|
|
99
96
|
}
|
|
100
|
-
|
|
101
|
-
return
|
|
97
|
+
cacheArgs.set(args, fn);
|
|
98
|
+
return fn(state, cacheKey);
|
|
102
99
|
};
|
|
103
100
|
|
|
104
101
|
// We use this property to detect if the selector was created with createSelector
|
|
105
102
|
// or it's only a simple function the receives the state and returns part of it.
|
|
106
103
|
selector.acceptsApiRef = true;
|
|
107
104
|
return selector;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
111
|
-
export const unstable_resetCreateSelectorCache = () => {
|
|
112
|
-
cacheContainer.cache = new WeakMap();
|
|
113
105
|
};
|
package/modern/utils/domUtils.js
CHANGED
|
@@ -46,4 +46,148 @@ export function isEventTargetInPortal(event) {
|
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
return false;
|
|
49
|
+
}
|
|
50
|
+
export function getFieldFromHeaderElem(colCellEl) {
|
|
51
|
+
return colCellEl.getAttribute('data-field');
|
|
52
|
+
}
|
|
53
|
+
export function findHeaderElementFromField(elem, field) {
|
|
54
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
55
|
+
}
|
|
56
|
+
export function findGroupHeaderElementsFromField(elem, field) {
|
|
57
|
+
return Array.from(elem.querySelectorAll(`[data-fields*="|-${field}-|"]`) ?? []);
|
|
58
|
+
}
|
|
59
|
+
export function findGridCellElementsFromCol(col, api) {
|
|
60
|
+
const root = findParentElementFromClassName(col, gridClasses.root);
|
|
61
|
+
if (!root) {
|
|
62
|
+
throw new Error('MUI X: The root element is not found.');
|
|
63
|
+
}
|
|
64
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
65
|
+
if (!ariaColIndex) {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
const colIndex = Number(ariaColIndex) - 1;
|
|
69
|
+
const cells = [];
|
|
70
|
+
if (!api.virtualScrollerRef?.current) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
queryRows(api).forEach(rowElement => {
|
|
74
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
75
|
+
if (!rowId) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
let columnIndex = colIndex;
|
|
79
|
+
const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);
|
|
80
|
+
if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
|
|
81
|
+
columnIndex = cellColSpanInfo.leftVisibleCellIndex;
|
|
82
|
+
}
|
|
83
|
+
const cell = rowElement.querySelector(`[data-colindex="${columnIndex}"]`);
|
|
84
|
+
if (cell) {
|
|
85
|
+
cells.push(cell);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return cells;
|
|
89
|
+
}
|
|
90
|
+
export function findGridElement(api, klass) {
|
|
91
|
+
return api.rootElementRef.current.querySelector(`.${gridClasses[klass]}`);
|
|
92
|
+
}
|
|
93
|
+
const findPinnedCells = ({
|
|
94
|
+
api,
|
|
95
|
+
colIndex,
|
|
96
|
+
position,
|
|
97
|
+
filterFn
|
|
98
|
+
}) => {
|
|
99
|
+
if (colIndex === null) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
const cells = [];
|
|
103
|
+
queryRows(api).forEach(rowElement => {
|
|
104
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
105
|
+
if (!rowId) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
rowElement.querySelectorAll(`.${gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {
|
|
109
|
+
const currentColIndex = parseCellColIndex(cell);
|
|
110
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
111
|
+
cells.push(cell);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
return cells;
|
|
116
|
+
};
|
|
117
|
+
export function findLeftPinnedCellsAfterCol(api, col) {
|
|
118
|
+
const colIndex = parseCellColIndex(col);
|
|
119
|
+
return findPinnedCells({
|
|
120
|
+
api,
|
|
121
|
+
colIndex,
|
|
122
|
+
position: 'left',
|
|
123
|
+
filterFn: index => index > colIndex
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
export function findRightPinnedCellsBeforeCol(api, col) {
|
|
127
|
+
const colIndex = parseCellColIndex(col);
|
|
128
|
+
return findPinnedCells({
|
|
129
|
+
api,
|
|
130
|
+
colIndex,
|
|
131
|
+
position: 'right',
|
|
132
|
+
filterFn: index => index < colIndex
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const findPinnedHeaders = ({
|
|
136
|
+
api,
|
|
137
|
+
colIndex,
|
|
138
|
+
position,
|
|
139
|
+
filterFn
|
|
140
|
+
}) => {
|
|
141
|
+
if (!api.columnHeadersContainerRef?.current) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
if (colIndex === null) {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
const elements = [];
|
|
148
|
+
api.columnHeadersContainerRef.current.querySelectorAll(`.${gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
|
|
149
|
+
const currentColIndex = parseCellColIndex(element);
|
|
150
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
151
|
+
elements.push(element);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
return elements;
|
|
155
|
+
};
|
|
156
|
+
export function findLeftPinnedHeadersAfterCol(api, col) {
|
|
157
|
+
const colIndex = parseCellColIndex(col);
|
|
158
|
+
return findPinnedHeaders({
|
|
159
|
+
api,
|
|
160
|
+
position: 'left',
|
|
161
|
+
colIndex,
|
|
162
|
+
filterFn: index => index > colIndex
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
export function findRightPinnedHeadersBeforeCol(api, col) {
|
|
166
|
+
const colIndex = parseCellColIndex(col);
|
|
167
|
+
return findPinnedHeaders({
|
|
168
|
+
api,
|
|
169
|
+
position: 'right',
|
|
170
|
+
colIndex,
|
|
171
|
+
filterFn: index => index < colIndex
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
export function findGridHeader(api, field) {
|
|
175
|
+
const headers = api.columnHeadersContainerRef.current;
|
|
176
|
+
return headers.querySelector(`:scope > div > [data-field="${field}"][role="columnheader"]`);
|
|
177
|
+
}
|
|
178
|
+
export function findGridCells(api, field) {
|
|
179
|
+
const container = api.virtualScrollerRef.current;
|
|
180
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${field}"][role="gridcell"]`));
|
|
181
|
+
}
|
|
182
|
+
function queryRows(api) {
|
|
183
|
+
return api.virtualScrollerRef.current.querySelectorAll(
|
|
184
|
+
// Use > to ignore rows from nested data grids (e.g. in detail panel)
|
|
185
|
+
`:scope > div > div > .${gridClasses.row}`);
|
|
186
|
+
}
|
|
187
|
+
function parseCellColIndex(col) {
|
|
188
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
189
|
+
if (!ariaColIndex) {
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
return Number(ariaColIndex) - 1;
|
|
49
193
|
}
|
|
@@ -74,6 +74,21 @@ DataGridRaw.propTypes = {
|
|
|
74
74
|
* @default false
|
|
75
75
|
*/
|
|
76
76
|
autoPageSize: _propTypes.default.bool,
|
|
77
|
+
/**
|
|
78
|
+
* If `true`, columns are autosized after the datagrid is mounted.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
autosizeOnMount: _propTypes.default.bool,
|
|
82
|
+
/**
|
|
83
|
+
* The options for autosize when user-initiated.
|
|
84
|
+
*/
|
|
85
|
+
autosizeOptions: _propTypes.default.shape({
|
|
86
|
+
columns: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
87
|
+
expand: _propTypes.default.bool,
|
|
88
|
+
includeHeaders: _propTypes.default.bool,
|
|
89
|
+
includeOutliers: _propTypes.default.bool,
|
|
90
|
+
outliersFactor: _propTypes.default.number
|
|
91
|
+
}),
|
|
77
92
|
/**
|
|
78
93
|
* Controls the modes of the cells.
|
|
79
94
|
*/
|
|
@@ -122,6 +137,11 @@ DataGridRaw.propTypes = {
|
|
|
122
137
|
* @default "standard"
|
|
123
138
|
*/
|
|
124
139
|
density: _propTypes.default.oneOf(['comfortable', 'compact', 'standard']),
|
|
140
|
+
/**
|
|
141
|
+
* If `true`, column autosizing on header separator double-click is disabled.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
disableAutosize: _propTypes.default.bool,
|
|
125
145
|
/**
|
|
126
146
|
* If `true`, column filters are disabled.
|
|
127
147
|
* @default false
|
|
@@ -132,6 +152,11 @@ DataGridRaw.propTypes = {
|
|
|
132
152
|
* @default false
|
|
133
153
|
*/
|
|
134
154
|
disableColumnMenu: _propTypes.default.bool,
|
|
155
|
+
/**
|
|
156
|
+
* If `true`, resizing columns is disabled.
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
disableColumnResize: _propTypes.default.bool,
|
|
135
160
|
/**
|
|
136
161
|
* If `true`, hiding/showing columns is disabled.
|
|
137
162
|
* @default false
|
|
@@ -429,12 +454,26 @@ DataGridRaw.propTypes = {
|
|
|
429
454
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
430
455
|
*/
|
|
431
456
|
onColumnOrderChange: _propTypes.default.func,
|
|
457
|
+
/**
|
|
458
|
+
* Callback fired while a column is being resized.
|
|
459
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
460
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
461
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
462
|
+
*/
|
|
463
|
+
onColumnResize: _propTypes.default.func,
|
|
432
464
|
/**
|
|
433
465
|
* Callback fired when the column visibility model changes.
|
|
434
466
|
* @param {GridColumnVisibilityModel} model The new model.
|
|
435
467
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
436
468
|
*/
|
|
437
469
|
onColumnVisibilityModelChange: _propTypes.default.func,
|
|
470
|
+
/**
|
|
471
|
+
* Callback fired when the width of a column is changed.
|
|
472
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
473
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
474
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
475
|
+
*/
|
|
476
|
+
onColumnWidthChange: _propTypes.default.func,
|
|
438
477
|
/**
|
|
439
478
|
* Callback fired when the Filter model changes before the filters are applied.
|
|
440
479
|
* @param {GridFilterModel} model With all properties from [[GridFilterModel]].
|
|
@@ -495,6 +534,11 @@ DataGridRaw.propTypes = {
|
|
|
495
534
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
496
535
|
*/
|
|
497
536
|
onRowClick: _propTypes.default.func,
|
|
537
|
+
/**
|
|
538
|
+
* Callback fired when the row count has changed.
|
|
539
|
+
* @param {number} count Updated row count.
|
|
540
|
+
*/
|
|
541
|
+
onRowCountChange: _propTypes.default.func,
|
|
498
542
|
/**
|
|
499
543
|
* Callback fired when a double click event comes from a row container element.
|
|
500
544
|
* @param {GridRowParams} params With all properties from [[RowParams]].
|
|
@@ -32,6 +32,7 @@ var _useGridStatePersistence = require("../hooks/features/statePersistence/useGr
|
|
|
32
32
|
var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpanning");
|
|
33
33
|
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
|
|
34
34
|
var _virtualization = require("../hooks/features/virtualization");
|
|
35
|
+
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
|
|
35
36
|
const useDataGridComponent = (inputApiRef, props) => {
|
|
36
37
|
const apiRef = (0, _useGridInitialization.useGridInitialization)(inputApiRef, props);
|
|
37
38
|
|
|
@@ -54,6 +55,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
55
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPreferencesPanel.preferencePanelStateInitializer, apiRef, props);
|
|
55
56
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridFilter.filterStateInitializer, apiRef, props);
|
|
56
57
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
|
|
58
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
|
|
57
59
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
58
60
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowsMeta.rowsMetaStateInitializer, apiRef, props);
|
|
59
61
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnMenu.columnMenuStateInitializer, apiRef, props);
|
|
@@ -72,6 +74,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
72
74
|
(0, _useGridFilter.useGridFilter)(apiRef, props);
|
|
73
75
|
(0, _useGridSorting.useGridSorting)(apiRef, props);
|
|
74
76
|
(0, _useGridDensity.useGridDensity)(apiRef, props);
|
|
77
|
+
(0, _useGridColumnResize.useGridColumnResize)(apiRef, props);
|
|
75
78
|
(0, _useGridPagination.useGridPagination)(apiRef, props);
|
|
76
79
|
(0, _useGridRowsMeta.useGridRowsMeta)(apiRef, props);
|
|
77
80
|
(0, _useGridScroll.useGridScroll)(apiRef, props);
|
|
@@ -22,7 +22,6 @@ const DATA_GRID_FORCED_PROPS = {
|
|
|
22
22
|
pagination: true,
|
|
23
23
|
checkboxSelectionVisibleOnly: false,
|
|
24
24
|
disableColumnReorder: true,
|
|
25
|
-
disableColumnResize: true,
|
|
26
25
|
keepColumnPositionIfDraggedOutside: false,
|
|
27
26
|
signature: 'DataGrid'
|
|
28
27
|
};
|
|
@@ -79,7 +78,9 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
79
78
|
keepColumnPositionIfDraggedOutside: false,
|
|
80
79
|
ignoreValueFormatterDuringExport: false,
|
|
81
80
|
clipboardCopyCellDelimiter: '\t',
|
|
82
|
-
rowPositionsDebounceMs: 166
|
|
81
|
+
rowPositionsDebounceMs: 166,
|
|
82
|
+
autosizeOnMount: false,
|
|
83
|
+
disableAutosize: false
|
|
83
84
|
};
|
|
84
85
|
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
85
86
|
const useDataGridProps = inProps => {
|
|
@@ -9,18 +9,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _utils = require("@mui/utils");
|
|
13
12
|
var _fastMemo = require("../utils/fastMemo");
|
|
14
13
|
var _useGridColumnHeaders = require("../hooks/features/columnHeaders/useGridColumnHeaders");
|
|
15
14
|
var _GridBaseColumnHeaders = require("./columnHeaders/GridBaseColumnHeaders");
|
|
16
|
-
var _GridColumnHeadersInner = require("./columnHeaders/GridColumnHeadersInner");
|
|
17
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["
|
|
16
|
+
const _excluded = ["className", "visibleColumns", "sortColumnLookup", "filterColumnLookup", "columnHeaderTabIndexState", "columnGroupHeaderTabIndexState", "columnHeaderFocus", "columnGroupHeaderFocus", "headerGroupingMaxDepth", "columnMenuState", "columnVisibility", "columnGroupsHeaderStructure", "hasOtherElementInTabSequence"];
|
|
19
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
20
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
19
|
const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeaders(props, ref) {
|
|
22
20
|
const {
|
|
23
|
-
innerRef,
|
|
24
21
|
visibleColumns,
|
|
25
22
|
sortColumnLookup,
|
|
26
23
|
filterColumnLookup,
|
|
@@ -36,12 +33,10 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
|
|
|
36
33
|
} = props,
|
|
37
34
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
35
|
const {
|
|
39
|
-
isDragging,
|
|
40
36
|
getInnerProps,
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
getColumnHeadersRow,
|
|
38
|
+
getColumnGroupHeadersRows
|
|
43
39
|
} = (0, _useGridColumnHeaders.useGridColumnHeaders)({
|
|
44
|
-
innerRef,
|
|
45
40
|
visibleColumns,
|
|
46
41
|
sortColumnLookup,
|
|
47
42
|
filterColumnLookup,
|
|
@@ -55,14 +50,10 @@ const GridColumnHeaders = /*#__PURE__*/React.forwardRef(function GridColumnHeade
|
|
|
55
50
|
columnGroupsHeaderStructure,
|
|
56
51
|
hasOtherElementInTabSequence
|
|
57
52
|
});
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridBaseColumnHeaders.GridBaseColumnHeaders, (0, _extends2.default)({
|
|
59
54
|
ref: ref
|
|
60
|
-
}, other, {
|
|
61
|
-
children:
|
|
62
|
-
isDragging: isDragging
|
|
63
|
-
}, getInnerProps(), {
|
|
64
|
-
children: [getColumnGroupHeaders(), getColumnHeaders()]
|
|
65
|
-
}))
|
|
55
|
+
}, other, getInnerProps(), {
|
|
56
|
+
children: [getColumnGroupHeadersRows(), getColumnHeadersRow()]
|
|
66
57
|
}));
|
|
67
58
|
});
|
|
68
59
|
process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
@@ -96,7 +87,6 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaders.propTypes = {
|
|
|
96
87
|
filterColumnLookup: _propTypes.default.object.isRequired,
|
|
97
88
|
hasOtherElementInTabSequence: _propTypes.default.bool.isRequired,
|
|
98
89
|
headerGroupingMaxDepth: _propTypes.default.number.isRequired,
|
|
99
|
-
innerRef: _utils.refType,
|
|
100
90
|
sortColumnLookup: _propTypes.default.object.isRequired,
|
|
101
91
|
visibleColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
|
|
102
92
|
} : void 0;
|
|
@@ -34,15 +34,12 @@ function GridHeaders() {
|
|
|
34
34
|
const columnVisibility = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnVisibilityModelSelector);
|
|
35
35
|
const columnGroupsHeaderStructure = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderStructureSelector);
|
|
36
36
|
const hasOtherElementInTabSequence = !(columnGroupHeaderTabIndexState === null && columnHeaderTabIndexState === null && cellTabIndexState === null);
|
|
37
|
-
const columnHeadersRef = React.useRef(null);
|
|
38
37
|
const columnsContainerRef = React.useRef(null);
|
|
39
38
|
apiRef.current.register('private', {
|
|
40
|
-
|
|
41
|
-
columnHeadersElementRef: columnHeadersRef
|
|
39
|
+
columnHeadersContainerRef: columnsContainerRef
|
|
42
40
|
});
|
|
43
41
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.columnHeaders, {
|
|
44
42
|
ref: columnsContainerRef,
|
|
45
|
-
innerRef: columnHeadersRef,
|
|
46
43
|
visibleColumns: visibleColumns,
|
|
47
44
|
filterColumnLookup: filterColumnLookup,
|
|
48
45
|
sortColumnLookup: sortColumnLookup,
|