@mui/x-data-grid 7.0.0-beta.6 → 7.0.0
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 +311 -12
- package/DataGrid/DataGrid.js +57 -17
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +6 -7
- package/README.md +1 -1
- package/components/GridColumnHeaders.d.ts +1 -2
- package/components/GridColumnHeaders.js +6 -17
- package/components/GridFooter.js +2 -3
- package/components/GridHeader.js +1 -2
- package/components/GridHeaders.js +1 -4
- package/components/GridPagination.d.ts +6 -5
- package/components/GridPagination.js +14 -11
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +17 -36
- package/components/GridScrollArea.d.ts +10 -0
- package/components/GridScrollArea.js +150 -0
- package/components/base/GridFooterPlaceholder.js +1 -2
- package/components/base/GridOverlays.js +3 -6
- package/components/cell/GridActionsCell.js +4 -6
- package/components/cell/GridActionsCellItem.d.ts +8 -25
- package/components/cell/GridActionsCellItem.js +8 -5
- package/components/cell/GridBooleanCell.d.ts +1 -0
- package/components/cell/GridBooleanCell.js +3 -2
- package/components/cell/GridCell.d.ts +7 -0
- package/components/cell/GridCell.js +18 -11
- package/components/cell/GridEditBooleanCell.js +1 -2
- package/components/cell/GridEditDateCell.js +2 -3
- package/components/cell/GridEditInputCell.js +2 -2
- package/components/cell/GridEditSingleSelectCell.js +5 -8
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +2 -3
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +22 -13
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +2 -3
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +26 -12
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +1 -2
- package/components/columnHeaders/GridColumnHeaderTitle.js +2 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +7 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +3 -5
- package/components/columnSelection/GridHeaderCheckbox.js +1 -2
- package/components/columnsManagement/GridColumnsManagement.js +17 -21
- package/components/containers/GridRoot.js +3 -3
- package/components/containers/GridRootStyles.js +12 -20
- package/components/menu/GridMenu.js +4 -6
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +2 -3
- package/components/panel/GridColumnsPanel.js +1 -2
- package/components/panel/GridPanel.d.ts +1 -10
- package/components/panel/GridPanel.js +1 -2
- package/components/panel/GridPreferencesPanel.js +2 -3
- package/components/panel/filterPanel/GridFilterForm.js +24 -27
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +6 -7
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +3 -4
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +11 -15
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +10 -14
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +10 -11
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputValue.js +5 -7
- package/components/panel/filterPanel/GridFilterPanel.js +5 -9
- package/components/panel/filterPanel/filterPanelUtils.js +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -5
- package/components/toolbar/GridToolbarDensitySelector.js +8 -10
- package/components/toolbar/GridToolbarExport.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +3 -5
- package/components/toolbar/GridToolbarFilterButton.js +3 -5
- package/components/toolbar/GridToolbarQuickFilter.js +4 -5
- package/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/components/virtualization/GridVirtualScroller.js +6 -1
- package/components/virtualization/GridVirtualScrollerContent.js +1 -2
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.js +1 -2
- 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/strategyProcessing/useGridStrategyProcessing.js +1 -2
- package/hooks/core/useGridApiInitialization.js +4 -6
- package/hooks/features/clipboard/useGridClipboard.js +6 -5
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.js +4 -16
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +4 -8
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +12 -23
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -101
- package/hooks/features/columnMenu/useGridColumnMenuSlots.js +2 -2
- 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 +553 -0
- package/hooks/features/columns/gridColumnsSelector.js +1 -2
- package/hooks/features/columns/gridColumnsUtils.d.ts +0 -9
- package/hooks/features/columns/gridColumnsUtils.js +5 -22
- package/hooks/features/columns/useGridColumnSpanning.js +1 -2
- package/hooks/features/columns/useGridColumns.js +11 -19
- package/hooks/features/density/densitySelector.d.ts +4 -2
- package/hooks/features/density/densitySelector.js +8 -2
- package/hooks/features/density/densityState.d.ts +1 -4
- package/hooks/features/density/useGridDensity.d.ts +2 -4
- package/hooks/features/density/useGridDensity.js +21 -29
- package/hooks/features/dimensions/useGridDimensions.js +7 -10
- package/hooks/features/editing/useGridCellEditing.js +25 -8
- package/hooks/features/editing/useGridEditing.js +1 -2
- package/hooks/features/editing/useGridRowEditing.js +4 -6
- package/hooks/features/export/serializers/csvSerializer.d.ts +2 -0
- package/hooks/features/export/serializers/csvSerializer.js +25 -16
- package/hooks/features/export/useGridCsvExport.js +9 -10
- package/hooks/features/export/useGridPrintExport.js +17 -22
- package/hooks/features/export/utils.js +2 -3
- package/hooks/features/filter/gridFilterSelector.js +15 -22
- package/hooks/features/filter/gridFilterUtils.js +10 -16
- package/hooks/features/filter/useGridFilter.js +9 -15
- package/hooks/features/focus/useGridFocus.js +5 -6
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +23 -5
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +1 -2
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
- package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
- package/hooks/features/pagination/gridPaginationSelector.js +9 -4
- package/hooks/features/pagination/useGridPagination.d.ts +1 -6
- package/hooks/features/pagination/useGridPagination.js +9 -158
- package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
- package/hooks/features/pagination/useGridPaginationModel.js +165 -0
- package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
- package/hooks/features/pagination/useGridRowCount.js +94 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +7 -12
- package/hooks/features/rowSelection/useGridRowSelection.js +11 -16
- package/hooks/features/rows/gridRowsSelector.js +11 -19
- package/hooks/features/rows/gridRowsUtils.js +7 -9
- package/hooks/features/rows/useGridParamsApi.js +1 -1
- package/hooks/features/rows/useGridRows.js +4 -13
- package/hooks/features/rows/useGridRowsMeta.js +7 -13
- package/hooks/features/scroll/useGridScroll.js +3 -4
- package/hooks/features/sorting/gridSortingSelector.js +4 -7
- package/hooks/features/sorting/useGridSorting.js +8 -14
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -3
- package/hooks/features/virtualization/useGridVirtualScroller.js +220 -71
- package/hooks/utils/useGridApiEventHandler.js +5 -10
- package/hooks/utils/useGridNativeEventListener.js +1 -2
- 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 +3 -1
- package/internals/index.js +2 -1
- package/internals/utils/getPinnedCellOffset.d.ts +3 -0
- package/internals/utils/getPinnedCellOffset.js +17 -0
- package/internals/utils/useProps.js +1 -2
- package/joy/joySlots.js +18 -63
- package/locales/jaJP.js +3 -4
- package/material/index.js +0 -2
- package/models/api/gridApiCommon.d.ts +3 -3
- package/models/api/gridCoreApi.d.ts +1 -5
- package/models/api/gridRowsMetaApi.d.ts +1 -1
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +13 -0
- package/models/gridExport.d.ts +6 -0
- package/models/gridHeaderFilteringModel.d.ts +1 -0
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridStateCommunity.d.ts +3 -0
- package/models/params/gridScrollParams.d.ts +5 -3
- package/models/props/DataGridProps.d.ts +58 -28
- package/modern/DataGrid/DataGrid.js +57 -17
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +6 -7
- package/modern/components/GridColumnHeaders.js +6 -17
- package/modern/components/GridHeaders.js +1 -4
- package/modern/components/GridPagination.js +13 -6
- package/modern/components/GridRow.js +4 -19
- package/modern/components/GridScrollArea.js +150 -0
- package/modern/components/cell/GridActionsCell.js +1 -1
- package/modern/components/cell/GridActionsCellItem.js +4 -0
- package/modern/components/cell/GridBooleanCell.js +3 -2
- package/modern/components/cell/GridCell.js +11 -3
- 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/GridRoot.js +3 -3
- package/modern/components/containers/GridRootStyles.js +12 -20
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/modern/components/toolbar/GridToolbarDensitySelector.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/modern/components/virtualization/GridVirtualScroller.js +6 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +4 -2
- 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 -20
- package/modern/hooks/features/density/densitySelector.js +8 -2
- package/modern/hooks/features/density/useGridDensity.js +21 -29
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/modern/hooks/features/editing/useGridCellEditing.js +22 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/modern/hooks/features/export/useGridCsvExport.js +2 -1
- package/modern/hooks/features/export/useGridPrintExport.js +8 -7
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
- 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/rowSelection/useGridRowSelection.js +3 -2
- package/modern/hooks/features/scroll/useGridScroll.js +1 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
- 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 -1
- 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/index.js +0 -1
- package/modern/utils/cellBorderUtils.js +8 -0
- package/modern/utils/createSelector.js +1 -1
- package/modern/utils/domUtils.js +144 -0
- package/modern/utils/keyboardUtils.js +1 -1
- package/node/DataGrid/DataGrid.js +57 -17
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +6 -7
- package/node/components/GridColumnHeaders.js +6 -16
- package/node/components/GridHeaders.js +1 -4
- package/node/components/GridPagination.js +10 -4
- package/node/components/GridRow.js +3 -18
- package/node/components/GridScrollArea.js +158 -0
- package/node/components/cell/GridActionsCell.js +1 -1
- package/node/components/cell/GridActionsCellItem.js +4 -0
- package/node/components/cell/GridBooleanCell.js +3 -2
- package/node/components/cell/GridCell.js +12 -4
- 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/GridRoot.js +2 -2
- package/node/components/containers/GridRootStyles.js +12 -20
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputDate.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputValue.js +1 -1
- package/node/components/toolbar/GridToolbarDensitySelector.js +4 -4
- package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/node/components/virtualization/GridVirtualScroller.js +6 -1
- package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +4 -2
- 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 -21
- package/node/hooks/features/density/densitySelector.js +9 -3
- package/node/hooks/features/density/useGridDensity.js +22 -30
- package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/node/hooks/features/editing/useGridCellEditing.js +22 -3
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +23 -12
- package/node/hooks/features/export/useGridCsvExport.js +2 -1
- package/node/hooks/features/export/useGridPrintExport.js +8 -7
- package/node/hooks/features/filter/gridFilterUtils.js +1 -1
- 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/rowSelection/useGridRowSelection.js +2 -1
- package/node/hooks/features/scroll/useGridScroll.js +1 -1
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +211 -57
- 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 +27 -8
- 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/index.js +0 -11
- package/node/utils/cellBorderUtils.js +16 -0
- package/node/utils/createSelector.js +1 -1
- package/node/utils/domUtils.js +155 -0
- package/node/utils/keyboardUtils.js +1 -1
- package/package.json +4 -4
- package/utils/cellBorderUtils.d.ts +3 -0
- package/utils/cellBorderUtils.js +8 -0
- package/utils/createSelector.js +9 -9
- package/utils/domUtils.d.ts +14 -1
- package/utils/domUtils.js +144 -0
- package/utils/getGridLocalization.js +9 -12
- package/utils/keyboardUtils.js +1 -1
- 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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPinnedCellOffset = void 0;
|
|
7
|
+
var _columns = require("../../hooks/features/columns");
|
|
8
|
+
const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {
|
|
9
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
10
|
+
let pinnedOffset;
|
|
11
|
+
switch (pinnedPosition) {
|
|
12
|
+
case _columns.GridPinnedColumnPosition.LEFT:
|
|
13
|
+
pinnedOffset = columnPositions[columnIndex];
|
|
14
|
+
break;
|
|
15
|
+
case _columns.GridPinnedColumnPosition.RIGHT:
|
|
16
|
+
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
pinnedOffset = 0;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
return pinnedOffset;
|
|
23
|
+
};
|
|
24
|
+
exports.getPinnedCellOffset = getPinnedCellOffset;
|
package/node/joy/joySlots.js
CHANGED
|
@@ -14,7 +14,6 @@ var _FormControl = _interopRequireDefault(require("@mui/joy/FormControl"));
|
|
|
14
14
|
var _FormLabel = _interopRequireDefault(require("@mui/joy/FormLabel"));
|
|
15
15
|
var _Button = _interopRequireDefault(require("@mui/joy/Button"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("@mui/joy/IconButton"));
|
|
17
|
-
var _Switch = _interopRequireDefault(require("@mui/joy/Switch"));
|
|
18
17
|
var _Select = _interopRequireDefault(require("@mui/joy/Select"));
|
|
19
18
|
var _Option = _interopRequireDefault(require("@mui/joy/Option"));
|
|
20
19
|
var _Box = _interopRequireDefault(require("@mui/joy/Box"));
|
|
@@ -32,10 +31,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
|
|
|
32
31
|
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
33
32
|
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
34
33
|
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
35
|
-
_excluded5 = ["
|
|
36
|
-
_excluded6 = ["
|
|
37
|
-
_excluded7 = ["
|
|
38
|
-
_excluded8 = ["shrink", "variant", "sx"];
|
|
34
|
+
_excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
35
|
+
_excluded6 = ["native"],
|
|
36
|
+
_excluded7 = ["shrink", "variant", "sx"];
|
|
39
37
|
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); }
|
|
40
38
|
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; }
|
|
41
39
|
function convertColor(color) {
|
|
@@ -162,43 +160,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
162
160
|
sx: sx
|
|
163
161
|
}));
|
|
164
162
|
});
|
|
165
|
-
const
|
|
166
|
-
let {
|
|
167
|
-
name,
|
|
168
|
-
color: colorProp,
|
|
169
|
-
edge,
|
|
170
|
-
icon,
|
|
171
|
-
inputProps,
|
|
172
|
-
inputRef,
|
|
173
|
-
size,
|
|
174
|
-
sx,
|
|
175
|
-
onChange,
|
|
176
|
-
onClick
|
|
177
|
-
} = _ref5,
|
|
178
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
|
|
179
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, (0, _extends2.default)({}, props, {
|
|
180
|
-
onChange: onChange,
|
|
181
|
-
size: convertSize(size),
|
|
182
|
-
color: convertColor(colorProp),
|
|
183
|
-
ref: ref,
|
|
184
|
-
slotProps: {
|
|
185
|
-
input: (0, _extends2.default)({}, inputProps, {
|
|
186
|
-
name,
|
|
187
|
-
onClick: onClick,
|
|
188
|
-
ref: inputRef
|
|
189
|
-
}),
|
|
190
|
-
thumb: {
|
|
191
|
-
children: icon
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
sx: [(0, _extends2.default)({}, edge === 'start' && {
|
|
195
|
-
ml: '-8px'
|
|
196
|
-
}, edge === 'end' && {
|
|
197
|
-
mr: '-8px'
|
|
198
|
-
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
199
|
-
}));
|
|
200
|
-
});
|
|
201
|
-
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
163
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
202
164
|
let {
|
|
203
165
|
open,
|
|
204
166
|
onOpen,
|
|
@@ -210,8 +172,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
210
172
|
MenuProps,
|
|
211
173
|
inputRef,
|
|
212
174
|
labelId
|
|
213
|
-
} =
|
|
214
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
175
|
+
} = _ref5,
|
|
176
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
|
|
215
177
|
const handleChange = (event, newValue) => {
|
|
216
178
|
if (event && onChange) {
|
|
217
179
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -262,17 +224,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
262
224
|
}
|
|
263
225
|
}));
|
|
264
226
|
});
|
|
265
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
266
|
-
let props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
227
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
228
|
+
let props = (0, _objectWithoutPropertiesLoose2.default)(_ref6, _excluded6);
|
|
267
229
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, (0, _extends2.default)({}, props, {
|
|
268
230
|
ref: ref
|
|
269
231
|
}));
|
|
270
232
|
});
|
|
271
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
233
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
272
234
|
let {
|
|
273
235
|
sx
|
|
274
|
-
} =
|
|
275
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
236
|
+
} = _ref7,
|
|
237
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref7, _excluded7);
|
|
276
238
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, (0, _extends2.default)({}, props, {
|
|
277
239
|
ref: ref,
|
|
278
240
|
sx: sx
|
|
@@ -402,7 +364,6 @@ const joySlots = (0, _extends2.default)({}, _icons.default, {
|
|
|
402
364
|
baseTextField: TextField,
|
|
403
365
|
baseButton: Button,
|
|
404
366
|
baseIconButton: IconButton,
|
|
405
|
-
baseSwitch: Switch,
|
|
406
367
|
baseSelect: Select,
|
|
407
368
|
baseSelectOption: Option,
|
|
408
369
|
baseInputLabel: InputLabel,
|
package/node/locales/jaJP.js
CHANGED
|
@@ -36,10 +36,9 @@ const jaJPGrid = {
|
|
|
36
36
|
toolbarExportPrint: '印刷',
|
|
37
37
|
toolbarExportExcel: 'Excelダウンロード',
|
|
38
38
|
// Columns management text
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
columnsManagementSearchTitle: '検索',
|
|
40
|
+
columnsManagementNoColumns: 'カラムなし',
|
|
41
|
+
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
43
42
|
// Filter panel text
|
|
44
43
|
filterPanelAddFilter: 'フィルター追加',
|
|
45
44
|
filterPanelRemoveAll: 'すべて削除',
|
package/node/material/index.js
CHANGED
|
@@ -10,7 +10,6 @@ var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
|
10
10
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
11
11
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
12
12
|
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
13
|
-
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
14
13
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
15
14
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
16
15
|
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
@@ -63,7 +62,6 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
|
63
62
|
baseTextField: _TextField.default,
|
|
64
63
|
baseFormControl: _FormControl.default,
|
|
65
64
|
baseSelect: _Select.default,
|
|
66
|
-
baseSwitch: _Switch.default,
|
|
67
65
|
baseButton: _Button.default,
|
|
68
66
|
baseIconButton: _IconButton.default,
|
|
69
67
|
baseInputAdornment: _InputAdornment.default,
|
package/node/models/api/index.js
CHANGED
|
@@ -156,15 +156,4 @@ Object.keys(_gridScrollApi).forEach(function (key) {
|
|
|
156
156
|
return _gridScrollApi[key];
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
});
|
|
160
|
-
var _gridVirtualizationApi = require("./gridVirtualizationApi");
|
|
161
|
-
Object.keys(_gridVirtualizationApi).forEach(function (key) {
|
|
162
|
-
if (key === "default" || key === "__esModule") return;
|
|
163
|
-
if (key in exports && exports[key] === _gridVirtualizationApi[key]) return;
|
|
164
|
-
Object.defineProperty(exports, key, {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () {
|
|
167
|
-
return _gridVirtualizationApi[key];
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
159
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldCellShowRightBorder = exports.shouldCellShowLeftBorder = void 0;
|
|
7
|
+
var _gridColumnsInterfaces = require("../hooks/features/columns/gridColumnsInterfaces");
|
|
8
|
+
const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
9
|
+
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
10
|
+
return showCellVerticalBorderRootProp && (pinnedPosition !== _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT && isSectionLastCell;
|
|
11
|
+
};
|
|
12
|
+
exports.shouldCellShowRightBorder = shouldCellShowRightBorder;
|
|
13
|
+
const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
14
|
+
return pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
15
|
+
};
|
|
16
|
+
exports.shouldCellShowLeftBorder = shouldCellShowLeftBorder;
|
|
@@ -7,7 +7,7 @@ exports.createSelectorMemoized = exports.createSelector = void 0;
|
|
|
7
7
|
var _reselect = require("reselect");
|
|
8
8
|
var _warning = require("./warning");
|
|
9
9
|
const cache = new WeakMap();
|
|
10
|
-
const missingInstanceIdWarning = (0, _warning.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`,
|
|
10
|
+
const missingInstanceIdWarning = (0, _warning.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`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
|
|
11
11
|
function checkIsAPIRef(value) {
|
|
12
12
|
return 'current' in value && 'instanceId' in value.current;
|
|
13
13
|
}
|
package/node/utils/domUtils.js
CHANGED
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.findGridCellElementsFromCol = findGridCellElementsFromCol;
|
|
7
|
+
exports.findGridCells = findGridCells;
|
|
8
|
+
exports.findGridElement = findGridElement;
|
|
9
|
+
exports.findGridHeader = findGridHeader;
|
|
10
|
+
exports.findGroupHeaderElementsFromField = findGroupHeaderElementsFromField;
|
|
11
|
+
exports.findHeaderElementFromField = findHeaderElementFromField;
|
|
12
|
+
exports.findLeftPinnedCellsAfterCol = findLeftPinnedCellsAfterCol;
|
|
13
|
+
exports.findLeftPinnedHeadersAfterCol = findLeftPinnedHeadersAfterCol;
|
|
6
14
|
exports.findParentElementFromClassName = findParentElementFromClassName;
|
|
15
|
+
exports.findRightPinnedCellsBeforeCol = findRightPinnedCellsBeforeCol;
|
|
16
|
+
exports.findRightPinnedHeadersBeforeCol = findRightPinnedHeadersBeforeCol;
|
|
7
17
|
exports.getActiveElement = void 0;
|
|
18
|
+
exports.getFieldFromHeaderElem = getFieldFromHeaderElem;
|
|
8
19
|
exports.getGridCellElement = getGridCellElement;
|
|
9
20
|
exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
|
|
10
21
|
exports.getGridRowElement = getGridRowElement;
|
|
@@ -59,4 +70,148 @@ function isEventTargetInPortal(event) {
|
|
|
59
70
|
return true;
|
|
60
71
|
}
|
|
61
72
|
return false;
|
|
73
|
+
}
|
|
74
|
+
function getFieldFromHeaderElem(colCellEl) {
|
|
75
|
+
return colCellEl.getAttribute('data-field');
|
|
76
|
+
}
|
|
77
|
+
function findHeaderElementFromField(elem, field) {
|
|
78
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
79
|
+
}
|
|
80
|
+
function findGroupHeaderElementsFromField(elem, field) {
|
|
81
|
+
return Array.from(elem.querySelectorAll(`[data-fields*="|-${field}-|"]`) ?? []);
|
|
82
|
+
}
|
|
83
|
+
function findGridCellElementsFromCol(col, api) {
|
|
84
|
+
const root = findParentElementFromClassName(col, _gridClasses.gridClasses.root);
|
|
85
|
+
if (!root) {
|
|
86
|
+
throw new Error('MUI X: The root element is not found.');
|
|
87
|
+
}
|
|
88
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
89
|
+
if (!ariaColIndex) {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const colIndex = Number(ariaColIndex) - 1;
|
|
93
|
+
const cells = [];
|
|
94
|
+
if (!api.virtualScrollerRef?.current) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
queryRows(api).forEach(rowElement => {
|
|
98
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
99
|
+
if (!rowId) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let columnIndex = colIndex;
|
|
103
|
+
const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);
|
|
104
|
+
if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
|
|
105
|
+
columnIndex = cellColSpanInfo.leftVisibleCellIndex;
|
|
106
|
+
}
|
|
107
|
+
const cell = rowElement.querySelector(`[data-colindex="${columnIndex}"]`);
|
|
108
|
+
if (cell) {
|
|
109
|
+
cells.push(cell);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return cells;
|
|
113
|
+
}
|
|
114
|
+
function findGridElement(api, klass) {
|
|
115
|
+
return api.rootElementRef.current.querySelector(`.${_gridClasses.gridClasses[klass]}`);
|
|
116
|
+
}
|
|
117
|
+
const findPinnedCells = ({
|
|
118
|
+
api,
|
|
119
|
+
colIndex,
|
|
120
|
+
position,
|
|
121
|
+
filterFn
|
|
122
|
+
}) => {
|
|
123
|
+
if (colIndex === null) {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
const cells = [];
|
|
127
|
+
queryRows(api).forEach(rowElement => {
|
|
128
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
129
|
+
if (!rowId) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
rowElement.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {
|
|
133
|
+
const currentColIndex = parseCellColIndex(cell);
|
|
134
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
135
|
+
cells.push(cell);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
return cells;
|
|
140
|
+
};
|
|
141
|
+
function findLeftPinnedCellsAfterCol(api, col) {
|
|
142
|
+
const colIndex = parseCellColIndex(col);
|
|
143
|
+
return findPinnedCells({
|
|
144
|
+
api,
|
|
145
|
+
colIndex,
|
|
146
|
+
position: 'left',
|
|
147
|
+
filterFn: index => index > colIndex
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function findRightPinnedCellsBeforeCol(api, col) {
|
|
151
|
+
const colIndex = parseCellColIndex(col);
|
|
152
|
+
return findPinnedCells({
|
|
153
|
+
api,
|
|
154
|
+
colIndex,
|
|
155
|
+
position: 'right',
|
|
156
|
+
filterFn: index => index < colIndex
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const findPinnedHeaders = ({
|
|
160
|
+
api,
|
|
161
|
+
colIndex,
|
|
162
|
+
position,
|
|
163
|
+
filterFn
|
|
164
|
+
}) => {
|
|
165
|
+
if (!api.columnHeadersContainerRef?.current) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
if (colIndex === null) {
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
const elements = [];
|
|
172
|
+
api.columnHeadersContainerRef.current.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
|
|
173
|
+
const currentColIndex = parseCellColIndex(element);
|
|
174
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
175
|
+
elements.push(element);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return elements;
|
|
179
|
+
};
|
|
180
|
+
function findLeftPinnedHeadersAfterCol(api, col) {
|
|
181
|
+
const colIndex = parseCellColIndex(col);
|
|
182
|
+
return findPinnedHeaders({
|
|
183
|
+
api,
|
|
184
|
+
position: 'left',
|
|
185
|
+
colIndex,
|
|
186
|
+
filterFn: index => index > colIndex
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function findRightPinnedHeadersBeforeCol(api, col) {
|
|
190
|
+
const colIndex = parseCellColIndex(col);
|
|
191
|
+
return findPinnedHeaders({
|
|
192
|
+
api,
|
|
193
|
+
position: 'right',
|
|
194
|
+
colIndex,
|
|
195
|
+
filterFn: index => index < colIndex
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function findGridHeader(api, field) {
|
|
199
|
+
const headers = api.columnHeadersContainerRef.current;
|
|
200
|
+
return headers.querySelector(`:scope > div > [data-field="${field}"][role="columnheader"]`);
|
|
201
|
+
}
|
|
202
|
+
function findGridCells(api, field) {
|
|
203
|
+
const container = api.virtualScrollerRef.current;
|
|
204
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${field}"][role="gridcell"]`));
|
|
205
|
+
}
|
|
206
|
+
function queryRows(api) {
|
|
207
|
+
return api.virtualScrollerRef.current.querySelectorAll(
|
|
208
|
+
// Use > to ignore rows from nested data grids (for example in detail panel)
|
|
209
|
+
`:scope > div > div > .${_gridClasses.gridClasses.row}`);
|
|
210
|
+
}
|
|
211
|
+
function parseCellColIndex(col) {
|
|
212
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
213
|
+
if (!ariaColIndex) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
return Number(ariaColIndex) - 1;
|
|
62
217
|
}
|
|
@@ -18,7 +18,7 @@ const isEscapeKey = key => key === 'Escape';
|
|
|
18
18
|
exports.isEscapeKey = isEscapeKey;
|
|
19
19
|
const isTabKey = key => key === 'Tab';
|
|
20
20
|
|
|
21
|
-
// Non printable keys have a name,
|
|
21
|
+
// Non printable keys have a name, for example "ArrowRight", see the whole list:
|
|
22
22
|
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
23
23
|
// So event.key.length === 1 is often enough.
|
|
24
24
|
//
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@babel/runtime": "^7.24.0",
|
|
40
|
-
"@mui/system": "^5.15.
|
|
41
|
-
"@mui/utils": "^5.15.
|
|
40
|
+
"@mui/system": "^5.15.14",
|
|
41
|
+
"@mui/utils": "^5.15.14",
|
|
42
42
|
"clsx": "^2.1.0",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^4.1.8"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@mui/material": "^5.15.
|
|
47
|
+
"@mui/material": "^5.15.14",
|
|
48
48
|
"react": "^17.0.0 || ^18.0.0",
|
|
49
49
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
50
50
|
},
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
+
export declare const shouldCellShowRightBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number, sectionLength: number, showCellVerticalBorderRootProp: boolean) => boolean;
|
|
3
|
+
export declare const shouldCellShowLeftBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number) => boolean;
|
|
@@ -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
|
+
};
|
package/utils/createSelector.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSelector as reselectCreateSelector } from 'reselect';
|
|
2
2
|
import { buildWarning } from './warning';
|
|
3
3
|
const cache = new WeakMap();
|
|
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`,
|
|
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`, for example `mySelector(apiRef)`, or pass the instance ID explicitly, for example `mySelector(state, apiRef.current.instanceId)`.']);
|
|
5
5
|
function checkIsAPIRef(value) {
|
|
6
6
|
return 'current' in value && 'instanceId' in value.current;
|
|
7
7
|
}
|
|
@@ -16,7 +16,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
16
16
|
if (a && b && c && d && e && f) {
|
|
17
17
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
18
18
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
19
|
-
const instanceId = instanceIdParam
|
|
19
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
20
20
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
21
21
|
const va = a(state, instanceId);
|
|
22
22
|
const vb = b(state, instanceId);
|
|
@@ -28,7 +28,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
28
28
|
} else if (a && b && c && d && e) {
|
|
29
29
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
30
30
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
31
|
-
const instanceId = instanceIdParam
|
|
31
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
32
32
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
33
33
|
const va = a(state, instanceId);
|
|
34
34
|
const vb = b(state, instanceId);
|
|
@@ -39,7 +39,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
39
39
|
} else if (a && b && c && d) {
|
|
40
40
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
41
41
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
42
|
-
const instanceId = instanceIdParam
|
|
42
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
43
43
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
44
44
|
const va = a(state, instanceId);
|
|
45
45
|
const vb = b(state, instanceId);
|
|
@@ -49,7 +49,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
49
49
|
} else if (a && b && c) {
|
|
50
50
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
51
51
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
52
|
-
const instanceId = instanceIdParam
|
|
52
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
53
53
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
54
54
|
const va = a(state, instanceId);
|
|
55
55
|
const vb = b(state, instanceId);
|
|
@@ -58,7 +58,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
58
58
|
} else if (a && b) {
|
|
59
59
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
60
60
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
61
|
-
const instanceId = instanceIdParam
|
|
61
|
+
const instanceId = instanceIdParam ?? (isAPIRef ? stateOrApiRef.current.instanceId : DEFAULT_INSTANCE_ID);
|
|
62
62
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
63
63
|
const va = a(state, instanceId);
|
|
64
64
|
return b(va);
|
|
@@ -75,7 +75,7 @@ export const createSelector = (a, b, c, d, e, f, ...rest) => {
|
|
|
75
75
|
export const createSelectorMemoized = (...args) => {
|
|
76
76
|
const selector = (stateOrApiRef, instanceId) => {
|
|
77
77
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
78
|
-
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId
|
|
78
|
+
const cacheKey = isAPIRef ? stateOrApiRef.current.instanceId : instanceId ?? DEFAULT_INSTANCE_ID;
|
|
79
79
|
const state = isAPIRef ? stateOrApiRef.current.state : stateOrApiRef;
|
|
80
80
|
if (process.env.NODE_ENV !== 'production') {
|
|
81
81
|
if (cacheKey.id === 'default') {
|
|
@@ -83,8 +83,8 @@ export const createSelectorMemoized = (...args) => {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
const cacheArgsInit = cache.get(cacheKey);
|
|
86
|
-
const cacheArgs = cacheArgsInit
|
|
87
|
-
const cacheFn = cacheArgs
|
|
86
|
+
const cacheArgs = cacheArgsInit ?? new Map();
|
|
87
|
+
const cacheFn = cacheArgs?.get(args);
|
|
88
88
|
if (cacheArgs && cacheFn) {
|
|
89
89
|
// We pass the cache key because the called selector might have as
|
|
90
90
|
// dependency another selector created with this `createSelector`.
|
package/utils/domUtils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { gridClasses } from '../constants/gridClasses';
|
|
3
|
+
import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
4
|
+
import type { GridRowId } from '../models/gridRows';
|
|
3
5
|
export declare function isOverflown(element: Element): boolean;
|
|
4
6
|
export declare function findParentElementFromClassName(elem: Element, className: string): Element | null;
|
|
5
7
|
export declare function getGridColumnHeaderElement(root: Element, field: string): HTMLDivElement | null;
|
|
@@ -10,3 +12,14 @@ export declare function getGridCellElement(root: Element, { id, field }: {
|
|
|
10
12
|
}): HTMLDivElement | null;
|
|
11
13
|
export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
|
|
12
14
|
export declare function isEventTargetInPortal(event: React.SyntheticEvent): boolean;
|
|
15
|
+
export declare function getFieldFromHeaderElem(colCellEl: Element): string;
|
|
16
|
+
export declare function findHeaderElementFromField(elem: Element, field: string): HTMLDivElement;
|
|
17
|
+
export declare function findGroupHeaderElementsFromField(elem: Element, field: string): Element[];
|
|
18
|
+
export declare function findGridCellElementsFromCol(col: HTMLElement, api: GridPrivateApiCommunity): Element[];
|
|
19
|
+
export declare function findGridElement(api: GridPrivateApiCommunity, klass: keyof typeof gridClasses): HTMLElement;
|
|
20
|
+
export declare function findLeftPinnedCellsAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
21
|
+
export declare function findRightPinnedCellsBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
22
|
+
export declare function findLeftPinnedHeadersAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
23
|
+
export declare function findRightPinnedHeadersBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
24
|
+
export declare function findGridHeader(api: GridPrivateApiCommunity, field: string): Element | null;
|
|
25
|
+
export declare function findGridCells(api: GridPrivateApiCommunity, field: string): Element[];
|