@mui/x-data-grid 8.0.0-beta.1 → 8.0.0-beta.3
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 +235 -0
- package/DataGrid/DataGrid.js +10 -2
- package/DataGrid/useDataGridProps.js +1 -1
- package/components/GridRow.js +3 -8
- package/components/GridScrollArea.js +4 -4
- package/components/GridShadowScrollArea.js +43 -35
- package/components/GridSkeletonLoadingOverlay.js +1 -1
- package/components/cell/GridActionsCellItem.d.ts +24 -13
- package/components/cell/GridActionsCellItem.js +5 -2
- package/components/cell/GridBooleanCell.d.ts +1 -2
- package/components/cell/GridEditSingleSelectCell.d.ts +4 -4
- package/components/cell/GridEditSingleSelectCell.js +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnsManagement/GridColumnsManagement.js +1 -24
- package/components/columnsPanel/ColumnsPanelTrigger.js +4 -129
- package/components/containers/GridToolbarContainer.js +5 -3
- package/components/export/ExportCsv.js +4 -129
- package/components/export/ExportPrint.js +4 -129
- package/components/filterPanel/FilterPanelTrigger.js +4 -129
- package/components/panel/GridPanel.d.ts +2 -2
- package/components/panel/GridPanel.js +1 -1
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/quickFilter/QuickFilter.d.ts +26 -3
- package/components/quickFilter/QuickFilter.js +103 -19
- package/components/quickFilter/QuickFilterClear.js +13 -104
- package/components/quickFilter/QuickFilterContext.d.ts +4 -1
- package/components/quickFilter/QuickFilterControl.js +36 -12
- package/components/quickFilter/QuickFilterTrigger.d.ts +28 -0
- package/components/quickFilter/QuickFilterTrigger.js +86 -0
- package/components/quickFilter/index.d.ts +2 -1
- package/components/quickFilter/index.js +11 -0
- package/components/toolbar/GridToolbar.js +4 -1
- package/components/toolbar/GridToolbarColumnsButton.d.ts +3 -4
- package/components/toolbar/GridToolbarDensitySelector.d.ts +3 -4
- package/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/components/toolbar/GridToolbarExport.d.ts +3 -4
- package/components/toolbar/GridToolbarExportContainer.d.ts +3 -4
- package/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/components/toolbar/GridToolbarFilterButton.d.ts +4 -6
- package/components/toolbar/GridToolbarFilterButton.js +1 -4
- package/components/toolbar/GridToolbarQuickFilter.js +100 -41
- package/components/toolbarV8/GridToolbar.d.ts +6 -1
- package/components/toolbarV8/GridToolbar.js +85 -27
- package/components/toolbarV8/Toolbar.d.ts +1 -1
- package/components/toolbarV8/Toolbar.js +78 -23
- package/components/toolbarV8/ToolbarButton.js +37 -114
- package/components/toolbarV8/ToolbarContext.d.ts +4 -2
- package/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -2
- package/constants/cssVariables.d.ts +3 -0
- package/constants/cssVariables.js +2 -1
- package/constants/gridClasses.d.ts +20 -0
- package/constants/gridClasses.js +1 -1
- package/esm/DataGrid/DataGrid.js +10 -2
- package/esm/DataGrid/useDataGridProps.js +1 -1
- package/esm/components/GridRow.js +4 -9
- package/esm/components/GridScrollArea.js +4 -4
- package/esm/components/GridShadowScrollArea.js +43 -35
- package/esm/components/GridSkeletonLoadingOverlay.js +2 -2
- package/esm/components/cell/GridActionsCellItem.d.ts +24 -13
- package/esm/components/cell/GridActionsCellItem.js +4 -3
- package/esm/components/cell/GridBooleanCell.d.ts +1 -2
- package/esm/components/cell/GridEditSingleSelectCell.d.ts +4 -4
- package/esm/components/cell/GridEditSingleSelectCell.js +1 -1
- package/esm/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/esm/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/esm/components/columnsManagement/GridColumnsManagement.js +1 -24
- package/esm/components/columnsPanel/ColumnsPanelTrigger.js +4 -129
- package/esm/components/containers/GridToolbarContainer.js +5 -3
- package/esm/components/export/ExportCsv.js +4 -129
- package/esm/components/export/ExportPrint.js +4 -129
- package/esm/components/filterPanel/FilterPanelTrigger.js +4 -129
- package/esm/components/panel/GridPanel.d.ts +2 -2
- package/esm/components/panel/GridPanel.js +1 -1
- package/esm/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/esm/components/quickFilter/QuickFilter.d.ts +26 -3
- package/esm/components/quickFilter/QuickFilter.js +101 -17
- package/esm/components/quickFilter/QuickFilterClear.js +13 -104
- package/esm/components/quickFilter/QuickFilterContext.d.ts +4 -1
- package/esm/components/quickFilter/QuickFilterControl.js +36 -12
- package/esm/components/quickFilter/QuickFilterTrigger.d.ts +28 -0
- package/esm/components/quickFilter/QuickFilterTrigger.js +79 -0
- package/esm/components/quickFilter/index.d.ts +2 -1
- package/esm/components/quickFilter/index.js +2 -1
- package/esm/components/toolbar/GridToolbar.js +4 -1
- package/esm/components/toolbar/GridToolbarColumnsButton.d.ts +3 -4
- package/esm/components/toolbar/GridToolbarDensitySelector.d.ts +3 -4
- package/esm/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/esm/components/toolbar/GridToolbarExport.d.ts +3 -4
- package/esm/components/toolbar/GridToolbarExportContainer.d.ts +3 -4
- package/esm/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/esm/components/toolbar/GridToolbarFilterButton.d.ts +4 -6
- package/esm/components/toolbar/GridToolbarFilterButton.js +1 -4
- package/esm/components/toolbar/GridToolbarQuickFilter.js +101 -44
- package/esm/components/toolbarV8/GridToolbar.d.ts +6 -1
- package/esm/components/toolbarV8/GridToolbar.js +83 -27
- package/esm/components/toolbarV8/Toolbar.d.ts +1 -1
- package/esm/components/toolbarV8/Toolbar.js +77 -22
- package/esm/components/toolbarV8/ToolbarButton.js +37 -114
- package/esm/components/toolbarV8/ToolbarContext.d.ts +4 -2
- package/esm/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/esm/components/virtualization/GridVirtualScroller.js +2 -2
- package/esm/constants/cssVariables.d.ts +3 -0
- package/esm/constants/cssVariables.js +2 -1
- package/esm/constants/gridClasses.d.ts +20 -0
- package/esm/constants/gridClasses.js +1 -1
- package/esm/hooks/core/gridCoreSelector.d.ts +1 -1
- package/esm/hooks/core/gridPropsSelectors.d.ts +1 -1
- package/esm/hooks/features/clipboard/useGridClipboard.js +2 -2
- package/esm/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +5 -5
- package/esm/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/esm/hooks/features/columnGrouping/useGridColumnGrouping.js +4 -4
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/esm/hooks/features/columnMenu/columnMenuSelector.d.ts +1 -1
- package/esm/hooks/features/columnMenu/useGridColumnMenu.js +4 -4
- package/esm/hooks/features/columnResize/columnResizeSelector.d.ts +2 -2
- package/esm/hooks/features/columnResize/useGridColumnResize.js +7 -7
- package/esm/hooks/features/columns/gridColumnsSelector.d.ts +14 -14
- package/esm/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/esm/hooks/features/columns/gridColumnsUtils.js +1 -1
- package/esm/hooks/features/columns/useGridColumnSpanning.js +2 -2
- package/esm/hooks/features/columns/useGridColumns.js +2 -3
- package/esm/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -4
- package/esm/hooks/features/dataSource/useGridDataSource.js +1 -1
- package/esm/hooks/features/density/densitySelector.d.ts +2 -2
- package/esm/hooks/features/dimensions/gridDimensionsSelectors.d.ts +13 -13
- package/esm/hooks/features/dimensions/useGridDimensions.js +5 -5
- package/esm/hooks/features/editing/gridEditingSelectors.d.ts +4 -4
- package/esm/hooks/features/editing/useGridCellEditing.js +8 -8
- package/esm/hooks/features/editing/useGridRowEditing.js +9 -9
- package/esm/hooks/features/events/useGridEvents.js +18 -18
- package/esm/hooks/features/filter/gridFilterSelector.d.ts +18 -18
- package/esm/hooks/features/filter/useGridFilter.js +7 -7
- package/esm/hooks/features/focus/gridFocusStateSelector.d.ts +10 -10
- package/esm/hooks/features/focus/useGridFocus.js +10 -10
- package/esm/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -4
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/esm/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -6
- package/esm/hooks/features/listView/gridListViewSelectors.d.ts +1 -1
- package/esm/hooks/features/listView/useGridListView.d.ts +4 -4
- package/esm/hooks/features/listView/useGridListView.js +9 -9
- package/esm/hooks/features/pagination/gridPaginationSelector.d.ts +14 -14
- package/esm/hooks/features/pagination/useGridPaginationModel.js +7 -7
- package/esm/hooks/features/pagination/useGridRowCount.js +2 -2
- package/esm/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +2 -2
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +4 -4
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +8 -8
- package/esm/hooks/features/rowSelection/utils.d.ts +1 -1
- package/esm/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/esm/hooks/features/rows/gridRowsMetaSelector.d.ts +1 -1
- package/esm/hooks/features/rows/gridRowsSelector.d.ts +21 -20
- package/esm/hooks/features/rows/gridRowsSelector.js +7 -0
- package/esm/hooks/features/rows/useGridParamsApi.js +2 -2
- package/esm/hooks/features/rows/useGridRowSpanning.js +6 -6
- package/esm/hooks/features/rows/useGridRows.js +5 -5
- package/esm/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/esm/hooks/features/scroll/useGridScroll.js +2 -2
- package/esm/hooks/features/sorting/gridSortingSelector.d.ts +5 -5
- package/esm/hooks/features/sorting/useGridSorting.js +6 -6
- package/esm/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +2 -2
- package/esm/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +6 -6
- package/esm/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
- package/esm/hooks/utils/index.d.ts +1 -1
- package/esm/hooks/utils/index.js +1 -1
- package/esm/hooks/utils/useGridAriaAttributes.js +6 -0
- package/esm/hooks/utils/{useGridApiEventHandler.d.ts → useGridEvent.d.ts} +2 -2
- package/{modern/hooks/utils/useGridApiEventHandler.js → esm/hooks/utils/useGridEvent.js} +3 -3
- package/esm/hooks/utils/useGridNativeEventListener.js +2 -2
- package/esm/hooks/utils/useGridVisibleRows.d.ts +4 -4
- package/esm/index.js +1 -1
- package/esm/locales/deDE.js +13 -13
- package/esm/material/augmentation.d.ts +74 -0
- package/esm/material/augmentation.js +1 -0
- package/esm/material/index.d.ts +1 -0
- package/esm/material/index.js +262 -141
- package/esm/material/variables.js +2 -0
- package/esm/models/colDef/gridColDef.d.ts +1 -1
- package/esm/models/colDef/index.d.ts +1 -1
- package/esm/models/gridBaseSlots.d.ts +25 -36
- package/esm/models/gridSlotsComponentsProps.d.ts +1 -19
- package/esm/models/props/DataGridProps.d.ts +20 -10
- package/esm/utils/utils.d.ts +0 -27
- package/esm/utils/utils.js +0 -122
- package/hooks/core/gridCoreSelector.d.ts +1 -1
- package/hooks/core/gridPropsSelectors.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +5 -5
- package/hooks/features/columnGrouping/gridColumnGroupsUtils.js +2 -2
- package/hooks/features/columnGrouping/useGridColumnGrouping.js +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/hooks/features/columnMenu/columnMenuSelector.d.ts +1 -1
- package/hooks/features/columnMenu/useGridColumnMenu.js +3 -3
- package/hooks/features/columnResize/columnResizeSelector.d.ts +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/hooks/features/columns/gridColumnsSelector.d.ts +14 -14
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +1 -1
- package/hooks/features/columns/useGridColumnSpanning.js +2 -2
- package/hooks/features/columns/useGridColumns.js +2 -3
- package/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -4
- package/hooks/features/dataSource/useGridDataSource.js +2 -2
- package/hooks/features/density/densitySelector.d.ts +2 -2
- package/hooks/features/dimensions/gridDimensionsSelectors.d.ts +13 -13
- package/hooks/features/dimensions/useGridDimensions.js +6 -6
- package/hooks/features/editing/gridEditingSelectors.d.ts +4 -4
- package/hooks/features/editing/useGridCellEditing.js +8 -8
- package/hooks/features/editing/useGridRowEditing.js +9 -9
- package/hooks/features/events/useGridEvents.js +18 -18
- package/hooks/features/filter/gridFilterSelector.d.ts +18 -18
- package/hooks/features/filter/useGridFilter.js +9 -9
- package/hooks/features/focus/gridFocusStateSelector.d.ts +10 -10
- package/hooks/features/focus/useGridFocus.js +10 -10
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -4
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -6
- package/hooks/features/listView/gridListViewSelectors.d.ts +1 -1
- package/hooks/features/listView/useGridListView.d.ts +4 -4
- package/hooks/features/listView/useGridListView.js +9 -9
- package/hooks/features/pagination/gridPaginationSelector.d.ts +14 -14
- package/hooks/features/pagination/useGridPaginationModel.js +7 -7
- package/hooks/features/pagination/useGridRowCount.js +1 -1
- package/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +2 -2
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +4 -4
- package/hooks/features/rowSelection/useGridRowSelection.js +8 -8
- package/hooks/features/rowSelection/utils.d.ts +1 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/hooks/features/rows/gridRowsMetaSelector.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.d.ts +21 -20
- package/hooks/features/rows/gridRowsSelector.js +8 -1
- package/hooks/features/rows/useGridParamsApi.js +2 -2
- package/hooks/features/rows/useGridRowSpanning.js +6 -6
- package/hooks/features/rows/useGridRows.js +4 -4
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.js +2 -2
- package/hooks/features/sorting/gridSortingSelector.d.ts +5 -5
- package/hooks/features/sorting/useGridSorting.js +6 -6
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +2 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +6 -6
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -6
- package/hooks/utils/index.d.ts +1 -1
- package/hooks/utils/index.js +8 -8
- package/hooks/utils/useGridAriaAttributes.js +6 -0
- package/{modern/hooks/utils/useGridApiEventHandler.d.ts → hooks/utils/useGridEvent.d.ts} +2 -2
- package/hooks/utils/{useGridApiEventHandler.js → useGridEvent.js} +5 -5
- package/hooks/utils/useGridNativeEventListener.js +2 -2
- package/hooks/utils/useGridVisibleRows.d.ts +4 -4
- package/index.js +1 -1
- package/locales/deDE.js +13 -13
- package/material/augmentation.d.ts +74 -0
- package/material/augmentation.js +5 -0
- package/material/index.d.ts +1 -0
- package/material/index.js +261 -141
- package/material/variables.js +2 -0
- package/models/colDef/gridColDef.d.ts +1 -1
- package/models/colDef/index.d.ts +1 -1
- package/models/gridBaseSlots.d.ts +25 -36
- package/models/gridSlotsComponentsProps.d.ts +1 -19
- package/models/props/DataGridProps.d.ts +20 -10
- package/modern/DataGrid/DataGrid.js +10 -2
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/components/GridRow.js +4 -9
- package/modern/components/GridScrollArea.js +4 -4
- package/modern/components/GridShadowScrollArea.js +43 -35
- package/modern/components/GridSkeletonLoadingOverlay.js +2 -2
- package/modern/components/cell/GridActionsCellItem.d.ts +24 -13
- package/modern/components/cell/GridActionsCellItem.js +4 -3
- package/modern/components/cell/GridBooleanCell.d.ts +1 -2
- package/modern/components/cell/GridEditSingleSelectCell.d.ts +4 -4
- package/modern/components/cell/GridEditSingleSelectCell.js +1 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/modern/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/modern/components/columnsManagement/GridColumnsManagement.js +1 -24
- package/modern/components/columnsPanel/ColumnsPanelTrigger.js +4 -129
- package/modern/components/containers/GridToolbarContainer.js +5 -3
- package/modern/components/export/ExportCsv.js +4 -129
- package/modern/components/export/ExportPrint.js +4 -129
- package/modern/components/filterPanel/FilterPanelTrigger.js +4 -129
- package/modern/components/panel/GridPanel.d.ts +2 -2
- package/modern/components/panel/GridPanel.js +1 -1
- package/modern/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/modern/components/quickFilter/QuickFilter.d.ts +26 -3
- package/modern/components/quickFilter/QuickFilter.js +101 -17
- package/modern/components/quickFilter/QuickFilterClear.js +13 -104
- package/modern/components/quickFilter/QuickFilterContext.d.ts +4 -1
- package/modern/components/quickFilter/QuickFilterControl.js +36 -12
- package/modern/components/quickFilter/QuickFilterTrigger.d.ts +28 -0
- package/modern/components/quickFilter/QuickFilterTrigger.js +79 -0
- package/modern/components/quickFilter/index.d.ts +2 -1
- package/modern/components/quickFilter/index.js +2 -1
- package/modern/components/toolbar/GridToolbar.js +4 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.d.ts +3 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.d.ts +3 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +1 -1
- package/modern/components/toolbar/GridToolbarExport.d.ts +3 -4
- package/modern/components/toolbar/GridToolbarExportContainer.d.ts +3 -4
- package/modern/components/toolbar/GridToolbarExportContainer.js +1 -1
- package/modern/components/toolbar/GridToolbarFilterButton.d.ts +4 -6
- package/modern/components/toolbar/GridToolbarFilterButton.js +1 -4
- package/modern/components/toolbar/GridToolbarQuickFilter.js +101 -44
- package/modern/components/toolbarV8/GridToolbar.d.ts +6 -1
- package/modern/components/toolbarV8/GridToolbar.js +83 -27
- package/modern/components/toolbarV8/Toolbar.d.ts +1 -1
- package/modern/components/toolbarV8/Toolbar.js +77 -22
- package/modern/components/toolbarV8/ToolbarButton.js +37 -114
- package/modern/components/toolbarV8/ToolbarContext.d.ts +4 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -2
- package/modern/constants/cssVariables.d.ts +3 -0
- package/modern/constants/cssVariables.js +2 -1
- package/modern/constants/gridClasses.d.ts +20 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/core/gridCoreSelector.d.ts +1 -1
- package/modern/hooks/core/gridPropsSelectors.d.ts +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +2 -2
- package/modern/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +5 -5
- package/modern/hooks/features/columnGrouping/gridColumnGroupsUtils.js +1 -1
- package/modern/hooks/features/columnGrouping/useGridColumnGrouping.js +4 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/modern/hooks/features/columnMenu/columnMenuSelector.d.ts +1 -1
- package/modern/hooks/features/columnMenu/useGridColumnMenu.js +4 -4
- package/modern/hooks/features/columnResize/columnResizeSelector.d.ts +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +7 -7
- package/modern/hooks/features/columns/gridColumnsSelector.d.ts +14 -14
- package/modern/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +1 -1
- package/modern/hooks/features/columns/useGridColumnSpanning.js +2 -2
- package/modern/hooks/features/columns/useGridColumns.js +2 -3
- package/modern/hooks/features/dataSource/gridDataSourceSelector.d.ts +4 -4
- package/modern/hooks/features/dataSource/useGridDataSource.js +1 -1
- package/modern/hooks/features/density/densitySelector.d.ts +2 -2
- package/modern/hooks/features/dimensions/gridDimensionsSelectors.d.ts +13 -13
- package/modern/hooks/features/dimensions/useGridDimensions.js +5 -5
- package/modern/hooks/features/editing/gridEditingSelectors.d.ts +4 -4
- package/modern/hooks/features/editing/useGridCellEditing.js +8 -8
- package/modern/hooks/features/editing/useGridRowEditing.js +9 -9
- package/modern/hooks/features/events/useGridEvents.js +18 -18
- package/modern/hooks/features/filter/gridFilterSelector.d.ts +18 -18
- package/modern/hooks/features/filter/useGridFilter.js +7 -7
- package/modern/hooks/features/focus/gridFocusStateSelector.d.ts +10 -10
- package/modern/hooks/features/focus/useGridFocus.js +10 -10
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -4
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +6 -6
- package/modern/hooks/features/listView/gridListViewSelectors.d.ts +1 -1
- package/modern/hooks/features/listView/useGridListView.d.ts +4 -4
- package/modern/hooks/features/listView/useGridListView.js +9 -9
- package/modern/hooks/features/pagination/gridPaginationSelector.d.ts +14 -14
- package/modern/hooks/features/pagination/useGridPaginationModel.js +7 -7
- package/modern/hooks/features/pagination/useGridRowCount.js +2 -2
- package/modern/hooks/features/preferencesPanel/gridPreferencePanelSelector.d.ts +2 -2
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +4 -4
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +8 -8
- package/modern/hooks/features/rowSelection/utils.d.ts +1 -1
- package/modern/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
- package/modern/hooks/features/rows/gridRowsMetaSelector.d.ts +1 -1
- package/modern/hooks/features/rows/gridRowsSelector.d.ts +21 -20
- package/modern/hooks/features/rows/gridRowsSelector.js +7 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +2 -2
- package/modern/hooks/features/rows/useGridRowSpanning.js +6 -6
- package/modern/hooks/features/rows/useGridRows.js +5 -5
- package/modern/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/modern/hooks/features/scroll/useGridScroll.js +2 -2
- package/modern/hooks/features/sorting/gridSortingSelector.d.ts +5 -5
- package/modern/hooks/features/sorting/useGridSorting.js +6 -6
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +2 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +6 -6
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +19 -8
- package/modern/hooks/utils/index.d.ts +1 -1
- package/modern/hooks/utils/index.js +1 -1
- package/modern/hooks/utils/useGridAriaAttributes.js +6 -0
- package/{hooks/utils/useGridApiEventHandler.d.ts → modern/hooks/utils/useGridEvent.d.ts} +2 -2
- package/{esm/hooks/utils/useGridApiEventHandler.js → modern/hooks/utils/useGridEvent.js} +3 -3
- package/modern/hooks/utils/useGridNativeEventListener.js +2 -2
- package/modern/hooks/utils/useGridVisibleRows.d.ts +4 -4
- package/modern/index.js +1 -1
- package/modern/locales/deDE.js +13 -13
- package/modern/material/augmentation.d.ts +74 -0
- package/modern/material/augmentation.js +1 -0
- package/modern/material/index.d.ts +1 -0
- package/modern/material/index.js +262 -141
- package/modern/material/variables.js +2 -0
- package/modern/models/colDef/gridColDef.d.ts +1 -1
- package/modern/models/colDef/index.d.ts +1 -1
- package/modern/models/gridBaseSlots.d.ts +25 -36
- package/modern/models/gridSlotsComponentsProps.d.ts +1 -19
- package/modern/models/props/DataGridProps.d.ts +20 -10
- package/modern/utils/utils.d.ts +0 -27
- package/modern/utils/utils.js +0 -122
- package/package.json +6 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/utils.d.ts +0 -27
- package/utils/utils.js +0 -123
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["className"],
|
|
4
|
+
_excluded2 = ["className"];
|
|
2
5
|
import * as React from 'react';
|
|
3
6
|
import PropTypes from 'prop-types';
|
|
4
|
-
import Menu from '@mui/material/Menu';
|
|
5
7
|
import useId from '@mui/utils/useId';
|
|
6
8
|
import { styled } from '@mui/system';
|
|
9
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
+
import { GridMenu } from "../menu/GridMenu.js";
|
|
7
11
|
import { Toolbar } from "./Toolbar.js";
|
|
8
12
|
import { ToolbarButton } from "./ToolbarButton.js";
|
|
9
13
|
import { FilterPanelTrigger } from "../filterPanel/index.js";
|
|
@@ -14,7 +18,18 @@ import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
|
14
18
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
15
19
|
import { NotRendered } from "../../utils/assert.js";
|
|
16
20
|
import { vars } from "../../constants/cssVariables.js";
|
|
21
|
+
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
17
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
const useUtilityClasses = ownerState => {
|
|
24
|
+
const {
|
|
25
|
+
classes
|
|
26
|
+
} = ownerState;
|
|
27
|
+
const slots = {
|
|
28
|
+
divider: ['toolbarDivider'],
|
|
29
|
+
label: ['toolbarLabel']
|
|
30
|
+
};
|
|
31
|
+
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
32
|
+
};
|
|
18
33
|
const Divider = styled(NotRendered, {
|
|
19
34
|
name: 'MuiDataGrid',
|
|
20
35
|
slot: 'ToolbarDivider'
|
|
@@ -22,6 +37,44 @@ const Divider = styled(NotRendered, {
|
|
|
22
37
|
height: '50%',
|
|
23
38
|
margin: vars.spacing(0, 0.5)
|
|
24
39
|
});
|
|
40
|
+
const Label = styled('span', {
|
|
41
|
+
name: 'MuiDataGrid',
|
|
42
|
+
slot: 'ToolbarLabel'
|
|
43
|
+
})({
|
|
44
|
+
flex: 1,
|
|
45
|
+
font: vars.typography.font.large,
|
|
46
|
+
fontWeight: vars.typography.fontWeight.medium,
|
|
47
|
+
margin: vars.spacing(0, 0.5),
|
|
48
|
+
textOverflow: 'ellipsis',
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
whiteSpace: 'nowrap'
|
|
51
|
+
});
|
|
52
|
+
function GridToolbarDivider(props) {
|
|
53
|
+
const other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
54
|
+
const rootProps = useGridRootProps();
|
|
55
|
+
const classes = useUtilityClasses(rootProps);
|
|
56
|
+
return /*#__PURE__*/_jsx(Divider, _extends({
|
|
57
|
+
as: rootProps.slots.baseDivider,
|
|
58
|
+
orientation: "vertical",
|
|
59
|
+
className: classes.divider
|
|
60
|
+
}, other));
|
|
61
|
+
}
|
|
62
|
+
process.env.NODE_ENV !== "production" ? GridToolbarDivider.propTypes = {
|
|
63
|
+
// ----------------------------- Warning --------------------------------
|
|
64
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
65
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
66
|
+
// ----------------------------------------------------------------------
|
|
67
|
+
className: PropTypes.string,
|
|
68
|
+
orientation: PropTypes.oneOf(['horizontal', 'vertical'])
|
|
69
|
+
} : void 0;
|
|
70
|
+
function GridToolbarLabel(props) {
|
|
71
|
+
const other = _objectWithoutPropertiesLoose(props, _excluded2);
|
|
72
|
+
const rootProps = useGridRootProps();
|
|
73
|
+
const classes = useUtilityClasses(rootProps);
|
|
74
|
+
return /*#__PURE__*/_jsx(Label, _extends({
|
|
75
|
+
className: classes.label
|
|
76
|
+
}, other));
|
|
77
|
+
}
|
|
25
78
|
function GridToolbar(props) {
|
|
26
79
|
const {
|
|
27
80
|
showQuickFilter = true,
|
|
@@ -39,7 +92,9 @@ function GridToolbar(props) {
|
|
|
39
92
|
const showExportMenu = !csvOptions?.disableToolbarButton || !printOptions?.disableToolbarButton || additionalExportMenuItems;
|
|
40
93
|
const closeExportMenu = () => setExportMenuOpen(false);
|
|
41
94
|
return /*#__PURE__*/_jsxs(Toolbar, {
|
|
42
|
-
children: [
|
|
95
|
+
children: [rootProps.label && /*#__PURE__*/_jsx(GridToolbarLabel, {
|
|
96
|
+
children: rootProps.label
|
|
97
|
+
}), !rootProps.disableColumnSelector && /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
43
98
|
title: apiRef.current.getLocaleText('toolbarColumns'),
|
|
44
99
|
children: /*#__PURE__*/_jsx(ColumnsPanelTrigger, {
|
|
45
100
|
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
@@ -51,7 +106,6 @@ function GridToolbar(props) {
|
|
|
51
106
|
title: apiRef.current.getLocaleText('toolbarFilters'),
|
|
52
107
|
children: /*#__PURE__*/_jsx(FilterPanelTrigger, {
|
|
53
108
|
render: (triggerProps, state) => /*#__PURE__*/_jsx(ToolbarButton, _extends({}, triggerProps, {
|
|
54
|
-
color: "default",
|
|
55
109
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
56
110
|
badgeContent: state.filterCount,
|
|
57
111
|
color: "primary",
|
|
@@ -62,10 +116,7 @@ function GridToolbar(props) {
|
|
|
62
116
|
})
|
|
63
117
|
}))
|
|
64
118
|
})
|
|
65
|
-
}), showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/_jsx(
|
|
66
|
-
as: rootProps.slots.baseDivider,
|
|
67
|
-
orientation: "vertical"
|
|
68
|
-
}), showExportMenu && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
119
|
+
}), showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/_jsx(GridToolbarDivider, {}), showExportMenu && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
69
120
|
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
70
121
|
title: apiRef.current.getLocaleText('toolbarExport'),
|
|
71
122
|
children: /*#__PURE__*/_jsx(ToolbarButton, {
|
|
@@ -74,32 +125,37 @@ function GridToolbar(props) {
|
|
|
74
125
|
"aria-controls": exportMenuId,
|
|
75
126
|
"aria-haspopup": "true",
|
|
76
127
|
"aria-expanded": exportMenuOpen ? 'true' : undefined,
|
|
77
|
-
onClick: () => setExportMenuOpen(
|
|
128
|
+
onClick: () => setExportMenuOpen(!exportMenuOpen),
|
|
78
129
|
children: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {
|
|
79
130
|
fontSize: "small"
|
|
80
131
|
})
|
|
81
132
|
})
|
|
82
|
-
}), /*#__PURE__*/
|
|
83
|
-
|
|
84
|
-
anchorEl: exportMenuTriggerRef.current,
|
|
133
|
+
}), /*#__PURE__*/_jsx(GridMenu, {
|
|
134
|
+
target: exportMenuTriggerRef.current,
|
|
85
135
|
open: exportMenuOpen,
|
|
86
136
|
onClose: closeExportMenu,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
137
|
+
position: "bottom-end",
|
|
138
|
+
children: /*#__PURE__*/_jsxs(rootProps.slots.baseMenuList, _extends({
|
|
139
|
+
id: exportMenuId,
|
|
140
|
+
"aria-labelledby": exportMenuTriggerId,
|
|
141
|
+
autoFocusItem: true
|
|
142
|
+
}, rootProps.slotProps?.baseMenuList, {
|
|
143
|
+
children: [!printOptions?.disableToolbarButton && /*#__PURE__*/_jsx(ExportPrint, {
|
|
144
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({}, rootProps.slotProps?.baseMenuItem)),
|
|
145
|
+
options: printOptions,
|
|
146
|
+
onClick: closeExportMenu,
|
|
147
|
+
children: apiRef.current.getLocaleText('toolbarExportPrint')
|
|
148
|
+
}), !csvOptions?.disableToolbarButton && /*#__PURE__*/_jsx(ExportCsv, {
|
|
149
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({}, rootProps.slotProps?.baseMenuItem)),
|
|
150
|
+
options: csvOptions,
|
|
151
|
+
onClick: closeExportMenu,
|
|
152
|
+
children: apiRef.current.getLocaleText('toolbarExportCSV')
|
|
153
|
+
}), additionalExportMenuItems?.(closeExportMenu)]
|
|
154
|
+
}))
|
|
101
155
|
})]
|
|
102
|
-
}), showQuickFilter && /*#__PURE__*/
|
|
156
|
+
}), showQuickFilter && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
157
|
+
children: [/*#__PURE__*/_jsx(GridToolbarDivider, {}), /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]
|
|
158
|
+
})]
|
|
103
159
|
});
|
|
104
160
|
}
|
|
105
161
|
process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
@@ -132,4 +188,4 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
|
132
188
|
slotProps: PropTypes.object,
|
|
133
189
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
134
190
|
} : void 0;
|
|
135
|
-
export { GridToolbar };
|
|
191
|
+
export { GridToolbar, GridToolbarDivider, GridToolbarLabel };
|
|
@@ -8,7 +8,7 @@ export type ToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
render?: RenderProp<React.ComponentProps<typeof ToolbarRoot>>;
|
|
9
9
|
};
|
|
10
10
|
type OwnerState = DataGridProcessedProps;
|
|
11
|
-
declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/
|
|
11
|
+
declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme> & {
|
|
12
12
|
ownerState: OwnerState;
|
|
13
13
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
14
14
|
/**
|
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["render", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { styled } from '@mui/
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
@@ -29,8 +29,11 @@ const ToolbarRoot = styled('div', {
|
|
|
29
29
|
flex: 0,
|
|
30
30
|
display: 'flex',
|
|
31
31
|
alignItems: 'center',
|
|
32
|
+
justifyContent: 'end',
|
|
32
33
|
gap: vars.spacing(0.25),
|
|
33
34
|
padding: vars.spacing(0.75),
|
|
35
|
+
minHeight: 52,
|
|
36
|
+
boxSizing: 'border-box',
|
|
34
37
|
borderBottom: `1px solid ${vars.colors.border.base}`
|
|
35
38
|
});
|
|
36
39
|
|
|
@@ -56,47 +59,99 @@ const Toolbar = forwardRef(function Toolbar(props, ref) {
|
|
|
56
59
|
const classes = useUtilityClasses(rootProps);
|
|
57
60
|
const [focusableItemId, setFocusableItemId] = React.useState(null);
|
|
58
61
|
const [items, setItems] = React.useState([]);
|
|
59
|
-
const registerItem = React.useCallback(
|
|
60
|
-
setItems(prevItems => [...prevItems,
|
|
62
|
+
const registerItem = React.useCallback((id, itemRef) => {
|
|
63
|
+
setItems(prevItems => [...prevItems, {
|
|
64
|
+
id,
|
|
65
|
+
ref: itemRef
|
|
66
|
+
}]);
|
|
61
67
|
}, []);
|
|
62
|
-
const unregisterItem = React.useCallback(
|
|
63
|
-
setItems(prevItems => prevItems.filter(i => i !==
|
|
64
|
-
if (focusableItemId ===
|
|
68
|
+
const unregisterItem = React.useCallback(id => {
|
|
69
|
+
setItems(prevItems => prevItems.filter(i => i.id !== id));
|
|
70
|
+
if (focusableItemId === id) {
|
|
65
71
|
setFocusableItemId(null);
|
|
66
72
|
}
|
|
67
73
|
}, [focusableItemId]);
|
|
74
|
+
const findEnabledItem = React.useCallback((startIndex, step, wrap = true) => {
|
|
75
|
+
let index = startIndex;
|
|
76
|
+
const itemCount = items.length;
|
|
77
|
+
|
|
78
|
+
// Look for enabled items in the specified direction
|
|
79
|
+
for (let i = 0; i < itemCount; i += 1) {
|
|
80
|
+
index += step;
|
|
81
|
+
|
|
82
|
+
// Handle wrapping around the ends
|
|
83
|
+
if (index >= itemCount) {
|
|
84
|
+
if (!wrap) {
|
|
85
|
+
return -1;
|
|
86
|
+
}
|
|
87
|
+
index = 0;
|
|
88
|
+
} else if (index < 0) {
|
|
89
|
+
if (!wrap) {
|
|
90
|
+
return -1;
|
|
91
|
+
}
|
|
92
|
+
index = itemCount - 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Return if we found an enabled item
|
|
96
|
+
if (!items[index].ref.current?.disabled && items[index].ref.current?.ariaDisabled !== 'true') {
|
|
97
|
+
return index;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// If we've checked all items and found none enabled
|
|
102
|
+
return -1;
|
|
103
|
+
}, [items]);
|
|
68
104
|
const onItemKeyDown = React.useCallback(event => {
|
|
69
105
|
if (!focusableItemId) {
|
|
70
106
|
return;
|
|
71
107
|
}
|
|
108
|
+
const currentIndex = items.findIndex(item => item.id === focusableItemId);
|
|
109
|
+
let newIndex = -1;
|
|
72
110
|
if (event.key === 'ArrowRight') {
|
|
73
111
|
event.preventDefault();
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
if (event.key === 'ArrowLeft') {
|
|
112
|
+
newIndex = findEnabledItem(currentIndex, 1);
|
|
113
|
+
} else if (event.key === 'ArrowLeft') {
|
|
78
114
|
event.preventDefault();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
if (event.key === 'Home') {
|
|
115
|
+
newIndex = findEnabledItem(currentIndex, -1);
|
|
116
|
+
} else if (event.key === 'Home') {
|
|
83
117
|
event.preventDefault();
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
if (event.key === 'End') {
|
|
118
|
+
newIndex = findEnabledItem(-1, 1, false);
|
|
119
|
+
} else if (event.key === 'End') {
|
|
87
120
|
event.preventDefault();
|
|
88
|
-
|
|
121
|
+
newIndex = findEnabledItem(items.length, -1, false);
|
|
122
|
+
}
|
|
123
|
+
if (newIndex >= 0 && newIndex < items.length) {
|
|
124
|
+
const item = items[newIndex];
|
|
125
|
+
setFocusableItemId(item.id);
|
|
126
|
+
item.ref.current?.focus();
|
|
127
|
+
}
|
|
128
|
+
}, [items, focusableItemId, findEnabledItem]);
|
|
129
|
+
const onItemFocus = React.useCallback(id => {
|
|
130
|
+
if (focusableItemId !== id) {
|
|
131
|
+
setFocusableItemId(id);
|
|
132
|
+
}
|
|
133
|
+
}, [focusableItemId]);
|
|
134
|
+
const onItemDisabled = React.useCallback(id => {
|
|
135
|
+
const currentIndex = items.findIndex(item => item.id === id);
|
|
136
|
+
const newIndex = findEnabledItem(currentIndex, 1);
|
|
137
|
+
if (newIndex >= 0 && newIndex < items.length) {
|
|
138
|
+
const item = items[newIndex];
|
|
139
|
+
setFocusableItemId(item.id);
|
|
140
|
+
item.ref.current?.focus();
|
|
89
141
|
}
|
|
90
|
-
}, [items,
|
|
142
|
+
}, [items, findEnabledItem]);
|
|
91
143
|
const contextValue = React.useMemo(() => ({
|
|
92
144
|
focusableItemId,
|
|
93
145
|
registerItem,
|
|
94
146
|
unregisterItem,
|
|
95
|
-
onItemKeyDown
|
|
96
|
-
|
|
147
|
+
onItemKeyDown,
|
|
148
|
+
onItemFocus,
|
|
149
|
+
onItemDisabled
|
|
150
|
+
}), [focusableItemId, registerItem, unregisterItem, onItemKeyDown, onItemFocus, onItemDisabled]);
|
|
97
151
|
const element = useGridComponentRenderer(ToolbarRoot, render, _extends({
|
|
98
152
|
role: 'toolbar',
|
|
99
153
|
'aria-orientation': 'horizontal',
|
|
154
|
+
'aria-label': rootProps.label || undefined,
|
|
100
155
|
className: clsx(classes.root, className),
|
|
101
156
|
ownerState: rootProps
|
|
102
157
|
}, other, {
|
|
@@ -104,7 +159,7 @@ const Toolbar = forwardRef(function Toolbar(props, ref) {
|
|
|
104
159
|
}));
|
|
105
160
|
React.useEffect(() => {
|
|
106
161
|
if (items.length > 0) {
|
|
107
|
-
setFocusableItemId(items[0]);
|
|
162
|
+
setFocusableItemId(items[0].id);
|
|
108
163
|
}
|
|
109
164
|
}, [items]);
|
|
110
165
|
return /*#__PURE__*/_jsx(ToolbarContext.Provider, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["render"];
|
|
3
|
+
const _excluded = ["render", "onKeyDown", "onFocus", "disabled", "aria-disabled"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
@@ -24,7 +24,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
24
24
|
*/
|
|
25
25
|
const ToolbarButton = forwardRef(function ToolbarButton(props, ref) {
|
|
26
26
|
const {
|
|
27
|
-
render
|
|
27
|
+
render,
|
|
28
|
+
onKeyDown,
|
|
29
|
+
onFocus,
|
|
30
|
+
disabled,
|
|
31
|
+
'aria-disabled': ariaDisabled
|
|
28
32
|
} = props,
|
|
29
33
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
34
|
const id = useId();
|
|
@@ -35,28 +39,44 @@ const ToolbarButton = forwardRef(function ToolbarButton(props, ref) {
|
|
|
35
39
|
focusableItemId,
|
|
36
40
|
registerItem,
|
|
37
41
|
unregisterItem,
|
|
38
|
-
onItemKeyDown
|
|
42
|
+
onItemKeyDown,
|
|
43
|
+
onItemFocus,
|
|
44
|
+
onItemDisabled
|
|
39
45
|
} = useToolbarContext();
|
|
46
|
+
const handleKeyDown = event => {
|
|
47
|
+
onItemKeyDown(event);
|
|
48
|
+
onKeyDown?.(event);
|
|
49
|
+
};
|
|
50
|
+
const handleFocus = event => {
|
|
51
|
+
onItemFocus(id);
|
|
52
|
+
onFocus?.(event);
|
|
53
|
+
};
|
|
40
54
|
React.useEffect(() => {
|
|
41
|
-
registerItem(id);
|
|
55
|
+
registerItem(id, buttonRef);
|
|
42
56
|
return () => unregisterItem(id);
|
|
43
57
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
44
58
|
}, []);
|
|
45
|
-
const
|
|
59
|
+
const previousDisabled = React.useRef(disabled);
|
|
46
60
|
React.useEffect(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
isInitialFocus.current = false;
|
|
50
|
-
return;
|
|
61
|
+
if (previousDisabled.current !== disabled && disabled === true) {
|
|
62
|
+
onItemDisabled(id, disabled);
|
|
51
63
|
}
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
previousDisabled.current = disabled;
|
|
65
|
+
}, [disabled, id, onItemDisabled]);
|
|
66
|
+
const previousAriaDisabled = React.useRef(ariaDisabled);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
if (previousAriaDisabled.current !== ariaDisabled && ariaDisabled === true) {
|
|
69
|
+
onItemDisabled(id, true);
|
|
54
70
|
}
|
|
55
|
-
|
|
71
|
+
previousAriaDisabled.current = ariaDisabled;
|
|
72
|
+
}, [ariaDisabled, id, onItemDisabled]);
|
|
56
73
|
const element = useGridComponentRenderer(rootProps.slots.baseIconButton, render, _extends({}, rootProps.slotProps?.baseIconButton, {
|
|
57
|
-
tabIndex: focusableItemId === id ? 0 : -1
|
|
58
|
-
onKeyDown: onItemKeyDown
|
|
74
|
+
tabIndex: focusableItemId === id ? 0 : -1
|
|
59
75
|
}, other, {
|
|
76
|
+
disabled,
|
|
77
|
+
'aria-disabled': ariaDisabled,
|
|
78
|
+
onKeyDown: handleKeyDown,
|
|
79
|
+
onFocus: handleFocus,
|
|
60
80
|
ref: handleRef
|
|
61
81
|
}));
|
|
62
82
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
@@ -68,118 +88,21 @@ process.env.NODE_ENV !== "production" ? ToolbarButton.propTypes = {
|
|
|
68
88
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
69
89
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
70
90
|
// ----------------------------------------------------------------------
|
|
71
|
-
/**
|
|
72
|
-
* A ref for imperative actions.
|
|
73
|
-
* It currently only supports `focusVisible()` action.
|
|
74
|
-
*/
|
|
75
|
-
action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
76
|
-
current: PropTypes.shape({
|
|
77
|
-
focusVisible: PropTypes.func.isRequired
|
|
78
|
-
})
|
|
79
|
-
})]),
|
|
80
|
-
/**
|
|
81
|
-
* If `true`, the ripples are centered.
|
|
82
|
-
* They won't start at the cursor interaction position.
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
centerRipple: PropTypes.bool,
|
|
86
91
|
className: PropTypes.string,
|
|
87
|
-
/**
|
|
88
|
-
* The color of the component.
|
|
89
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
90
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
91
|
-
*/
|
|
92
92
|
color: PropTypes.oneOf(['default', 'inherit', 'primary']),
|
|
93
|
-
component: PropTypes.elementType,
|
|
94
|
-
/**
|
|
95
|
-
* If `true`, the component is disabled.
|
|
96
|
-
*/
|
|
97
93
|
disabled: PropTypes.bool,
|
|
98
|
-
/**
|
|
99
|
-
* If `true`, the keyboard focus ripple is disabled.
|
|
100
|
-
* @default false
|
|
101
|
-
*/
|
|
102
|
-
disableFocusRipple: PropTypes.bool,
|
|
103
|
-
/**
|
|
104
|
-
* If `true`, the ripple effect is disabled.
|
|
105
|
-
*
|
|
106
|
-
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
107
|
-
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
108
|
-
* @default false
|
|
109
|
-
*/
|
|
110
|
-
disableRipple: PropTypes.bool,
|
|
111
|
-
/**
|
|
112
|
-
* If `true`, the touch ripple effect is disabled.
|
|
113
|
-
* @default false
|
|
114
|
-
*/
|
|
115
|
-
disableTouchRipple: PropTypes.bool,
|
|
116
|
-
/**
|
|
117
|
-
* If given, uses a negative margin to counteract the padding on one
|
|
118
|
-
* side (this is often helpful for aligning the left or right
|
|
119
|
-
* side of the icon with content above or below, without ruining the border
|
|
120
|
-
* size and shape).
|
|
121
|
-
*/
|
|
122
94
|
edge: PropTypes.oneOf(['end', 'start', false]),
|
|
123
|
-
|
|
124
|
-
* If `true`, the base button will have a keyboard focus ripple.
|
|
125
|
-
* @default false
|
|
126
|
-
*/
|
|
127
|
-
focusRipple: PropTypes.bool,
|
|
128
|
-
/**
|
|
129
|
-
* This prop can help identify which element has keyboard focus.
|
|
130
|
-
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
131
|
-
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
132
|
-
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
133
|
-
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
134
|
-
* if needed.
|
|
135
|
-
*/
|
|
136
|
-
focusVisibleClassName: PropTypes.string,
|
|
95
|
+
id: PropTypes.string,
|
|
137
96
|
label: PropTypes.string,
|
|
138
|
-
/**
|
|
139
|
-
* The component used to render a link when the `href` prop is provided.
|
|
140
|
-
* @default 'a'
|
|
141
|
-
*/
|
|
142
|
-
LinkComponent: PropTypes.elementType,
|
|
143
|
-
/**
|
|
144
|
-
* If `true`, the loading indicator is visible and the button is disabled.
|
|
145
|
-
* If `true | false`, the loading wrapper is always rendered before the children to prevent [Google Translation Crash](https://github.com/mui/material-ui/issues/27853).
|
|
146
|
-
* @default null
|
|
147
|
-
*/
|
|
148
|
-
loading: PropTypes.bool,
|
|
149
|
-
/**
|
|
150
|
-
* Element placed before the children if the button is in loading state.
|
|
151
|
-
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
152
|
-
* By default, it renders a `CircularProgress` that is labeled by the button itself.
|
|
153
|
-
* @default <CircularProgress color="inherit" size={16} />
|
|
154
|
-
*/
|
|
155
|
-
loadingIndicator: PropTypes.node,
|
|
156
|
-
/**
|
|
157
|
-
* Callback fired when the component is focused with a keyboard.
|
|
158
|
-
* We trigger a `onFocus` callback too.
|
|
159
|
-
*/
|
|
160
|
-
onFocusVisible: PropTypes.func,
|
|
161
97
|
/**
|
|
162
98
|
* A function to customize rendering of the component.
|
|
163
99
|
*/
|
|
164
100
|
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
165
|
-
|
|
166
|
-
* The size of the component.
|
|
167
|
-
* `small` is equivalent to the dense button styling.
|
|
168
|
-
*/
|
|
101
|
+
role: PropTypes.string,
|
|
169
102
|
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
170
103
|
style: PropTypes.object,
|
|
171
|
-
/**
|
|
172
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
173
|
-
*/
|
|
174
|
-
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
175
104
|
tabIndex: PropTypes.number,
|
|
176
|
-
|
|
177
|
-
* Props applied to the `TouchRipple` element.
|
|
178
|
-
*/
|
|
179
|
-
TouchRippleProps: PropTypes.object,
|
|
180
|
-
/**
|
|
181
|
-
* A ref that points to the `TouchRipple` element.
|
|
182
|
-
*/
|
|
105
|
+
title: PropTypes.string,
|
|
183
106
|
touchRippleRef: PropTypes.any
|
|
184
107
|
} : void 0;
|
|
185
108
|
export { ToolbarButton };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface ToolbarContextValue {
|
|
3
3
|
focusableItemId: string | null;
|
|
4
|
-
registerItem: (
|
|
5
|
-
unregisterItem: (
|
|
4
|
+
registerItem: (id: string, ref: React.RefObject<HTMLButtonElement | null>) => void;
|
|
5
|
+
unregisterItem: (id: string) => void;
|
|
6
6
|
onItemKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
7
|
+
onItemFocus: (id: string) => void;
|
|
8
|
+
onItemDisabled: (id: string, disabled: boolean) => void;
|
|
7
9
|
}
|
|
8
10
|
export declare const ToolbarContext: React.Context<ToolbarContextValue | undefined>;
|
|
9
11
|
export declare function useToolbarContext(): ToolbarContextValue;
|
|
@@ -127,7 +127,7 @@ const GridVirtualScrollbar = forwardRef(function GridVirtualScrollbar(props, ref
|
|
|
127
127
|
return /*#__PURE__*/_jsx(Container, {
|
|
128
128
|
ref: useForkRef(ref, scrollbarRef),
|
|
129
129
|
className: classes.root,
|
|
130
|
-
style: props.position === 'vertical' && rootProps.
|
|
130
|
+
style: props.position === 'vertical' && rootProps.listView ? {
|
|
131
131
|
height: '100%',
|
|
132
132
|
top: 0
|
|
133
133
|
} : undefined,
|
|
@@ -102,7 +102,7 @@ function GridVirtualScroller(props) {
|
|
|
102
102
|
}, getScrollerProps(), {
|
|
103
103
|
ownerState: ownerState,
|
|
104
104
|
children: [/*#__PURE__*/_jsxs(TopContainer, {
|
|
105
|
-
children: [!rootProps.
|
|
105
|
+
children: [!rootProps.listView && /*#__PURE__*/_jsx(GridHeaders, {}), /*#__PURE__*/_jsx(rootProps.slots.pinnedRows, {
|
|
106
106
|
position: "top",
|
|
107
107
|
virtualScroller: virtualScroller
|
|
108
108
|
})]
|
|
@@ -120,7 +120,7 @@ function GridVirtualScroller(props) {
|
|
|
120
120
|
virtualScroller: virtualScroller
|
|
121
121
|
})
|
|
122
122
|
})]
|
|
123
|
-
})), hasScrollX && !rootProps.
|
|
123
|
+
})), hasScrollX && !rootProps.listView && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
124
124
|
position: "horizontal"
|
|
125
125
|
}, getScrollbarHorizontalProps())), hasScrollY && /*#__PURE__*/_jsx(Scrollbar, _extends({
|
|
126
126
|
position: "vertical"
|
|
@@ -43,6 +43,7 @@ declare const keys: {
|
|
|
43
43
|
readonly font: {
|
|
44
44
|
readonly body: "--DataGrid-t-typography-font-body";
|
|
45
45
|
readonly small: "--DataGrid-t-typography-font-small";
|
|
46
|
+
readonly large: "--DataGrid-t-typography-font-large";
|
|
46
47
|
};
|
|
47
48
|
readonly fontFamily: {
|
|
48
49
|
readonly base: "--DataGrid-t-typography-font-family-base";
|
|
@@ -134,6 +135,7 @@ export declare const vars: {
|
|
|
134
135
|
readonly font: {
|
|
135
136
|
readonly body: "--DataGrid-t-typography-font-body";
|
|
136
137
|
readonly small: "--DataGrid-t-typography-font-small";
|
|
138
|
+
readonly large: "--DataGrid-t-typography-font-large";
|
|
137
139
|
};
|
|
138
140
|
readonly fontFamily: {
|
|
139
141
|
readonly base: "--DataGrid-t-typography-font-family-base";
|
|
@@ -222,6 +224,7 @@ export declare const vars: {
|
|
|
222
224
|
readonly font: {
|
|
223
225
|
readonly body: "--DataGrid-t-typography-font-body";
|
|
224
226
|
readonly small: "--DataGrid-t-typography-font-small";
|
|
227
|
+
readonly large: "--DataGrid-t-typography-font-large";
|
|
225
228
|
};
|
|
226
229
|
readonly fontFamily: {
|
|
227
230
|
readonly base: "--DataGrid-t-typography-font-family-base";
|
|
@@ -66,7 +66,8 @@ const keys = {
|
|
|
66
66
|
typography: {
|
|
67
67
|
font: {
|
|
68
68
|
body: '--DataGrid-t-typography-font-body',
|
|
69
|
-
small: '--DataGrid-t-typography-font-small'
|
|
69
|
+
small: '--DataGrid-t-typography-font-small',
|
|
70
|
+
large: '--DataGrid-t-typography-font-large'
|
|
70
71
|
},
|
|
71
72
|
fontFamily: {
|
|
72
73
|
base: '--DataGrid-t-typography-font-family-base'
|
|
@@ -598,6 +598,14 @@ export interface GridClasses {
|
|
|
598
598
|
* Styles applied to the toolbar root element.
|
|
599
599
|
*/
|
|
600
600
|
toolbar: string;
|
|
601
|
+
/**
|
|
602
|
+
* Styles applied to the toolbar label element.
|
|
603
|
+
*/
|
|
604
|
+
toolbarLabel: string;
|
|
605
|
+
/**
|
|
606
|
+
* Styles applied to the toolbar divider element.
|
|
607
|
+
*/
|
|
608
|
+
toolbarDivider: string;
|
|
601
609
|
/**
|
|
602
610
|
* Styles applied to the shadow scroll area element.
|
|
603
611
|
* @ignore - do not document.
|
|
@@ -631,6 +639,18 @@ export interface GridClasses {
|
|
|
631
639
|
* Styles applied to the toolbar prompt control send button element.
|
|
632
640
|
*/
|
|
633
641
|
toolbarPromptControlSendButton: string;
|
|
642
|
+
/**
|
|
643
|
+
* Styles applied to the toolbar quick filter root element.
|
|
644
|
+
*/
|
|
645
|
+
toolbarQuickFilter: string;
|
|
646
|
+
/**
|
|
647
|
+
* Styles applied to the toolbar quick filter trigger element.
|
|
648
|
+
*/
|
|
649
|
+
toolbarQuickFilterTrigger: string;
|
|
650
|
+
/**
|
|
651
|
+
* Styles applied to the toolbar quick filter control element.
|
|
652
|
+
*/
|
|
653
|
+
toolbarQuickFilterControl: string;
|
|
634
654
|
/**
|
|
635
655
|
* Styles applied the grid if `showColumnVerticalBorder={true}`.
|
|
636
656
|
*/
|