@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
package/index.js
CHANGED
package/internals/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export type { GridDetailPanelsProps } from '../components/GridDetailPanels';
|
|
|
6
6
|
export type { GridPinnedRowsProps } from '../components/GridPinnedRows';
|
|
7
7
|
export { GridHeaders } from '../components/GridHeaders';
|
|
8
8
|
export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColumnHeaders';
|
|
9
|
-
export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
|
|
10
9
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
11
10
|
export { getGridFilter } from '../components/panel/filterPanel/GridFilterPanel';
|
|
12
11
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
@@ -61,6 +60,7 @@ export { useGridStatePersistence } from '../hooks/features/statePersistence/useG
|
|
|
61
60
|
export type { GridRestoreStatePreProcessingContext } from '../hooks/features/statePersistence/gridStatePersistenceInterface';
|
|
62
61
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS, } from '../hooks/features/virtualization/useGridVirtualScroller';
|
|
63
62
|
export * from '../hooks/features/virtualization';
|
|
63
|
+
export { useGridColumnResize, columnResizeStateInitializer, } from '../hooks/features/columnResize/useGridColumnResize';
|
|
64
64
|
export { useTimeout } from '../hooks/utils/useTimeout';
|
|
65
65
|
export { useGridVisibleRows, getVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
66
66
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
@@ -76,7 +76,9 @@ export * from '../utils/fastMemo';
|
|
|
76
76
|
export { buildWarning } from '../utils/warning';
|
|
77
77
|
export { exportAs } from '../utils/exportAs';
|
|
78
78
|
export * from '../utils/getPublicApiRef';
|
|
79
|
+
export * from '../utils/cellBorderUtils';
|
|
79
80
|
export type { GridPrivateOnlyApiCommon } from '../models/api/gridApiCommon';
|
|
81
|
+
export type { GridInfiniteLoaderPrivateApi } from '../models/api/gridInfiniteLoaderApi';
|
|
80
82
|
export { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
81
83
|
export * from '../hooks/utils';
|
|
82
84
|
export type { GridApiCommunity } from '../models/api/gridApiCommunity';
|
package/internals/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export { GridVirtualScrollerContent } from '../components/virtualization/GridVir
|
|
|
3
3
|
export { GridVirtualScrollerRenderZone } from '../components/virtualization/GridVirtualScrollerRenderZone';
|
|
4
4
|
export { GridHeaders } from '../components/GridHeaders';
|
|
5
5
|
export { GridBaseColumnHeaders } from '../components/columnHeaders/GridBaseColumnHeaders';
|
|
6
|
-
export { GridColumnHeadersInner } from '../components/columnHeaders/GridColumnHeadersInner';
|
|
7
6
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from '../constants/defaultGridSlotsComponents';
|
|
8
7
|
export { getGridFilter } from '../components/panel/filterPanel/GridFilterPanel';
|
|
9
8
|
export { useGridRegisterPipeProcessor } from '../hooks/core/pipeProcessing';
|
|
@@ -49,6 +48,7 @@ export { dimensionsStateInitializer, useGridDimensions } from '../hooks/features
|
|
|
49
48
|
export { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';
|
|
50
49
|
export { useGridVirtualScroller, EMPTY_DETAIL_PANELS } from '../hooks/features/virtualization/useGridVirtualScroller';
|
|
51
50
|
export * from '../hooks/features/virtualization';
|
|
51
|
+
export { useGridColumnResize, columnResizeStateInitializer } from '../hooks/features/columnResize/useGridColumnResize';
|
|
52
52
|
export { useTimeout } from '../hooks/utils/useTimeout';
|
|
53
53
|
export { useGridVisibleRows, getVisibleRows } from '../hooks/utils/useGridVisibleRows';
|
|
54
54
|
export { useGridInitializeState } from '../hooks/utils/useGridInitializeState';
|
|
@@ -62,6 +62,7 @@ export * from '../utils/fastMemo';
|
|
|
62
62
|
export { buildWarning } from '../utils/warning';
|
|
63
63
|
export { exportAs } from '../utils/exportAs';
|
|
64
64
|
export * from '../utils/getPublicApiRef';
|
|
65
|
+
export * from '../utils/cellBorderUtils';
|
|
65
66
|
export { useGridPrivateApiContext } from '../hooks/utils/useGridPrivateApiContext';
|
|
66
67
|
export * from '../hooks/utils';
|
|
67
68
|
export { serializeCellValue } from '../hooks/features/export/serializers/csvSerializer';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition, gridColumnPositionsSelector } from '../../hooks/features/columns';
|
|
2
|
+
import type { GridDimensions } from '../../hooks/features/dimensions';
|
|
3
|
+
export declare const getPinnedCellOffset: (pinnedPosition: GridPinnedColumnPosition | undefined, computedWidth: number, columnIndex: number, columnPositions: ReturnType<typeof gridColumnPositionsSelector>, dimensions: GridDimensions) => number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../../hooks/features/columns';
|
|
2
|
+
export const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {
|
|
3
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
4
|
+
let pinnedOffset;
|
|
5
|
+
switch (pinnedPosition) {
|
|
6
|
+
case GridPinnedColumnPosition.LEFT:
|
|
7
|
+
pinnedOffset = columnPositions[columnIndex];
|
|
8
|
+
break;
|
|
9
|
+
case GridPinnedColumnPosition.RIGHT:
|
|
10
|
+
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
|
|
11
|
+
break;
|
|
12
|
+
default:
|
|
13
|
+
pinnedOffset = 0;
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
return pinnedOffset;
|
|
17
|
+
};
|
|
@@ -4,13 +4,12 @@ import * as React from 'react';
|
|
|
4
4
|
|
|
5
5
|
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
6
6
|
function groupForwardedProps(props) {
|
|
7
|
-
var _props$forwardedProps;
|
|
8
7
|
const keys = Object.keys(props);
|
|
9
8
|
if (!keys.some(key => key.startsWith('aria-') || key.startsWith('data-'))) {
|
|
10
9
|
return props;
|
|
11
10
|
}
|
|
12
11
|
const newProps = {};
|
|
13
|
-
const forwardedProps =
|
|
12
|
+
const forwardedProps = props.forwardedProps ?? {};
|
|
14
13
|
for (let i = 0; i < keys.length; i += 1) {
|
|
15
14
|
const key = keys[i];
|
|
16
15
|
if (key.startsWith('aria-') || key.startsWith('data-')) {
|
package/joy/joySlots.js
CHANGED
|
@@ -4,10 +4,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
|
|
|
4
4
|
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
5
5
|
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
6
6
|
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
7
|
-
_excluded5 = ["
|
|
8
|
-
_excluded6 = ["
|
|
9
|
-
_excluded7 = ["
|
|
10
|
-
_excluded8 = ["shrink", "variant", "sx"];
|
|
7
|
+
_excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
8
|
+
_excluded6 = ["native"],
|
|
9
|
+
_excluded7 = ["shrink", "variant", "sx"];
|
|
11
10
|
import * as React from 'react';
|
|
12
11
|
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
13
12
|
import JoyInput from '@mui/joy/Input';
|
|
@@ -15,7 +14,6 @@ import JoyFormControl from '@mui/joy/FormControl';
|
|
|
15
14
|
import JoyFormLabel from '@mui/joy/FormLabel';
|
|
16
15
|
import JoyButton from '@mui/joy/Button';
|
|
17
16
|
import JoyIconButton from '@mui/joy/IconButton';
|
|
18
|
-
import JoySwitch from '@mui/joy/Switch';
|
|
19
17
|
import JoySelect from '@mui/joy/Select';
|
|
20
18
|
import JoyOption from '@mui/joy/Option';
|
|
21
19
|
import JoyBox from '@mui/joy/Box';
|
|
@@ -81,7 +79,6 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
81
79
|
}));
|
|
82
80
|
});
|
|
83
81
|
const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
84
|
-
var _props$InputProps, _props$inputProps;
|
|
85
82
|
let {
|
|
86
83
|
onChange,
|
|
87
84
|
label,
|
|
@@ -93,8 +90,8 @@ const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
93
90
|
variant
|
|
94
91
|
} = _ref2,
|
|
95
92
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
96
|
-
const rootRef = useForkRef(ref,
|
|
97
|
-
const inputForkRef = useForkRef(inputRef, props
|
|
93
|
+
const rootRef = useForkRef(ref, props.InputProps?.ref);
|
|
94
|
+
const inputForkRef = useForkRef(inputRef, props?.inputProps?.ref);
|
|
98
95
|
const {
|
|
99
96
|
startAdornment,
|
|
100
97
|
endAdornment
|
|
@@ -111,7 +108,7 @@ const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
111
108
|
variant: convertVariant(variant, 'outlined'),
|
|
112
109
|
size: convertSize(size),
|
|
113
110
|
slotProps: {
|
|
114
|
-
input: _extends({}, props
|
|
111
|
+
input: _extends({}, props?.inputProps, {
|
|
115
112
|
ref: inputForkRef
|
|
116
113
|
})
|
|
117
114
|
},
|
|
@@ -141,7 +138,6 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
|
|
|
141
138
|
}));
|
|
142
139
|
});
|
|
143
140
|
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
|
|
144
|
-
var _convertColor;
|
|
145
141
|
let {
|
|
146
142
|
color,
|
|
147
143
|
size,
|
|
@@ -150,49 +146,13 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
150
146
|
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
151
147
|
return /*#__PURE__*/_jsx(JoyIconButton, _extends({}, props, {
|
|
152
148
|
size: convertSize(size),
|
|
153
|
-
color:
|
|
149
|
+
color: convertColor(color) ?? 'neutral',
|
|
154
150
|
variant: "plain",
|
|
155
151
|
ref: ref,
|
|
156
152
|
sx: sx
|
|
157
153
|
}));
|
|
158
154
|
});
|
|
159
|
-
const
|
|
160
|
-
let {
|
|
161
|
-
name,
|
|
162
|
-
color: colorProp,
|
|
163
|
-
edge,
|
|
164
|
-
icon,
|
|
165
|
-
inputProps,
|
|
166
|
-
inputRef,
|
|
167
|
-
size,
|
|
168
|
-
sx,
|
|
169
|
-
onChange,
|
|
170
|
-
onClick
|
|
171
|
-
} = _ref5,
|
|
172
|
-
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
173
|
-
return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
|
|
174
|
-
onChange: onChange,
|
|
175
|
-
size: convertSize(size),
|
|
176
|
-
color: convertColor(colorProp),
|
|
177
|
-
ref: ref,
|
|
178
|
-
slotProps: {
|
|
179
|
-
input: _extends({}, inputProps, {
|
|
180
|
-
name,
|
|
181
|
-
onClick: onClick,
|
|
182
|
-
ref: inputRef
|
|
183
|
-
}),
|
|
184
|
-
thumb: {
|
|
185
|
-
children: icon
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
sx: [_extends({}, edge === 'start' && {
|
|
189
|
-
ml: '-8px'
|
|
190
|
-
}, edge === 'end' && {
|
|
191
|
-
mr: '-8px'
|
|
192
|
-
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
193
|
-
}));
|
|
194
|
-
});
|
|
195
|
-
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
155
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
196
156
|
let {
|
|
197
157
|
open,
|
|
198
158
|
onOpen,
|
|
@@ -204,8 +164,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
204
164
|
MenuProps,
|
|
205
165
|
inputRef,
|
|
206
166
|
labelId
|
|
207
|
-
} =
|
|
208
|
-
props = _objectWithoutPropertiesLoose(
|
|
167
|
+
} = _ref5,
|
|
168
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
209
169
|
const handleChange = (event, newValue) => {
|
|
210
170
|
if (event && onChange) {
|
|
211
171
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -231,10 +191,9 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
231
191
|
listboxOpen: open,
|
|
232
192
|
onListboxOpenChange: isOpen => {
|
|
233
193
|
if (isOpen) {
|
|
234
|
-
onOpen
|
|
194
|
+
onOpen?.({});
|
|
235
195
|
} else {
|
|
236
|
-
|
|
237
|
-
MenuProps == null || (_MenuProps$onClose = MenuProps.onClose) == null || _MenuProps$onClose.call(MenuProps, {}, undefined);
|
|
196
|
+
MenuProps?.onClose?.({}, undefined);
|
|
238
197
|
}
|
|
239
198
|
},
|
|
240
199
|
size: convertSize(size),
|
|
@@ -257,17 +216,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
257
216
|
}
|
|
258
217
|
}));
|
|
259
218
|
});
|
|
260
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
261
|
-
let props = _objectWithoutPropertiesLoose(
|
|
219
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
220
|
+
let props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
262
221
|
return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
|
|
263
222
|
ref: ref
|
|
264
223
|
}));
|
|
265
224
|
});
|
|
266
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
225
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
267
226
|
let {
|
|
268
227
|
sx
|
|
269
|
-
} =
|
|
270
|
-
props = _objectWithoutPropertiesLoose(
|
|
228
|
+
} = _ref7,
|
|
229
|
+
props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
271
230
|
return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
|
|
272
231
|
ref: ref,
|
|
273
232
|
sx: sx
|
|
@@ -295,10 +254,7 @@ const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
295
254
|
const rootProps = useGridRootProps();
|
|
296
255
|
const paginationModel = gridPaginationModelSelector(apiRef);
|
|
297
256
|
const visibleTopLevelRowCount = gridFilteredTopLevelRowCountSelector(apiRef);
|
|
298
|
-
const rowCount = React.useMemo(() =>
|
|
299
|
-
var _ref9, _rootProps$rowCount;
|
|
300
|
-
return (_ref9 = (_rootProps$rowCount = rootProps.rowCount) != null ? _rootProps$rowCount : visibleTopLevelRowCount) != null ? _ref9 : 0;
|
|
301
|
-
}, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
257
|
+
const rowCount = React.useMemo(() => rootProps.rowCount ?? visibleTopLevelRowCount ?? 0, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
302
258
|
const lastPage = React.useMemo(() => Math.floor(rowCount / (paginationModel.pageSize || 1)), [rowCount, paginationModel.pageSize]);
|
|
303
259
|
const handlePageChange = React.useCallback(page => {
|
|
304
260
|
apiRef.current.setPage(page);
|
|
@@ -400,7 +356,6 @@ const joySlots = _extends({}, joyIconSlots, {
|
|
|
400
356
|
baseTextField: TextField,
|
|
401
357
|
baseButton: Button,
|
|
402
358
|
baseIconButton: IconButton,
|
|
403
|
-
baseSwitch: Switch,
|
|
404
359
|
baseSelect: Select,
|
|
405
360
|
baseSelectOption: Option,
|
|
406
361
|
baseInputLabel: InputLabel,
|
package/locales/jaJP.js
CHANGED
|
@@ -30,10 +30,9 @@ const jaJPGrid = {
|
|
|
30
30
|
toolbarExportPrint: '印刷',
|
|
31
31
|
toolbarExportExcel: 'Excelダウンロード',
|
|
32
32
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
columnsManagementSearchTitle: '検索',
|
|
34
|
+
columnsManagementNoColumns: 'カラムなし',
|
|
35
|
+
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
37
36
|
// Filter panel text
|
|
38
37
|
filterPanelAddFilter: 'フィルター追加',
|
|
39
38
|
filterPanelRemoveAll: 'すべて削除',
|
package/material/index.js
CHANGED
|
@@ -3,7 +3,6 @@ import MUICheckbox from '@mui/material/Checkbox';
|
|
|
3
3
|
import MUITextField from '@mui/material/TextField';
|
|
4
4
|
import MUIFormControl from '@mui/material/FormControl';
|
|
5
5
|
import MUISelect from '@mui/material/Select';
|
|
6
|
-
import MUISwitch from '@mui/material/Switch';
|
|
7
6
|
import MUIButton from '@mui/material/Button';
|
|
8
7
|
import MUIIconButton from '@mui/material/IconButton';
|
|
9
8
|
import MUIInputAdornment from '@mui/material/InputAdornment';
|
|
@@ -56,7 +55,6 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
56
55
|
baseTextField: MUITextField,
|
|
57
56
|
baseFormControl: MUIFormControl,
|
|
58
57
|
baseSelect: MUISelect,
|
|
59
|
-
baseSwitch: MUISwitch,
|
|
60
58
|
baseButton: MUIButton,
|
|
61
59
|
baseIconButton: MUIIconButton,
|
|
62
60
|
baseInputAdornment: MUIInputAdornment,
|
|
@@ -28,10 +28,10 @@ import { GridColumnGroupingApi } from './gridColumnGroupingApi';
|
|
|
28
28
|
import type { GridInitialStateCommunity, GridStateCommunity } from '../gridStateCommunity';
|
|
29
29
|
import { GridHeaderFilteringApi, GridHeaderFilteringPrivateApi } from './gridHeaderFilteringApi';
|
|
30
30
|
import type { DataGridProcessedProps } from '../props/DataGridProps';
|
|
31
|
-
import type {
|
|
32
|
-
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi {
|
|
31
|
+
import type { GridColumnResizeApi } from '../../hooks/features/columnResize';
|
|
32
|
+
export interface GridApiCommon<GridState extends GridStateCommunity = any, GridInitialState extends GridInitialStateCommunity = any> extends GridCoreApi, GridPipeProcessingApi, GridDensityApi, GridDimensionsApi, GridRowApi, GridRowsMetaApi, GridEditingApi, GridParamsApi, GridColumnApi, GridRowSelectionApi, GridSortApi, GridPaginationApi, GridCsvExportApi, GridFocusApi, GridFilterApi, GridColumnMenuApi, GridPreferencesPanelApi, GridPrintExportApi, GridVirtualizationApi, GridLocaleTextApi, GridScrollApi, GridColumnSpanningApi, GridStateApi<GridState>, GridStatePersistenceApi<GridInitialState>, GridColumnGroupingApi, GridHeaderFilteringApi, GridColumnResizeApi {
|
|
33
33
|
}
|
|
34
|
-
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi
|
|
34
|
+
export interface GridPrivateOnlyApiCommon<Api extends GridApiCommon, PrivateApi extends GridPrivateApiCommon, Props extends DataGridProcessedProps> extends GridCorePrivateApi<Api, PrivateApi, Props>, GridStatePrivateApi<PrivateApi['state']>, GridPipeProcessingPrivateApi, GridStrategyProcessingApi, GridColumnSpanningPrivateApi, GridRowsMetaPrivateApi, GridDimensionsPrivateApi, GridEditingPrivateApi, GridLoggerApi, GridFocusPrivateApi, GridHeaderFilteringPrivateApi, GridVirtualizationPrivateApi {
|
|
35
35
|
}
|
|
36
36
|
export interface GridPrivateApiCommon extends GridApiCommon, GridPrivateOnlyApiCommon<GridApiCommon, GridPrivateApiCommon, DataGridProcessedProps> {
|
|
37
37
|
}
|
|
@@ -67,11 +67,7 @@ export interface GridCorePrivateApi<GridPublicApi extends GridApiCommon, GridPri
|
|
|
67
67
|
/**
|
|
68
68
|
* The React ref of the grid column container virtualized div element.
|
|
69
69
|
*/
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* The React ref of the grid column headers container element.
|
|
73
|
-
*/
|
|
74
|
-
columnHeadersElementRef?: React.RefObject<HTMLDivElement>;
|
|
70
|
+
columnHeadersContainerRef?: React.RefObject<HTMLDivElement>;
|
|
75
71
|
/**
|
|
76
72
|
* The React ref of the grid header filter row element.
|
|
77
73
|
*/
|
|
@@ -52,7 +52,7 @@ export interface GridRowsMetaPrivateApi {
|
|
|
52
52
|
rowHasAutoHeight: (id: GridRowId) => boolean;
|
|
53
53
|
/**
|
|
54
54
|
* Returns the index of the last row measured.
|
|
55
|
-
* The value considers only the rows reachable by scroll,
|
|
55
|
+
* The value considers only the rows reachable by scroll, for example first row has index=0 in all pages.
|
|
56
56
|
* @returns {number} The index of the last measured row.
|
|
57
57
|
*/
|
|
58
58
|
getLastMeasuredRowIndex: () => number;
|
package/models/api/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export * from './gridPreferencesPanelApi';
|
|
|
17
17
|
export * from './gridPrintExportApi';
|
|
18
18
|
export * from './gridCallbackDetails';
|
|
19
19
|
export * from './gridScrollApi';
|
|
20
|
-
export
|
|
20
|
+
export type { GridVirtualizationApi } from './gridVirtualizationApi';
|
|
21
21
|
export type { GridApiCommon } from './gridApiCommon';
|
|
22
22
|
export type { GridEditingApi, GridCellModesModel, GridRowModesModel } from './gridEditingApi';
|
|
23
23
|
export type GridEditRowApi = GridEditingApi;
|
package/models/api/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import type { GridStrategyProcessorName } from '../../hooks/core/strategyProcess
|
|
|
13
13
|
import { GridRowEditStartParams, GridRowEditStopParams } from '../params/gridRowParams';
|
|
14
14
|
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
15
15
|
import { GridPaginationModel } from '../gridPaginationProps';
|
|
16
|
+
import { GridDensity } from '../gridDensity';
|
|
16
17
|
export interface GridRowEventLookup {
|
|
17
18
|
/**
|
|
18
19
|
* Fired when a row is clicked.
|
|
@@ -369,6 +370,18 @@ export interface GridControlledStateEventLookup {
|
|
|
369
370
|
columnVisibilityModelChange: {
|
|
370
371
|
params: GridColumnVisibilityModel;
|
|
371
372
|
};
|
|
373
|
+
/**
|
|
374
|
+
* Fired when the row count change.
|
|
375
|
+
*/
|
|
376
|
+
rowCountChange: {
|
|
377
|
+
params: number;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Fired when the density changes.
|
|
381
|
+
*/
|
|
382
|
+
densityChange: {
|
|
383
|
+
params: GridDensity;
|
|
384
|
+
};
|
|
372
385
|
}
|
|
373
386
|
export interface GridControlledStateReasonLookup {
|
|
374
387
|
filter: 'upsertFilterItem' | 'upsertFilterItems' | 'deleteFilterItem' | 'changeLogicOperator' | 'restoreState' | 'removeAllFilterItems';
|
package/models/gridExport.d.ts
CHANGED
|
@@ -88,6 +88,12 @@ export interface GridCsvExportOptions extends GridFileExportOptions {
|
|
|
88
88
|
* @returns {GridRowId[]} The list of row ids to export.
|
|
89
89
|
*/
|
|
90
90
|
getRowsToExport?: (params: GridCsvGetRowsToExportParams) => GridRowId[];
|
|
91
|
+
/**
|
|
92
|
+
* @ignore
|
|
93
|
+
* If `false`, the quotes will not be appended to the cell value.
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
shouldAppendQuotes?: boolean;
|
|
91
97
|
}
|
|
92
98
|
/**
|
|
93
99
|
* The options to apply on the Print export.
|
|
@@ -33,11 +33,6 @@ export interface GridBaseSlots {
|
|
|
33
33
|
* @default Select
|
|
34
34
|
*/
|
|
35
35
|
baseSelect: React.JSXElementConstructor<GridSlotProps['baseSelect']>;
|
|
36
|
-
/**
|
|
37
|
-
* The custom Switch component used in the grid.
|
|
38
|
-
* @default Switch
|
|
39
|
-
*/
|
|
40
|
-
baseSwitch: React.JSXElementConstructor<GridSlotProps['baseSwitch']>;
|
|
41
36
|
/**
|
|
42
37
|
* The custom Button component used in the grid.
|
|
43
38
|
* @default Button
|
|
@@ -5,6 +5,7 @@ import type { GridEditingState } from './gridEditRowModel';
|
|
|
5
5
|
import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
|
|
6
6
|
import type { GridRowSelectionModel } from './gridRowSelectionModel';
|
|
7
7
|
import type { GridVisibleRowsLookupState } from '../hooks/features/filter/gridFilterState';
|
|
8
|
+
import type { GridColumnResizeState } from '../hooks/features/columnResize';
|
|
8
9
|
/**
|
|
9
10
|
* The state of `DataGrid`.
|
|
10
11
|
*/
|
|
@@ -29,6 +30,7 @@ export interface GridStateCommunity {
|
|
|
29
30
|
preferencePanel: GridPreferencePanelState;
|
|
30
31
|
density: GridDensityState;
|
|
31
32
|
virtualization: GridVirtualizationState;
|
|
33
|
+
columnResize: GridColumnResizeState;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* The initial state of `DataGrid`.
|
|
@@ -39,4 +41,5 @@ export interface GridInitialStateCommunity {
|
|
|
39
41
|
filter?: GridFilterInitialState;
|
|
40
42
|
columns?: GridColumnsInitialState;
|
|
41
43
|
preferencePanel?: GridPreferencePanelInitialState;
|
|
44
|
+
density?: GridDensityState;
|
|
42
45
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export interface
|
|
2
|
-
firstRowIndex: number;
|
|
3
|
-
lastRowIndex: number;
|
|
1
|
+
export interface GridColumnsRenderContext {
|
|
4
2
|
firstColumnIndex: number;
|
|
5
3
|
lastColumnIndex: number;
|
|
6
4
|
}
|
|
5
|
+
export interface GridRenderContext extends GridColumnsRenderContext {
|
|
6
|
+
firstRowIndex: number;
|
|
7
|
+
lastRowIndex: number;
|
|
8
|
+
}
|
|
7
9
|
export interface GridScrollParams {
|
|
8
10
|
left: number;
|
|
9
11
|
top: number;
|
|
@@ -24,6 +24,7 @@ import { GridColumnVisibilityModel } from '../../hooks/features/columns/gridColu
|
|
|
24
24
|
import { GridCellModesModel, GridRowModesModel } from '../api/gridEditingApi';
|
|
25
25
|
import { GridColumnGroupingModel } from '../gridColumnGrouping';
|
|
26
26
|
import { GridPaginationModel } from '../gridPaginationProps';
|
|
27
|
+
import type { GridAutosizeOptions } from '../../hooks/features/columnResize';
|
|
27
28
|
export interface GridExperimentalFeatures {
|
|
28
29
|
/**
|
|
29
30
|
* Emits a warning if the cell receives focus without also syncing the focus state.
|
|
@@ -34,7 +35,7 @@ export interface GridExperimentalFeatures {
|
|
|
34
35
|
/**
|
|
35
36
|
* The props users can give to the `DataGrid` component.
|
|
36
37
|
*/
|
|
37
|
-
export type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<DataGridPropsWithDefaultValues
|
|
38
|
+
export type DataGridProps<R extends GridValidRowModel = any> = Omit<Partial<DataGridPropsWithDefaultValues<R>> & DataGridPropsWithComplexDefaultValueBeforeProcessing & DataGridPropsWithoutDefaultValue<R>, DataGridForcedPropsKey> & {
|
|
38
39
|
pagination?: true;
|
|
39
40
|
};
|
|
40
41
|
/**
|
|
@@ -46,7 +47,7 @@ export interface DataGridProcessedProps<R extends GridValidRowModel = any> exten
|
|
|
46
47
|
* The props of the `DataGrid` component after the pre-processing phase that the user should not be able to override.
|
|
47
48
|
* Those are usually used in feature-hook for which the pro-plan has more advanced features (eg: multi-sorting, multi-filtering, ...).
|
|
48
49
|
*/
|
|
49
|
-
export type DataGridForcedPropsKey = 'checkboxSelectionVisibleOnly' | 'disableMultipleColumnsFiltering' | 'disableMultipleColumnsSorting' | 'disableColumnReorder' | '
|
|
50
|
+
export type DataGridForcedPropsKey = 'checkboxSelectionVisibleOnly' | 'disableMultipleColumnsFiltering' | 'disableMultipleColumnsSorting' | 'disableColumnReorder' | 'keepColumnPositionIfDraggedOutside' | 'throttleRowsMs' | 'hideFooterRowCount' | 'pagination' | 'signature';
|
|
50
51
|
/**
|
|
51
52
|
* The `DataGrid` options with a default value that must be merged with the value given through props.
|
|
52
53
|
*/
|
|
@@ -74,7 +75,7 @@ export interface DataGridPropsWithComplexDefaultValueBeforeProcessing {
|
|
|
74
75
|
* The controlled model do not have a default value at the prop processing level, so they must be defined in `DataGridOtherProps`
|
|
75
76
|
* TODO: add multiSortKey
|
|
76
77
|
*/
|
|
77
|
-
export interface DataGridPropsWithDefaultValues {
|
|
78
|
+
export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = any> {
|
|
78
79
|
/**
|
|
79
80
|
* If `true`, the Data Grid height is dynamic and follow the number of rows in the Data Grid.
|
|
80
81
|
* @default false
|
|
@@ -97,35 +98,20 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
97
98
|
*/
|
|
98
99
|
checkboxSelectionVisibleOnly: boolean;
|
|
99
100
|
/**
|
|
100
|
-
*
|
|
101
|
-
* @default
|
|
101
|
+
* Column region in pixels to render before/after the viewport
|
|
102
|
+
* @default 150
|
|
102
103
|
*/
|
|
103
|
-
|
|
104
|
+
columnBufferPx: number;
|
|
104
105
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @default
|
|
106
|
+
* Row region in pixels to render before/after the viewport
|
|
107
|
+
* @default 150
|
|
107
108
|
*/
|
|
108
|
-
|
|
109
|
+
rowBufferPx: number;
|
|
109
110
|
/**
|
|
110
111
|
* If `false`, the row selection mode is disabled.
|
|
111
112
|
* @default true
|
|
112
113
|
*/
|
|
113
114
|
rowSelection: boolean;
|
|
114
|
-
/**
|
|
115
|
-
* Number of rows from the `rowBuffer` that can be visible before a new slice is rendered.
|
|
116
|
-
* @default 3
|
|
117
|
-
*/
|
|
118
|
-
rowThreshold: number;
|
|
119
|
-
/**
|
|
120
|
-
* Number of rows from the `columnBuffer` that can be visible before a new slice is rendered.
|
|
121
|
-
* @default 3
|
|
122
|
-
*/
|
|
123
|
-
columnThreshold: number;
|
|
124
|
-
/**
|
|
125
|
-
* Set the density of the Data Grid.
|
|
126
|
-
* @default "standard"
|
|
127
|
-
*/
|
|
128
|
-
density: GridDensity;
|
|
129
115
|
/**
|
|
130
116
|
* If `true`, column filters are disabled.
|
|
131
117
|
* @default false
|
|
@@ -259,6 +245,11 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
259
245
|
* @default "client"
|
|
260
246
|
*/
|
|
261
247
|
paginationMode: GridFeatureMode;
|
|
248
|
+
/**
|
|
249
|
+
* Set of rows of type [[GridRowsProp]].
|
|
250
|
+
* @default []
|
|
251
|
+
*/
|
|
252
|
+
rows: GridRowsProp<R>;
|
|
262
253
|
/**
|
|
263
254
|
* Sets the height in pixel of a row in the Data Grid.
|
|
264
255
|
* @default 52
|
|
@@ -342,6 +333,16 @@ export interface DataGridPropsWithDefaultValues {
|
|
|
342
333
|
* @default 166
|
|
343
334
|
*/
|
|
344
335
|
rowPositionsDebounceMs: number;
|
|
336
|
+
/**
|
|
337
|
+
* If `true`, columns are autosized after the datagrid is mounted.
|
|
338
|
+
* @default false
|
|
339
|
+
*/
|
|
340
|
+
autosizeOnMount: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* If `true`, column autosizing on header separator double-click is disabled.
|
|
343
|
+
* @default false
|
|
344
|
+
*/
|
|
345
|
+
disableAutosize: boolean;
|
|
345
346
|
}
|
|
346
347
|
/**
|
|
347
348
|
* The `DataGrid` props with no default value.
|
|
@@ -366,6 +367,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
366
367
|
* Override or extend the styles applied to the component.
|
|
367
368
|
*/
|
|
368
369
|
classes?: Partial<GridClasses>;
|
|
370
|
+
/**
|
|
371
|
+
* Set the density of the Data Grid.
|
|
372
|
+
* @default "standard"
|
|
373
|
+
*/
|
|
374
|
+
density?: GridDensity;
|
|
369
375
|
/**
|
|
370
376
|
* Set the total number of rows, if it is different from the length of the value `rows` prop.
|
|
371
377
|
* If some rows have children (for instance in the tree data), this number represents the amount of top level rows.
|
|
@@ -519,6 +525,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
519
525
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
520
526
|
*/
|
|
521
527
|
onColumnOrderChange?: GridEventListener<'columnOrderChange'>;
|
|
528
|
+
/**
|
|
529
|
+
* Callback fired when the density changes.
|
|
530
|
+
* @param {GridDensity} density New density value.
|
|
531
|
+
*/
|
|
532
|
+
onDensityChange?: (density: GridDensity) => void;
|
|
522
533
|
/**
|
|
523
534
|
* Callback fired when a row is clicked.
|
|
524
535
|
* Not called if the target clicked is an interactive element added by the built-in columns.
|
|
@@ -559,6 +570,11 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
559
570
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
560
571
|
*/
|
|
561
572
|
onPaginationModelChange?: (model: GridPaginationModel, details: GridCallbackDetails) => void;
|
|
573
|
+
/**
|
|
574
|
+
* Callback fired when the row count has changed.
|
|
575
|
+
* @param {number} count Updated row count.
|
|
576
|
+
*/
|
|
577
|
+
onRowCountChange?: (count: number) => void;
|
|
562
578
|
/**
|
|
563
579
|
* Callback fired when the preferences panel is closed.
|
|
564
580
|
* @param {GridPreferencePanelParams} params With all properties from [[GridPreferencePanelParams]].
|
|
@@ -672,10 +688,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
672
688
|
* Nonce of the inline styles for [Content Security Policy](https://www.w3.org/TR/2016/REC-CSP2-20161215/#script-src-the-nonce-attribute).
|
|
673
689
|
*/
|
|
674
690
|
nonce?: string;
|
|
675
|
-
/**
|
|
676
|
-
* Set of rows of type [[GridRowsProp]].
|
|
677
|
-
*/
|
|
678
|
-
rows: GridRowsProp<R>;
|
|
679
691
|
/**
|
|
680
692
|
* The initial state of the DataGrid.
|
|
681
693
|
* The data in it will be set in the state on initialization but will not be controlled.
|
|
@@ -714,4 +726,22 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
|
|
|
714
726
|
* @param {string} data The data copied to the clipboard.
|
|
715
727
|
*/
|
|
716
728
|
onClipboardCopy?: GridEventListener<'clipboardCopy'>;
|
|
729
|
+
/**
|
|
730
|
+
* The options for autosize when user-initiated.
|
|
731
|
+
*/
|
|
732
|
+
autosizeOptions?: GridAutosizeOptions;
|
|
733
|
+
/**
|
|
734
|
+
* Callback fired while a column is being resized.
|
|
735
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
736
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
737
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
738
|
+
*/
|
|
739
|
+
onColumnResize?: GridEventListener<'columnResize'>;
|
|
740
|
+
/**
|
|
741
|
+
* Callback fired when the width of a column is changed.
|
|
742
|
+
* @param {GridColumnResizeParams} params With all properties from [[GridColumnResizeParams]].
|
|
743
|
+
* @param {MuiEvent<React.MouseEvent>} event The event object.
|
|
744
|
+
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
745
|
+
*/
|
|
746
|
+
onColumnWidthChange?: GridEventListener<'columnWidthChange'>;
|
|
717
747
|
}
|