@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,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", "className"];
|
|
3
|
+
const _excluded = ["render", "className", "slotProps", "onKeyDown", "onChange"];
|
|
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,35 +24,61 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
24
24
|
const QuickFilterControl = forwardRef(function QuickFilterControl(props, ref) {
|
|
25
25
|
const {
|
|
26
26
|
render,
|
|
27
|
-
className
|
|
27
|
+
className,
|
|
28
|
+
slotProps,
|
|
29
|
+
onKeyDown,
|
|
30
|
+
onChange
|
|
28
31
|
} = props,
|
|
29
32
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
33
|
const rootProps = useGridRootProps();
|
|
31
34
|
const {
|
|
32
35
|
state,
|
|
36
|
+
controlId,
|
|
33
37
|
controlRef,
|
|
34
38
|
onValueChange,
|
|
39
|
+
onExpandedChange,
|
|
35
40
|
clearValue
|
|
36
41
|
} = useQuickFilterContext();
|
|
37
42
|
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
38
43
|
const handleRef = useForkRef(controlRef, ref);
|
|
39
44
|
const handleKeyDown = event => {
|
|
40
45
|
if (event.key === 'Escape') {
|
|
41
|
-
|
|
46
|
+
if (state.value === '') {
|
|
47
|
+
onExpandedChange(false);
|
|
48
|
+
} else {
|
|
49
|
+
clearValue();
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
|
-
|
|
52
|
+
onKeyDown?.(event);
|
|
53
|
+
};
|
|
54
|
+
const handleBlur = event => {
|
|
55
|
+
if (state.value === '') {
|
|
56
|
+
onExpandedChange(false);
|
|
57
|
+
}
|
|
58
|
+
slotProps?.htmlInput?.onBlur?.(event);
|
|
59
|
+
};
|
|
60
|
+
const handleChange = event => {
|
|
61
|
+
if (!state.expanded) {
|
|
62
|
+
onExpandedChange(true);
|
|
63
|
+
}
|
|
64
|
+
onValueChange(event);
|
|
65
|
+
onChange?.(event);
|
|
44
66
|
};
|
|
45
67
|
const element = useGridComponentRenderer(rootProps.slots.baseTextField, render, _extends({}, rootProps.slotProps?.baseTextField, {
|
|
46
68
|
slotProps: _extends({
|
|
47
69
|
htmlInput: _extends({
|
|
48
|
-
role: 'searchbox'
|
|
49
|
-
|
|
50
|
-
|
|
70
|
+
role: 'searchbox',
|
|
71
|
+
id: controlId,
|
|
72
|
+
tabIndex: state.expanded ? undefined : -1
|
|
73
|
+
}, slotProps?.htmlInput, {
|
|
74
|
+
onBlur: handleBlur
|
|
75
|
+
})
|
|
76
|
+
}, slotProps),
|
|
51
77
|
value: state.value,
|
|
52
|
-
className: resolvedClassName
|
|
53
|
-
onChange: onValueChange,
|
|
54
|
-
onKeyDown: handleKeyDown
|
|
78
|
+
className: resolvedClassName
|
|
55
79
|
}, other, {
|
|
80
|
+
onChange: handleChange,
|
|
81
|
+
onKeyDown: handleKeyDown,
|
|
56
82
|
ref: handleRef
|
|
57
83
|
}), state);
|
|
58
84
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
@@ -79,8 +105,6 @@ process.env.NODE_ENV !== "production" ? QuickFilterControl.propTypes = {
|
|
|
79
105
|
current: PropTypes.object
|
|
80
106
|
})]),
|
|
81
107
|
label: PropTypes.node,
|
|
82
|
-
onChange: PropTypes.func,
|
|
83
|
-
onKeyDown: PropTypes.func,
|
|
84
108
|
placeholder: PropTypes.string,
|
|
85
109
|
/**
|
|
86
110
|
* A function to customize rendering of the component.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
3
|
+
import type { GridSlotProps } from '../../models';
|
|
4
|
+
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
5
|
+
export type QuickFilterTriggerProps = Omit<GridSlotProps['baseButton'], 'className'> & {
|
|
6
|
+
/**
|
|
7
|
+
* A function to customize rendering of the component.
|
|
8
|
+
*/
|
|
9
|
+
render?: RenderProp<GridSlotProps['baseButton'], QuickFilterState>;
|
|
10
|
+
/**
|
|
11
|
+
* Override or extend the styles applied to the component.
|
|
12
|
+
*/
|
|
13
|
+
className?: string | ((state: QuickFilterState) => string);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A button that expands/collapses the quick filter.
|
|
17
|
+
* It renders the `baseButton` slot.
|
|
18
|
+
*
|
|
19
|
+
* Demos:
|
|
20
|
+
*
|
|
21
|
+
* - [Quick Filter](https://mui.com/x/react-data-grid/components/quick-filter/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [QuickFilterTrigger API](https://mui.com/x/api/data-grid/quick-filter-trigger/)
|
|
26
|
+
*/
|
|
27
|
+
declare const QuickFilterTrigger: React.ForwardRefExoticComponent<QuickFilterTriggerProps> | React.ForwardRefExoticComponent<Omit<QuickFilterTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
export { QuickFilterTrigger };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["render", "className", "onClick"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
8
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
10
|
+
import { useQuickFilterContext } from "./QuickFilterContext.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* A button that expands/collapses the quick filter.
|
|
14
|
+
* It renders the `baseButton` slot.
|
|
15
|
+
*
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [Quick Filter](https://mui.com/x/react-data-grid/components/quick-filter/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [QuickFilterTrigger API](https://mui.com/x/api/data-grid/quick-filter-trigger/)
|
|
23
|
+
*/
|
|
24
|
+
const QuickFilterTrigger = forwardRef(function QuickFilterTrigger(props, ref) {
|
|
25
|
+
const {
|
|
26
|
+
render,
|
|
27
|
+
className,
|
|
28
|
+
onClick
|
|
29
|
+
} = props,
|
|
30
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
31
|
+
const rootProps = useGridRootProps();
|
|
32
|
+
const {
|
|
33
|
+
state,
|
|
34
|
+
controlId,
|
|
35
|
+
onExpandedChange,
|
|
36
|
+
triggerRef
|
|
37
|
+
} = useQuickFilterContext();
|
|
38
|
+
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
39
|
+
const handleRef = useForkRef(triggerRef, ref);
|
|
40
|
+
const handleClick = event => {
|
|
41
|
+
onExpandedChange(!state.expanded);
|
|
42
|
+
onClick?.(event);
|
|
43
|
+
};
|
|
44
|
+
const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
|
|
45
|
+
className: resolvedClassName,
|
|
46
|
+
'aria-controls': controlId,
|
|
47
|
+
'aria-expanded': state.expanded
|
|
48
|
+
}, other, {
|
|
49
|
+
onClick: handleClick,
|
|
50
|
+
ref: handleRef
|
|
51
|
+
}), state);
|
|
52
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
53
|
+
children: element
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
process.env.NODE_ENV !== "production" ? QuickFilterTrigger.propTypes = {
|
|
57
|
+
// ----------------------------- Warning --------------------------------
|
|
58
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
59
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
60
|
+
// ----------------------------------------------------------------------
|
|
61
|
+
/**
|
|
62
|
+
* Override or extend the styles applied to the component.
|
|
63
|
+
*/
|
|
64
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
65
|
+
disabled: PropTypes.bool,
|
|
66
|
+
id: PropTypes.string,
|
|
67
|
+
/**
|
|
68
|
+
* A function to customize rendering of the component.
|
|
69
|
+
*/
|
|
70
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
71
|
+
role: PropTypes.string,
|
|
72
|
+
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
73
|
+
startIcon: PropTypes.node,
|
|
74
|
+
style: PropTypes.object,
|
|
75
|
+
tabIndex: PropTypes.number,
|
|
76
|
+
title: PropTypes.string,
|
|
77
|
+
touchRippleRef: PropTypes.any
|
|
78
|
+
} : void 0;
|
|
79
|
+
export { QuickFilterTrigger };
|
|
@@ -11,6 +11,7 @@ import { GridToolbarFilterButton } from "./GridToolbarFilterButton.js";
|
|
|
11
11
|
import { GridToolbarExport } from "./GridToolbarExport.js";
|
|
12
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
13
13
|
import { GridToolbarQuickFilter } from "./GridToolbarQuickFilter.js";
|
|
14
|
+
import { GridToolbarLabel } from "../toolbarV8/GridToolbar.js";
|
|
14
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
const GridToolbar = forwardRef(function GridToolbar(props, ref) {
|
|
16
17
|
// TODO v7: think about where export option should be passed.
|
|
@@ -30,7 +31,9 @@ const GridToolbar = forwardRef(function GridToolbar(props, ref) {
|
|
|
30
31
|
}
|
|
31
32
|
return /*#__PURE__*/_jsxs(GridToolbarContainer, _extends({}, other, {
|
|
32
33
|
ref: ref,
|
|
33
|
-
children: [
|
|
34
|
+
children: [rootProps.label && /*#__PURE__*/_jsx(GridToolbarLabel, {
|
|
35
|
+
children: rootProps.label
|
|
36
|
+
}), /*#__PURE__*/_jsx(GridToolbarColumnsButton, {}), /*#__PURE__*/_jsx(GridToolbarFilterButton, {}), /*#__PURE__*/_jsx(GridToolbarDensitySelector, {}), /*#__PURE__*/_jsx(GridToolbarExport, {
|
|
34
37
|
csvOptions: csvOptions,
|
|
35
38
|
printOptions: printOptions
|
|
36
39
|
// @ts-ignore
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
import type { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
4
3
|
interface GridToolbarColumnsButtonProps {
|
|
5
4
|
/**
|
|
6
5
|
* The props used for each slot inside.
|
|
7
6
|
* @default {}
|
|
8
7
|
*/
|
|
9
8
|
slotProps?: {
|
|
10
|
-
button?: Partial<
|
|
11
|
-
tooltip?: Partial<
|
|
9
|
+
button?: Partial<GridSlotProps['baseButton']>;
|
|
10
|
+
tooltip?: Partial<GridSlotProps['baseTooltip']>;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
declare const GridToolbarColumnsButton: React.ForwardRefExoticComponent<GridToolbarColumnsButtonProps> | React.ForwardRefExoticComponent<GridToolbarColumnsButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
import type { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
4
3
|
interface GridToolbarDensitySelectorProps {
|
|
5
4
|
/**
|
|
6
5
|
* The props used for each slot inside.
|
|
7
6
|
* @default {}
|
|
8
7
|
*/
|
|
9
8
|
slotProps?: {
|
|
10
|
-
button?: Partial<
|
|
11
|
-
tooltip?: Partial<
|
|
9
|
+
button?: Partial<GridSlotProps['baseButton']>;
|
|
10
|
+
tooltip?: Partial<GridSlotProps['baseTooltip']>;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
declare const GridToolbarDensitySelector: React.ForwardRefExoticComponent<GridToolbarDensitySelectorProps> | React.ForwardRefExoticComponent<GridToolbarDensitySelectorProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -100,7 +100,7 @@ const GridToolbarDensitySelector = forwardRef(function GridToolbarDensitySelecto
|
|
|
100
100
|
open: open,
|
|
101
101
|
target: buttonRef.current,
|
|
102
102
|
onClose: handleDensitySelectorClose,
|
|
103
|
-
position: "bottom-
|
|
103
|
+
position: "bottom-end",
|
|
104
104
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
|
|
105
105
|
id: densityMenuId,
|
|
106
106
|
className: gridClasses.menuList,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
import type { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
4
3
|
import { GridCsvExportOptions, GridPrintExportOptions } from "../../models/gridExport.js";
|
|
5
4
|
export interface GridExportDisplayOptions {
|
|
6
5
|
/**
|
|
@@ -23,8 +22,8 @@ export interface GridToolbarExportProps {
|
|
|
23
22
|
* @default {}
|
|
24
23
|
*/
|
|
25
24
|
slotProps?: {
|
|
26
|
-
button?: Partial<
|
|
27
|
-
tooltip?: Partial<
|
|
25
|
+
button?: Partial<GridSlotProps['baseButton']>;
|
|
26
|
+
tooltip?: Partial<GridSlotProps['baseTooltip']>;
|
|
28
27
|
};
|
|
29
28
|
[x: `data-${string}`]: string;
|
|
30
29
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
2
|
+
import type { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
4
3
|
interface GridToolbarExportContainerProps {
|
|
5
4
|
/**
|
|
6
5
|
* The props used for each slot inside.
|
|
7
6
|
* @default {}
|
|
8
7
|
*/
|
|
9
8
|
slotProps?: {
|
|
10
|
-
button?: Partial<
|
|
11
|
-
tooltip?: Partial<
|
|
9
|
+
button?: Partial<GridSlotProps['baseButton']>;
|
|
10
|
+
tooltip?: Partial<GridSlotProps['baseTooltip']>;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
declare const GridToolbarExportContainer: React.ForwardRefExoticComponent<React.PropsWithChildren<GridToolbarExportContainerProps>> | React.ForwardRefExoticComponent<GridToolbarExportContainerProps & {
|
|
@@ -61,7 +61,7 @@ const GridToolbarExportContainer = forwardRef(function GridToolbarExportContaine
|
|
|
61
61
|
open: open,
|
|
62
62
|
target: buttonRef.current,
|
|
63
63
|
onClose: handleMenuClose,
|
|
64
|
-
position: "bottom-
|
|
64
|
+
position: "bottom-end",
|
|
65
65
|
children: /*#__PURE__*/_jsx(rootProps.slots.baseMenuList, {
|
|
66
66
|
id: exportMenuId,
|
|
67
67
|
className: gridClasses.menuList,
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { TooltipProps } from '@mui/material/Tooltip';
|
|
4
|
-
import { BadgeProps } from "../../models/gridBaseSlots.js";
|
|
2
|
+
import type { GridSlotProps } from '../../models/gridSlotsComponentsProps';
|
|
5
3
|
export interface GridToolbarFilterButtonProps {
|
|
6
4
|
/**
|
|
7
5
|
* The props used for each slot inside.
|
|
8
6
|
* @default {}
|
|
9
7
|
*/
|
|
10
8
|
slotProps?: {
|
|
11
|
-
button?: Partial<
|
|
12
|
-
tooltip?: Partial<
|
|
13
|
-
badge?: Partial<
|
|
9
|
+
button?: Partial<GridSlotProps['baseButton']>;
|
|
10
|
+
tooltip?: Partial<GridSlotProps['baseTooltip']>;
|
|
11
|
+
badge?: Partial<GridSlotProps['baseBadge']>;
|
|
14
12
|
};
|
|
15
13
|
}
|
|
16
14
|
declare const GridToolbarFilterButton: React.ForwardRefExoticComponent<GridToolbarFilterButtonProps> | React.ForwardRefExoticComponent<GridToolbarFilterButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -3,8 +3,8 @@ import * as React from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
|
|
6
|
-
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
6
|
import useForkRef from '@mui/utils/useForkRef';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
8
|
import { vars } from "../../constants/cssVariables.js";
|
|
9
9
|
import { gridColumnLookupSelector } from "../../hooks/features/columns/gridColumnsSelector.js";
|
|
10
10
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
@@ -33,9 +33,6 @@ const GridToolbarFilterListRoot = styled('ul', {
|
|
|
33
33
|
margin: vars.spacing(1, 1, 0.5),
|
|
34
34
|
padding: vars.spacing(0, 1)
|
|
35
35
|
});
|
|
36
|
-
|
|
37
|
-
// FIXME(v8:romgrk): override slotProps
|
|
38
|
-
|
|
39
36
|
const GridToolbarFilterButton = forwardRef(function GridToolbarFilterButton(props, ref) {
|
|
40
37
|
const {
|
|
41
38
|
slotProps = {}
|
|
@@ -7,38 +7,70 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
8
|
import { styled } from '@mui/system';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
// import { NotRendered } from '../../utils/assert';
|
|
11
|
-
|
|
12
10
|
import { getDataGridUtilityClass } from "../../constants/index.js";
|
|
13
11
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
14
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
15
|
-
import { QuickFilter, QuickFilterClear, QuickFilterControl } from "../quickFilter/index.js";
|
|
16
|
-
import {
|
|
13
|
+
import { QuickFilter, QuickFilterClear, QuickFilterControl, QuickFilterTrigger } from "../quickFilter/index.js";
|
|
14
|
+
import { ToolbarButton } from "../toolbarV8/index.js";
|
|
15
|
+
import { vars } from "../../constants/cssVariables.js";
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const useUtilityClasses = ownerState => {
|
|
18
18
|
const {
|
|
19
19
|
classes
|
|
20
20
|
} = ownerState;
|
|
21
21
|
const slots = {
|
|
22
|
-
root: ['toolbarQuickFilter']
|
|
22
|
+
root: ['toolbarQuickFilter'],
|
|
23
|
+
trigger: ['toolbarQuickFilterTrigger'],
|
|
24
|
+
control: ['toolbarQuickFilterControl']
|
|
23
25
|
};
|
|
24
26
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
27
|
};
|
|
28
|
+
const GridQuickFilterRoot = styled('div', {
|
|
29
|
+
name: 'MuiDataGrid',
|
|
30
|
+
slot: 'ToolbarQuickFilter'
|
|
31
|
+
})({
|
|
32
|
+
display: 'grid',
|
|
33
|
+
alignItems: 'center'
|
|
34
|
+
});
|
|
35
|
+
const GridQuickFilterTrigger = styled(ToolbarButton, {
|
|
36
|
+
name: 'MuiDataGrid',
|
|
37
|
+
slot: 'ToolbarQuickFilterTrigger'
|
|
38
|
+
})(({
|
|
39
|
+
ownerState
|
|
40
|
+
}) => ({
|
|
41
|
+
gridArea: '1 / 1',
|
|
42
|
+
width: 'min-content',
|
|
43
|
+
height: 'min-content',
|
|
44
|
+
zIndex: 1,
|
|
45
|
+
opacity: ownerState.expanded ? 0 : 1,
|
|
46
|
+
pointerEvents: ownerState.expanded ? 'none' : 'auto',
|
|
47
|
+
transition: vars.transition(['opacity'])
|
|
48
|
+
}));
|
|
26
49
|
|
|
27
50
|
// TODO: Use NotRendered from /utils/assert
|
|
28
51
|
// Currently causes react-docgen to fail
|
|
29
|
-
const
|
|
52
|
+
const GridQuickFilterTextField = styled(_props => {
|
|
30
53
|
throw new Error('Failed assertion: should not be rendered');
|
|
31
54
|
}, {
|
|
32
55
|
name: 'MuiDataGrid',
|
|
33
|
-
slot: '
|
|
34
|
-
})({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
slot: 'ToolbarQuickFilterControl'
|
|
57
|
+
})(({
|
|
58
|
+
ownerState
|
|
59
|
+
}) => ({
|
|
60
|
+
gridArea: '1 / 1',
|
|
61
|
+
overflowX: 'clip',
|
|
62
|
+
width: ownerState.expanded ? 260 : 'var(--trigger-width)',
|
|
63
|
+
opacity: ownerState.expanded ? 1 : 0,
|
|
64
|
+
transition: vars.transition(['width', 'opacity'])
|
|
65
|
+
}));
|
|
38
66
|
function GridToolbarQuickFilter(props) {
|
|
39
67
|
const apiRef = useGridApiContext();
|
|
40
68
|
const rootProps = useGridRootProps();
|
|
41
|
-
const
|
|
69
|
+
const ownerState = {
|
|
70
|
+
classes: rootProps.classes,
|
|
71
|
+
expanded: false
|
|
72
|
+
};
|
|
73
|
+
const classes = useUtilityClasses(ownerState);
|
|
42
74
|
const {
|
|
43
75
|
quickFilterParser,
|
|
44
76
|
quickFilterFormatter,
|
|
@@ -51,40 +83,65 @@ function GridToolbarQuickFilter(props) {
|
|
|
51
83
|
parser: quickFilterParser,
|
|
52
84
|
formatter: quickFilterFormatter,
|
|
53
85
|
debounceMs: debounceMs,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
86
|
+
render: (quickFilterProps, state) => {
|
|
87
|
+
const currentOwnerState = _extends({}, ownerState, {
|
|
88
|
+
expanded: state.expanded
|
|
89
|
+
});
|
|
90
|
+
return /*#__PURE__*/_jsxs(GridQuickFilterRoot, _extends({}, quickFilterProps, {
|
|
91
|
+
className: clsx(classes.root, className),
|
|
92
|
+
children: [/*#__PURE__*/_jsx(QuickFilterTrigger, {
|
|
93
|
+
render: triggerProps => /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
94
|
+
title: apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
95
|
+
enterDelay: 0 // Prevents tooltip lagging behind transitioning trigger element
|
|
96
|
+
,
|
|
97
|
+
children: /*#__PURE__*/_jsx(GridQuickFilterTrigger, _extends({
|
|
98
|
+
className: classes.trigger
|
|
99
|
+
}, triggerProps, {
|
|
100
|
+
ownerState: currentOwnerState,
|
|
101
|
+
color: "default",
|
|
102
|
+
"aria-disabled": state.expanded,
|
|
103
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {
|
|
71
104
|
fontSize: "small"
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
105
|
+
})
|
|
106
|
+
}))
|
|
107
|
+
})
|
|
108
|
+
}), /*#__PURE__*/_jsx(QuickFilterControl, {
|
|
109
|
+
render: _ref => {
|
|
110
|
+
let {
|
|
111
|
+
ref,
|
|
112
|
+
slotProps: controlSlotProps
|
|
113
|
+
} = _ref,
|
|
114
|
+
controlProps = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
115
|
+
return /*#__PURE__*/_jsx(GridQuickFilterTextField, _extends({
|
|
116
|
+
as: rootProps.slots.baseTextField,
|
|
117
|
+
className: classes.control,
|
|
118
|
+
ownerState: currentOwnerState,
|
|
119
|
+
inputRef: ref,
|
|
120
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
121
|
+
placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),
|
|
122
|
+
size: "small",
|
|
123
|
+
slotProps: _extends({
|
|
124
|
+
input: _extends({
|
|
125
|
+
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {
|
|
79
126
|
fontSize: "small"
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
127
|
+
}),
|
|
128
|
+
endAdornment: controlProps.value ? /*#__PURE__*/_jsx(QuickFilterClear, {
|
|
129
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
130
|
+
size: "small",
|
|
131
|
+
edge: "end",
|
|
132
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
133
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
134
|
+
fontSize: "small"
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}) : null
|
|
138
|
+
}, controlSlotProps?.input)
|
|
139
|
+
}, controlSlotProps)
|
|
140
|
+
}, rootProps.slotProps?.baseTextField, controlProps, slotProps?.root, other));
|
|
141
|
+
}
|
|
142
|
+
})]
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
88
145
|
});
|
|
89
146
|
}
|
|
90
147
|
process.env.NODE_ENV !== "production" ? GridToolbarQuickFilter.propTypes = {
|
|
@@ -4,8 +4,13 @@ interface GridToolbarInternalProps {
|
|
|
4
4
|
additionalExportMenuItems?: (onMenuItemClick: () => void) => React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
export type GridToolbarProps = GridSlotProps['toolbar'] & GridToolbarInternalProps;
|
|
7
|
+
declare function GridToolbarDivider(props: GridSlotProps['baseDivider']): React.JSX.Element;
|
|
8
|
+
declare namespace GridToolbarDivider {
|
|
9
|
+
var propTypes: any;
|
|
10
|
+
}
|
|
11
|
+
declare function GridToolbarLabel(props: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
7
12
|
declare function GridToolbar(props: GridToolbarProps): React.JSX.Element;
|
|
8
13
|
declare namespace GridToolbar {
|
|
9
14
|
var propTypes: any;
|
|
10
15
|
}
|
|
11
|
-
export { GridToolbar };
|
|
16
|
+
export { GridToolbar, GridToolbarDivider, GridToolbarLabel };
|