@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,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
3
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
2
4
|
import type { GridFilterModel } from '../../models';
|
|
3
|
-
export type QuickFilterProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
+
export type QuickFilterProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'className'> & {
|
|
5
6
|
/**
|
|
6
7
|
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
7
8
|
* @param {string} input The value entered by the user
|
|
@@ -21,10 +22,32 @@ export type QuickFilterProps = {
|
|
|
21
22
|
* @default 150
|
|
22
23
|
*/
|
|
23
24
|
debounceMs?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The default expanded state of the quick filter control.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
defaultExpanded?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The expanded state of the quick filter control.
|
|
32
|
+
*/
|
|
33
|
+
expanded?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* A function to customize rendering of the component.
|
|
36
|
+
*/
|
|
37
|
+
render?: RenderProp<React.ComponentProps<'div'>, QuickFilterState>;
|
|
38
|
+
/**
|
|
39
|
+
* Override or extend the styles applied to the component.
|
|
40
|
+
*/
|
|
41
|
+
className?: string | ((state: QuickFilterState) => string);
|
|
42
|
+
/**
|
|
43
|
+
* Callback function that is called when the quick filter input is expanded or collapsed.
|
|
44
|
+
* @param {boolean} expanded The new expanded state of the quick filter control
|
|
45
|
+
*/
|
|
46
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
24
47
|
};
|
|
25
48
|
/**
|
|
26
49
|
* The top level Quick Filter component that provides context to child components.
|
|
27
|
-
* It
|
|
50
|
+
* It renders a `<div />` element.
|
|
28
51
|
*
|
|
29
52
|
* Demos:
|
|
30
53
|
*
|
|
@@ -6,22 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.QuickFilter = QuickFilter;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
9
11
|
var React = _interopRequireWildcard(require("react"));
|
|
10
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
13
|
var _utils = require("@mui/utils");
|
|
14
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
15
|
+
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
16
|
+
var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
|
|
12
17
|
var _QuickFilterContext = require("./QuickFilterContext");
|
|
18
|
+
var _useGridComponentRenderer = require("../../hooks/utils/useGridComponentRenderer");
|
|
13
19
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
14
20
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
15
21
|
var _filter = require("../../hooks/features/filter");
|
|
16
22
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
17
|
-
var _utils2 = require("../../utils/utils");
|
|
18
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
+
const _excluded = ["render", "className", "parser", "formatter", "debounceMs", "defaultExpanded", "expanded", "onExpandedChange"];
|
|
19
25
|
const DEFAULT_PARSER = searchText => searchText.split(' ').filter(word => word !== '');
|
|
20
26
|
const DEFAULT_FORMATTER = values => values.join(' ');
|
|
21
27
|
|
|
22
28
|
/**
|
|
23
29
|
* The top level Quick Filter component that provides context to child components.
|
|
24
|
-
* It
|
|
30
|
+
* It renders a `<div />` element.
|
|
25
31
|
*
|
|
26
32
|
* Demos:
|
|
27
33
|
*
|
|
@@ -34,26 +40,73 @@ const DEFAULT_FORMATTER = values => values.join(' ');
|
|
|
34
40
|
function QuickFilter(props) {
|
|
35
41
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
36
42
|
const {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
render,
|
|
44
|
+
className,
|
|
45
|
+
parser = DEFAULT_PARSER,
|
|
46
|
+
formatter = DEFAULT_FORMATTER,
|
|
47
|
+
debounceMs = rootProps.filterDebounceMs,
|
|
48
|
+
defaultExpanded,
|
|
49
|
+
expanded,
|
|
50
|
+
onExpandedChange
|
|
51
|
+
} = props,
|
|
52
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
42
53
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
43
54
|
const controlRef = React.useRef(null);
|
|
44
55
|
const triggerRef = React.useRef(null);
|
|
45
56
|
const quickFilterValues = (0, _useGridSelector.useGridSelector)(apiRef, _filter.gridQuickFilterValuesSelector);
|
|
46
57
|
const [value, setValue] = React.useState(formatter(quickFilterValues ?? []));
|
|
58
|
+
const [internalExpanded, setInternalExpanded] = React.useState(defaultExpanded ?? value.length > 0);
|
|
59
|
+
const expandedValue = expanded ?? internalExpanded;
|
|
60
|
+
const state = React.useMemo(() => ({
|
|
61
|
+
value,
|
|
62
|
+
expanded: expandedValue
|
|
63
|
+
}), [value, expandedValue]);
|
|
64
|
+
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
65
|
+
const ref = React.useRef(null);
|
|
66
|
+
const controlId = (0, _useId.default)();
|
|
67
|
+
const handleExpandedChange = React.useCallback(newExpanded => {
|
|
68
|
+
if (onExpandedChange) {
|
|
69
|
+
onExpandedChange(newExpanded);
|
|
70
|
+
}
|
|
71
|
+
if (expanded === undefined) {
|
|
72
|
+
setInternalExpanded(newExpanded);
|
|
73
|
+
}
|
|
74
|
+
}, [onExpandedChange, expanded]);
|
|
47
75
|
const prevQuickFilterValuesRef = React.useRef(quickFilterValues);
|
|
48
76
|
React.useEffect(() => {
|
|
49
|
-
if (!(0,
|
|
77
|
+
if (!(0, _isDeepEqual.isDeepEqual)(prevQuickFilterValuesRef.current, quickFilterValues)) {
|
|
50
78
|
// The model of quick filter value has been updated
|
|
51
79
|
prevQuickFilterValuesRef.current = quickFilterValues;
|
|
52
80
|
|
|
53
81
|
// Update the input value if needed to match the new model
|
|
54
|
-
setValue(prevSearchValue => (0,
|
|
82
|
+
setValue(prevSearchValue => (0, _isDeepEqual.isDeepEqual)(parser(prevSearchValue), quickFilterValues) ? prevSearchValue : formatter(quickFilterValues ?? []));
|
|
55
83
|
}
|
|
56
84
|
}, [quickFilterValues, formatter, parser]);
|
|
85
|
+
const isFirstRender = React.useRef(true);
|
|
86
|
+
const previousExpandedValue = React.useRef(expandedValue);
|
|
87
|
+
React.useEffect(() => {
|
|
88
|
+
if (isFirstRender.current) {
|
|
89
|
+
isFirstRender.current = false;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Ensure the expanded state has actually changed before focusing
|
|
94
|
+
if (previousExpandedValue.current !== expandedValue) {
|
|
95
|
+
if (expandedValue) {
|
|
96
|
+
// Ensures the focus does not interupt CSS transitions and animations on the control
|
|
97
|
+
requestAnimationFrame(() => {
|
|
98
|
+
controlRef.current?.focus({
|
|
99
|
+
preventScroll: true
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
triggerRef.current?.focus({
|
|
104
|
+
preventScroll: true
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
previousExpandedValue.current = expandedValue;
|
|
108
|
+
}
|
|
109
|
+
}, [expandedValue]);
|
|
57
110
|
const setQuickFilterValueDebounced = React.useMemo(() => (0, _utils.unstable_debounce)(newValue => {
|
|
58
111
|
const newQuickFilterValues = parser(newValue);
|
|
59
112
|
prevQuickFilterValuesRef.current = newQuickFilterValues;
|
|
@@ -65,7 +118,7 @@ function QuickFilter(props) {
|
|
|
65
118
|
setValue(newValue);
|
|
66
119
|
setQuickFilterValueDebounced(newValue);
|
|
67
120
|
}, [setQuickFilterValueDebounced]);
|
|
68
|
-
const
|
|
121
|
+
const handleClearValue = React.useCallback(() => {
|
|
69
122
|
setValue('');
|
|
70
123
|
apiRef.current.setQuickFilterValues([]);
|
|
71
124
|
controlRef.current?.focus();
|
|
@@ -73,15 +126,25 @@ function QuickFilter(props) {
|
|
|
73
126
|
const contextValue = React.useMemo(() => ({
|
|
74
127
|
controlRef,
|
|
75
128
|
triggerRef,
|
|
76
|
-
state
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}), [
|
|
129
|
+
state,
|
|
130
|
+
controlId,
|
|
131
|
+
clearValue: handleClearValue,
|
|
132
|
+
onValueChange: handleValueChange,
|
|
133
|
+
onExpandedChange: handleExpandedChange
|
|
134
|
+
}), [controlId, state, handleValueChange, handleClearValue, handleExpandedChange]);
|
|
135
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
136
|
+
if (ref.current && triggerRef.current) {
|
|
137
|
+
ref.current.style.setProperty('--trigger-width', `${triggerRef.current?.offsetWidth}px`);
|
|
138
|
+
}
|
|
139
|
+
}, []);
|
|
140
|
+
const element = (0, _useGridComponentRenderer.useGridComponentRenderer)('div', render, (0, _extends2.default)({
|
|
141
|
+
className: resolvedClassName
|
|
142
|
+
}, other, {
|
|
143
|
+
ref
|
|
144
|
+
}), state);
|
|
82
145
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_QuickFilterContext.QuickFilterContext.Provider, {
|
|
83
146
|
value: contextValue,
|
|
84
|
-
children:
|
|
147
|
+
children: element
|
|
85
148
|
});
|
|
86
149
|
}
|
|
87
150
|
process.env.NODE_ENV !== "production" ? QuickFilter.propTypes = {
|
|
@@ -89,12 +152,24 @@ process.env.NODE_ENV !== "production" ? QuickFilter.propTypes = {
|
|
|
89
152
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
90
153
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
91
154
|
// ----------------------------------------------------------------------
|
|
92
|
-
|
|
155
|
+
/**
|
|
156
|
+
* Override or extend the styles applied to the component.
|
|
157
|
+
*/
|
|
158
|
+
className: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
93
159
|
/**
|
|
94
160
|
* The debounce time in milliseconds.
|
|
95
161
|
* @default 150
|
|
96
162
|
*/
|
|
97
163
|
debounceMs: _propTypes.default.number,
|
|
164
|
+
/**
|
|
165
|
+
* The default expanded state of the quick filter control.
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
defaultExpanded: _propTypes.default.bool,
|
|
169
|
+
/**
|
|
170
|
+
* The expanded state of the quick filter control.
|
|
171
|
+
*/
|
|
172
|
+
expanded: _propTypes.default.bool,
|
|
98
173
|
/**
|
|
99
174
|
* Function responsible for formatting values of quick filter in a string when the model is modified
|
|
100
175
|
* @param {any[]} values The new values passed to the quick filter model
|
|
@@ -102,11 +177,20 @@ process.env.NODE_ENV !== "production" ? QuickFilter.propTypes = {
|
|
|
102
177
|
* @default (values: string[]) => values.join(' ')
|
|
103
178
|
*/
|
|
104
179
|
formatter: _propTypes.default.func,
|
|
180
|
+
/**
|
|
181
|
+
* Callback function that is called when the quick filter input is expanded or collapsed.
|
|
182
|
+
* @param {boolean} expanded The new expanded state of the quick filter control
|
|
183
|
+
*/
|
|
184
|
+
onExpandedChange: _propTypes.default.func,
|
|
105
185
|
/**
|
|
106
186
|
* Function responsible for parsing text input in an array of independent values for quick filtering.
|
|
107
187
|
* @param {string} input The value entered by the user
|
|
108
188
|
* @returns {any[]} The array of value on which quick filter is applied
|
|
109
189
|
* @default (searchText: string) => searchText.split(' ').filter((word) => word !== '')
|
|
110
190
|
*/
|
|
111
|
-
parser: _propTypes.default.func
|
|
191
|
+
parser: _propTypes.default.func,
|
|
192
|
+
/**
|
|
193
|
+
* A function to customize rendering of the component.
|
|
194
|
+
*/
|
|
195
|
+
render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func])
|
|
112
196
|
} : void 0;
|
|
@@ -15,7 +15,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
15
15
|
var _useGridComponentRenderer = require("../../hooks/utils/useGridComponentRenderer");
|
|
16
16
|
var _QuickFilterContext = require("./QuickFilterContext");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["render", "className"];
|
|
18
|
+
const _excluded = ["render", "className", "onClick"];
|
|
19
19
|
/**
|
|
20
20
|
* A button that resets the filter value.
|
|
21
21
|
* It renders the `baseIconButton` slot.
|
|
@@ -31,7 +31,8 @@ const _excluded = ["render", "className"];
|
|
|
31
31
|
const QuickFilterClear = exports.QuickFilterClear = (0, _forwardRef.forwardRef)(function QuickFilterClear(props, ref) {
|
|
32
32
|
const {
|
|
33
33
|
render,
|
|
34
|
-
className
|
|
34
|
+
className,
|
|
35
|
+
onClick
|
|
35
36
|
} = props,
|
|
36
37
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
37
38
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
@@ -40,10 +41,15 @@ const QuickFilterClear = exports.QuickFilterClear = (0, _forwardRef.forwardRef)(
|
|
|
40
41
|
clearValue
|
|
41
42
|
} = (0, _QuickFilterContext.useQuickFilterContext)();
|
|
42
43
|
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
44
|
+
const handleClick = event => {
|
|
45
|
+
clearValue();
|
|
46
|
+
onClick?.(event);
|
|
47
|
+
};
|
|
43
48
|
const element = (0, _useGridComponentRenderer.useGridComponentRenderer)(rootProps.slots.baseIconButton, render, (0, _extends2.default)({}, rootProps.slotProps?.baseIconButton, {
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
className: resolvedClassName,
|
|
50
|
+
tabIndex: -1
|
|
46
51
|
}, other, {
|
|
52
|
+
onClick: handleClick,
|
|
47
53
|
ref
|
|
48
54
|
}), state);
|
|
49
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
@@ -55,120 +61,23 @@ process.env.NODE_ENV !== "production" ? QuickFilterClear.propTypes = {
|
|
|
55
61
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
56
62
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
57
63
|
// ----------------------------------------------------------------------
|
|
58
|
-
/**
|
|
59
|
-
* A ref for imperative actions.
|
|
60
|
-
* It currently only supports `focusVisible()` action.
|
|
61
|
-
*/
|
|
62
|
-
action: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.shape({
|
|
63
|
-
current: _propTypes.default.shape({
|
|
64
|
-
focusVisible: _propTypes.default.func.isRequired
|
|
65
|
-
})
|
|
66
|
-
})]),
|
|
67
|
-
/**
|
|
68
|
-
* If `true`, the ripples are centered.
|
|
69
|
-
* They won't start at the cursor interaction position.
|
|
70
|
-
* @default false
|
|
71
|
-
*/
|
|
72
|
-
centerRipple: _propTypes.default.bool,
|
|
73
64
|
/**
|
|
74
65
|
* Override or extend the styles applied to the component.
|
|
75
66
|
*/
|
|
76
67
|
className: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
77
|
-
/**
|
|
78
|
-
* The color of the component.
|
|
79
|
-
* It supports both default and custom theme colors, which can be added as shown in the
|
|
80
|
-
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
81
|
-
*/
|
|
82
68
|
color: _propTypes.default.oneOf(['default', 'inherit', 'primary']),
|
|
83
|
-
component: _propTypes.default.elementType,
|
|
84
|
-
/**
|
|
85
|
-
* If `true`, the component is disabled.
|
|
86
|
-
*/
|
|
87
69
|
disabled: _propTypes.default.bool,
|
|
88
|
-
/**
|
|
89
|
-
* If `true`, the keyboard focus ripple is disabled.
|
|
90
|
-
* @default false
|
|
91
|
-
*/
|
|
92
|
-
disableFocusRipple: _propTypes.default.bool,
|
|
93
|
-
/**
|
|
94
|
-
* If `true`, the ripple effect is disabled.
|
|
95
|
-
*
|
|
96
|
-
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
97
|
-
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
98
|
-
* @default false
|
|
99
|
-
*/
|
|
100
|
-
disableRipple: _propTypes.default.bool,
|
|
101
|
-
/**
|
|
102
|
-
* If `true`, the touch ripple effect is disabled.
|
|
103
|
-
* @default false
|
|
104
|
-
*/
|
|
105
|
-
disableTouchRipple: _propTypes.default.bool,
|
|
106
|
-
/**
|
|
107
|
-
* If given, uses a negative margin to counteract the padding on one
|
|
108
|
-
* side (this is often helpful for aligning the left or right
|
|
109
|
-
* side of the icon with content above or below, without ruining the border
|
|
110
|
-
* size and shape).
|
|
111
|
-
*/
|
|
112
70
|
edge: _propTypes.default.oneOf(['end', 'start', false]),
|
|
113
|
-
|
|
114
|
-
* If `true`, the base button will have a keyboard focus ripple.
|
|
115
|
-
* @default false
|
|
116
|
-
*/
|
|
117
|
-
focusRipple: _propTypes.default.bool,
|
|
118
|
-
/**
|
|
119
|
-
* This prop can help identify which element has keyboard focus.
|
|
120
|
-
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
121
|
-
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
122
|
-
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
123
|
-
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
124
|
-
* if needed.
|
|
125
|
-
*/
|
|
126
|
-
focusVisibleClassName: _propTypes.default.string,
|
|
71
|
+
id: _propTypes.default.string,
|
|
127
72
|
label: _propTypes.default.string,
|
|
128
|
-
/**
|
|
129
|
-
* The component used to render a link when the `href` prop is provided.
|
|
130
|
-
* @default 'a'
|
|
131
|
-
*/
|
|
132
|
-
LinkComponent: _propTypes.default.elementType,
|
|
133
|
-
/**
|
|
134
|
-
* If `true`, the loading indicator is visible and the button is disabled.
|
|
135
|
-
* 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).
|
|
136
|
-
* @default null
|
|
137
|
-
*/
|
|
138
|
-
loading: _propTypes.default.bool,
|
|
139
|
-
/**
|
|
140
|
-
* Element placed before the children if the button is in loading state.
|
|
141
|
-
* The node should contain an element with `role="progressbar"` with an accessible name.
|
|
142
|
-
* By default, it renders a `CircularProgress` that is labeled by the button itself.
|
|
143
|
-
* @default <CircularProgress color="inherit" size={16} />
|
|
144
|
-
*/
|
|
145
|
-
loadingIndicator: _propTypes.default.node,
|
|
146
|
-
/**
|
|
147
|
-
* Callback fired when the component is focused with a keyboard.
|
|
148
|
-
* We trigger a `onFocus` callback too.
|
|
149
|
-
*/
|
|
150
|
-
onFocusVisible: _propTypes.default.func,
|
|
151
73
|
/**
|
|
152
74
|
* A function to customize rendering of the component.
|
|
153
75
|
*/
|
|
154
76
|
render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
155
|
-
|
|
156
|
-
* The size of the component.
|
|
157
|
-
* `small` is equivalent to the dense button styling.
|
|
158
|
-
*/
|
|
77
|
+
role: _propTypes.default.string,
|
|
159
78
|
size: _propTypes.default.oneOf(['large', 'medium', 'small']),
|
|
160
79
|
style: _propTypes.default.object,
|
|
161
|
-
/**
|
|
162
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
163
|
-
*/
|
|
164
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
165
80
|
tabIndex: _propTypes.default.number,
|
|
166
|
-
|
|
167
|
-
* Props applied to the `TouchRipple` element.
|
|
168
|
-
*/
|
|
169
|
-
TouchRippleProps: _propTypes.default.object,
|
|
170
|
-
/**
|
|
171
|
-
* A ref that points to the `TouchRipple` element.
|
|
172
|
-
*/
|
|
81
|
+
title: _propTypes.default.string,
|
|
173
82
|
touchRippleRef: _propTypes.default.any
|
|
174
83
|
} : void 0;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface QuickFilterState {
|
|
3
3
|
value: string;
|
|
4
|
+
expanded: boolean;
|
|
4
5
|
}
|
|
5
6
|
export interface QuickFilterContextValue {
|
|
6
7
|
state: QuickFilterState;
|
|
8
|
+
controlId: string | undefined;
|
|
7
9
|
controlRef: React.RefObject<HTMLInputElement | null>;
|
|
8
10
|
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
9
|
-
onValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
11
|
clearValue: () => void;
|
|
12
|
+
onValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
11
14
|
}
|
|
12
15
|
export declare const QuickFilterContext: React.Context<QuickFilterContextValue | undefined>;
|
|
13
16
|
export declare function useQuickFilterContext(): QuickFilterContextValue;
|
|
@@ -16,7 +16,7 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
16
16
|
var _useGridComponentRenderer = require("../../hooks/utils/useGridComponentRenderer");
|
|
17
17
|
var _QuickFilterContext = require("./QuickFilterContext");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["render", "className"];
|
|
19
|
+
const _excluded = ["render", "className", "slotProps", "onKeyDown", "onChange"];
|
|
20
20
|
/**
|
|
21
21
|
* A component that takes user input and filters row data.
|
|
22
22
|
* It renders the `baseTextField` slot.
|
|
@@ -32,35 +32,61 @@ const _excluded = ["render", "className"];
|
|
|
32
32
|
const QuickFilterControl = exports.QuickFilterControl = (0, _forwardRef.forwardRef)(function QuickFilterControl(props, ref) {
|
|
33
33
|
const {
|
|
34
34
|
render,
|
|
35
|
-
className
|
|
35
|
+
className,
|
|
36
|
+
slotProps,
|
|
37
|
+
onKeyDown,
|
|
38
|
+
onChange
|
|
36
39
|
} = props,
|
|
37
40
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
38
41
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
39
42
|
const {
|
|
40
43
|
state,
|
|
44
|
+
controlId,
|
|
41
45
|
controlRef,
|
|
42
46
|
onValueChange,
|
|
47
|
+
onExpandedChange,
|
|
43
48
|
clearValue
|
|
44
49
|
} = (0, _QuickFilterContext.useQuickFilterContext)();
|
|
45
50
|
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
46
51
|
const handleRef = (0, _utils.unstable_useForkRef)(controlRef, ref);
|
|
47
52
|
const handleKeyDown = event => {
|
|
48
53
|
if (event.key === 'Escape') {
|
|
49
|
-
|
|
54
|
+
if (state.value === '') {
|
|
55
|
+
onExpandedChange(false);
|
|
56
|
+
} else {
|
|
57
|
+
clearValue();
|
|
58
|
+
}
|
|
50
59
|
}
|
|
51
|
-
|
|
60
|
+
onKeyDown?.(event);
|
|
61
|
+
};
|
|
62
|
+
const handleBlur = event => {
|
|
63
|
+
if (state.value === '') {
|
|
64
|
+
onExpandedChange(false);
|
|
65
|
+
}
|
|
66
|
+
slotProps?.htmlInput?.onBlur?.(event);
|
|
67
|
+
};
|
|
68
|
+
const handleChange = event => {
|
|
69
|
+
if (!state.expanded) {
|
|
70
|
+
onExpandedChange(true);
|
|
71
|
+
}
|
|
72
|
+
onValueChange(event);
|
|
73
|
+
onChange?.(event);
|
|
52
74
|
};
|
|
53
75
|
const element = (0, _useGridComponentRenderer.useGridComponentRenderer)(rootProps.slots.baseTextField, render, (0, _extends2.default)({}, rootProps.slotProps?.baseTextField, {
|
|
54
76
|
slotProps: (0, _extends2.default)({
|
|
55
77
|
htmlInput: (0, _extends2.default)({
|
|
56
|
-
role: 'searchbox'
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
role: 'searchbox',
|
|
79
|
+
id: controlId,
|
|
80
|
+
tabIndex: state.expanded ? undefined : -1
|
|
81
|
+
}, slotProps?.htmlInput, {
|
|
82
|
+
onBlur: handleBlur
|
|
83
|
+
})
|
|
84
|
+
}, slotProps),
|
|
59
85
|
value: state.value,
|
|
60
|
-
className: resolvedClassName
|
|
61
|
-
onChange: onValueChange,
|
|
62
|
-
onKeyDown: handleKeyDown
|
|
86
|
+
className: resolvedClassName
|
|
63
87
|
}, other, {
|
|
88
|
+
onChange: handleChange,
|
|
89
|
+
onKeyDown: handleKeyDown,
|
|
64
90
|
ref: handleRef
|
|
65
91
|
}), state);
|
|
66
92
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
@@ -87,8 +113,6 @@ process.env.NODE_ENV !== "production" ? QuickFilterControl.propTypes = {
|
|
|
87
113
|
current: _propTypes.default.object
|
|
88
114
|
})]),
|
|
89
115
|
label: _propTypes.default.node,
|
|
90
|
-
onChange: _propTypes.default.func,
|
|
91
|
-
onKeyDown: _propTypes.default.func,
|
|
92
116
|
placeholder: _propTypes.default.string,
|
|
93
117
|
/**
|
|
94
118
|
* 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,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.QuickFilterTrigger = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
14
|
+
var _utils = require("@mui/utils");
|
|
15
|
+
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
16
|
+
var _useGridComponentRenderer = require("../../hooks/utils/useGridComponentRenderer");
|
|
17
|
+
var _QuickFilterContext = require("./QuickFilterContext");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
const _excluded = ["render", "className", "onClick"];
|
|
20
|
+
/**
|
|
21
|
+
* A button that expands/collapses the quick filter.
|
|
22
|
+
* It renders the `baseButton` slot.
|
|
23
|
+
*
|
|
24
|
+
* Demos:
|
|
25
|
+
*
|
|
26
|
+
* - [Quick Filter](https://mui.com/x/react-data-grid/components/quick-filter/)
|
|
27
|
+
*
|
|
28
|
+
* API:
|
|
29
|
+
*
|
|
30
|
+
* - [QuickFilterTrigger API](https://mui.com/x/api/data-grid/quick-filter-trigger/)
|
|
31
|
+
*/
|
|
32
|
+
const QuickFilterTrigger = exports.QuickFilterTrigger = (0, _forwardRef.forwardRef)(function QuickFilterTrigger(props, ref) {
|
|
33
|
+
const {
|
|
34
|
+
render,
|
|
35
|
+
className,
|
|
36
|
+
onClick
|
|
37
|
+
} = props,
|
|
38
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
39
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
40
|
+
const {
|
|
41
|
+
state,
|
|
42
|
+
controlId,
|
|
43
|
+
onExpandedChange,
|
|
44
|
+
triggerRef
|
|
45
|
+
} = (0, _QuickFilterContext.useQuickFilterContext)();
|
|
46
|
+
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
47
|
+
const handleRef = (0, _utils.unstable_useForkRef)(triggerRef, ref);
|
|
48
|
+
const handleClick = event => {
|
|
49
|
+
onExpandedChange(!state.expanded);
|
|
50
|
+
onClick?.(event);
|
|
51
|
+
};
|
|
52
|
+
const element = (0, _useGridComponentRenderer.useGridComponentRenderer)(rootProps.slots.baseButton, render, (0, _extends2.default)({}, rootProps.slotProps?.baseButton, {
|
|
53
|
+
className: resolvedClassName,
|
|
54
|
+
'aria-controls': controlId,
|
|
55
|
+
'aria-expanded': state.expanded
|
|
56
|
+
}, other, {
|
|
57
|
+
onClick: handleClick,
|
|
58
|
+
ref: handleRef
|
|
59
|
+
}), state);
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
61
|
+
children: element
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
process.env.NODE_ENV !== "production" ? QuickFilterTrigger.propTypes = {
|
|
65
|
+
// ----------------------------- Warning --------------------------------
|
|
66
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
67
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
68
|
+
// ----------------------------------------------------------------------
|
|
69
|
+
/**
|
|
70
|
+
* Override or extend the styles applied to the component.
|
|
71
|
+
*/
|
|
72
|
+
className: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
73
|
+
disabled: _propTypes.default.bool,
|
|
74
|
+
id: _propTypes.default.string,
|
|
75
|
+
/**
|
|
76
|
+
* A function to customize rendering of the component.
|
|
77
|
+
*/
|
|
78
|
+
render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
79
|
+
role: _propTypes.default.string,
|
|
80
|
+
size: _propTypes.default.oneOf(['large', 'medium', 'small']),
|
|
81
|
+
startIcon: _propTypes.default.node,
|
|
82
|
+
style: _propTypes.default.object,
|
|
83
|
+
tabIndex: _propTypes.default.number,
|
|
84
|
+
title: _propTypes.default.string,
|
|
85
|
+
touchRippleRef: _propTypes.default.any
|
|
86
|
+
} : void 0;
|
|
@@ -35,4 +35,15 @@ Object.keys(_QuickFilterClear).forEach(function (key) {
|
|
|
35
35
|
return _QuickFilterClear[key];
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
+
});
|
|
39
|
+
var _QuickFilterTrigger = require("./QuickFilterTrigger");
|
|
40
|
+
Object.keys(_QuickFilterTrigger).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _QuickFilterTrigger[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _QuickFilterTrigger[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
38
49
|
});
|
|
@@ -18,6 +18,7 @@ var _GridToolbarFilterButton = require("./GridToolbarFilterButton");
|
|
|
18
18
|
var _GridToolbarExport = require("./GridToolbarExport");
|
|
19
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
20
20
|
var _GridToolbarQuickFilter = require("./GridToolbarQuickFilter");
|
|
21
|
+
var _GridToolbar = require("../toolbarV8/GridToolbar");
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
const _excluded = ["className", "csvOptions", "printOptions", "excelOptions", "showQuickFilter", "quickFilterProps"];
|
|
23
24
|
const GridToolbar = exports.GridToolbar = (0, _forwardRef.forwardRef)(function GridToolbar(props, ref) {
|
|
@@ -38,7 +39,9 @@ const GridToolbar = exports.GridToolbar = (0, _forwardRef.forwardRef)(function G
|
|
|
38
39
|
}
|
|
39
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridToolbarContainer.GridToolbarContainer, (0, _extends2.default)({}, other, {
|
|
40
41
|
ref: ref,
|
|
41
|
-
children: [
|
|
42
|
+
children: [rootProps.label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbar.GridToolbarLabel, {
|
|
43
|
+
children: rootProps.label
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarColumnsButton.GridToolbarColumnsButton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarFilterButton.GridToolbarFilterButton, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarDensitySelector.GridToolbarDensitySelector, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarExport.GridToolbarExport, {
|
|
42
45
|
csvOptions: csvOptions,
|
|
43
46
|
printOptions: printOptions
|
|
44
47
|
// @ts-ignore
|