@mui/x-data-grid 7.0.0-alpha.8 → 7.0.0-alpha.9
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 +379 -2
- package/DataGrid/DataGrid.js +6 -6
- package/DataGrid/useDataGridComponent.js +2 -1
- package/DataGrid/useDataGridProps.js +1 -0
- package/README.md +1 -1
- package/components/GridColumnHeaders.d.ts +3 -2
- package/components/GridColumnHeaders.js +3 -11
- package/components/GridDetailPanels.d.ts +5 -0
- package/components/GridDetailPanels.js +4 -0
- package/components/GridHeaders.d.ts +4 -0
- package/components/GridHeaders.js +53 -0
- package/components/GridPinnedRows.d.ts +7 -0
- package/components/GridPinnedRows.js +4 -0
- package/components/GridRow.d.ts +7 -4
- package/components/GridRow.js +260 -97
- package/components/GridScrollbarFillerCell.d.ts +7 -0
- package/components/GridScrollbarFillerCell.js +39 -0
- package/components/base/GridBody.d.ts +2 -13
- package/components/base/GridBody.js +2 -116
- package/components/base/GridOverlays.js +10 -21
- package/components/cell/GridActionsCellItem.d.ts +2 -2
- package/components/cell/GridCell.d.ts +15 -21
- package/components/cell/GridCell.js +67 -372
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -1
- package/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -0
- package/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/components/containers/GridRoot.js +18 -15
- package/components/containers/GridRootStyles.js +307 -204
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/components/panel/GridPanel.js +3 -4
- package/components/panel/filterPanel/GridFilterForm.d.ts +6 -4
- package/components/panel/filterPanel/GridFilterForm.js +31 -14
- package/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/components/toolbar/GridToolbarColumnsButton.d.ts +13 -1
- package/components/toolbar/GridToolbarColumnsButton.js +40 -22
- package/components/toolbar/GridToolbarDensitySelector.d.ts +13 -1
- package/components/toolbar/GridToolbarDensitySelector.js +40 -22
- package/components/toolbar/GridToolbarExport.d.ts +10 -1
- package/components/toolbar/GridToolbarExport.js +6 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +15 -1
- package/components/toolbar/GridToolbarExportContainer.js +41 -23
- package/components/toolbar/GridToolbarFilterButton.d.ts +5 -4
- package/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/components/virtualization/GridBottomContainer.d.ts +2 -0
- package/components/virtualization/GridBottomContainer.js +25 -0
- package/components/{containers → virtualization}/GridMainContainer.d.ts +2 -0
- package/components/virtualization/GridMainContainer.js +20 -0
- package/components/virtualization/GridTopContainer.d.ts +2 -0
- package/components/virtualization/GridTopContainer.js +35 -0
- package/components/virtualization/GridVirtualScrollbar.d.ts +7 -0
- package/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/components/virtualization/GridVirtualScroller.d.ts +4 -4
- package/components/virtualization/GridVirtualScroller.js +69 -16
- package/components/virtualization/GridVirtualScrollerFiller.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/constants/defaultGridSlotsComponents.js +6 -2
- package/constants/gridClasses.d.ts +60 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/core/gridCoreSelector.d.ts +6 -0
- package/hooks/core/gridCoreSelector.js +5 -0
- package/hooks/core/useGridInitialization.js +4 -0
- package/hooks/core/useGridRefs.d.ts +3 -0
- package/hooks/core/useGridRefs.js +13 -0
- package/hooks/core/useGridTheme.d.ts +3 -0
- package/hooks/core/useGridTheme.js +19 -0
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +7 -14
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +13 -18
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +68 -162
- package/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +17 -0
- package/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/hooks/features/columns/gridColumnsSelector.d.ts +14 -1
- package/hooks/features/columns/gridColumnsSelector.js +52 -0
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -5
- package/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/hooks/features/columns/index.d.ts +2 -2
- package/hooks/features/columns/index.js +2 -1
- package/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/hooks/features/columns/useGridColumns.js +20 -23
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +60 -11
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +2 -0
- package/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/hooks/features/dimensions/index.d.ts +2 -0
- package/hooks/features/dimensions/index.js +1 -0
- package/hooks/features/dimensions/useGridDimensions.d.ts +7 -1
- package/hooks/features/dimensions/useGridDimensions.js +216 -148
- package/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/hooks/features/filter/useGridFilter.js +3 -3
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -2
- package/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/hooks/features/focus/useGridFocus.js +3 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/hooks/features/pagination/useGridPagination.js +3 -5
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +2 -2
- package/hooks/features/rows/gridRowsSelector.js +5 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.js +4 -4
- package/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/hooks/features/scroll/useGridScroll.js +8 -10
- package/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/sorting/useGridSorting.js +15 -10
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +14 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +27 -42
- package/hooks/features/virtualization/useGridVirtualScroller.js +441 -438
- package/hooks/features/virtualization/useGridVirtualization.d.ts +8 -0
- package/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/hooks/utils/index.d.ts +3 -0
- package/hooks/utils/index.js +4 -1
- package/hooks/utils/useGridAriaAttributes.js +1 -2
- package/hooks/utils/useGridNativeEventListener.js +4 -9
- package/hooks/utils/useResizeObserver.d.ts +2 -0
- package/hooks/utils/useResizeObserver.js +36 -0
- package/hooks/utils/useRunOnce.d.ts +5 -0
- package/hooks/utils/useRunOnce.js +18 -0
- package/index.js +1 -1
- package/internals/index.d.ts +12 -9
- package/internals/index.js +9 -7
- package/legacy/DataGrid/DataGrid.js +6 -6
- package/legacy/DataGrid/useDataGridComponent.js +2 -1
- package/legacy/DataGrid/useDataGridProps.js +1 -0
- package/legacy/components/GridColumnHeaders.js +3 -11
- package/legacy/components/GridDetailPanels.js +4 -0
- package/legacy/components/GridHeaders.js +53 -0
- package/legacy/components/GridPinnedRows.js +4 -0
- package/legacy/components/GridRow.js +258 -98
- package/legacy/components/GridScrollbarFillerCell.js +36 -0
- package/legacy/components/base/GridBody.js +2 -114
- package/legacy/components/base/GridOverlays.js +10 -25
- package/legacy/components/cell/GridCell.js +69 -377
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +1 -2
- package/legacy/components/containers/GridRoot.js +18 -15
- package/legacy/components/containers/GridRootStyles.js +215 -137
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/legacy/components/panel/GridPanel.js +3 -4
- package/legacy/components/panel/filterPanel/GridFilterForm.js +30 -13
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +49 -20
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +40 -21
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +40 -21
- package/legacy/components/toolbar/GridToolbarExport.js +6 -1
- package/legacy/components/toolbar/GridToolbarExportContainer.js +40 -21
- package/legacy/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/legacy/components/virtualization/GridBottomContainer.js +25 -0
- package/legacy/components/virtualization/GridMainContainer.js +20 -0
- package/legacy/components/virtualization/GridTopContainer.js +35 -0
- package/legacy/components/virtualization/GridVirtualScrollbar.js +129 -0
- package/legacy/components/virtualization/GridVirtualScroller.js +67 -16
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +70 -0
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/legacy/constants/defaultGridSlotsComponents.js +6 -2
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/hooks/core/gridCoreSelector.js +7 -0
- package/legacy/hooks/core/useGridInitialization.js +4 -0
- package/legacy/hooks/core/useGridRefs.js +13 -0
- package/legacy/hooks/core/useGridTheme.js +21 -0
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +7 -14
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +69 -181
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/legacy/hooks/features/columns/gridColumnsSelector.js +62 -0
- package/legacy/hooks/features/columns/gridColumnsUtils.js +10 -16
- package/legacy/hooks/features/columns/index.js +2 -1
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +60 -59
- package/legacy/hooks/features/columns/useGridColumns.js +22 -23
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +3 -0
- package/legacy/hooks/features/dimensions/index.js +1 -0
- package/legacy/hooks/features/dimensions/useGridDimensions.js +226 -151
- package/legacy/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/legacy/hooks/features/filter/useGridFilter.js +3 -3
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/legacy/hooks/features/focus/useGridFocus.js +3 -3
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/legacy/hooks/features/pagination/useGridPagination.js +3 -5
- package/legacy/hooks/features/rows/gridRowsSelector.js +5 -5
- package/legacy/hooks/features/rows/gridRowsUtils.js +4 -4
- package/legacy/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/legacy/hooks/features/scroll/useGridScroll.js +8 -10
- package/legacy/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/legacy/hooks/features/sorting/useGridSorting.js +15 -10
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +29 -1
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +490 -483
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/legacy/hooks/utils/index.js +4 -1
- package/legacy/hooks/utils/useGridAriaAttributes.js +1 -2
- package/legacy/hooks/utils/useGridNativeEventListener.js +4 -9
- package/legacy/hooks/utils/useResizeObserver.js +36 -0
- package/legacy/hooks/utils/useRunOnce.js +18 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +9 -7
- package/legacy/locales/hrHR.js +161 -0
- package/legacy/locales/index.js +4 -1
- package/legacy/locales/ptPT.js +161 -0
- package/legacy/locales/zhHK.js +161 -0
- package/legacy/models/index.js +0 -1
- package/legacy/models/params/index.js +1 -2
- package/legacy/utils/utils.js +10 -1
- package/locales/hrHR.d.ts +1 -0
- package/locales/hrHR.js +149 -0
- package/locales/index.d.ts +3 -0
- package/locales/index.js +4 -1
- package/locales/ptPT.d.ts +1 -0
- package/locales/ptPT.js +149 -0
- package/locales/zhHK.d.ts +1 -0
- package/locales/zhHK.js +149 -0
- package/models/api/gridColumnGroupingApi.d.ts +2 -2
- package/models/api/gridCoreApi.d.ts +16 -16
- package/models/api/gridRowsMetaApi.d.ts +1 -1
- package/models/api/gridVirtualizationApi.d.ts +2 -3
- package/models/events/gridEventLookup.d.ts +3 -3
- package/models/gridFilterModel.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +16 -2
- package/models/gridStateCommunity.d.ts +5 -1
- package/models/index.d.ts +0 -1
- package/models/index.js +0 -1
- package/models/params/index.d.ts +0 -1
- package/models/params/index.js +1 -2
- package/models/props/DataGridProps.d.ts +6 -11
- package/modern/DataGrid/DataGrid.js +6 -6
- package/modern/DataGrid/useDataGridComponent.js +2 -1
- package/modern/DataGrid/useDataGridProps.js +1 -0
- package/modern/components/GridColumnHeaders.js +3 -11
- package/modern/components/GridDetailPanels.js +4 -0
- package/modern/components/GridHeaders.js +53 -0
- package/modern/components/GridPinnedRows.js +4 -0
- package/modern/components/GridRow.js +258 -96
- package/modern/components/GridScrollbarFillerCell.js +39 -0
- package/modern/components/base/GridBody.js +2 -116
- package/modern/components/base/GridOverlays.js +10 -16
- package/modern/components/cell/GridCell.js +65 -369
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +7 -3
- package/modern/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/modern/components/containers/GridRoot.js +18 -14
- package/modern/components/containers/GridRootStyles.js +307 -204
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/modern/components/panel/GridPanel.js +3 -4
- package/modern/components/panel/filterPanel/GridFilterForm.js +30 -13
- package/modern/components/panel/filterPanel/GridFilterPanel.js +46 -20
- package/modern/components/toolbar/GridToolbarColumnsButton.js +38 -21
- package/modern/components/toolbar/GridToolbarDensitySelector.js +38 -21
- package/modern/components/toolbar/GridToolbarExport.js +6 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +39 -22
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/modern/components/virtualization/GridBottomContainer.js +25 -0
- package/modern/components/virtualization/GridMainContainer.js +20 -0
- package/modern/components/virtualization/GridTopContainer.js +35 -0
- package/modern/components/virtualization/GridVirtualScrollbar.js +131 -0
- package/modern/components/virtualization/GridVirtualScroller.js +69 -16
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +71 -0
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/modern/constants/defaultGridSlotsComponents.js +6 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/gridCoreSelector.js +5 -0
- package/modern/hooks/core/useGridInitialization.js +4 -0
- package/modern/hooks/core/useGridRefs.js +13 -0
- package/modern/hooks/core/useGridTheme.js +19 -0
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +5 -12
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +67 -160
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/modern/hooks/features/columns/gridColumnsInterfaces.js +9 -1
- package/modern/hooks/features/columns/gridColumnsSelector.js +51 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +10 -12
- package/modern/hooks/features/columns/index.js +2 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/modern/hooks/features/columns/useGridColumns.js +19 -21
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.js +1 -0
- package/modern/hooks/features/dimensions/index.js +1 -0
- package/modern/hooks/features/dimensions/useGridDimensions.js +214 -146
- package/modern/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/modern/hooks/features/filter/useGridFilter.js +3 -3
- package/modern/hooks/features/focus/gridFocusStateSelector.js +2 -6
- package/modern/hooks/features/focus/useGridFocus.js +3 -3
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +3 -16
- package/modern/hooks/features/pagination/useGridPagination.js +3 -5
- package/modern/hooks/features/rows/gridRowsSelector.js +2 -2
- package/modern/hooks/features/rows/gridRowsUtils.js +4 -4
- package/modern/hooks/features/rows/useGridRowsMeta.js +7 -4
- package/modern/hooks/features/scroll/useGridScroll.js +8 -9
- package/modern/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/modern/hooks/features/sorting/useGridSorting.js +15 -10
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +435 -432
- package/modern/hooks/features/virtualization/useGridVirtualization.js +8 -1
- package/modern/hooks/utils/index.js +4 -1
- package/modern/hooks/utils/useGridAriaAttributes.js +1 -1
- package/modern/hooks/utils/useGridNativeEventListener.js +3 -9
- package/modern/hooks/utils/useResizeObserver.js +36 -0
- package/modern/hooks/utils/useRunOnce.js +18 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +9 -7
- package/modern/locales/hrHR.js +149 -0
- package/modern/locales/index.js +4 -1
- package/modern/locales/ptPT.js +149 -0
- package/modern/locales/zhHK.js +149 -0
- package/modern/models/index.js +0 -1
- package/modern/models/params/index.js +1 -2
- package/modern/utils/utils.js +10 -1
- package/node/DataGrid/DataGrid.js +6 -6
- package/node/DataGrid/useDataGridComponent.js +1 -0
- package/node/DataGrid/useDataGridProps.js +1 -0
- package/node/components/GridColumnHeaders.js +3 -11
- package/node/components/GridDetailPanels.js +10 -0
- package/node/components/GridHeaders.js +60 -0
- package/node/components/GridPinnedRows.js +10 -0
- package/node/components/GridRow.js +256 -94
- package/node/components/GridScrollbarFillerCell.js +47 -0
- package/node/components/base/GridBody.js +7 -118
- package/node/components/base/GridOverlays.js +9 -15
- package/node/components/cell/GridCell.js +66 -369
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -6
- package/node/components/columnHeaders/GridColumnHeaderItem.js +8 -4
- package/node/components/columnHeaders/GridColumnHeaderSortIcon.js +5 -2
- package/node/components/columnHeaders/GridColumnHeadersInner.js +1 -1
- package/node/components/containers/GridRoot.js +17 -14
- package/node/components/containers/GridRootStyles.js +175 -72
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +1 -1
- package/node/components/panel/GridPanel.js +3 -4
- package/node/components/panel/filterPanel/GridFilterForm.js +29 -12
- package/node/components/panel/filterPanel/GridFilterPanel.js +45 -19
- package/node/components/toolbar/GridToolbarColumnsButton.js +36 -20
- package/node/components/toolbar/GridToolbarDensitySelector.js +36 -20
- package/node/components/toolbar/GridToolbarExport.js +6 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +37 -21
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -10
- package/node/components/virtualization/GridBottomContainer.js +34 -0
- package/node/components/{containers → virtualization}/GridMainContainer.js +7 -29
- package/node/components/virtualization/GridTopContainer.js +44 -0
- package/node/components/virtualization/GridVirtualScrollbar.js +138 -0
- package/node/components/virtualization/GridVirtualScroller.js +69 -17
- package/node/components/virtualization/GridVirtualScrollerFiller.js +77 -0
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +2 -1
- package/node/constants/defaultGridSlotsComponents.js +5 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/core/gridCoreSelector.js +12 -0
- package/node/hooks/core/useGridInitialization.js +4 -0
- package/node/hooks/core/useGridRefs.js +22 -0
- package/node/hooks/core/useGridTheme.js +29 -0
- package/node/hooks/features/columnGrouping/useGridColumnGrouping.js +5 -12
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +65 -159
- package/node/hooks/features/columnMenu/useGridColumnMenu.js +28 -23
- package/node/hooks/features/columns/gridColumnsInterfaces.js +11 -1
- package/node/hooks/features/columns/gridColumnsSelector.js +52 -1
- package/node/hooks/features/columns/gridColumnsUtils.js +10 -13
- package/node/hooks/features/columns/index.js +22 -61
- package/node/hooks/features/columns/useGridColumnSpanning.js +62 -61
- package/node/hooks/features/columns/useGridColumns.js +20 -22
- package/node/hooks/features/dimensions/gridDimensionsSelectors.js +8 -0
- package/node/hooks/features/dimensions/index.js +11 -0
- package/node/hooks/features/dimensions/useGridDimensions.js +215 -144
- package/node/hooks/features/export/serializers/csvSerializer.js +2 -2
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/focus/gridFocusStateSelector.js +3 -7
- package/node/hooks/features/focus/useGridFocus.js +2 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +2 -15
- package/node/hooks/features/pagination/useGridPagination.js +3 -5
- package/node/hooks/features/rows/gridRowsSelector.js +2 -2
- package/node/hooks/features/rows/gridRowsUtils.js +4 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -3
- package/node/hooks/features/scroll/useGridScroll.js +8 -9
- package/node/hooks/features/sorting/gridSortingUtils.js +1 -1
- package/node/hooks/features/sorting/useGridSorting.js +15 -10
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +22 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +434 -431
- package/node/hooks/features/virtualization/useGridVirtualization.js +9 -1
- package/node/hooks/utils/index.js +36 -0
- package/node/hooks/utils/useGridAriaAttributes.js +1 -1
- package/node/hooks/utils/useGridNativeEventListener.js +3 -9
- package/node/hooks/utils/useResizeObserver.js +44 -0
- package/node/hooks/utils/useRunOnce.js +27 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +86 -71
- package/node/locales/hrHR.js +155 -0
- package/node/locales/index.js +33 -0
- package/node/locales/ptPT.js +155 -0
- package/node/locales/zhHK.js +155 -0
- package/node/models/index.js +0 -11
- package/node/models/params/index.js +0 -11
- package/node/utils/utils.js +11 -1
- package/package.json +6 -6
- package/utils/utils.d.ts +6 -0
- package/utils/utils.js +10 -1
- package/components/DataGridVirtualScroller.d.ts +0 -3
- package/components/DataGridVirtualScroller.js +0 -35
- package/components/containers/GridMainContainer.js +0 -43
- package/legacy/components/DataGridVirtualScroller.js +0 -32
- package/legacy/components/containers/GridMainContainer.js +0 -45
- package/legacy/models/gridRootContainerRef.js +0 -1
- package/legacy/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/models/gridRootContainerRef.d.ts +0 -5
- package/models/gridRootContainerRef.js +0 -1
- package/models/params/gridRenderedRowsIntervalChangeParams.d.ts +0 -10
- package/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/modern/components/DataGridVirtualScroller.js +0 -35
- package/modern/components/containers/GridMainContainer.js +0 -42
- package/modern/models/gridRootContainerRef.js +0 -1
- package/modern/models/params/gridRenderedRowsIntervalChangeParams.js +0 -1
- package/node/components/DataGridVirtualScroller.js +0 -42
- package/node/models/gridRootContainerRef.js +0 -5
- package/node/models/params/gridRenderedRowsIntervalChangeParams.js +0 -5
|
@@ -31,7 +31,7 @@ function GridColumnMenuSortItem(props) {
|
|
|
31
31
|
const direction = event.currentTarget.getAttribute('data-value') || null;
|
|
32
32
|
apiRef.current.sortColumn(colDef.field, direction === sortDirection ? null : direction);
|
|
33
33
|
}, [apiRef, colDef, onClick, sortDirection]);
|
|
34
|
-
if (!colDef || !colDef.sortable || !sortingOrder.some(item => !!item)) {
|
|
34
|
+
if (rootProps.disableColumnSorting || !colDef || !colDef.sortable || !sortingOrder.some(item => !!item)) {
|
|
35
35
|
return null;
|
|
36
36
|
}
|
|
37
37
|
const getLabel = key => {
|
|
@@ -11,7 +11,6 @@ import Paper from '@mui/material/Paper';
|
|
|
11
11
|
import Popper from '@mui/material/Popper';
|
|
12
12
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
13
13
|
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
14
|
-
import { gridClasses } from '../../constants/gridClasses';
|
|
15
14
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
export const gridPanelClasses = generateUtilityClasses('MuiDataGrid', ['panel', 'paper']);
|
|
@@ -71,9 +70,9 @@ const GridPanel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
71
70
|
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
72
71
|
React.useEffect(() => {
|
|
73
72
|
var _apiRef$current$rootE;
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
setAnchorEl(
|
|
73
|
+
const panelAnchor = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null || (_apiRef$current$rootE = _apiRef$current$rootE.current) == null ? void 0 : _apiRef$current$rootE.querySelector('[data-id="gridPanelAnchor"]');
|
|
74
|
+
if (panelAnchor) {
|
|
75
|
+
setAnchorEl(panelAnchor);
|
|
77
76
|
}
|
|
78
77
|
}, [apiRef]);
|
|
79
78
|
if (!anchorEl) {
|
|
@@ -20,10 +20,6 @@ export interface GridFilterFormProps {
|
|
|
20
20
|
* If `true`, the logic operator field is visible.
|
|
21
21
|
*/
|
|
22
22
|
showMultiFilterOperators?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The current logic operator applied.
|
|
25
|
-
*/
|
|
26
|
-
multiFilterOperator?: GridLogicOperator;
|
|
27
23
|
/**
|
|
28
24
|
* If `true`, disables the logic operator field but still renders it.
|
|
29
25
|
*/
|
|
@@ -84,6 +80,12 @@ export interface GridFilterFormProps {
|
|
|
84
80
|
* @default {}
|
|
85
81
|
*/
|
|
86
82
|
columnInputProps?: any;
|
|
83
|
+
/**
|
|
84
|
+
* `true` if the filter is disabled/read only.
|
|
85
|
+
* i.e. `colDef.fiterable = false` but passed in `filterModel`
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
readOnly?: boolean;
|
|
87
89
|
/**
|
|
88
90
|
* Props passed to the value input component.
|
|
89
91
|
* @default {}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "
|
|
3
|
+
const _excluded = ["item", "hasMultipleFilters", "deleteFilter", "applyFilterChanges", "showMultiFilterOperators", "disableMultiFilterOperator", "applyMultiFilterOperatorChanges", "focusElementRef", "logicOperators", "columnsSort", "filterColumns", "deleteIconProps", "logicOperatorInputProps", "operatorInputProps", "columnInputProps", "valueInputProps", "readOnly", "children"],
|
|
4
4
|
_excluded2 = ["InputComponentProps"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { unstable_composeClasses as composeClasses, unstable_useId as useId, unstable_capitalize as capitalize } from '@mui/utils';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
10
|
+
import { gridFilterableColumnDefinitionsSelector, gridColumnLookupSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
11
11
|
import { gridFilterModelSelector } from '../../../hooks/features/filter/gridFilterSelector';
|
|
12
12
|
import { useGridSelector } from '../../../hooks/utils/useGridSelector';
|
|
13
13
|
import { GridLogicOperator } from '../../../models/gridFilterItem';
|
|
@@ -97,13 +97,12 @@ const getLogicOperatorLocaleKey = logicOperator => {
|
|
|
97
97
|
const getColumnLabel = col => col.headerName || col.field;
|
|
98
98
|
const collator = new Intl.Collator();
|
|
99
99
|
const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(props, ref) {
|
|
100
|
-
var _rootProps$slotProps, _rootProps$slotProps2, _baseSelectProps$nati, _rootProps$slotProps3, _rootProps$slotProps4, _rootProps$slotProps5, _rootProps$slotProps6, _rootProps$slotProps7, _rootProps$slotProps8, _currentColumn$filter2;
|
|
100
|
+
var _filterModel$logicOpe, _rootProps$slotProps, _rootProps$slotProps2, _baseSelectProps$nati, _rootProps$slotProps3, _rootProps$slotProps4, _rootProps$slotProps5, _rootProps$slotProps6, _rootProps$slotProps7, _rootProps$slotProps8, _currentColumn$filter2;
|
|
101
101
|
const {
|
|
102
102
|
item,
|
|
103
103
|
hasMultipleFilters,
|
|
104
104
|
deleteFilter,
|
|
105
105
|
applyFilterChanges,
|
|
106
|
-
multiFilterOperator,
|
|
107
106
|
showMultiFilterOperators,
|
|
108
107
|
disableMultiFilterOperator,
|
|
109
108
|
applyMultiFilterOperatorChanges,
|
|
@@ -115,10 +114,12 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
115
114
|
logicOperatorInputProps = {},
|
|
116
115
|
operatorInputProps = {},
|
|
117
116
|
columnInputProps = {},
|
|
118
|
-
valueInputProps = {}
|
|
117
|
+
valueInputProps = {},
|
|
118
|
+
readOnly
|
|
119
119
|
} = props,
|
|
120
120
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
121
121
|
const apiRef = useGridApiContext();
|
|
122
|
+
const columnLookup = useGridSelector(apiRef, gridColumnLookupSelector);
|
|
122
123
|
const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);
|
|
123
124
|
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
124
125
|
const columnSelectId = useId();
|
|
@@ -129,6 +130,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
129
130
|
const classes = useUtilityClasses(rootProps);
|
|
130
131
|
const valueRef = React.useRef(null);
|
|
131
132
|
const filterSelectorRef = React.useRef(null);
|
|
133
|
+
const multiFilterOperator = (_filterModel$logicOpe = filterModel.logicOperator) != null ? _filterModel$logicOpe : GridLogicOperator.And;
|
|
132
134
|
const hasLogicOperatorColumn = hasMultipleFilters && logicOperators.length > 0;
|
|
133
135
|
const baseFormControlProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseFormControl) || {};
|
|
134
136
|
const baseSelectProps = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect) || {};
|
|
@@ -144,6 +146,15 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
144
146
|
selectedField
|
|
145
147
|
} = React.useMemo(() => {
|
|
146
148
|
let itemField = item.field;
|
|
149
|
+
|
|
150
|
+
// Yields a valid value if the current filter belongs to a column that is not filterable
|
|
151
|
+
const selectedNonFilterableColumn = columnLookup[item.field].filterable === false ? columnLookup[item.field] : null;
|
|
152
|
+
if (selectedNonFilterableColumn) {
|
|
153
|
+
return {
|
|
154
|
+
filteredColumns: [selectedNonFilterableColumn],
|
|
155
|
+
selectedField: itemField
|
|
156
|
+
};
|
|
157
|
+
}
|
|
147
158
|
if (filterColumns === undefined || typeof filterColumns !== 'function') {
|
|
148
159
|
return {
|
|
149
160
|
filteredColumns: filterableColumns,
|
|
@@ -165,7 +176,7 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
165
176
|
}),
|
|
166
177
|
selectedField: itemField
|
|
167
178
|
};
|
|
168
|
-
}, [filterColumns, filterModel == null ? void 0 : filterModel.items, filterableColumns, item.field]);
|
|
179
|
+
}, [filterColumns, filterModel == null ? void 0 : filterModel.items, filterableColumns, item.field, columnLookup]);
|
|
169
180
|
const sortedFilteredColumns = React.useMemo(() => {
|
|
170
181
|
switch (columnsSort) {
|
|
171
182
|
case 'asc':
|
|
@@ -274,7 +285,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
274
285
|
"aria-label": apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
|
|
275
286
|
title: apiRef.current.getLocaleText('filterPanelDeleteIconLabel'),
|
|
276
287
|
onClick: handleDeleteFilter,
|
|
277
|
-
size: "small"
|
|
288
|
+
size: "small",
|
|
289
|
+
disabled: readOnly
|
|
278
290
|
}, (_rootProps$slotProps5 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps5.baseIconButton, {
|
|
279
291
|
children: /*#__PURE__*/_jsx(rootProps.slots.filterPanelDeleteIcon, {
|
|
280
292
|
fontSize: "small"
|
|
@@ -321,7 +333,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
321
333
|
label: apiRef.current.getLocaleText('filterPanelColumns'),
|
|
322
334
|
value: selectedField != null ? selectedField : '',
|
|
323
335
|
onChange: changeColumn,
|
|
324
|
-
native: isBaseSelectNative
|
|
336
|
+
native: isBaseSelectNative,
|
|
337
|
+
disabled: readOnly
|
|
325
338
|
}, (_rootProps$slotProps7 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps7.baseSelect, {
|
|
326
339
|
children: sortedFilteredColumns.map(col => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
327
340
|
native: isBaseSelectNative,
|
|
@@ -346,7 +359,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
346
359
|
value: item.operator,
|
|
347
360
|
onChange: changeOperator,
|
|
348
361
|
native: isBaseSelectNative,
|
|
349
|
-
inputRef: filterSelectorRef
|
|
362
|
+
inputRef: filterSelectorRef,
|
|
363
|
+
disabled: readOnly
|
|
350
364
|
}, (_rootProps$slotProps8 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps8.baseSelect, {
|
|
351
365
|
children: currentColumn == null || (_currentColumn$filter2 = currentColumn.filterOperators) == null ? void 0 : _currentColumn$filter2.map(operator => /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, baseSelectOptionProps, {
|
|
352
366
|
native: isBaseSelectNative,
|
|
@@ -364,7 +378,8 @@ const GridFilterForm = /*#__PURE__*/React.forwardRef(function GridFilterForm(pro
|
|
|
364
378
|
apiRef: apiRef,
|
|
365
379
|
item: item,
|
|
366
380
|
applyValue: applyFilterChanges,
|
|
367
|
-
focusElementRef: valueRef
|
|
381
|
+
focusElementRef: valueRef,
|
|
382
|
+
disabled: readOnly
|
|
368
383
|
}, currentOperator.InputComponentProps, InputComponentProps), item.field) : null
|
|
369
384
|
}))]
|
|
370
385
|
}));
|
|
@@ -447,15 +462,17 @@ process.env.NODE_ENV !== "production" ? GridFilterForm.propTypes = {
|
|
|
447
462
|
* @default [GridLogicOperator.And, GridLogicOperator.Or]
|
|
448
463
|
*/
|
|
449
464
|
logicOperators: PropTypes.arrayOf(PropTypes.oneOf(['and', 'or']).isRequired),
|
|
450
|
-
/**
|
|
451
|
-
* The current logic operator applied.
|
|
452
|
-
*/
|
|
453
|
-
multiFilterOperator: PropTypes.oneOf(['and', 'or']),
|
|
454
465
|
/**
|
|
455
466
|
* Props passed to the operator input component.
|
|
456
467
|
* @default {}
|
|
457
468
|
*/
|
|
458
469
|
operatorInputProps: PropTypes.any,
|
|
470
|
+
/**
|
|
471
|
+
* `true` if the filter is disabled/read only.
|
|
472
|
+
* i.e. `colDef.fiterable = false` but passed in `filterModel`
|
|
473
|
+
* @default false
|
|
474
|
+
*/
|
|
475
|
+
readOnly: PropTypes.bool,
|
|
459
476
|
/**
|
|
460
477
|
* If `true`, the logic operator field is visible.
|
|
461
478
|
*/
|
|
@@ -12,7 +12,7 @@ import { GridFilterForm } from './GridFilterForm';
|
|
|
12
12
|
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
|
|
13
13
|
import { useGridSelector } from '../../../hooks/utils/useGridSelector';
|
|
14
14
|
import { gridFilterModelSelector } from '../../../hooks/features/filter/gridFilterSelector';
|
|
15
|
-
import { gridFilterableColumnDefinitionsSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
15
|
+
import { gridFilterableColumnDefinitionsSelector, gridFilterableColumnLookupSelector } from '../../../hooks/features/columns/gridColumnsSelector';
|
|
16
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
const getGridFilter = col => ({
|
|
@@ -26,6 +26,7 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
26
26
|
const rootProps = useGridRootProps();
|
|
27
27
|
const filterModel = useGridSelector(apiRef, gridFilterModelSelector);
|
|
28
28
|
const filterableColumns = useGridSelector(apiRef, gridFilterableColumnDefinitionsSelector);
|
|
29
|
+
const filterableColumnsLookup = useGridSelector(apiRef, gridFilterableColumnLookupSelector);
|
|
29
30
|
const lastFilterRef = React.useRef(null);
|
|
30
31
|
const placeholderFilter = React.useRef(null);
|
|
31
32
|
const {
|
|
@@ -98,63 +99,88 @@ const GridFilterPanel = /*#__PURE__*/React.forwardRef(function GridFilterPanel(p
|
|
|
98
99
|
return placeholderFilter.current ? [placeholderFilter.current] : [];
|
|
99
100
|
}, [filterModel.items, getDefaultFilter]);
|
|
100
101
|
const hasMultipleFilters = items.length > 1;
|
|
101
|
-
const
|
|
102
|
+
const {
|
|
103
|
+
readOnlyFilters,
|
|
104
|
+
validFilters
|
|
105
|
+
} = React.useMemo(() => items.reduce((acc, item) => {
|
|
106
|
+
if (filterableColumnsLookup[item.field]) {
|
|
107
|
+
acc.validFilters.push(item);
|
|
108
|
+
} else {
|
|
109
|
+
acc.readOnlyFilters.push(item);
|
|
110
|
+
}
|
|
111
|
+
return acc;
|
|
112
|
+
}, {
|
|
113
|
+
readOnlyFilters: [],
|
|
114
|
+
validFilters: []
|
|
115
|
+
}), [items, filterableColumnsLookup]);
|
|
116
|
+
const addNewFilter = React.useCallback(() => {
|
|
102
117
|
const newFilter = getNewFilter();
|
|
103
118
|
if (!newFilter) {
|
|
104
119
|
return;
|
|
105
120
|
}
|
|
106
121
|
apiRef.current.upsertFilterItems([...items, newFilter]);
|
|
107
|
-
};
|
|
122
|
+
}, [apiRef, getNewFilter, items]);
|
|
108
123
|
const deleteFilter = React.useCallback(item => {
|
|
109
|
-
const shouldCloseFilterPanel =
|
|
124
|
+
const shouldCloseFilterPanel = validFilters.length === 1;
|
|
110
125
|
apiRef.current.deleteFilterItem(item);
|
|
111
126
|
if (shouldCloseFilterPanel) {
|
|
112
127
|
apiRef.current.hideFilterPanel();
|
|
113
128
|
}
|
|
114
|
-
}, [apiRef,
|
|
115
|
-
const handleRemoveAll = () => {
|
|
116
|
-
if (
|
|
117
|
-
apiRef.current.deleteFilterItem(
|
|
118
|
-
apiRef.current.hideFilterPanel();
|
|
129
|
+
}, [apiRef, validFilters.length]);
|
|
130
|
+
const handleRemoveAll = React.useCallback(() => {
|
|
131
|
+
if (validFilters.length === 1 && validFilters[0].value === undefined) {
|
|
132
|
+
apiRef.current.deleteFilterItem(validFilters[0]);
|
|
133
|
+
return apiRef.current.hideFilterPanel();
|
|
119
134
|
}
|
|
120
|
-
apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
121
|
-
items:
|
|
135
|
+
return apiRef.current.setFilterModel(_extends({}, filterModel, {
|
|
136
|
+
items: readOnlyFilters
|
|
122
137
|
}));
|
|
123
|
-
};
|
|
138
|
+
}, [apiRef, readOnlyFilters, filterModel, validFilters]);
|
|
124
139
|
React.useEffect(() => {
|
|
125
140
|
if (logicOperators.length > 0 && filterModel.logicOperator && !logicOperators.includes(filterModel.logicOperator)) {
|
|
126
141
|
applyFilterLogicOperator(logicOperators[0]);
|
|
127
142
|
}
|
|
128
143
|
}, [logicOperators, applyFilterLogicOperator, filterModel.logicOperator]);
|
|
129
144
|
React.useEffect(() => {
|
|
130
|
-
if (
|
|
145
|
+
if (validFilters.length > 0) {
|
|
131
146
|
lastFilterRef.current.focus();
|
|
132
147
|
}
|
|
133
|
-
}, [
|
|
148
|
+
}, [validFilters.length]);
|
|
134
149
|
return /*#__PURE__*/_jsxs(GridPanelWrapper, _extends({
|
|
135
150
|
ref: ref
|
|
136
151
|
}, other, {
|
|
137
|
-
children: [/*#__PURE__*/
|
|
138
|
-
children:
|
|
152
|
+
children: [/*#__PURE__*/_jsxs(GridPanelContent, {
|
|
153
|
+
children: [readOnlyFilters.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({
|
|
139
154
|
item: item,
|
|
140
155
|
applyFilterChanges: applyFilter,
|
|
141
156
|
deleteFilter: deleteFilter,
|
|
142
157
|
hasMultipleFilters: hasMultipleFilters,
|
|
143
158
|
showMultiFilterOperators: index > 0,
|
|
144
|
-
multiFilterOperator: filterModel.logicOperator,
|
|
145
159
|
disableMultiFilterOperator: index !== 1,
|
|
146
160
|
applyMultiFilterOperatorChanges: applyFilterLogicOperator,
|
|
147
|
-
focusElementRef:
|
|
161
|
+
focusElementRef: null,
|
|
162
|
+
readOnly: true,
|
|
163
|
+
logicOperators: logicOperators,
|
|
164
|
+
columnsSort: columnsSort
|
|
165
|
+
}, filterFormProps), item.id == null ? index : item.id)), validFilters.map((item, index) => /*#__PURE__*/_jsx(GridFilterForm, _extends({
|
|
166
|
+
item: item,
|
|
167
|
+
applyFilterChanges: applyFilter,
|
|
168
|
+
deleteFilter: deleteFilter,
|
|
169
|
+
hasMultipleFilters: hasMultipleFilters,
|
|
170
|
+
showMultiFilterOperators: readOnlyFilters.length + index > 0,
|
|
171
|
+
disableMultiFilterOperator: readOnlyFilters.length + index !== 1,
|
|
172
|
+
applyMultiFilterOperatorChanges: applyFilterLogicOperator,
|
|
173
|
+
focusElementRef: index === validFilters.length - 1 ? lastFilterRef : null,
|
|
148
174
|
logicOperators: logicOperators,
|
|
149
175
|
columnsSort: columnsSort
|
|
150
|
-
}, filterFormProps), item.id == null ? index : item.id))
|
|
176
|
+
}, filterFormProps), item.id == null ? index + readOnlyFilters.length : item.id))]
|
|
151
177
|
}), !rootProps.disableMultipleColumnsFiltering && !(disableAddFilterButton && disableRemoveAllButton) ? /*#__PURE__*/_jsxs(GridPanelFooter, {
|
|
152
178
|
children: [!disableAddFilterButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
153
179
|
onClick: addNewFilter,
|
|
154
180
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.filterPanelAddIcon, {})
|
|
155
181
|
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseButton, {
|
|
156
182
|
children: apiRef.current.getLocaleText('filterPanelAddFilter')
|
|
157
|
-
})) : /*#__PURE__*/_jsx("span", {}), !disableRemoveAllButton ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
183
|
+
})) : /*#__PURE__*/_jsx("span", {}), !disableRemoveAllButton && validFilters.length > 0 ? /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
158
184
|
onClick: handleRemoveAll,
|
|
159
185
|
startIcon: /*#__PURE__*/_jsx(rootProps.slots.filterPanelRemoveAllIcon, {})
|
|
160
186
|
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseButton, {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
|
|
3
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
interface GridToolbarColumnsButtonProps {
|
|
5
|
+
/**
|
|
6
|
+
* The props used for each slot inside.
|
|
7
|
+
* @default {}
|
|
8
|
+
*/
|
|
9
|
+
slotProps?: {
|
|
10
|
+
button?: Partial<ButtonProps>;
|
|
11
|
+
tooltip?: Partial<TooltipProps>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<GridToolbarColumnsButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export { GridToolbarColumnsButton };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["onClick"];
|
|
4
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
5
4
|
import { unstable_useId as useId } from '@mui/material/utils';
|
|
6
5
|
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
7
6
|
import { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';
|
|
@@ -9,24 +8,26 @@ import { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel
|
|
|
9
8
|
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
10
9
|
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
11
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
|
-
var _rootProps$slotProps;
|
|
11
|
+
const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function GridToolbarColumnsButton(props, ref) {
|
|
12
|
+
var _rootProps$slotProps, _rootProps$slotProps2;
|
|
14
13
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
slotProps = {}
|
|
15
|
+
} = props;
|
|
16
|
+
const buttonProps = slotProps.button || {};
|
|
17
|
+
const tooltipProps = slotProps.tooltip || {};
|
|
18
18
|
const columnButtonId = useId();
|
|
19
19
|
const columnPanelId = useId();
|
|
20
20
|
const apiRef = useGridApiContext();
|
|
21
21
|
const rootProps = useGridRootProps();
|
|
22
22
|
const preferencePanel = useGridSelector(apiRef, gridPreferencePanelStateSelector);
|
|
23
23
|
const showColumns = event => {
|
|
24
|
+
var _buttonProps$onClick;
|
|
24
25
|
if (preferencePanel.open && preferencePanel.openedPanelValue === GridPreferencePanelsValue.columns) {
|
|
25
26
|
apiRef.current.hidePreferences();
|
|
26
27
|
} else {
|
|
27
28
|
apiRef.current.showPreferences(GridPreferencePanelsValue.columns, columnPanelId, columnButtonId);
|
|
28
29
|
}
|
|
29
|
-
onClick == null || onClick(event);
|
|
30
|
+
(_buttonProps$onClick = buttonProps.onClick) == null || _buttonProps$onClick.call(buttonProps, event);
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
// Disable the button if the corresponding is disabled
|
|
@@ -34,18 +35,35 @@ export const GridToolbarColumnsButton = /*#__PURE__*/React.forwardRef(function G
|
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
36
37
|
const isOpen = preferencePanel.open && preferencePanel.panelId === columnPanelId;
|
|
37
|
-
return /*#__PURE__*/_jsx(rootProps.slots.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
return /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
39
|
+
title: apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
40
|
+
enterDelay: 1000
|
|
41
|
+
}, tooltipProps, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
|
|
42
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
43
|
+
ref: ref,
|
|
44
|
+
id: columnButtonId,
|
|
45
|
+
size: "small",
|
|
46
|
+
"aria-label": apiRef.current.getLocaleText('toolbarColumnsLabel'),
|
|
47
|
+
"aria-haspopup": "menu",
|
|
48
|
+
"aria-expanded": isOpen,
|
|
49
|
+
"aria-controls": isOpen ? columnPanelId : undefined,
|
|
50
|
+
startIcon: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {})
|
|
51
|
+
}, buttonProps, {
|
|
52
|
+
onClick: showColumns
|
|
53
|
+
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseButton, {
|
|
54
|
+
children: apiRef.current.getLocaleText('toolbarColumns')
|
|
55
|
+
}))
|
|
50
56
|
}));
|
|
51
|
-
});
|
|
57
|
+
});
|
|
58
|
+
process.env.NODE_ENV !== "production" ? GridToolbarColumnsButton.propTypes = {
|
|
59
|
+
// ----------------------------- Warning --------------------------------
|
|
60
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
61
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
62
|
+
// ----------------------------------------------------------------------
|
|
63
|
+
/**
|
|
64
|
+
* The props used for each slot inside.
|
|
65
|
+
* @default {}
|
|
66
|
+
*/
|
|
67
|
+
slotProps: PropTypes.object
|
|
68
|
+
} : void 0;
|
|
69
|
+
export { GridToolbarColumnsButton };
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
|
|
3
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
interface GridToolbarDensitySelectorProps {
|
|
5
|
+
/**
|
|
6
|
+
* The props used for each slot inside.
|
|
7
|
+
* @default {}
|
|
8
|
+
*/
|
|
9
|
+
slotProps?: {
|
|
10
|
+
button?: Partial<ButtonProps>;
|
|
11
|
+
tooltip?: Partial<TooltipProps>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<GridToolbarDensitySelectorProps & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export { GridToolbarDensitySelector };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["onClick"];
|
|
4
2
|
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
5
4
|
import { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
6
5
|
import MenuList from '@mui/material/MenuList';
|
|
7
6
|
import MenuItem from '@mui/material/MenuItem';
|
|
@@ -15,12 +14,13 @@ import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
|
15
14
|
import { gridClasses } from '../../constants/gridClasses';
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
-
|
|
19
|
-
var _rootProps$slotProps;
|
|
17
|
+
const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function GridToolbarDensitySelector(props, ref) {
|
|
18
|
+
var _rootProps$slotProps, _rootProps$slotProps2;
|
|
20
19
|
const {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
slotProps = {}
|
|
21
|
+
} = props;
|
|
22
|
+
const buttonProps = slotProps.button || {};
|
|
23
|
+
const tooltipProps = slotProps.tooltip || {};
|
|
24
24
|
const apiRef = useGridApiContext();
|
|
25
25
|
const rootProps = useGridRootProps();
|
|
26
26
|
const densityValue = useGridSelector(apiRef, gridDensityValueSelector);
|
|
@@ -53,8 +53,9 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
53
53
|
}
|
|
54
54
|
}, [densityValue, rootProps]);
|
|
55
55
|
const handleDensitySelectorOpen = event => {
|
|
56
|
+
var _buttonProps$onClick;
|
|
56
57
|
setOpen(prevOpen => !prevOpen);
|
|
57
|
-
onClick == null || onClick(event);
|
|
58
|
+
(_buttonProps$onClick = buttonProps.onClick) == null || _buttonProps$onClick.call(buttonProps, event);
|
|
58
59
|
};
|
|
59
60
|
const handleDensitySelectorClose = () => {
|
|
60
61
|
setOpen(false);
|
|
@@ -84,19 +85,24 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
84
85
|
}), option.label]
|
|
85
86
|
}, index));
|
|
86
87
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
87
|
-
children: [/*#__PURE__*/_jsx(rootProps.slots.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
88
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, _extends({
|
|
89
|
+
title: apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
90
|
+
enterDelay: 1000
|
|
91
|
+
}, tooltipProps, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseTooltip, {
|
|
92
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseButton, _extends({
|
|
93
|
+
ref: handleRef,
|
|
94
|
+
size: "small",
|
|
95
|
+
startIcon: startIcon,
|
|
96
|
+
"aria-label": apiRef.current.getLocaleText('toolbarDensityLabel'),
|
|
97
|
+
"aria-haspopup": "menu",
|
|
98
|
+
"aria-expanded": open,
|
|
99
|
+
"aria-controls": open ? densityMenuId : undefined,
|
|
100
|
+
id: densityButtonId
|
|
101
|
+
}, buttonProps, {
|
|
102
|
+
onClick: handleDensitySelectorOpen
|
|
103
|
+
}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseButton, {
|
|
104
|
+
children: apiRef.current.getLocaleText('toolbarDensity')
|
|
105
|
+
}))
|
|
100
106
|
})), /*#__PURE__*/_jsx(GridMenu, {
|
|
101
107
|
open: open,
|
|
102
108
|
target: buttonRef.current,
|
|
@@ -112,4 +118,16 @@ export const GridToolbarDensitySelector = /*#__PURE__*/React.forwardRef(function
|
|
|
112
118
|
})
|
|
113
119
|
})]
|
|
114
120
|
});
|
|
115
|
-
});
|
|
121
|
+
});
|
|
122
|
+
process.env.NODE_ENV !== "production" ? GridToolbarDensitySelector.propTypes = {
|
|
123
|
+
// ----------------------------- Warning --------------------------------
|
|
124
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
125
|
+
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
126
|
+
// ----------------------------------------------------------------------
|
|
127
|
+
/**
|
|
128
|
+
* The props used for each slot inside.
|
|
129
|
+
* @default {}
|
|
130
|
+
*/
|
|
131
|
+
slotProps: PropTypes.object
|
|
132
|
+
} : void 0;
|
|
133
|
+
export { GridToolbarDensitySelector };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
3
4
|
import { GridCsvExportOptions, GridPrintExportOptions } from '../../models/gridExport';
|
|
4
5
|
export interface GridExportDisplayOptions {
|
|
5
6
|
/**
|
|
@@ -14,9 +15,17 @@ export interface GridExportMenuItemProps<Options extends {}> {
|
|
|
14
15
|
}
|
|
15
16
|
export type GridCsvExportMenuItemProps = GridExportMenuItemProps<GridCsvExportOptions>;
|
|
16
17
|
export type GridPrintExportMenuItemProps = GridExportMenuItemProps<GridPrintExportOptions>;
|
|
17
|
-
export interface GridToolbarExportProps
|
|
18
|
+
export interface GridToolbarExportProps {
|
|
18
19
|
csvOptions?: GridCsvExportOptions & GridExportDisplayOptions;
|
|
19
20
|
printOptions?: GridPrintExportOptions & GridExportDisplayOptions;
|
|
21
|
+
/**
|
|
22
|
+
* The props used for each slot inside.
|
|
23
|
+
* @default {}
|
|
24
|
+
*/
|
|
25
|
+
slotProps?: {
|
|
26
|
+
button?: Partial<ButtonProps>;
|
|
27
|
+
tooltip?: Partial<TooltipProps>;
|
|
28
|
+
};
|
|
20
29
|
[key: string]: any;
|
|
21
30
|
}
|
|
22
31
|
export declare function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps): React.JSX.Element;
|
|
@@ -70,6 +70,11 @@ process.env.NODE_ENV !== "production" ? GridToolbarExport.propTypes = {
|
|
|
70
70
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
71
71
|
// ----------------------------------------------------------------------
|
|
72
72
|
csvOptions: PropTypes.object,
|
|
73
|
-
printOptions: PropTypes.object
|
|
73
|
+
printOptions: PropTypes.object,
|
|
74
|
+
/**
|
|
75
|
+
* The props used for each slot inside.
|
|
76
|
+
* @default {}
|
|
77
|
+
*/
|
|
78
|
+
slotProps: PropTypes.object
|
|
74
79
|
} : void 0;
|
|
75
80
|
export { GridToolbarExport };
|
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ButtonProps } from '@mui/material/Button';
|
|
3
|
-
|
|
3
|
+
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
+
interface GridToolbarExportContainerProps {
|
|
5
|
+
/**
|
|
6
|
+
* The props used for each slot inside.
|
|
7
|
+
* @default {}
|
|
8
|
+
*/
|
|
9
|
+
slotProps?: {
|
|
10
|
+
button?: Partial<ButtonProps>;
|
|
11
|
+
tooltip?: Partial<TooltipProps>;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<GridToolbarExportContainerProps & {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export { GridToolbarExportContainer };
|