@mui/x-data-grid 9.14.0 → 9.15.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 +176 -0
- package/DataGrid/DataGrid.js +8 -0
- package/DataGrid/DataGrid.mjs +9 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/DataGrid/useDataGridComponent.mjs +2 -2
- package/DataGrid/useDataGridProps.mjs +1 -1
- package/colDef/gridActionsColDef.mjs +1 -1
- package/colDef/gridBooleanColDef.mjs +1 -1
- package/colDef/gridCheckboxSelectionColDef.mjs +1 -1
- package/colDef/gridDateColDef.mjs +1 -1
- package/colDef/gridDefaultColumnTypes.mjs +1 -1
- package/colDef/gridLongTextColDef.mjs +1 -1
- package/colDef/gridNumericColDef.mjs +1 -1
- package/colDef/gridSingleSelectColDef.mjs +1 -1
- package/components/GridColumnHeaders.mjs +2 -2
- package/components/GridColumnSortButton.mjs +2 -2
- package/components/GridColumnUnsortedIcon.mjs +2 -2
- package/components/GridFooter.mjs +1 -1
- package/components/GridHeader.mjs +1 -1
- package/components/GridHeaders.mjs +1 -1
- package/components/GridLoadingOverlay.mjs +2 -2
- package/components/GridNoColumnsOverlay.mjs +1 -1
- package/components/GridNoResultsOverlay.mjs +1 -1
- package/components/GridNoRowsOverlay.mjs +1 -1
- package/components/GridPagination.js +9 -1
- package/components/GridPagination.mjs +10 -2
- package/components/GridRow.mjs +2 -2
- package/components/GridRowCount.mjs +2 -2
- package/components/GridRowDragAndDropOverlay.mjs +1 -1
- package/components/GridScrollArea.mjs +1 -1
- package/components/GridSelectedRowCount.mjs +2 -2
- package/components/GridShadowScrollArea.mjs +2 -2
- package/components/GridSkeletonLoadingOverlay.mjs +2 -2
- package/components/base/GridFooterPlaceholder.mjs +1 -1
- package/components/base/GridOverlays.mjs +1 -1
- package/components/cell/GridActionsCell.js +2 -2
- package/components/cell/GridActionsCell.mjs +5 -5
- package/components/cell/GridActionsCellItem.d.mts +20 -6
- package/components/cell/GridActionsCellItem.d.ts +20 -6
- package/components/cell/GridActionsCellItem.js +30 -7
- package/components/cell/GridActionsCellItem.mjs +32 -9
- package/components/cell/GridBooleanCell.mjs +2 -2
- package/components/cell/GridCell.js +1 -1
- package/components/cell/GridCell.mjs +3 -3
- package/components/cell/GridEditBooleanCell.mjs +2 -2
- package/components/cell/GridEditDateCell.mjs +2 -2
- package/components/cell/GridEditInputCell.mjs +2 -2
- package/components/cell/GridEditLongTextCell.mjs +1 -1
- package/components/cell/GridEditSingleSelectCell.mjs +2 -2
- package/components/cell/GridFooterCell.mjs +2 -2
- package/components/cell/GridLongTextCell.mjs +1 -1
- package/components/cell/GridSkeletonCell.mjs +2 -2
- package/components/columnHeaders/ColumnHeaderMenuIcon.mjs +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.mjs +2 -2
- package/components/columnHeaders/GridColumnGroupHeader.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderItem.mjs +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.mts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSeparator.mjs +2 -2
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +17 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.mjs +18 -1
- package/components/columnHeaders/GridColumnHeaderTitle.mjs +2 -2
- package/components/columnHeaders/GridGenericColumnHeaderItem.mjs +2 -2
- package/components/columnHeaders/GridIconButtonContainer.mjs +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.mjs +2 -2
- package/components/columnSelection/GridHeaderCheckbox.mjs +2 -2
- package/components/columnSelection/GridRowCheckbox.js +1 -3
- package/components/columnSelection/GridRowCheckbox.mjs +3 -5
- package/components/columnsManagement/GridColumnsManagement.mjs +1 -1
- package/components/columnsPanel/ColumnsPanelTrigger.mjs +2 -2
- package/components/containers/GridFooterContainer.mjs +2 -2
- package/components/containers/GridOverlay.mjs +2 -2
- package/components/containers/GridRoot.mjs +2 -2
- package/components/containers/GridRootStyles.js +22 -10
- package/components/containers/GridRootStyles.mjs +22 -10
- package/components/containers/GridToolbarContainer.mjs +2 -2
- package/components/export/ExportCsv.mjs +2 -2
- package/components/export/ExportPrint.js +4 -1
- package/components/export/ExportPrint.mjs +6 -3
- package/components/filterPanel/FilterPanelTrigger.mjs +2 -2
- package/components/menu/GridMenu.mjs +2 -2
- package/components/menu/columnMenu/GridColumnHeaderMenu.mjs +1 -1
- package/components/menu/columnMenu/GridColumnMenu.mjs +2 -2
- package/components/menu/columnMenu/GridColumnMenuContainer.mjs +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.mjs +1 -1
- package/components/panel/GridColumnsPanel.mjs +1 -1
- package/components/panel/GridPanel.mjs +2 -2
- package/components/panel/GridPanelContent.mjs +2 -2
- package/components/panel/GridPanelContext.mjs +1 -1
- package/components/panel/GridPanelFooter.mjs +2 -2
- package/components/panel/GridPanelHeader.mjs +2 -2
- package/components/panel/GridPanelWrapper.mjs +2 -2
- package/components/panel/GridPreferencesPanel.mjs +1 -1
- package/components/panel/filterPanel/GridFilterForm.mjs +1 -1
- package/components/panel/filterPanel/GridFilterFormBase.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +1 -12
- package/components/panel/filterPanel/GridFilterInputBoolean.mjs +3 -14
- package/components/panel/filterPanel/GridFilterInputDate.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.mjs +2 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +1 -12
- package/components/panel/filterPanel/GridFilterInputSingleSelect.mjs +3 -14
- package/components/panel/filterPanel/GridFilterInputValue.mjs +2 -2
- package/components/panel/filterPanel/GridFilterPanel.mjs +1 -1
- package/components/panel/filterPanel/GridFilterPanelBase.mjs +2 -2
- package/components/panel/filterPanel/filterPanelUtils.mjs +1 -1
- package/components/quickFilter/QuickFilter.mjs +2 -2
- package/components/quickFilter/QuickFilterClear.js +17 -0
- package/components/quickFilter/QuickFilterClear.mjs +19 -2
- package/components/quickFilter/QuickFilterControl.mjs +2 -2
- package/components/quickFilter/QuickFilterTrigger.mjs +2 -2
- package/components/toolbar/GridToolbar.mjs +2 -2
- package/components/toolbar/GridToolbarColumnsButton.mjs +1 -1
- package/components/toolbar/GridToolbarDensitySelector.mjs +1 -1
- package/components/toolbar/GridToolbarExport.js +4 -1
- package/components/toolbar/GridToolbarExport.mjs +6 -3
- package/components/toolbar/GridToolbarExportContainer.mjs +1 -1
- package/components/toolbar/GridToolbarFilterButton.mjs +1 -1
- package/components/toolbar/GridToolbarQuickFilter.mjs +2 -2
- package/components/toolbarV8/GridToolbar.mjs +2 -2
- package/components/toolbarV8/Toolbar.mjs +2 -2
- package/components/toolbarV8/ToolbarButton.js +17 -0
- package/components/toolbarV8/ToolbarButton.mjs +19 -2
- package/components/virtualization/GridBottomContainer.mjs +1 -1
- package/components/virtualization/GridMainContainer.mjs +1 -1
- package/components/virtualization/GridTopContainer.mjs +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -2
- package/components/virtualization/GridVirtualScrollbar.mjs +2 -2
- package/components/virtualization/GridVirtualScroller.js +2 -2
- package/components/virtualization/GridVirtualScroller.mjs +3 -3
- package/components/virtualization/GridVirtualScrollerContent.mjs +1 -1
- package/components/virtualization/GridVirtualScrollerRenderZone.mjs +1 -1
- package/constants/cssVariables.mjs +1 -1
- package/constants/defaultGridSlotsComponents.mjs +1 -1
- package/constants/signature.d.mts +1 -1
- package/constants/signature.d.ts +1 -1
- package/hooks/core/pipeProcessing/useGridPipeProcessing.mjs +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeApplier.mjs +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +2 -2
- package/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.mjs +2 -2
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.mts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +1 -1
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +2 -2
- package/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.mjs +2 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.mjs +2 -2
- package/hooks/core/useGridApiInitialization.js +1 -1
- package/hooks/core/useGridApiInitialization.mjs +1 -1
- package/hooks/core/useGridIsRtl.mjs +1 -1
- package/hooks/core/useGridProps.mjs +1 -1
- package/hooks/core/useGridStateInitialization.mjs +1 -1
- package/hooks/core/useGridVirtualizer.d.mts +2 -2
- package/hooks/core/useGridVirtualizer.d.ts +2 -2
- package/hooks/core/useGridVirtualizer.js +6 -6
- package/hooks/core/useGridVirtualizer.mjs +4 -4
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.mjs +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.mjs +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.mjs +1 -1
- package/hooks/features/columnMenu/getColumnMenuItemKeys.mjs +1 -1
- package/hooks/features/columnMenu/useGridColumnMenu.mjs +1 -1
- package/hooks/features/columnMenu/useGridColumnMenuSlots.mjs +2 -2
- package/hooks/features/columnResize/useGridColumnResize.mjs +1 -1
- package/hooks/features/columns/gridColumnsInterfaces.d.mts +1 -1
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.mts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.mjs +1 -1
- package/hooks/features/columns/useGridColumns.js +1 -1
- package/hooks/features/columns/useGridColumns.mjs +2 -2
- package/hooks/features/dataSource/cache.js +1 -1
- package/hooks/features/dataSource/cache.mjs +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +13 -28
- package/hooks/features/dataSource/useGridDataSourceBase.mjs +16 -31
- package/hooks/features/dataSource/useGridDataSourcePolling.d.mts +29 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.d.ts +29 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.js +62 -0
- package/hooks/features/dataSource/useGridDataSourcePolling.mjs +54 -0
- package/hooks/features/dataSource/utils.d.mts +1 -1
- package/hooks/features/dataSource/utils.d.ts +1 -1
- package/hooks/features/dataSource/utils.mjs +1 -1
- package/hooks/features/density/useGridDensity.mjs +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.mts +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +3 -3
- package/hooks/features/dimensions/useGridDimensions.mjs +3 -3
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridCellEditing.mjs +5 -5
- package/hooks/features/editing/useGridEditing.mjs +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/editing/useGridRowEditing.mjs +5 -5
- package/hooks/features/export/serializers/csvSerializer.js +5 -5
- package/hooks/features/export/serializers/csvSerializer.mjs +5 -5
- package/hooks/features/export/useGridPrintExport.js +44 -20
- package/hooks/features/export/useGridPrintExport.mjs +45 -21
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/gridFilterUtils.mjs +5 -5
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/filter/useGridFilter.mjs +3 -3
- package/hooks/features/focus/useGridFocus.mjs +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.mjs +1 -1
- package/hooks/features/listView/useGridListView.d.mts +2 -2
- package/hooks/features/listView/useGridListView.d.ts +2 -2
- package/hooks/features/listView/useGridListView.js +1 -1
- package/hooks/features/listView/useGridListView.mjs +2 -2
- package/hooks/features/pagination/useGridPagination.mjs +1 -1
- package/hooks/features/pagination/useGridPaginationMeta.mjs +1 -1
- package/hooks/features/pagination/useGridPaginationModel.mjs +1 -1
- package/hooks/features/pagination/useGridRowCount.js +2 -2
- package/hooks/features/pagination/useGridRowCount.mjs +2 -2
- package/hooks/features/preferencesPanel/gridPreferencePanelsValue.d.mts +1 -1
- package/hooks/features/preferencesPanel/gridPreferencePanelsValue.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.mjs +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.mjs +1 -1
- package/hooks/features/rowSelection/useGridRowSelectionPreProcessors.mjs +1 -1
- package/hooks/features/rows/gridRowsUtils.js +2 -2
- package/hooks/features/rows/gridRowsUtils.mjs +3 -3
- package/hooks/features/rows/useGridRowSpanning.mjs +1 -1
- package/hooks/features/rows/useGridRows.mjs +1 -1
- package/hooks/features/rows/useGridRowsMeta.mjs +1 -1
- package/hooks/features/rows/useGridRowsOverridableMethods.mjs +1 -1
- package/hooks/features/rows/useGridRowsPreProcessors.mjs +1 -1
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/sorting/gridSortingUtils.mjs +3 -3
- package/hooks/features/sorting/useGridSorting.js +2 -2
- package/hooks/features/sorting/useGridSorting.mjs +3 -3
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.mjs +1 -1
- package/hooks/features/virtualization/useGridVirtualization.mjs +1 -1
- package/hooks/utils/index.d.mts +1 -1
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +8 -12
- package/hooks/utils/index.mjs +2 -1
- package/hooks/utils/useGridSelector.js +2 -2
- package/hooks/utils/useGridSelector.mjs +2 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/constants.d.mts +1 -1
- package/internals/constants.d.ts +1 -1
- package/internals/index.d.mts +1 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +8 -0
- package/internals/index.mjs +1 -0
- package/internals/utils/cache.d.mts +0 -1
- package/internals/utils/cache.d.ts +0 -1
- package/internals/utils/cache.js +1 -3
- package/internals/utils/cache.mjs +1 -3
- package/internals/utils/computeSlots.mjs +1 -1
- package/internals/utils/propValidation.js +2 -2
- package/internals/utils/propValidation.mjs +3 -3
- package/material/index.mjs +2 -2
- package/models/api/gridCoreApi.d.mts +1 -1
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/api/gridEditingApi.d.mts +6 -6
- package/models/api/gridEditingApi.d.ts +6 -6
- package/models/api/gridPrintExportApi.d.mts +2 -1
- package/models/api/gridPrintExportApi.d.ts +2 -1
- package/models/events/gridEventLookup.d.mts +5 -5
- package/models/events/gridEventLookup.d.ts +5 -5
- package/models/gridBaseSlots.d.mts +18 -1
- package/models/gridBaseSlots.d.ts +18 -1
- package/models/gridEditRowModel.d.mts +3 -3
- package/models/gridEditRowModel.d.ts +3 -3
- package/models/gridExport.d.mts +13 -0
- package/models/gridExport.d.ts +13 -0
- package/models/gridFilterItem.d.mts +2 -2
- package/models/gridFilterItem.d.ts +2 -2
- package/models/index.d.mts +2 -1
- package/models/index.d.ts +2 -1
- package/models/params/gridEditCellParams.d.mts +2 -2
- package/models/params/gridEditCellParams.d.ts +2 -2
- package/models/params/gridRowParams.d.mts +2 -2
- package/models/params/gridRowParams.d.ts +2 -2
- package/models/props/DataGridProps.d.mts +8 -0
- package/models/props/DataGridProps.d.ts +8 -0
- package/package.json +5 -5
- package/utils/createSelector.d.mts +1 -1
- package/utils/createSelector.d.ts +1 -1
- package/utils/createSelector.js +1 -1
- package/utils/createSelector.mjs +1 -1
- package/hooks/utils/useFirstRender.d.mts +0 -1
- package/hooks/utils/useFirstRender.d.ts +0 -1
- package/hooks/utils/useFirstRender.js +0 -16
- package/hooks/utils/useFirstRender.mjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
-
import {
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import { errorOnce } from '@mui/x-internals/warning';
|
|
4
4
|
import { GridLogicOperator } from "../../../models/index.mjs";
|
|
5
5
|
import { getDefaultGridFilterModel } from "./gridFilterState.mjs";
|
|
6
6
|
import { getPublicApiRef } from "../../../utils/getPublicApiRef.mjs";
|
|
@@ -123,7 +123,7 @@ export const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiR
|
|
|
123
123
|
let items;
|
|
124
124
|
if (hasSeveralItems && disableMultipleColumnsFiltering) {
|
|
125
125
|
if (process.env.NODE_ENV !== 'production') {
|
|
126
|
-
|
|
126
|
+
errorOnce(['MUI X: The `filterModel` can only contain a single item when the `disableMultipleColumnsFiltering` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'].join('\n'));
|
|
127
127
|
}
|
|
128
128
|
items = [model.items[0]];
|
|
129
129
|
} else {
|
|
@@ -132,10 +132,10 @@ export const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiR
|
|
|
132
132
|
const hasItemsWithoutIds = hasSeveralItems && items.some(item => item.id == null);
|
|
133
133
|
const hasItemWithoutOperator = items.some(item => item.operator == null);
|
|
134
134
|
if (hasItemsWithoutIds && process.env.NODE_ENV !== 'production') {
|
|
135
|
-
|
|
135
|
+
errorOnce('MUI X: The `id` field is required on `filterModel.items` when you use multiple filters.');
|
|
136
136
|
}
|
|
137
137
|
if (hasItemWithoutOperator && process.env.NODE_ENV !== 'production') {
|
|
138
|
-
|
|
138
|
+
errorOnce('MUI X: The `operator` field is required on `filterModel.items`, one or more of your filtering item has no `operator` provided.');
|
|
139
139
|
}
|
|
140
140
|
if (hasItemWithoutOperator || hasItemsWithoutIds) {
|
|
141
141
|
return _extends({}, model, {
|
|
@@ -11,6 +11,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _lruMemoize = require("@mui/x-internals/lruMemoize");
|
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
13
13
|
var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
|
|
14
|
+
var _useOnFirstRender = require("@base-ui/utils/useOnFirstRender");
|
|
14
15
|
var _useLazyRef = require("../../utils/useLazyRef");
|
|
15
16
|
var _useGridEvent = require("../../utils/useGridEvent");
|
|
16
17
|
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
@@ -19,7 +20,6 @@ var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
|
19
20
|
var _gridPreferencePanelsValue = require("../preferencesPanel/gridPreferencePanelsValue");
|
|
20
21
|
var _gridFilterState = require("./gridFilterState");
|
|
21
22
|
var _gridFilterSelector = require("./gridFilterSelector");
|
|
22
|
-
var _useFirstRender = require("../../utils/useFirstRender");
|
|
23
23
|
var _rows = require("../rows");
|
|
24
24
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
25
25
|
var _strategyProcessing = require("../../core/strategyProcessing");
|
|
@@ -311,7 +311,7 @@ const useGridFilter = (apiRef, props, configuration) => {
|
|
|
311
311
|
/**
|
|
312
312
|
* 1ST RENDER
|
|
313
313
|
*/
|
|
314
|
-
(0,
|
|
314
|
+
(0, _useOnFirstRender.useOnFirstRender)(() => {
|
|
315
315
|
if (props.signature === 'DataGrid') {
|
|
316
316
|
updateFilteredRows();
|
|
317
317
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { lruMemoize } from '@mui/x-internals/lruMemoize';
|
|
4
4
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
5
|
import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
|
|
6
|
+
import { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
6
7
|
import { useLazyRef } from "../../utils/useLazyRef.mjs";
|
|
7
8
|
import { useGridEvent } from "../../utils/useGridEvent.mjs";
|
|
8
9
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
|
|
@@ -11,7 +12,6 @@ import { gridColumnLookupSelector } from "../columns/gridColumnsSelector.mjs";
|
|
|
11
12
|
import { GridPreferencePanelsValue } from "../preferencesPanel/gridPreferencePanelsValue.mjs";
|
|
12
13
|
import { defaultGridFilterLookup, getDefaultGridFilterModel } from "./gridFilterState.mjs";
|
|
13
14
|
import { gridFilterModelSelector } from "./gridFilterSelector.mjs";
|
|
14
|
-
import { useFirstRender } from "../../utils/useFirstRender.mjs";
|
|
15
15
|
import { gridRowsLookupSelector } from "../rows/index.mjs";
|
|
16
16
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
17
17
|
import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from "../../core/strategyProcessing/index.mjs";
|
|
@@ -302,7 +302,7 @@ export const useGridFilter = (apiRef, props, configuration) => {
|
|
|
302
302
|
/**
|
|
303
303
|
* 1ST RENDER
|
|
304
304
|
*/
|
|
305
|
-
|
|
305
|
+
useOnFirstRender(() => {
|
|
306
306
|
if (props.signature === 'DataGrid') {
|
|
307
307
|
updateFilteredRows();
|
|
308
308
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import debounce from '@mui/utils/debounce';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
|
|
6
6
|
import { useGridLogger } from "../../utils/index.mjs";
|
|
@@ -3,8 +3,8 @@ import type { GridListViewColDef } from "../../../models/colDef/gridColDef.mjs";
|
|
|
3
3
|
import type { GridStateInitializer } from "../../utils/useGridInitializeState.mjs";
|
|
4
4
|
import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommunity.mjs";
|
|
5
5
|
import type { DataGridProcessedProps } from "../../../models/props/DataGridProps.mjs";
|
|
6
|
-
export type GridListViewState =
|
|
6
|
+
export type GridListViewState = GridListViewColDef & {
|
|
7
7
|
computedWidth: number;
|
|
8
|
-
}
|
|
8
|
+
} | undefined;
|
|
9
9
|
export declare const listViewStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'listViewColumn'>>;
|
|
10
10
|
export declare function useGridListView(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'listView' | 'listViewColumn'>): void;
|
|
@@ -3,8 +3,8 @@ import type { GridListViewColDef } from "../../../models/colDef/gridColDef.js";
|
|
|
3
3
|
import type { GridStateInitializer } from "../../utils/useGridInitializeState.js";
|
|
4
4
|
import type { GridPrivateApiCommunity } from "../../../models/api/gridApiCommunity.js";
|
|
5
5
|
import type { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
|
|
6
|
-
export type GridListViewState =
|
|
6
|
+
export type GridListViewState = GridListViewColDef & {
|
|
7
7
|
computedWidth: number;
|
|
8
|
-
}
|
|
8
|
+
} | undefined;
|
|
9
9
|
export declare const listViewStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'listViewColumn'>>;
|
|
10
10
|
export declare function useGridListView(apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, 'listView' | 'listViewColumn'>): void;
|
|
@@ -63,7 +63,7 @@ function useGridListView(apiRef, props) {
|
|
|
63
63
|
}, [apiRef, props.listViewColumn]);
|
|
64
64
|
React.useEffect(() => {
|
|
65
65
|
if (process.env.NODE_ENV !== 'production' && props.listView && !props.listViewColumn) {
|
|
66
|
-
(0, _warning.warnOnce)(['MUI X: The `listViewColumn` prop must be set if `listView` is enabled.', 'To fix, pass a column definition to the `listViewColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.', 'For more details, see https://mui.com/x/react-data-grid/list-view/']);
|
|
66
|
+
(0, _warning.warnOnce)(['MUI X: The `listViewColumn` prop must be set if `listView` is enabled.', 'To fix, pass a column definition to the `listViewColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.', 'For more details, see https://mui.com/x/react-data-grid/list-view/'].join('\n'));
|
|
67
67
|
}
|
|
68
68
|
}, [props.listView, props.listViewColumn]);
|
|
69
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
6
6
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
@@ -54,7 +54,7 @@ export function useGridListView(apiRef, props) {
|
|
|
54
54
|
}, [apiRef, props.listViewColumn]);
|
|
55
55
|
React.useEffect(() => {
|
|
56
56
|
if (process.env.NODE_ENV !== 'production' && props.listView && !props.listViewColumn) {
|
|
57
|
-
warnOnce(['MUI X: The `listViewColumn` prop must be set if `listView` is enabled.', 'To fix, pass a column definition to the `listViewColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.', 'For more details, see https://mui.com/x/react-data-grid/list-view/']);
|
|
57
|
+
warnOnce(['MUI X: The `listViewColumn` prop must be set if `listView` is enabled.', 'To fix, pass a column definition to the `listViewColumn` prop, e.g. `{ field: "example", renderCell: (params) => <div>{params.row.id}</div> }`.', 'For more details, see https://mui.com/x/react-data-grid/list-view/'].join('\n'));
|
|
58
58
|
}
|
|
59
59
|
}, [props.listView, props.listViewColumn]);
|
|
60
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { throwIfPageSizeExceedsTheLimit, getDefaultGridPaginationModel } from "./gridPaginationUtils.mjs";
|
|
3
3
|
import { useGridPaginationModel } from "./useGridPaginationModel.mjs";
|
|
4
4
|
import { useGridRowCount } from "./useGridRowCount.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useGridLogger, useGridApiMethod } from "../../utils/index.mjs";
|
|
6
6
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import debounce from '@mui/utils/debounce';
|
|
6
6
|
import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
|
|
@@ -10,7 +10,7 @@ exports.useGridRowCount = void 0;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
13
|
-
var
|
|
13
|
+
var _useStoreEffect = require("@mui/x-internals/useStoreEffect");
|
|
14
14
|
var _filter = require("../filter");
|
|
15
15
|
var _utils = require("../../utils");
|
|
16
16
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
@@ -120,7 +120,7 @@ const useGridRowCount = (apiRef, props) => {
|
|
|
120
120
|
apiRef.current.setRowCount(props.rowCount);
|
|
121
121
|
}
|
|
122
122
|
}, [apiRef, props.paginationMode, props.rowCount]);
|
|
123
|
-
(0,
|
|
123
|
+
(0, _useStoreEffect.useStoreEffect)(
|
|
124
124
|
// typings not supported currently, but methods work
|
|
125
125
|
apiRef.current.store, () => {
|
|
126
126
|
const isLastPage = (0, _gridPaginationSelector.gridPaginationMetaSelector)(apiRef).hasNextPage === false;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
6
|
-
import { useStoreEffect } from '@mui/x-internals/
|
|
6
|
+
import { useStoreEffect } from '@mui/x-internals/useStoreEffect';
|
|
7
7
|
import { gridFilteredTopLevelRowCountSelector } from "../filter/index.mjs";
|
|
8
8
|
import { useGridLogger, useGridApiMethod, useGridEvent } from "../../utils/index.mjs";
|
|
9
9
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
|
|
4
4
|
import { useGridLogger } from "../../utils/useGridLogger.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/
|
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
7
7
|
import { GridSignature } from "../../../constants/signature.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import composeClasses from '@mui/utils/composeClasses';
|
|
4
4
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
@@ -253,7 +253,7 @@ const warnIfReplaceLosesPrototype = (oldRow, replacement) => {
|
|
|
253
253
|
|
|
254
254
|
// The message must stay free of row-specific details: `warnOnce()` caches by message, so
|
|
255
255
|
// interpolating the id would log once per row and grow the cache with every update.
|
|
256
|
-
(0, _warning.warnOnce)(["MUI X Data Grid: A plain object was provided as the `row` of a `_action: 'replace'` update, but the row it replaces is a class instance.", "Building the replacement with a spread (`{ _action: 'replace', row: { ...row } }`) creates a plain object, dropping the prototype chain and the private fields that `_action: 'replace'` exists to preserve.", "Pass the instance itself instead, for example `{ _action: 'replace', row }`.", 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.']);
|
|
256
|
+
(0, _warning.warnOnce)(["MUI X Data Grid: A plain object was provided as the `row` of a `_action: 'replace'` update, but the row it replaces is a class instance.", "Building the replacement with a spread (`{ _action: 'replace', row: { ...row } }`) creates a plain object, dropping the prototype chain and the private fields that `_action: 'replace'` exists to preserve.", "Pass the instance itself instead, for example `{ _action: 'replace', row }`.", 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.'].join('\n'));
|
|
257
257
|
};
|
|
258
258
|
exports.warnIfReplaceLosesPrototype = warnIfReplaceLosesPrototype;
|
|
259
259
|
const updateCacheWithNewRows = ({
|
|
@@ -286,7 +286,7 @@ const updateCacheWithNewRows = ({
|
|
|
286
286
|
} else if (uniqueUpdates.has(id)) {
|
|
287
287
|
const accumulatedUpdate = uniqueUpdates.get(id);
|
|
288
288
|
if (process.env.NODE_ENV !== 'production' && replaceIds.has(id)) {
|
|
289
|
-
(0, _warning.warnOnce)(["MUI X Data Grid: A row was provided with `_action: 'replace'` but it is not the last update for that row in this batch.", 'The remaining updates are merged onto the replacement, so the row keeps its prototype but is neither the same object nor carries its `#private` fields, which a merge cannot copy.', 'Make the replace the last update for that row if `apiRef.current.getRow(id)` must return the object you passed in.', 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.']);
|
|
289
|
+
(0, _warning.warnOnce)(["MUI X Data Grid: A row was provided with `_action: 'replace'` but it is not the last update for that row in this batch.", 'The remaining updates are merged onto the replacement, so the row keeps its prototype but is neither the same object nor carries its `#private` fields, which a merge cannot copy.', 'Make the replace the last update for that row if `apiRef.current.getRow(id)` must return the object you passed in.', 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.'].join('\n'));
|
|
290
290
|
}
|
|
291
291
|
// The merge keeps the accumulated entry's prototype and the id stays in `replaceIds`,
|
|
292
292
|
// so the result is still applied as a replace.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
4
|
import { gridRowNodeSelector } from "./gridRowsSelector.mjs";
|
|
@@ -231,7 +231,7 @@ export const warnIfReplaceLosesPrototype = (oldRow, replacement) => {
|
|
|
231
231
|
|
|
232
232
|
// The message must stay free of row-specific details: `warnOnce()` caches by message, so
|
|
233
233
|
// interpolating the id would log once per row and grow the cache with every update.
|
|
234
|
-
warnOnce(["MUI X Data Grid: A plain object was provided as the `row` of a `_action: 'replace'` update, but the row it replaces is a class instance.", "Building the replacement with a spread (`{ _action: 'replace', row: { ...row } }`) creates a plain object, dropping the prototype chain and the private fields that `_action: 'replace'` exists to preserve.", "Pass the instance itself instead, for example `{ _action: 'replace', row }`.", 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.']);
|
|
234
|
+
warnOnce(["MUI X Data Grid: A plain object was provided as the `row` of a `_action: 'replace'` update, but the row it replaces is a class instance.", "Building the replacement with a spread (`{ _action: 'replace', row: { ...row } }`) creates a plain object, dropping the prototype chain and the private fields that `_action: 'replace'` exists to preserve.", "Pass the instance itself instead, for example `{ _action: 'replace', row }`.", 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.'].join('\n'));
|
|
235
235
|
};
|
|
236
236
|
export const updateCacheWithNewRows = ({
|
|
237
237
|
previousCache,
|
|
@@ -263,7 +263,7 @@ export const updateCacheWithNewRows = ({
|
|
|
263
263
|
} else if (uniqueUpdates.has(id)) {
|
|
264
264
|
const accumulatedUpdate = uniqueUpdates.get(id);
|
|
265
265
|
if (process.env.NODE_ENV !== 'production' && replaceIds.has(id)) {
|
|
266
|
-
warnOnce(["MUI X Data Grid: A row was provided with `_action: 'replace'` but it is not the last update for that row in this batch.", 'The remaining updates are merged onto the replacement, so the row keeps its prototype but is neither the same object nor carries its `#private` fields, which a merge cannot copy.', 'Make the replace the last update for that row if `apiRef.current.getRow(id)` must return the object you passed in.', 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.']);
|
|
266
|
+
warnOnce(["MUI X Data Grid: A row was provided with `_action: 'replace'` but it is not the last update for that row in this batch.", 'The remaining updates are merged onto the replacement, so the row keeps its prototype but is neither the same object nor carries its `#private` fields, which a merge cannot copy.', 'Make the replace the last update for that row if `apiRef.current.getRow(id)` must return the object you passed in.', 'For more detail, see https://mui.com/x/react-data-grid/row-updates/.'].join('\n'));
|
|
267
267
|
}
|
|
268
268
|
// The merge keeps the accumulated entry's prototype and the id stays in `replaceIds`,
|
|
269
269
|
// so the result is still applied as a replace.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { Rowspan } from '@mui/x-virtualizer/features';
|
|
6
6
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/
|
|
4
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
7
7
|
import { isObjectEmpty } from '@mui/x-internals/isObjectEmpty';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
|
|
3
3
|
import { gridPaginationSelector } from "../pagination/gridPaginationSelector.mjs";
|
|
4
4
|
import { useGridRegisterPipeApplier } from "../../core/pipeProcessing/index.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _formatErrorMessage from "@mui/x-internals/formatErrorMessage";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { gridRowTreeSelector, gridRowNodeSelector } from "./gridRowsSelector.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from "../../core/strategyProcessing/index.mjs";
|
|
3
3
|
import { buildRootGroup, GRID_ROOT_GROUP_ID } from "./gridRowsUtils.mjs";
|
|
4
4
|
const createFlatRowTree = rows => {
|
|
@@ -11,7 +11,7 @@ var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
|
11
11
|
const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {
|
|
12
12
|
if (disableMultipleColumnsSorting && model.length > 1) {
|
|
13
13
|
if (process.env.NODE_ENV !== 'production') {
|
|
14
|
-
(0, _warning.
|
|
14
|
+
(0, _warning.errorOnce)(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'].join('\n'));
|
|
15
15
|
}
|
|
16
16
|
return [model[0]];
|
|
17
17
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
2
|
-
import {
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import { errorOnce } from '@mui/x-internals/warning';
|
|
3
3
|
import { gridRowNodeSelector } from "../rows/gridRowsSelector.mjs";
|
|
4
4
|
export const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {
|
|
5
5
|
if (disableMultipleColumnsSorting && model.length > 1) {
|
|
6
6
|
if (process.env.NODE_ENV !== 'production') {
|
|
7
|
-
|
|
7
|
+
errorOnce(['MUI X: The `sortModel` can only contain a single item when the `disableMultipleColumnsSorting` prop is set to `true`.', 'If you are using the community version of the Data Grid, this prop is always `true`.'].join('\n'));
|
|
8
8
|
}
|
|
9
9
|
return [model[0]];
|
|
10
10
|
}
|
|
@@ -9,13 +9,13 @@ exports.useGridSorting = exports.sortingStateInitializer = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
12
|
+
var _useOnFirstRender = require("@base-ui/utils/useOnFirstRender");
|
|
12
13
|
var _useGridEvent = require("../../utils/useGridEvent");
|
|
13
14
|
var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
14
15
|
var _useGridLogger = require("../../utils/useGridLogger");
|
|
15
16
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
16
17
|
var _gridSortingSelector = require("./gridSortingSelector");
|
|
17
18
|
var _rows = require("../rows");
|
|
18
|
-
var _useFirstRender = require("../../utils/useFirstRender");
|
|
19
19
|
var _strategyProcessing = require("../../core/strategyProcessing");
|
|
20
20
|
var _gridSortingUtils = require("./gridSortingUtils");
|
|
21
21
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
@@ -247,7 +247,7 @@ const useGridSorting = (apiRef, props) => {
|
|
|
247
247
|
/**
|
|
248
248
|
* 1ST RENDER
|
|
249
249
|
*/
|
|
250
|
-
(0,
|
|
250
|
+
(0, _useOnFirstRender.useOnFirstRender)(() => {
|
|
251
251
|
if (props.signature === 'DataGrid') {
|
|
252
252
|
apiRef.current.applySorting();
|
|
253
253
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
4
|
+
import { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
4
5
|
import { useGridEvent } from "../../utils/useGridEvent.mjs";
|
|
5
6
|
import { useGridApiMethod } from "../../utils/useGridApiMethod.mjs";
|
|
6
7
|
import { useGridLogger } from "../../utils/useGridLogger.mjs";
|
|
7
8
|
import { gridColumnLookupSelector } from "../columns/gridColumnsSelector.mjs";
|
|
8
9
|
import { gridSortedRowEntriesSelector, gridSortedRowIdsSelector, gridSortModelSelector } from "./gridSortingSelector.mjs";
|
|
9
10
|
import { GRID_ROOT_GROUP_ID, gridRowTreeSelector } from "../rows/index.mjs";
|
|
10
|
-
import { useFirstRender } from "../../utils/useFirstRender.mjs";
|
|
11
11
|
import { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../../core/strategyProcessing/index.mjs";
|
|
12
12
|
import { buildAggregatedSortingApplier, mergeStateWithSortModel, getNextGridSortDirection, sanitizeSortModel } from "./gridSortingUtils.mjs";
|
|
13
13
|
import { useGridRegisterPipeProcessor } from "../../core/pipeProcessing/index.mjs";
|
|
@@ -238,7 +238,7 @@ export const useGridSorting = (apiRef, props) => {
|
|
|
238
238
|
/**
|
|
239
239
|
* 1ST RENDER
|
|
240
240
|
*/
|
|
241
|
-
|
|
241
|
+
useOnFirstRender(() => {
|
|
242
242
|
if (props.signature === 'DataGrid') {
|
|
243
243
|
apiRef.current.applySorting();
|
|
244
244
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import { createSelector, createSelectorMemoized } from "../../../utils/createSelector.mjs";
|
|
3
3
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.mjs";
|
|
4
4
|
import { gridRenderContextSelector } from "./gridVirtualizationSelectors.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _extends from "@babel/runtime/helpers/
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { EMPTY_RENDER_CONTEXT } from '@mui/x-virtualizer';
|
|
6
6
|
import { platform } from '@base-ui/utils/platform';
|
package/hooks/utils/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from '@mui/x-internals/useRunOnce';
|
|
2
|
+
export { useOnFirstRender as useFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
2
3
|
export { useGridEvent, useGridEventPriority, unstable_resetCleanupTracking } from "./useGridEvent.mjs";
|
|
3
4
|
export * from "./useGridApiMethod.mjs";
|
|
4
5
|
export * from "./useGridLogger.mjs";
|
|
5
6
|
export { useGridSelector } from "./useGridSelector.mjs";
|
|
6
7
|
export * from "./useGridNativeEventListener.mjs";
|
|
7
|
-
export * from "./useFirstRender.mjs";
|
|
8
8
|
export * from "./useOnMount.mjs";
|
|
9
9
|
export * from "./useRunOncePerLoop.mjs";
|
|
10
10
|
export type { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
package/hooks/utils/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from '@mui/x-internals/useRunOnce';
|
|
2
|
+
export { useOnFirstRender as useFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
2
3
|
export { useGridEvent, useGridEventPriority, unstable_resetCleanupTracking } from "./useGridEvent.js";
|
|
3
4
|
export * from "./useGridApiMethod.js";
|
|
4
5
|
export * from "./useGridLogger.js";
|
|
5
6
|
export { useGridSelector } from "./useGridSelector.js";
|
|
6
7
|
export * from "./useGridNativeEventListener.js";
|
|
7
|
-
export * from "./useFirstRender.js";
|
|
8
8
|
export * from "./useOnMount.js";
|
|
9
9
|
export * from "./useRunOncePerLoop.js";
|
|
10
10
|
export type { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
package/hooks/utils/index.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
+
useFirstRender: true,
|
|
7
8
|
useGridEvent: true,
|
|
8
9
|
useGridEventPriority: true,
|
|
9
10
|
unstable_resetCleanupTracking: true,
|
|
@@ -15,6 +16,12 @@ Object.defineProperty(exports, "unstable_resetCleanupTracking", {
|
|
|
15
16
|
return _useGridEvent.unstable_resetCleanupTracking;
|
|
16
17
|
}
|
|
17
18
|
});
|
|
19
|
+
Object.defineProperty(exports, "useFirstRender", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () {
|
|
22
|
+
return _useOnFirstRender.useOnFirstRender;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
18
25
|
Object.defineProperty(exports, "useGridEvent", {
|
|
19
26
|
enumerable: true,
|
|
20
27
|
get: function () {
|
|
@@ -45,6 +52,7 @@ Object.keys(_useRunOnce).forEach(function (key) {
|
|
|
45
52
|
}
|
|
46
53
|
});
|
|
47
54
|
});
|
|
55
|
+
var _useOnFirstRender = require("@base-ui/utils/useOnFirstRender");
|
|
48
56
|
var _useGridEvent = require("./useGridEvent");
|
|
49
57
|
var _useGridApiMethod = require("./useGridApiMethod");
|
|
50
58
|
Object.keys(_useGridApiMethod).forEach(function (key) {
|
|
@@ -83,18 +91,6 @@ Object.keys(_useGridNativeEventListener).forEach(function (key) {
|
|
|
83
91
|
}
|
|
84
92
|
});
|
|
85
93
|
});
|
|
86
|
-
var _useFirstRender = require("./useFirstRender");
|
|
87
|
-
Object.keys(_useFirstRender).forEach(function (key) {
|
|
88
|
-
if (key === "default" || key === "__esModule") return;
|
|
89
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
90
|
-
if (key in exports && exports[key] === _useFirstRender[key]) return;
|
|
91
|
-
Object.defineProperty(exports, key, {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () {
|
|
94
|
-
return _useFirstRender[key];
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
94
|
var _useOnMount = require("./useOnMount");
|
|
99
95
|
Object.keys(_useOnMount).forEach(function (key) {
|
|
100
96
|
if (key === "default" || key === "__esModule") return;
|
package/hooks/utils/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export * from '@mui/x-internals/useRunOnce';
|
|
2
|
+
// Public re-export kept for backwards compatibility; internals import Base UI directly.
|
|
3
|
+
export { useOnFirstRender as useFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
2
4
|
export { useGridEvent, useGridEventPriority, unstable_resetCleanupTracking } from "./useGridEvent.mjs";
|
|
3
5
|
export * from "./useGridApiMethod.mjs";
|
|
4
6
|
export * from "./useGridLogger.mjs";
|
|
5
7
|
export { useGridSelector } from "./useGridSelector.mjs";
|
|
6
8
|
export * from "./useGridNativeEventListener.mjs";
|
|
7
|
-
export * from "./useFirstRender.mjs";
|
|
8
9
|
export * from "./useOnMount.mjs";
|
|
9
10
|
export * from "./useRunOncePerLoop.mjs";
|
|
@@ -10,7 +10,7 @@ exports.objectShallowCompare = void 0;
|
|
|
10
10
|
exports.useGridSelector = useGridSelector;
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
13
|
-
var _fastObjectShallowCompare = require("@
|
|
13
|
+
var _fastObjectShallowCompare = require("@base-ui/utils/fastObjectShallowCompare");
|
|
14
14
|
var _warning = require("@mui/x-internals/warning");
|
|
15
15
|
var _useLazyRef = require("./useLazyRef");
|
|
16
16
|
const defaultCompare = Object.is;
|
|
@@ -40,7 +40,7 @@ const createRefs = () => ({
|
|
|
40
40
|
const EMPTY = [];
|
|
41
41
|
function useGridSelector(apiRef, selector, args = undefined, equals = defaultCompare) {
|
|
42
42
|
if (process.env.NODE_ENV !== 'production' && !apiRef.current.state) {
|
|
43
|
-
(0, _warning.warnOnce)(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
43
|
+
(0, _warning.warnOnce)(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.'].join('\n'));
|
|
44
44
|
}
|
|
45
45
|
const refs = (0, _useLazyRef.useLazyRef)(createRefs);
|
|
46
46
|
const didInit = refs.current.selector !== null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
5
|
-
import { fastObjectShallowCompare } from '@
|
|
5
|
+
import { fastObjectShallowCompare } from '@base-ui/utils/fastObjectShallowCompare';
|
|
6
6
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
7
7
|
import { useLazyRef } from "./useLazyRef.mjs";
|
|
8
8
|
const defaultCompare = Object.is;
|
|
@@ -32,7 +32,7 @@ const createRefs = () => ({
|
|
|
32
32
|
const EMPTY = [];
|
|
33
33
|
export function useGridSelector(apiRef, selector, args = undefined, equals = defaultCompare) {
|
|
34
34
|
if (process.env.NODE_ENV !== 'production' && !apiRef.current.state) {
|
|
35
|
-
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
|
|
35
|
+
warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.'].join('\n'));
|
|
36
36
|
}
|
|
37
37
|
const refs = useLazyRef(createRefs);
|
|
38
38
|
const didInit = refs.current.selector !== null;
|
package/index.js
CHANGED
package/index.mjs
CHANGED
package/internals/constants.d.ts
CHANGED
package/internals/index.d.mts
CHANGED
|
@@ -102,6 +102,7 @@ export { useGridDataSourceBase } from "../hooks/features/dataSource/useGridDataS
|
|
|
102
102
|
export { CacheChunkManager } from "../hooks/features/dataSource/utils.mjs";
|
|
103
103
|
export { gridGetRowsParamsSelector } from "../hooks/features/dataSource/gridDataSourceSelector.mjs";
|
|
104
104
|
export { useGridDataSourceFilterModelChange } from "../hooks/features/dataSource/useGridDataSourceFilterModelChange.mjs";
|
|
105
|
+
export { useGridDataSourcePolling } from "../hooks/features/dataSource/useGridDataSourcePolling.mjs";
|
|
105
106
|
export { getColumnsToExport, defaultGetRowsToExport } from "../hooks/features/export/utils.mjs";
|
|
106
107
|
export * from "../utils/createControllablePromise.mjs";
|
|
107
108
|
export * from "../utils/focusElement.mjs";
|