@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,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>>;
|
|
@@ -108,7 +108,7 @@ const GridToolbarDensitySelector = exports.GridToolbarDensitySelector = (0, _for
|
|
|
108
108
|
open: open,
|
|
109
109
|
target: buttonRef.current,
|
|
110
110
|
onClose: handleDensitySelectorClose,
|
|
111
|
-
position: "bottom-
|
|
111
|
+
position: "bottom-end",
|
|
112
112
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuList, {
|
|
113
113
|
id: densityMenuId,
|
|
114
114
|
className: _gridClasses.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 & {
|
|
@@ -69,7 +69,7 @@ const GridToolbarExportContainer = exports.GridToolbarExportContainer = (0, _for
|
|
|
69
69
|
open: open,
|
|
70
70
|
target: buttonRef.current,
|
|
71
71
|
onClose: handleMenuClose,
|
|
72
|
-
position: "bottom-
|
|
72
|
+
position: "bottom-end",
|
|
73
73
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuList, {
|
|
74
74
|
id: exportMenuId,
|
|
75
75
|
className: _gridClasses.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>>;
|
|
@@ -11,8 +11,8 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _styles = require("@mui/material/styles");
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
|
-
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
15
14
|
var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
15
|
+
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
16
|
var _cssVariables = require("../../constants/cssVariables");
|
|
17
17
|
var _gridColumnsSelector = require("../../hooks/features/columns/gridColumnsSelector");
|
|
18
18
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
@@ -41,9 +41,6 @@ const GridToolbarFilterListRoot = (0, _styles.styled)('ul', {
|
|
|
41
41
|
margin: _cssVariables.vars.spacing(1, 1, 0.5),
|
|
42
42
|
padding: _cssVariables.vars.spacing(0, 1)
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
// FIXME(v8:romgrk): override slotProps
|
|
46
|
-
|
|
47
44
|
const GridToolbarFilterButton = exports.GridToolbarFilterButton = (0, _forwardRef.forwardRef)(function GridToolbarFilterButton(props, ref) {
|
|
48
45
|
const {
|
|
49
46
|
slotProps = {}
|
|
@@ -17,34 +17,68 @@ var _constants = require("../../constants");
|
|
|
17
17
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
18
18
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
19
|
var _quickFilter = require("../quickFilter");
|
|
20
|
+
var _toolbarV = require("../toolbarV8");
|
|
21
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
23
|
const _excluded = ["quickFilterParser", "quickFilterFormatter", "debounceMs", "className", "slotProps"],
|
|
22
|
-
_excluded2 = ["ref", "slotProps"];
|
|
24
|
+
_excluded2 = ["ref", "slotProps"];
|
|
23
25
|
const useUtilityClasses = ownerState => {
|
|
24
26
|
const {
|
|
25
27
|
classes
|
|
26
28
|
} = ownerState;
|
|
27
29
|
const slots = {
|
|
28
|
-
root: ['toolbarQuickFilter']
|
|
30
|
+
root: ['toolbarQuickFilter'],
|
|
31
|
+
trigger: ['toolbarQuickFilterTrigger'],
|
|
32
|
+
control: ['toolbarQuickFilterControl']
|
|
29
33
|
};
|
|
30
34
|
return (0, _composeClasses.default)(slots, _constants.getDataGridUtilityClass, classes);
|
|
31
35
|
};
|
|
36
|
+
const GridQuickFilterRoot = (0, _system.styled)('div', {
|
|
37
|
+
name: 'MuiDataGrid',
|
|
38
|
+
slot: 'ToolbarQuickFilter'
|
|
39
|
+
})({
|
|
40
|
+
display: 'grid',
|
|
41
|
+
alignItems: 'center'
|
|
42
|
+
});
|
|
43
|
+
const GridQuickFilterTrigger = (0, _system.styled)(_toolbarV.ToolbarButton, {
|
|
44
|
+
name: 'MuiDataGrid',
|
|
45
|
+
slot: 'ToolbarQuickFilterTrigger'
|
|
46
|
+
})(({
|
|
47
|
+
ownerState
|
|
48
|
+
}) => ({
|
|
49
|
+
gridArea: '1 / 1',
|
|
50
|
+
width: 'min-content',
|
|
51
|
+
height: 'min-content',
|
|
52
|
+
zIndex: 1,
|
|
53
|
+
opacity: ownerState.expanded ? 0 : 1,
|
|
54
|
+
pointerEvents: ownerState.expanded ? 'none' : 'auto',
|
|
55
|
+
transition: _cssVariables.vars.transition(['opacity'])
|
|
56
|
+
}));
|
|
32
57
|
|
|
33
58
|
// TODO: Use NotRendered from /utils/assert
|
|
34
59
|
// Currently causes react-docgen to fail
|
|
35
|
-
const
|
|
60
|
+
const GridQuickFilterTextField = (0, _system.styled)(_props => {
|
|
36
61
|
throw new Error('Failed assertion: should not be rendered');
|
|
37
62
|
}, {
|
|
38
63
|
name: 'MuiDataGrid',
|
|
39
|
-
slot: '
|
|
40
|
-
})({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
64
|
+
slot: 'ToolbarQuickFilterControl'
|
|
65
|
+
})(({
|
|
66
|
+
ownerState
|
|
67
|
+
}) => ({
|
|
68
|
+
gridArea: '1 / 1',
|
|
69
|
+
overflowX: 'clip',
|
|
70
|
+
width: ownerState.expanded ? 260 : 'var(--trigger-width)',
|
|
71
|
+
opacity: ownerState.expanded ? 1 : 0,
|
|
72
|
+
transition: _cssVariables.vars.transition(['width', 'opacity'])
|
|
73
|
+
}));
|
|
44
74
|
function GridToolbarQuickFilter(props) {
|
|
45
75
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
46
76
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
47
|
-
const
|
|
77
|
+
const ownerState = {
|
|
78
|
+
classes: rootProps.classes,
|
|
79
|
+
expanded: false
|
|
80
|
+
};
|
|
81
|
+
const classes = useUtilityClasses(ownerState);
|
|
48
82
|
const {
|
|
49
83
|
quickFilterParser,
|
|
50
84
|
quickFilterFormatter,
|
|
@@ -57,40 +91,65 @@ function GridToolbarQuickFilter(props) {
|
|
|
57
91
|
parser: quickFilterParser,
|
|
58
92
|
formatter: quickFilterFormatter,
|
|
59
93
|
debounceMs: debounceMs,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
render: (quickFilterProps, state) => {
|
|
95
|
+
const currentOwnerState = (0, _extends2.default)({}, ownerState, {
|
|
96
|
+
expanded: state.expanded
|
|
97
|
+
});
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridQuickFilterRoot, (0, _extends2.default)({}, quickFilterProps, {
|
|
99
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
100
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_quickFilter.QuickFilterTrigger, {
|
|
101
|
+
render: triggerProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
|
|
102
|
+
title: apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
103
|
+
enterDelay: 0 // Prevents tooltip lagging behind transitioning trigger element
|
|
104
|
+
,
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(GridQuickFilterTrigger, (0, _extends2.default)({
|
|
106
|
+
className: classes.trigger
|
|
107
|
+
}, triggerProps, {
|
|
108
|
+
ownerState: currentOwnerState,
|
|
109
|
+
color: "default",
|
|
110
|
+
"aria-disabled": state.expanded,
|
|
111
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterIcon, {
|
|
77
112
|
fontSize: "small"
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
113
|
+
})
|
|
114
|
+
}))
|
|
115
|
+
})
|
|
116
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_quickFilter.QuickFilterControl, {
|
|
117
|
+
render: _ref => {
|
|
118
|
+
let {
|
|
119
|
+
ref,
|
|
120
|
+
slotProps: controlSlotProps
|
|
121
|
+
} = _ref,
|
|
122
|
+
controlProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded2);
|
|
123
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridQuickFilterTextField, (0, _extends2.default)({
|
|
124
|
+
as: rootProps.slots.baseTextField,
|
|
125
|
+
className: classes.control,
|
|
126
|
+
ownerState: currentOwnerState,
|
|
127
|
+
inputRef: ref,
|
|
128
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
129
|
+
placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),
|
|
130
|
+
size: "small",
|
|
131
|
+
slotProps: (0, _extends2.default)({
|
|
132
|
+
input: (0, _extends2.default)({
|
|
133
|
+
startAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterIcon, {
|
|
85
134
|
fontSize: "small"
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
135
|
+
}),
|
|
136
|
+
endAdornment: controlProps.value ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_quickFilter.QuickFilterClear, {
|
|
137
|
+
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, {
|
|
138
|
+
size: "small",
|
|
139
|
+
edge: "end",
|
|
140
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
141
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterClearIcon, {
|
|
142
|
+
fontSize: "small"
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
}) : null
|
|
146
|
+
}, controlSlotProps?.input)
|
|
147
|
+
}, controlSlotProps)
|
|
148
|
+
}, rootProps.slotProps?.baseTextField, controlProps, slotProps?.root, other));
|
|
149
|
+
}
|
|
150
|
+
})]
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
94
153
|
});
|
|
95
154
|
}
|
|
96
155
|
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 };
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.GridToolbar = GridToolbar;
|
|
9
|
+
exports.GridToolbarDivider = GridToolbarDivider;
|
|
10
|
+
exports.GridToolbarLabel = GridToolbarLabel;
|
|
9
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
13
|
var React = _interopRequireWildcard(require("react"));
|
|
11
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
-
var _Menu = _interopRequireDefault(require("@mui/material/Menu"));
|
|
13
15
|
var _useId = _interopRequireDefault(require("@mui/utils/useId"));
|
|
14
16
|
var _system = require("@mui/system");
|
|
17
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
18
|
+
var _GridMenu = require("../menu/GridMenu");
|
|
15
19
|
var _Toolbar = require("./Toolbar");
|
|
16
20
|
var _ToolbarButton = require("./ToolbarButton");
|
|
17
21
|
var _filterPanel = require("../filterPanel");
|
|
@@ -22,7 +26,20 @@ var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
|
22
26
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
23
27
|
var _assert = require("../../utils/assert");
|
|
24
28
|
var _cssVariables = require("../../constants/cssVariables");
|
|
29
|
+
var _gridClasses = require("../../constants/gridClasses");
|
|
25
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
const _excluded = ["className"],
|
|
32
|
+
_excluded2 = ["className"];
|
|
33
|
+
const useUtilityClasses = ownerState => {
|
|
34
|
+
const {
|
|
35
|
+
classes
|
|
36
|
+
} = ownerState;
|
|
37
|
+
const slots = {
|
|
38
|
+
divider: ['toolbarDivider'],
|
|
39
|
+
label: ['toolbarLabel']
|
|
40
|
+
};
|
|
41
|
+
return (0, _composeClasses.default)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
42
|
+
};
|
|
26
43
|
const Divider = (0, _system.styled)(_assert.NotRendered, {
|
|
27
44
|
name: 'MuiDataGrid',
|
|
28
45
|
slot: 'ToolbarDivider'
|
|
@@ -30,6 +47,44 @@ const Divider = (0, _system.styled)(_assert.NotRendered, {
|
|
|
30
47
|
height: '50%',
|
|
31
48
|
margin: _cssVariables.vars.spacing(0, 0.5)
|
|
32
49
|
});
|
|
50
|
+
const Label = (0, _system.styled)('span', {
|
|
51
|
+
name: 'MuiDataGrid',
|
|
52
|
+
slot: 'ToolbarLabel'
|
|
53
|
+
})({
|
|
54
|
+
flex: 1,
|
|
55
|
+
font: _cssVariables.vars.typography.font.large,
|
|
56
|
+
fontWeight: _cssVariables.vars.typography.fontWeight.medium,
|
|
57
|
+
margin: _cssVariables.vars.spacing(0, 0.5),
|
|
58
|
+
textOverflow: 'ellipsis',
|
|
59
|
+
overflow: 'hidden',
|
|
60
|
+
whiteSpace: 'nowrap'
|
|
61
|
+
});
|
|
62
|
+
function GridToolbarDivider(props) {
|
|
63
|
+
const other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
64
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
65
|
+
const classes = useUtilityClasses(rootProps);
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, (0, _extends2.default)({
|
|
67
|
+
as: rootProps.slots.baseDivider,
|
|
68
|
+
orientation: "vertical",
|
|
69
|
+
className: classes.divider
|
|
70
|
+
}, other));
|
|
71
|
+
}
|
|
72
|
+
process.env.NODE_ENV !== "production" ? GridToolbarDivider.propTypes = {
|
|
73
|
+
// ----------------------------- Warning --------------------------------
|
|
74
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
75
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
76
|
+
// ----------------------------------------------------------------------
|
|
77
|
+
className: _propTypes.default.string,
|
|
78
|
+
orientation: _propTypes.default.oneOf(['horizontal', 'vertical'])
|
|
79
|
+
} : void 0;
|
|
80
|
+
function GridToolbarLabel(props) {
|
|
81
|
+
const other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
|
|
82
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
83
|
+
const classes = useUtilityClasses(rootProps);
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Label, (0, _extends2.default)({
|
|
85
|
+
className: classes.label
|
|
86
|
+
}, other));
|
|
87
|
+
}
|
|
33
88
|
function GridToolbar(props) {
|
|
34
89
|
const {
|
|
35
90
|
showQuickFilter = true,
|
|
@@ -47,7 +102,9 @@ function GridToolbar(props) {
|
|
|
47
102
|
const showExportMenu = !csvOptions?.disableToolbarButton || !printOptions?.disableToolbarButton || additionalExportMenuItems;
|
|
48
103
|
const closeExportMenu = () => setExportMenuOpen(false);
|
|
49
104
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Toolbar.Toolbar, {
|
|
50
|
-
children: [
|
|
105
|
+
children: [rootProps.label && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarLabel, {
|
|
106
|
+
children: rootProps.label
|
|
107
|
+
}), !rootProps.disableColumnSelector && /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
|
|
51
108
|
title: apiRef.current.getLocaleText('toolbarColumns'),
|
|
52
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_columnsPanel.ColumnsPanelTrigger, {
|
|
53
110
|
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarButton.ToolbarButton, {}),
|
|
@@ -59,7 +116,6 @@ function GridToolbar(props) {
|
|
|
59
116
|
title: apiRef.current.getLocaleText('toolbarFilters'),
|
|
60
117
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_filterPanel.FilterPanelTrigger, {
|
|
61
118
|
render: (triggerProps, state) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarButton.ToolbarButton, (0, _extends2.default)({}, triggerProps, {
|
|
62
|
-
color: "default",
|
|
63
119
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseBadge, {
|
|
64
120
|
badgeContent: state.filterCount,
|
|
65
121
|
color: "primary",
|
|
@@ -70,10 +126,7 @@ function GridToolbar(props) {
|
|
|
70
126
|
})
|
|
71
127
|
}))
|
|
72
128
|
})
|
|
73
|
-
}), showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
74
|
-
as: rootProps.slots.baseDivider,
|
|
75
|
-
orientation: "vertical"
|
|
76
|
-
}), showExportMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
129
|
+
}), showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarDivider, {}), showExportMenu && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
77
130
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTooltip, {
|
|
78
131
|
title: apiRef.current.getLocaleText('toolbarExport'),
|
|
79
132
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarButton.ToolbarButton, {
|
|
@@ -82,32 +135,37 @@ function GridToolbar(props) {
|
|
|
82
135
|
"aria-controls": exportMenuId,
|
|
83
136
|
"aria-haspopup": "true",
|
|
84
137
|
"aria-expanded": exportMenuOpen ? 'true' : undefined,
|
|
85
|
-
onClick: () => setExportMenuOpen(
|
|
138
|
+
onClick: () => setExportMenuOpen(!exportMenuOpen),
|
|
86
139
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.exportIcon, {
|
|
87
140
|
fontSize: "small"
|
|
88
141
|
})
|
|
89
142
|
})
|
|
90
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
91
|
-
|
|
92
|
-
anchorEl: exportMenuTriggerRef.current,
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridMenu.GridMenu, {
|
|
144
|
+
target: exportMenuTriggerRef.current,
|
|
93
145
|
open: exportMenuOpen,
|
|
94
146
|
onClose: closeExportMenu,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
147
|
+
position: "bottom-end",
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseMenuList, (0, _extends2.default)({
|
|
149
|
+
id: exportMenuId,
|
|
150
|
+
"aria-labelledby": exportMenuTriggerId,
|
|
151
|
+
autoFocusItem: true
|
|
152
|
+
}, rootProps.slotProps?.baseMenuList, {
|
|
153
|
+
children: [!printOptions?.disableToolbarButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_export.ExportPrint, {
|
|
154
|
+
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, (0, _extends2.default)({}, rootProps.slotProps?.baseMenuItem)),
|
|
155
|
+
options: printOptions,
|
|
156
|
+
onClick: closeExportMenu,
|
|
157
|
+
children: apiRef.current.getLocaleText('toolbarExportPrint')
|
|
158
|
+
}), !csvOptions?.disableToolbarButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_export.ExportCsv, {
|
|
159
|
+
render: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseMenuItem, (0, _extends2.default)({}, rootProps.slotProps?.baseMenuItem)),
|
|
160
|
+
options: csvOptions,
|
|
161
|
+
onClick: closeExportMenu,
|
|
162
|
+
children: apiRef.current.getLocaleText('toolbarExportCSV')
|
|
163
|
+
}), additionalExportMenuItems?.(closeExportMenu)]
|
|
164
|
+
}))
|
|
109
165
|
})]
|
|
110
|
-
}), showQuickFilter && /*#__PURE__*/(0, _jsxRuntime.
|
|
166
|
+
}), showQuickFilter && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
167
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(GridToolbarDivider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridToolbarQuickFilter.GridToolbarQuickFilter, (0, _extends2.default)({}, quickFilterProps))]
|
|
168
|
+
})]
|
|
111
169
|
});
|
|
112
170
|
}
|
|
113
171
|
process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
@@ -8,7 +8,7 @@ export type ToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
render?: RenderProp<React.ComponentProps<typeof ToolbarRoot>>;
|
|
9
9
|
};
|
|
10
10
|
type OwnerState = DataGridProcessedProps;
|
|
11
|
-
declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/
|
|
11
|
+
declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme> & {
|
|
12
12
|
ownerState: OwnerState;
|
|
13
13
|
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
14
14
|
/**
|