@mui/x-data-grid 8.0.0-alpha.12 → 8.0.0-alpha.14
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 +430 -0
- package/DataGrid/DataGrid.js +31 -22
- package/DataGrid/useDataGridProps.js +1 -1
- package/colDef/gridActionsColDef.js +1 -1
- package/colDef/gridBooleanColDef.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +2 -4
- package/components/GridFooter.js +1 -1
- package/components/GridHeader.js +1 -1
- package/components/GridPagination.js +5 -6
- package/components/GridRowCount.js +4 -5
- package/components/GridScrollArea.js +4 -3
- package/components/GridSelectedRowCount.js +5 -6
- package/components/GridShadowScrollArea.d.ts +8 -0
- package/components/GridShadowScrollArea.js +82 -0
- package/components/cell/GridEditInputCell.js +2 -3
- package/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/components/columnsManagement/GridColumnsManagement.js +60 -61
- package/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
- package/components/columnsPanel/ColumnsPanelTrigger.js +209 -0
- package/components/columnsPanel/index.d.ts +1 -0
- package/components/columnsPanel/index.js +16 -0
- package/components/containers/GridOverlay.js +6 -8
- package/components/containers/GridRoot.js +4 -2
- package/components/containers/GridRootStyles.d.ts +1 -2
- package/components/containers/GridRootStyles.js +77 -100
- package/components/containers/GridToolbarContainer.js +5 -6
- package/components/export/ExportCsv.d.ts +30 -0
- package/components/export/ExportCsv.js +196 -0
- package/components/export/ExportPrint.d.ts +30 -0
- package/components/export/ExportPrint.js +196 -0
- package/components/export/index.d.ts +2 -0
- package/components/export/index.js +27 -0
- package/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
- package/components/filterPanel/FilterPanelTrigger.js +212 -0
- package/components/filterPanel/index.d.ts +1 -0
- package/components/filterPanel/index.js +16 -0
- package/components/index.d.ts +6 -1
- package/components/index.js +60 -0
- package/components/menu/GridMenu.js +7 -6
- package/components/menu/columnMenu/GridColumnHeaderMenu.js +4 -3
- package/components/panel/GridPanel.js +18 -20
- package/components/panel/GridPanelContent.js +6 -8
- package/components/panel/GridPanelFooter.js +5 -6
- package/components/panel/GridPanelHeader.js +4 -5
- package/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +20 -45
- package/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/components/quickFilter/QuickFilter.d.ts +41 -0
- package/components/quickFilter/QuickFilter.js +110 -0
- package/components/quickFilter/QuickFilterClear.d.ts +28 -0
- package/components/quickFilter/QuickFilterClear.js +161 -0
- package/components/quickFilter/QuickFilterContext.d.ts +13 -0
- package/components/quickFilter/QuickFilterContext.js +17 -0
- package/components/quickFilter/QuickFilterControl.d.ts +28 -0
- package/components/quickFilter/QuickFilterControl.js +104 -0
- package/components/quickFilter/index.d.ts +3 -0
- package/components/quickFilter/index.js +38 -0
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/components/toolbar/GridToolbarQuickFilter.js +57 -97
- package/components/toolbarV8/GridToolbar.d.ts +11 -0
- package/components/toolbarV8/GridToolbar.js +142 -0
- package/components/toolbarV8/Toolbar.d.ts +32 -0
- package/components/toolbarV8/Toolbar.js +132 -0
- package/components/toolbarV8/ToolbarButton.d.ts +23 -0
- package/components/toolbarV8/ToolbarButton.js +179 -0
- package/components/toolbarV8/ToolbarContext.d.ts +9 -0
- package/components/toolbarV8/ToolbarContext.js +17 -0
- package/components/toolbarV8/index.d.ts +2 -0
- package/components/toolbarV8/index.js +27 -0
- package/components/virtualization/GridVirtualScrollbar.js +15 -6
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/cssVariables.d.ts +294 -0
- package/constants/cssVariables.js +168 -0
- package/constants/dataGridPropsDefaultValues.js +1 -0
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/gridClasses.d.ts +17 -0
- package/constants/gridClasses.js +1 -1
- package/context/GridContextProvider.js +4 -1
- package/esm/DataGrid/DataGrid.js +31 -22
- package/esm/DataGrid/useDataGridProps.js +1 -1
- package/esm/colDef/gridActionsColDef.js +1 -1
- package/esm/colDef/gridBooleanColDef.js +1 -1
- package/esm/colDef/gridCheckboxSelectionColDef.js +2 -4
- package/esm/components/GridFooter.js +2 -2
- package/esm/components/GridHeader.js +1 -1
- package/esm/components/GridPagination.js +5 -6
- package/esm/components/GridRowCount.js +4 -5
- package/esm/components/GridScrollArea.js +2 -1
- package/esm/components/GridSelectedRowCount.js +5 -6
- package/esm/components/GridShadowScrollArea.d.ts +8 -0
- package/esm/components/GridShadowScrollArea.js +74 -0
- package/esm/components/cell/GridEditInputCell.js +2 -3
- package/esm/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/esm/components/columnsManagement/GridColumnsManagement.js +61 -62
- package/esm/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
- package/esm/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
- package/esm/components/columnsPanel/index.d.ts +1 -0
- package/esm/components/columnsPanel/index.js +1 -0
- package/esm/components/containers/GridOverlay.js +6 -8
- package/esm/components/containers/GridRoot.js +4 -2
- package/esm/components/containers/GridRootStyles.d.ts +1 -2
- package/esm/components/containers/GridRootStyles.js +78 -101
- package/esm/components/containers/GridToolbarContainer.js +5 -6
- package/esm/components/export/ExportCsv.d.ts +30 -0
- package/esm/components/export/ExportCsv.js +189 -0
- package/esm/components/export/ExportPrint.d.ts +30 -0
- package/esm/components/export/ExportPrint.js +189 -0
- package/esm/components/export/index.d.ts +2 -0
- package/esm/components/export/index.js +2 -0
- package/esm/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
- package/esm/components/filterPanel/FilterPanelTrigger.js +205 -0
- package/esm/components/filterPanel/index.d.ts +1 -0
- package/esm/components/filterPanel/index.js +1 -0
- package/esm/components/index.d.ts +6 -1
- package/esm/components/index.js +6 -1
- package/esm/components/menu/GridMenu.js +7 -6
- package/esm/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/esm/components/panel/GridPanel.js +18 -20
- package/esm/components/panel/GridPanelContent.js +6 -8
- package/esm/components/panel/GridPanelFooter.js +5 -6
- package/esm/components/panel/GridPanelHeader.js +4 -5
- package/esm/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/esm/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/esm/components/quickFilter/QuickFilter.d.ts +41 -0
- package/esm/components/quickFilter/QuickFilter.js +103 -0
- package/esm/components/quickFilter/QuickFilterClear.d.ts +28 -0
- package/esm/components/quickFilter/QuickFilterClear.js +154 -0
- package/esm/components/quickFilter/QuickFilterContext.d.ts +13 -0
- package/esm/components/quickFilter/QuickFilterContext.js +9 -0
- package/esm/components/quickFilter/QuickFilterControl.d.ts +28 -0
- package/esm/components/quickFilter/QuickFilterControl.js +97 -0
- package/esm/components/quickFilter/index.d.ts +3 -0
- package/esm/components/quickFilter/index.js +3 -0
- package/esm/components/toolbar/GridToolbar.d.ts +1 -1
- package/esm/components/toolbar/GridToolbar.js +2 -2
- package/esm/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/esm/components/toolbar/GridToolbarQuickFilter.js +59 -97
- package/esm/components/toolbarV8/GridToolbar.d.ts +11 -0
- package/esm/components/toolbarV8/GridToolbar.js +135 -0
- package/esm/components/toolbarV8/Toolbar.d.ts +32 -0
- package/esm/components/toolbarV8/Toolbar.js +125 -0
- package/esm/components/toolbarV8/ToolbarButton.d.ts +23 -0
- package/esm/components/toolbarV8/ToolbarButton.js +172 -0
- package/esm/components/toolbarV8/ToolbarContext.d.ts +9 -0
- package/esm/components/toolbarV8/ToolbarContext.js +9 -0
- package/esm/components/toolbarV8/index.d.ts +2 -0
- package/esm/components/toolbarV8/index.js +2 -0
- package/esm/components/virtualization/GridVirtualScrollbar.js +10 -2
- package/esm/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/esm/constants/cssVariables.d.ts +294 -0
- package/esm/constants/cssVariables.js +161 -0
- package/esm/constants/dataGridPropsDefaultValues.js +1 -0
- package/esm/constants/defaultGridSlotsComponents.js +2 -1
- package/esm/constants/gridClasses.d.ts +17 -0
- package/esm/constants/gridClasses.js +1 -1
- package/esm/context/GridContextProvider.js +4 -1
- package/esm/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/esm/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/esm/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/esm/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/esm/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/esm/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/esm/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/esm/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/esm/hooks/features/columns/index.d.ts +1 -1
- package/esm/hooks/features/columns/index.js +1 -1
- package/esm/hooks/features/columns/useGridColumns.js +4 -2
- package/esm/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/esm/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/esm/hooks/features/dataSource/index.d.ts +2 -0
- package/esm/hooks/features/dataSource/index.js +2 -0
- package/esm/hooks/features/dataSource/models.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/esm/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/esm/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/esm/hooks/features/editing/useGridCellEditing.js +2 -1
- package/esm/hooks/features/editing/useGridRowEditing.js +2 -1
- package/esm/hooks/features/export/utils.js +4 -2
- package/esm/hooks/features/focus/useGridFocus.js +3 -2
- package/esm/hooks/features/index.d.ts +1 -1
- package/esm/hooks/features/index.js +1 -1
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/esm/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/esm/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/esm/hooks/features/rowSelection/utils.d.ts +2 -2
- package/esm/hooks/features/rowSelection/utils.js +11 -11
- package/esm/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/esm/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/esm/hooks/features/rows/gridRowsUtils.js +8 -0
- package/esm/hooks/features/rows/useGridParamsApi.js +2 -8
- package/esm/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/esm/hooks/features/rows/useGridRows.d.ts +2 -2
- package/esm/hooks/features/rows/useGridRows.js +7 -7
- package/esm/hooks/features/rows/useGridRowsMeta.js +8 -0
- package/esm/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
- package/esm/hooks/features/virtualization/useGridVirtualScroller.js +5 -11
- package/esm/hooks/utils/index.d.ts +2 -1
- package/esm/hooks/utils/useGridComponentRenderer.d.ts +12 -0
- package/esm/hooks/utils/useGridComponentRenderer.js +36 -0
- package/esm/hooks/utils/useGridSelector.js +4 -1
- package/esm/hooks/utils/useIsSSR.js +4 -1
- package/esm/index.js +1 -1
- package/esm/internals/demo/TailwindDemoContainer.d.ts +11 -0
- package/esm/internals/demo/TailwindDemoContainer.js +55 -0
- package/esm/internals/demo/index.d.ts +1 -0
- package/esm/internals/demo/index.js +1 -0
- package/esm/internals/index.d.ts +6 -1
- package/esm/internals/index.js +5 -1
- package/esm/internals/utils/propValidation.js +1 -1
- package/esm/locales/bnBD.d.ts +2 -0
- package/esm/locales/bnBD.js +167 -0
- package/esm/locales/deDE.js +3 -5
- package/esm/locales/huHU.js +10 -13
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/locales/ruRU.js +17 -21
- package/esm/material/icons/index.d.ts +3 -3
- package/esm/material/icons/index.js +6 -6
- package/esm/material/index.d.ts +1 -0
- package/esm/material/index.js +167 -52
- package/esm/material/variables.d.ts +5 -0
- package/esm/material/variables.js +89 -0
- package/esm/models/api/gridRowSelectionApi.d.ts +4 -2
- package/esm/models/api/gridSortApi.d.ts +1 -1
- package/esm/models/configuration/gridConfiguration.d.ts +7 -1
- package/esm/models/gridBaseSlots.d.ts +61 -7
- package/esm/models/gridDataSource.d.ts +9 -4
- package/esm/models/gridIconSlotsComponent.d.ts +1 -1
- package/esm/models/gridRowSelectionManager.d.ts +9 -0
- package/esm/models/gridRowSelectionManager.js +36 -0
- package/esm/models/gridRowSelectionModel.d.ts +4 -2
- package/esm/models/gridSlotsComponent.d.ts +7 -28
- package/esm/models/gridSlotsComponentsProps.d.ts +3 -11
- package/esm/models/gridSortModel.d.ts +1 -1
- package/esm/models/index.d.ts +2 -1
- package/esm/models/index.js +2 -3
- package/esm/models/props/DataGridProps.d.ts +22 -17
- package/esm/utils/css/context.d.ts +14 -0
- package/esm/utils/css/context.js +54 -0
- package/esm/utils/index.d.ts +2 -1
- package/esm/utils/index.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/hooks/features/columnResize/useGridColumnResize.js +28 -27
- package/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/hooks/features/columns/gridColumnsSelector.js +9 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/hooks/features/columns/index.d.ts +1 -1
- package/hooks/features/columns/index.js +94 -10
- package/hooks/features/columns/useGridColumns.js +4 -2
- package/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/hooks/features/dataSource/gridDataSourceError.js +40 -0
- package/hooks/features/dataSource/index.d.ts +2 -0
- package/hooks/features/dataSource/index.js +25 -0
- package/hooks/features/dataSource/models.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/hooks/features/dimensions/useGridDimensions.js +19 -18
- package/hooks/features/editing/useGridCellEditing.js +10 -9
- package/hooks/features/editing/useGridRowEditing.js +11 -10
- package/hooks/features/export/utils.js +4 -2
- package/hooks/features/focus/useGridFocus.js +8 -7
- package/hooks/features/index.d.ts +1 -1
- package/hooks/features/index.js +11 -28
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/hooks/features/rowSelection/useGridRowSelection.js +146 -79
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rowSelection/utils.js +10 -10
- package/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/hooks/features/rows/gridRowsUtils.js +10 -1
- package/hooks/features/rows/useGridParamsApi.js +2 -8
- package/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/hooks/features/rows/useGridRows.d.ts +2 -2
- package/hooks/features/rows/useGridRows.js +7 -7
- package/hooks/features/rows/useGridRowsMeta.js +8 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
- package/hooks/features/virtualization/useGridVirtualScroller.js +21 -27
- package/hooks/utils/index.d.ts +2 -1
- package/hooks/utils/useGridComponentRenderer.d.ts +12 -0
- package/hooks/utils/useGridComponentRenderer.js +44 -0
- package/hooks/utils/useGridSelector.js +6 -2
- package/hooks/utils/useIsSSR.js +6 -2
- package/index.js +1 -1
- package/internals/demo/TailwindDemoContainer.d.ts +11 -0
- package/internals/demo/TailwindDemoContainer.js +63 -0
- package/internals/demo/index.d.ts +1 -0
- package/internals/demo/index.js +12 -0
- package/internals/index.d.ts +6 -1
- package/internals/index.js +43 -0
- package/internals/utils/propValidation.js +1 -1
- package/locales/bnBD.d.ts +2 -0
- package/locales/bnBD.js +173 -0
- package/locales/deDE.js +3 -5
- package/locales/huHU.js +10 -13
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/locales/ruRU.js +17 -21
- package/material/icons/index.d.ts +3 -3
- package/material/icons/index.js +7 -7
- package/material/index.d.ts +1 -0
- package/material/index.js +172 -51
- package/material/variables.d.ts +5 -0
- package/material/variables.js +95 -0
- package/models/api/gridRowSelectionApi.d.ts +4 -2
- package/models/api/gridSortApi.d.ts +1 -1
- package/models/configuration/gridConfiguration.d.ts +7 -1
- package/models/gridBaseSlots.d.ts +61 -7
- package/models/gridDataSource.d.ts +9 -4
- package/models/gridIconSlotsComponent.d.ts +1 -1
- package/models/gridRowSelectionManager.d.ts +9 -0
- package/models/gridRowSelectionManager.js +43 -0
- package/models/gridRowSelectionModel.d.ts +4 -2
- package/models/gridSlotsComponent.d.ts +7 -28
- package/models/gridSlotsComponentsProps.d.ts +3 -11
- package/models/gridSortModel.d.ts +1 -1
- package/models/index.d.ts +2 -1
- package/models/index.js +34 -11
- package/models/props/DataGridProps.d.ts +22 -17
- package/modern/DataGrid/DataGrid.js +31 -22
- package/modern/DataGrid/useDataGridProps.js +1 -1
- package/modern/colDef/gridActionsColDef.js +1 -1
- package/modern/colDef/gridBooleanColDef.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +2 -4
- package/modern/components/GridFooter.js +2 -2
- package/modern/components/GridHeader.js +1 -1
- package/modern/components/GridPagination.js +5 -6
- package/modern/components/GridRowCount.js +4 -5
- package/modern/components/GridScrollArea.js +2 -1
- package/modern/components/GridSelectedRowCount.js +5 -6
- package/modern/components/GridShadowScrollArea.d.ts +8 -0
- package/modern/components/GridShadowScrollArea.js +74 -0
- package/modern/components/cell/GridEditInputCell.js +2 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +51 -17
- package/modern/components/columnsManagement/GridColumnsManagement.js +61 -62
- package/modern/components/columnsPanel/ColumnsPanelTrigger.d.ts +33 -0
- package/modern/components/columnsPanel/ColumnsPanelTrigger.js +202 -0
- package/modern/components/columnsPanel/index.d.ts +1 -0
- package/modern/components/columnsPanel/index.js +1 -0
- package/modern/components/containers/GridOverlay.js +6 -8
- package/modern/components/containers/GridRoot.js +4 -2
- package/modern/components/containers/GridRootStyles.d.ts +1 -2
- package/modern/components/containers/GridRootStyles.js +78 -101
- package/modern/components/containers/GridToolbarContainer.js +5 -6
- package/modern/components/export/ExportCsv.d.ts +30 -0
- package/modern/components/export/ExportCsv.js +189 -0
- package/modern/components/export/ExportPrint.d.ts +30 -0
- package/modern/components/export/ExportPrint.js +189 -0
- package/modern/components/export/index.d.ts +2 -0
- package/modern/components/export/index.js +2 -0
- package/modern/components/filterPanel/FilterPanelTrigger.d.ts +37 -0
- package/modern/components/filterPanel/FilterPanelTrigger.js +205 -0
- package/modern/components/filterPanel/index.d.ts +1 -0
- package/modern/components/filterPanel/index.js +1 -0
- package/modern/components/index.d.ts +6 -1
- package/modern/components/index.js +6 -1
- package/modern/components/menu/GridMenu.js +7 -6
- package/modern/components/menu/columnMenu/GridColumnHeaderMenu.js +2 -1
- package/modern/components/panel/GridPanel.js +18 -20
- package/modern/components/panel/GridPanelContent.js +6 -8
- package/modern/components/panel/GridPanelFooter.js +5 -6
- package/modern/components/panel/GridPanelHeader.js +4 -5
- package/modern/components/panel/filterPanel/GridFilterForm.js +13 -20
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +10 -39
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +19 -44
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +3 -6
- package/modern/components/quickFilter/QuickFilter.d.ts +41 -0
- package/modern/components/quickFilter/QuickFilter.js +103 -0
- package/modern/components/quickFilter/QuickFilterClear.d.ts +28 -0
- package/modern/components/quickFilter/QuickFilterClear.js +154 -0
- package/modern/components/quickFilter/QuickFilterContext.d.ts +13 -0
- package/modern/components/quickFilter/QuickFilterContext.js +9 -0
- package/modern/components/quickFilter/QuickFilterControl.d.ts +28 -0
- package/modern/components/quickFilter/QuickFilterControl.js +97 -0
- package/modern/components/quickFilter/index.d.ts +3 -0
- package/modern/components/quickFilter/index.js +3 -0
- package/modern/components/toolbar/GridToolbar.d.ts +1 -1
- package/modern/components/toolbar/GridToolbar.js +2 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +5 -6
- package/modern/components/toolbar/GridToolbarQuickFilter.js +59 -97
- package/modern/components/toolbarV8/GridToolbar.d.ts +11 -0
- package/modern/components/toolbarV8/GridToolbar.js +135 -0
- package/modern/components/toolbarV8/Toolbar.d.ts +32 -0
- package/modern/components/toolbarV8/Toolbar.js +125 -0
- package/modern/components/toolbarV8/ToolbarButton.d.ts +23 -0
- package/modern/components/toolbarV8/ToolbarButton.js +172 -0
- package/modern/components/toolbarV8/ToolbarContext.d.ts +9 -0
- package/modern/components/toolbarV8/ToolbarContext.js +9 -0
- package/modern/components/toolbarV8/index.d.ts +2 -0
- package/modern/components/toolbarV8/index.js +2 -0
- package/modern/components/virtualization/GridVirtualScrollbar.js +10 -2
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/cssVariables.d.ts +294 -0
- package/modern/constants/cssVariables.js +161 -0
- package/modern/constants/dataGridPropsDefaultValues.js +1 -0
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/gridClasses.d.ts +17 -0
- package/modern/constants/gridClasses.js +1 -1
- package/modern/context/GridContextProvider.js +4 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +3 -2
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/gridColumnsInterfaces.d.ts +1 -0
- package/modern/hooks/features/columns/gridColumnsSelector.d.ts +7 -0
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -0
- package/modern/hooks/features/columns/gridColumnsUtils.d.ts +3 -1
- package/modern/hooks/features/columns/gridColumnsUtils.js +6 -3
- package/modern/hooks/features/columns/index.d.ts +1 -1
- package/modern/hooks/features/columns/index.js +1 -1
- package/modern/hooks/features/columns/useGridColumns.js +4 -2
- package/modern/hooks/features/dataSource/gridDataSourceError.d.ts +31 -0
- package/modern/hooks/features/dataSource/gridDataSourceError.js +32 -0
- package/modern/hooks/features/dataSource/index.d.ts +2 -0
- package/modern/hooks/features/dataSource/index.js +2 -0
- package/modern/hooks/features/dataSource/models.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.d.ts +1 -1
- package/modern/hooks/features/dataSource/useGridDataSourceBase.js +27 -17
- package/modern/hooks/features/dimensions/useGridDimensions.js +11 -10
- package/modern/hooks/features/editing/useGridCellEditing.js +2 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -1
- package/modern/hooks/features/export/utils.js +4 -2
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/index.d.ts +1 -1
- package/modern/hooks/features/index.js +1 -1
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/modern/hooks/features/rowSelection/gridRowSelectionSelector.js +27 -7
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +148 -81
- package/modern/hooks/features/rowSelection/utils.d.ts +2 -2
- package/modern/hooks/features/rowSelection/utils.js +11 -11
- package/modern/hooks/features/rows/gridRowsInterfaces.d.ts +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.d.ts +2 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +8 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +2 -8
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +2 -4
- package/modern/hooks/features/rows/useGridRows.d.ts +2 -2
- package/modern/hooks/features/rows/useGridRows.js +7 -7
- package/modern/hooks/features/rows/useGridRowsMeta.js +8 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.d.ts +0 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +5 -11
- package/modern/hooks/utils/index.d.ts +2 -1
- package/modern/hooks/utils/useGridComponentRenderer.d.ts +12 -0
- package/modern/hooks/utils/useGridComponentRenderer.js +36 -0
- package/modern/hooks/utils/useGridSelector.js +4 -1
- package/modern/hooks/utils/useIsSSR.js +4 -1
- package/modern/index.js +1 -1
- package/modern/internals/demo/TailwindDemoContainer.d.ts +11 -0
- package/modern/internals/demo/TailwindDemoContainer.js +55 -0
- package/modern/internals/demo/index.d.ts +1 -0
- package/modern/internals/demo/index.js +1 -0
- package/modern/internals/index.d.ts +6 -1
- package/modern/internals/index.js +5 -1
- package/modern/internals/utils/propValidation.js +1 -1
- package/modern/locales/bnBD.d.ts +2 -0
- package/modern/locales/bnBD.js +167 -0
- package/modern/locales/deDE.js +3 -5
- package/modern/locales/huHU.js +10 -13
- package/modern/locales/index.d.ts +1 -0
- package/modern/locales/index.js +1 -0
- package/modern/locales/ruRU.js +17 -21
- package/modern/material/icons/index.d.ts +3 -3
- package/modern/material/icons/index.js +6 -6
- package/modern/material/index.d.ts +1 -0
- package/modern/material/index.js +167 -52
- package/modern/material/variables.d.ts +5 -0
- package/modern/material/variables.js +89 -0
- package/modern/models/api/gridRowSelectionApi.d.ts +4 -2
- package/modern/models/api/gridSortApi.d.ts +1 -1
- package/modern/models/configuration/gridConfiguration.d.ts +7 -1
- package/modern/models/gridBaseSlots.d.ts +61 -7
- package/modern/models/gridDataSource.d.ts +9 -4
- package/modern/models/gridIconSlotsComponent.d.ts +1 -1
- package/modern/models/gridRowSelectionManager.d.ts +9 -0
- package/modern/models/gridRowSelectionManager.js +36 -0
- package/modern/models/gridRowSelectionModel.d.ts +4 -2
- package/modern/models/gridSlotsComponent.d.ts +7 -28
- package/modern/models/gridSlotsComponentsProps.d.ts +3 -11
- package/modern/models/gridSortModel.d.ts +1 -1
- package/modern/models/index.d.ts +2 -1
- package/modern/models/index.js +2 -3
- package/modern/models/props/DataGridProps.d.ts +22 -17
- package/modern/utils/css/context.d.ts +14 -0
- package/modern/utils/css/context.js +54 -0
- package/modern/utils/index.d.ts +2 -1
- package/modern/utils/index.js +1 -1
- package/package.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/utils/css/context.d.ts +14 -0
- package/utils/css/context.js +64 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +8 -1
|
@@ -12,6 +12,7 @@ var _useGridApiMethod = require("../../utils/useGridApiMethod");
|
|
|
12
12
|
var _gridFocusStateSelector = require("../focus/gridFocusStateSelector");
|
|
13
13
|
var _gridListViewSelectors = require("../listView/gridListViewSelectors");
|
|
14
14
|
var _gridRowsSelector = require("./gridRowsSelector");
|
|
15
|
+
var _gridRowsUtils = require("./gridRowsUtils");
|
|
15
16
|
class MissingRowIdError extends Error {}
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -97,14 +98,7 @@ function useGridParamsApi(apiRef, props) {
|
|
|
97
98
|
}
|
|
98
99
|
return colDef.valueGetter(row[colDef.field], row, colDef, apiRef);
|
|
99
100
|
}, [apiRef]);
|
|
100
|
-
const getRowValue = React.useCallback((row, colDef) =>
|
|
101
|
-
const field = colDef.field;
|
|
102
|
-
if (!colDef || !colDef.valueGetter) {
|
|
103
|
-
return row[field];
|
|
104
|
-
}
|
|
105
|
-
const value = row[colDef.field];
|
|
106
|
-
return colDef.valueGetter(value, row, colDef, apiRef);
|
|
107
|
-
}, [apiRef]);
|
|
101
|
+
const getRowValue = React.useCallback((row, colDef) => (0, _gridRowsUtils.getRowValue)(row, colDef, apiRef), [apiRef]);
|
|
108
102
|
const getRowFormattedValue = React.useCallback((row, colDef) => {
|
|
109
103
|
const value = getRowValue(row, colDef);
|
|
110
104
|
if (!colDef || !colDef.valueFormatter) {
|
|
@@ -6,22 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useGridRowAriaAttributes = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _rowSelection = require("../rowSelection");
|
|
10
9
|
var _useGridSelector = require("../../utils/useGridSelector");
|
|
11
10
|
var _gridColumnGroupsSelector = require("../columnGrouping/gridColumnGroupsSelector");
|
|
12
11
|
var _useGridPrivateApiContext = require("../../utils/useGridPrivateApiContext");
|
|
13
12
|
const useGridRowAriaAttributes = () => {
|
|
14
13
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
15
|
-
const selectedIdsLookup = (0, _useGridSelector.useGridSelector)(apiRef, _rowSelection.selectedIdsLookupSelector);
|
|
16
14
|
const headerGroupingMaxDepth = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsHeaderMaxDepthSelector);
|
|
17
15
|
return React.useCallback((rowNode, index) => {
|
|
18
16
|
const ariaAttributes = {};
|
|
19
17
|
const ariaRowIndex = index + headerGroupingMaxDepth + 2; // 1 for the header row and 1 as it's 1-based
|
|
20
18
|
ariaAttributes['aria-rowindex'] = ariaRowIndex;
|
|
21
19
|
if (apiRef.current.isRowSelectable(rowNode.id)) {
|
|
22
|
-
ariaAttributes['aria-selected'] =
|
|
20
|
+
ariaAttributes['aria-selected'] = apiRef.current.isRowSelected(rowNode.id);
|
|
23
21
|
}
|
|
24
22
|
return ariaAttributes;
|
|
25
|
-
}, [apiRef,
|
|
23
|
+
}, [apiRef, headerGroupingMaxDepth]);
|
|
26
24
|
};
|
|
27
25
|
exports.useGridRowAriaAttributes = useGridRowAriaAttributes;
|
|
@@ -2,5 +2,5 @@ import { RefObject } from '@mui/x-internals/types';
|
|
|
2
2
|
import { DataGridProcessedProps } from "../../../models/props/DataGridProps.js";
|
|
3
3
|
import { GridPrivateApiCommunity } from "../../../models/api/gridApiCommunity.js";
|
|
4
4
|
import { GridStateInitializer } from "../../utils/useGridInitializeState.js";
|
|
5
|
-
export declare const rowsStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, '
|
|
6
|
-
export declare const useGridRows: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "
|
|
5
|
+
export declare const rowsStateInitializer: GridStateInitializer<Pick<DataGridProcessedProps, 'dataSource' | 'rows' | 'rowCount' | 'getRowId' | 'loading'>>;
|
|
6
|
+
export declare const useGridRows: (apiRef: RefObject<GridPrivateApiCommunity>, props: Pick<DataGridProcessedProps, "rows" | "getRowId" | "rowCount" | "throttleRowsMs" | "signature" | "pagination" | "paginationMode" | "loading" | "dataSource">) => void;
|
|
@@ -24,7 +24,7 @@ var _gridRowsUtils = require("./gridRowsUtils");
|
|
|
24
24
|
var _pipeProcessing = require("../../core/pipeProcessing");
|
|
25
25
|
var _strategyProcessing = require("../../core/strategyProcessing");
|
|
26
26
|
const rowsStateInitializer = (state, props, apiRef) => {
|
|
27
|
-
const isDataSourceAvailable = !!props.
|
|
27
|
+
const isDataSourceAvailable = !!props.dataSource;
|
|
28
28
|
apiRef.current.caches.rows = (0, _gridRowsUtils.createRowsInternalCache)({
|
|
29
29
|
rows: isDataSourceAvailable ? [] : props.rows,
|
|
30
30
|
getRowId: props.getRowId,
|
|
@@ -365,16 +365,16 @@ const useGridRows = (apiRef, props) => {
|
|
|
365
365
|
throttle: false
|
|
366
366
|
});
|
|
367
367
|
}, [logger, apiRef, props.rows, props.getRowId, props.loading, props.rowCount, throttledRowsChange]);
|
|
368
|
-
const previousDataSource = (0, _useLazyRef.default)(() => props.
|
|
368
|
+
const previousDataSource = (0, _useLazyRef.default)(() => props.dataSource);
|
|
369
369
|
const handleStrategyProcessorChange = React.useCallback(methodName => {
|
|
370
|
-
if (props.
|
|
371
|
-
previousDataSource.current = props.
|
|
370
|
+
if (props.dataSource && props.dataSource !== previousDataSource.current) {
|
|
371
|
+
previousDataSource.current = props.dataSource;
|
|
372
372
|
return;
|
|
373
373
|
}
|
|
374
374
|
if (methodName === 'rowTreeCreation') {
|
|
375
375
|
groupRows();
|
|
376
376
|
}
|
|
377
|
-
}, [groupRows, previousDataSource, props.
|
|
377
|
+
}, [groupRows, previousDataSource, props.dataSource]);
|
|
378
378
|
const handleStrategyActivityChange = React.useCallback(() => {
|
|
379
379
|
// `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.
|
|
380
380
|
// All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.
|
|
@@ -425,7 +425,7 @@ const useGridRows = (apiRef, props) => {
|
|
|
425
425
|
isRowCountPropUpdated = true;
|
|
426
426
|
lastRowCount.current = props.rowCount;
|
|
427
427
|
}
|
|
428
|
-
const currentRows = props.
|
|
428
|
+
const currentRows = props.dataSource ? Array.from(apiRef.current.getRowModels().values()) : props.rows;
|
|
429
429
|
const areNewRowsAlreadyInState = apiRef.current.caches.rows.rowsBeforePartialUpdates === currentRows;
|
|
430
430
|
const isNewLoadingAlreadyInState = apiRef.current.caches.rows.loadingPropBeforePartialUpdates === props.loading;
|
|
431
431
|
const isNewRowCountAlreadyInState = apiRef.current.caches.rows.rowCountPropBeforePartialUpdates === props.rowCount;
|
|
@@ -464,6 +464,6 @@ const useGridRows = (apiRef, props) => {
|
|
|
464
464
|
}),
|
|
465
465
|
throttle: false
|
|
466
466
|
});
|
|
467
|
-
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.
|
|
467
|
+
}, [props.rows, props.rowCount, props.getRowId, props.loading, props.dataSource, logger, throttledRowsChange, apiRef]);
|
|
468
468
|
};
|
|
469
469
|
exports.useGridRows = useGridRows;
|
|
@@ -21,6 +21,7 @@ var _pipeProcessing = require("../../core/pipeProcessing");
|
|
|
21
21
|
var _gridRowsSelector = require("./gridRowsSelector");
|
|
22
22
|
var _gridDimensionsSelectors = require("../dimensions/gridDimensionsSelectors");
|
|
23
23
|
var _gridRowsUtils = require("./gridRowsUtils");
|
|
24
|
+
var _gridFocusedVirtualCellSelector = require("../virtualization/gridFocusedVirtualCellSelector");
|
|
24
25
|
/* eslint-disable no-underscore-dangle */
|
|
25
26
|
|
|
26
27
|
const rowsMetaStateInitializer = (state, props, apiRef) => {
|
|
@@ -192,6 +193,13 @@ const useGridRowsMeta = (apiRef, props) => {
|
|
|
192
193
|
const entry = entries[i];
|
|
193
194
|
const height = entry.borderBoxSize && entry.borderBoxSize.length > 0 ? entry.borderBoxSize[0].blockSize : entry.contentRect.height;
|
|
194
195
|
const rowId = entry.target.__mui_id;
|
|
196
|
+
const focusedVirtualRowId = (0, _gridFocusedVirtualCellSelector.gridFocusedVirtualCellSelector)(apiRef)?.id;
|
|
197
|
+
if (focusedVirtualRowId === rowId && height === 0) {
|
|
198
|
+
// Focused virtual row has 0 height.
|
|
199
|
+
// We don't want to store it to avoid scroll jumping.
|
|
200
|
+
// https://github.com/mui/mui-x/issues/14726
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
195
203
|
apiRef.current.unstable_storeRowHeightMeasurement(rowId, height);
|
|
196
204
|
}
|
|
197
205
|
if (!isHeightMetaValid.current) {
|
|
@@ -33,7 +33,6 @@ export declare const useGridVirtualScroller: () => {
|
|
|
33
33
|
};
|
|
34
34
|
getScrollbarVerticalProps: () => {
|
|
35
35
|
ref: React.RefObject<HTMLDivElement | null>;
|
|
36
|
-
role: string;
|
|
37
36
|
scrollPosition: React.RefObject<{
|
|
38
37
|
top: number;
|
|
39
38
|
left: number;
|
|
@@ -41,7 +40,6 @@ export declare const useGridVirtualScroller: () => {
|
|
|
41
40
|
};
|
|
42
41
|
getScrollbarHorizontalProps: () => {
|
|
43
42
|
ref: React.RefObject<HTMLDivElement | null>;
|
|
44
|
-
role: string;
|
|
45
43
|
scrollPosition: React.RefObject<{
|
|
46
44
|
top: number;
|
|
47
45
|
left: number;
|
|
@@ -12,7 +12,8 @@ exports.useGridVirtualScroller = void 0;
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var React = _interopRequireWildcard(require("react"));
|
|
14
14
|
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
15
|
-
var
|
|
15
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
16
|
+
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
16
17
|
var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
|
|
17
18
|
var _useTimeout = _interopRequireDefault(require("@mui/utils/useTimeout"));
|
|
18
19
|
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
@@ -25,10 +26,9 @@ var _useRunOnce = require("../../utils/useRunOnce");
|
|
|
25
26
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
26
27
|
var _gridRowsSelector = require("../rows/gridRowsSelector");
|
|
27
28
|
var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
28
|
-
var
|
|
29
|
+
var _utils = require("../../utils");
|
|
29
30
|
var platform = _interopRequireWildcard(require("../../../utils/platform"));
|
|
30
|
-
var
|
|
31
|
-
var _gridRowSelectionSelector = require("../rowSelection/gridRowSelectionSelector");
|
|
31
|
+
var _utils2 = require("../../../utils/utils");
|
|
32
32
|
var _gridRowsMetaSelector = require("../rows/gridRowsMetaSelector");
|
|
33
33
|
var _gridColumnsUtils = require("../columns/gridColumnsUtils");
|
|
34
34
|
var _gridVirtualizationSelectors = require("./gridVirtualizationSelectors");
|
|
@@ -40,6 +40,7 @@ var _columns = require("../columns");
|
|
|
40
40
|
var _gridFocusedVirtualCellSelector = require("./gridFocusedVirtualCellSelector");
|
|
41
41
|
var _roundToDecimalPlaces = require("../../../utils/roundToDecimalPlaces");
|
|
42
42
|
var _isJSDOM = require("../../../utils/isJSDOM");
|
|
43
|
+
var _rowSelection = require("../rowSelection");
|
|
43
44
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
44
45
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
45
46
|
var ScrollDirection = /*#__PURE__*/function (ScrollDirection) {
|
|
@@ -74,7 +75,7 @@ const useGridVirtualScroller = () => {
|
|
|
74
75
|
const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
|
|
75
76
|
const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
|
|
76
77
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
77
|
-
const
|
|
78
|
+
const rowSelectionManager = (0, _useGridSelector.useGridSelector)(apiRef, _rowSelection.gridRowSelectionManagerSelector);
|
|
78
79
|
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef);
|
|
79
80
|
const mainRef = apiRef.current.mainElementRef;
|
|
80
81
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
@@ -178,7 +179,7 @@ const useGridVirtualScroller = () => {
|
|
|
178
179
|
}
|
|
179
180
|
previousContextScrollPosition.current = scrollPosition.current;
|
|
180
181
|
}, [apiRef]);
|
|
181
|
-
const triggerUpdateRenderContext = (0,
|
|
182
|
+
const triggerUpdateRenderContext = (0, _useEventCallback.default)(() => {
|
|
182
183
|
const scroller = scrollerRef.current;
|
|
183
184
|
if (!scroller) {
|
|
184
185
|
return undefined;
|
|
@@ -189,8 +190,8 @@ const useGridVirtualScroller = () => {
|
|
|
189
190
|
|
|
190
191
|
// Clamp the scroll position to the viewport to avoid re-calculating the render context for scroll bounce
|
|
191
192
|
const newScroll = {
|
|
192
|
-
top: (0,
|
|
193
|
-
left: isRtl ? (0,
|
|
193
|
+
top: (0, _utils2.clamp)(scroller.scrollTop, 0, maxScrollTop),
|
|
194
|
+
left: isRtl ? (0, _utils2.clamp)(scroller.scrollLeft, -maxScrollLeft, 0) : (0, _utils2.clamp)(scroller.scrollLeft, 0, maxScrollLeft)
|
|
194
195
|
};
|
|
195
196
|
const dx = newScroll.left - scrollPosition.current.left;
|
|
196
197
|
const dy = newScroll.top - scrollPosition.current.top;
|
|
@@ -247,7 +248,7 @@ const useGridVirtualScroller = () => {
|
|
|
247
248
|
frozenContext.current = undefined;
|
|
248
249
|
updateRenderContext(nextRenderContext);
|
|
249
250
|
};
|
|
250
|
-
const handleScroll = (0,
|
|
251
|
+
const handleScroll = (0, _useEventCallback.default)(() => {
|
|
251
252
|
if (ignoreNextScrollEvent.current) {
|
|
252
253
|
ignoreNextScrollEvent.current = false;
|
|
253
254
|
return;
|
|
@@ -259,10 +260,10 @@ const useGridVirtualScroller = () => {
|
|
|
259
260
|
renderContext: nextRenderContext
|
|
260
261
|
});
|
|
261
262
|
});
|
|
262
|
-
const handleWheel = (0,
|
|
263
|
+
const handleWheel = (0, _useEventCallback.default)(event => {
|
|
263
264
|
apiRef.current.publishEvent('virtualScrollerWheel', {}, event);
|
|
264
265
|
});
|
|
265
|
-
const handleTouchMove = (0,
|
|
266
|
+
const handleTouchMove = (0, _useEventCallback.default)(event => {
|
|
266
267
|
apiRef.current.publishEvent('virtualScrollerTouchMove', {}, event);
|
|
267
268
|
});
|
|
268
269
|
const getRows = (params = {}) => {
|
|
@@ -294,7 +295,7 @@ const useGridVirtualScroller = () => {
|
|
|
294
295
|
const rowModels = params.rows ?? currentPage.rows;
|
|
295
296
|
const firstRowToRender = baseRenderContext.firstRowIndex;
|
|
296
297
|
const lastRowToRender = Math.min(baseRenderContext.lastRowIndex, rowModels.length);
|
|
297
|
-
const rowIndexes = params.rows ? (0,
|
|
298
|
+
const rowIndexes = params.rows ? (0, _utils2.range)(0, params.rows.length) : (0, _utils2.range)(firstRowToRender, lastRowToRender);
|
|
298
299
|
let virtualRowIndex = -1;
|
|
299
300
|
if (!isPinnedSection && focusedVirtualCell) {
|
|
300
301
|
if (focusedVirtualCell.rowIndex < firstRowToRender) {
|
|
@@ -344,12 +345,7 @@ const useGridVirtualScroller = () => {
|
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
347
|
const baseRowHeight = !apiRef.current.rowHasAutoHeight(id) ? apiRef.current.unstable_getRowHeight(id) : 'auto';
|
|
347
|
-
|
|
348
|
-
if (selectedRowsLookup[id] == null) {
|
|
349
|
-
isSelected = false;
|
|
350
|
-
} else {
|
|
351
|
-
isSelected = apiRef.current.isRowSelectable(id);
|
|
352
|
-
}
|
|
348
|
+
const isSelected = rowSelectionManager.has(id) && apiRef.current.isRowSelectable(id);
|
|
353
349
|
let isFirstVisible = false;
|
|
354
350
|
if (params.position === undefined) {
|
|
355
351
|
isFirstVisible = rowIndexInPage === 0;
|
|
@@ -436,13 +432,13 @@ const useGridVirtualScroller = () => {
|
|
|
436
432
|
contentHeight
|
|
437
433
|
});
|
|
438
434
|
}, [apiRef, columnsTotalWidth, contentHeight]);
|
|
439
|
-
(0,
|
|
435
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
440
436
|
if (!isRenderContextReady.current) {
|
|
441
437
|
return;
|
|
442
438
|
}
|
|
443
439
|
apiRef.current.updateRenderContext?.();
|
|
444
440
|
}, [apiRef, enabledForColumns, enabledForRows]);
|
|
445
|
-
(0,
|
|
441
|
+
(0, _useEnhancedEffect.default)(() => {
|
|
446
442
|
if (listView) {
|
|
447
443
|
scrollerRef.current.scrollLeft = 0;
|
|
448
444
|
}
|
|
@@ -504,9 +500,9 @@ const useGridVirtualScroller = () => {
|
|
|
504
500
|
apiRef.current.register('private', {
|
|
505
501
|
updateRenderContext: forceUpdateRenderContext
|
|
506
502
|
});
|
|
507
|
-
(0,
|
|
508
|
-
(0,
|
|
509
|
-
(0,
|
|
503
|
+
(0, _utils.useGridApiOptionHandler)(apiRef, 'sortedRowsSet', forceUpdateRenderContext);
|
|
504
|
+
(0, _utils.useGridApiOptionHandler)(apiRef, 'paginationModelChange', forceUpdateRenderContext);
|
|
505
|
+
(0, _utils.useGridApiOptionHandler)(apiRef, 'columnsChange', forceUpdateRenderContext);
|
|
510
506
|
return {
|
|
511
507
|
renderContext,
|
|
512
508
|
setPanels,
|
|
@@ -535,12 +531,10 @@ const useGridVirtualScroller = () => {
|
|
|
535
531
|
}),
|
|
536
532
|
getScrollbarVerticalProps: () => ({
|
|
537
533
|
ref: scrollbarVerticalRef,
|
|
538
|
-
role: 'presentation',
|
|
539
534
|
scrollPosition
|
|
540
535
|
}),
|
|
541
536
|
getScrollbarHorizontalProps: () => ({
|
|
542
537
|
ref: scrollbarHorizontalRef,
|
|
543
|
-
role: 'presentation',
|
|
544
538
|
scrollPosition
|
|
545
539
|
}),
|
|
546
540
|
getScrollAreaProps: () => ({
|
|
@@ -660,7 +654,7 @@ function getNearestIndexToRender(inputs, offset, options) {
|
|
|
660
654
|
// Check if all rows in this page are already measured
|
|
661
655
|
allRowsMeasured = lastMeasuredIndexRelativeToAllRows >= inputs.range.lastRowIndex;
|
|
662
656
|
}
|
|
663
|
-
const lastMeasuredIndexRelativeToCurrentPage = (0,
|
|
657
|
+
const lastMeasuredIndexRelativeToCurrentPage = (0, _utils2.clamp)(lastMeasuredIndexRelativeToAllRows - (inputs.range?.firstRowIndex || 0), 0, inputs.rowsMeta.positions.length);
|
|
664
658
|
if (allRowsMeasured || inputs.rowsMeta.positions[lastMeasuredIndexRelativeToCurrentPage] >= offset) {
|
|
665
659
|
// If all rows were measured (when no row has "auto" as height) or all rows before the offset
|
|
666
660
|
// were measured, then use a binary search because it's faster.
|
|
@@ -763,7 +757,7 @@ function getIndexesToRender({
|
|
|
763
757
|
lastPosition: positions[positions.length - 1] + lastSize
|
|
764
758
|
});
|
|
765
759
|
const lastIndexPadded = binarySearch(lastPosition, positions);
|
|
766
|
-
return [(0,
|
|
760
|
+
return [(0, _utils2.clamp)(firstIndexPadded, minFirstIndex, maxLastIndex), (0, _utils2.clamp)(lastIndexPadded, minFirstIndex, maxLastIndex)];
|
|
767
761
|
}
|
|
768
762
|
function areRenderContextsEqual(context1, context2) {
|
|
769
763
|
if (context1 === context2) {
|
package/hooks/utils/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { useGridSelector } from "./useGridSelector.js";
|
|
|
5
5
|
export * from "./useGridNativeEventListener.js";
|
|
6
6
|
export * from "./useFirstRender.js";
|
|
7
7
|
export * from "./useOnMount.js";
|
|
8
|
-
export * from "./useRunOnce.js";
|
|
8
|
+
export * from "./useRunOnce.js";
|
|
9
|
+
export type { RenderProp } from './useGridComponentRenderer';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type RenderProp<Props, State = {}> = ((props: Props, state: State) => React.ReactElement<unknown>) | React.ReactElement<Props>;
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the rendering logic for a component.
|
|
5
|
+
* Handles three scenarios:
|
|
6
|
+
* 1. A render function that receives props and state
|
|
7
|
+
* 2. A React element
|
|
8
|
+
* 3. A default element
|
|
9
|
+
*
|
|
10
|
+
* @ignore - internal hook.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useGridComponentRenderer<Props extends React.HTMLAttributes<any>, State extends Record<string, any>>(defaultElement: keyof React.JSX.IntrinsicElements | React.ComponentType<Props>, render: RenderProp<Props, State> | undefined, props: Props, state?: State): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useGridComponentRenderer = useGridComponentRenderer;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
12
|
+
/**
|
|
13
|
+
* Resolves the rendering logic for a component.
|
|
14
|
+
* Handles three scenarios:
|
|
15
|
+
* 1. A render function that receives props and state
|
|
16
|
+
* 2. A React element
|
|
17
|
+
* 3. A default element
|
|
18
|
+
*
|
|
19
|
+
* @ignore - internal hook.
|
|
20
|
+
*/
|
|
21
|
+
function useGridComponentRenderer(defaultElement, render, props, state = {}) {
|
|
22
|
+
if (typeof render === 'function') {
|
|
23
|
+
return render(props, state);
|
|
24
|
+
}
|
|
25
|
+
if (render) {
|
|
26
|
+
if (render.props.className) {
|
|
27
|
+
props.className = (0, _clsx.default)(render.props.className, props.className);
|
|
28
|
+
}
|
|
29
|
+
if (render.props.style || props.style) {
|
|
30
|
+
props.style = (0, _extends2.default)({}, props.style, render.props.style);
|
|
31
|
+
}
|
|
32
|
+
if (render.props.sx || props.sx) {
|
|
33
|
+
props.sx = mergeSx(props.sx, render.props.sx);
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/React.cloneElement(render, props);
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/React.createElement(defaultElement, props);
|
|
38
|
+
}
|
|
39
|
+
function mergeSx(sx1, sx2) {
|
|
40
|
+
if (!sx1 || !sx2) {
|
|
41
|
+
return sx1 || sx2;
|
|
42
|
+
}
|
|
43
|
+
return (Array.isArray(sx1) ? sx1 : [sx1]).concat(Array.isArray(sx2) ? sx2 : [sx2]);
|
|
44
|
+
}
|
|
@@ -8,8 +8,12 @@ exports.useGridSelector = exports.objectShallowCompare = exports.argsEqual = voi
|
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
|
-
var
|
|
11
|
+
var _index = require("use-sync-external-store/shim/index.js");
|
|
12
12
|
var _useLazyRef = require("./useLazyRef");
|
|
13
|
+
// use-sync-external-store has no exports field defined
|
|
14
|
+
// See https://github.com/facebook/react/issues/30698
|
|
15
|
+
// eslint-disable-next-line import/extensions
|
|
16
|
+
|
|
13
17
|
const defaultCompare = Object.is;
|
|
14
18
|
const objectShallowCompare = exports.objectShallowCompare = _fastObjectShallowCompare.fastObjectShallowCompare;
|
|
15
19
|
const arrayShallowCompare = (a, b) => {
|
|
@@ -83,7 +87,7 @@ const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCom
|
|
|
83
87
|
};
|
|
84
88
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
85
89
|
}, EMPTY);
|
|
86
|
-
(0,
|
|
90
|
+
(0, _index.useSyncExternalStore)(unsubscribe, subscribe, emptyGetSnapshot);
|
|
87
91
|
return state;
|
|
88
92
|
};
|
|
89
93
|
exports.useGridSelector = useGridSelector;
|
package/hooks/utils/useIsSSR.js
CHANGED
|
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useIsSSR = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _index = require("use-sync-external-store/shim/index.js");
|
|
8
|
+
// use-sync-external-store has no exports field defined
|
|
9
|
+
// See https://github.com/facebook/react/issues/30698
|
|
10
|
+
// eslint-disable-next-line import/extensions
|
|
11
|
+
|
|
8
12
|
const emptySubscribe = () => () => {};
|
|
9
13
|
const clientSnapshot = () => false;
|
|
10
14
|
const serverSnapshot = () => true;
|
|
11
|
-
const useIsSSR = () => (0,
|
|
15
|
+
const useIsSSR = () => (0, _index.useSyncExternalStore)(emptySubscribe, clientSnapshot, serverSnapshot);
|
|
12
16
|
exports.useIsSSR = useIsSSR;
|
package/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface TailwindDemoContainerProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
documentBody?: HTMLElement;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* WARNING: This is an internal component used in documentation to inject the Tailwind script.
|
|
8
|
+
* Please do not use it in your application.
|
|
9
|
+
*/
|
|
10
|
+
export declare function TailwindDemoContainer(props: TailwindDemoContainerProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | React.ReactPortal | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
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.TailwindDemoContainer = TailwindDemoContainer;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
11
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* WARNING: This is an internal component used in documentation to inject the Tailwind script.
|
|
15
|
+
* Please do not use it in your application.
|
|
16
|
+
*/
|
|
17
|
+
function TailwindDemoContainer(props) {
|
|
18
|
+
const {
|
|
19
|
+
children,
|
|
20
|
+
documentBody
|
|
21
|
+
} = props;
|
|
22
|
+
const [isLoaded, setIsLoaded] = React.useState(false);
|
|
23
|
+
React.useEffect(() => {
|
|
24
|
+
const body = documentBody ?? document.body;
|
|
25
|
+
const script = document.createElement('script');
|
|
26
|
+
script.src = 'https://unpkg.com/@tailwindcss/browser@4';
|
|
27
|
+
let mounted = true;
|
|
28
|
+
const cleanup = () => {
|
|
29
|
+
mounted = false;
|
|
30
|
+
script.remove();
|
|
31
|
+
const head = body?.ownerDocument?.head;
|
|
32
|
+
if (!head) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const styles = head.querySelectorAll('style:not([data-emotion])');
|
|
36
|
+
styles.forEach(style => {
|
|
37
|
+
const styleText = style.textContent?.substring(0, 100);
|
|
38
|
+
const isTailwindStylesheet = styleText?.includes('tailwind');
|
|
39
|
+
if (isTailwindStylesheet) {
|
|
40
|
+
style.remove();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
script.onload = () => {
|
|
45
|
+
if (!mounted) {
|
|
46
|
+
cleanup();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
setIsLoaded(true);
|
|
50
|
+
};
|
|
51
|
+
body.appendChild(script);
|
|
52
|
+
return cleanup;
|
|
53
|
+
}, [documentBody]);
|
|
54
|
+
return isLoaded ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
55
|
+
sx: {
|
|
56
|
+
display: 'flex',
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
height: '100%'
|
|
60
|
+
},
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CircularProgress.default, {})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TailwindDemoContainer } from "./TailwindDemoContainer.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "TailwindDemoContainer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TailwindDemoContainer.TailwindDemoContainer;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _TailwindDemoContainer = require("./TailwindDemoContainer");
|
package/internals/index.d.ts
CHANGED
|
@@ -5,9 +5,12 @@ export { GridVirtualScrollerRenderZone } from "../components/virtualization/Grid
|
|
|
5
5
|
export type { GridDetailPanelsProps } from '../components/GridDetailPanels';
|
|
6
6
|
export type { GridPinnedRowsProps } from '../components/GridPinnedRows';
|
|
7
7
|
export { GridHeaders } from "../components/GridHeaders.js";
|
|
8
|
+
export { GridToolbar } from "../components/toolbarV8/GridToolbar.js";
|
|
9
|
+
export type { GridToolbarProps } from '../components/toolbarV8/GridToolbar';
|
|
8
10
|
export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
|
|
9
11
|
export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
|
|
10
12
|
export * from "../constants/signature.js";
|
|
13
|
+
export { vars } from "../constants/cssVariables.js";
|
|
11
14
|
export { propsStateInitializer } from "../hooks/core/useGridProps.js";
|
|
12
15
|
export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.js";
|
|
13
16
|
export { getValueOptions } from "../components/panel/filterPanel/filterPanelUtils.js";
|
|
@@ -54,7 +57,7 @@ export type { GridRowTreeCreationParams, GridRowTreeCreationValue, GridHydrateRo
|
|
|
54
57
|
export { getTreeNodeDescendants, buildRootGroup } from "../hooks/features/rows/gridRowsUtils.js";
|
|
55
58
|
export { useGridRowsMeta, rowsMetaStateInitializer } from "../hooks/features/rows/useGridRowsMeta.js";
|
|
56
59
|
export { useGridParamsApi } from "../hooks/features/rows/useGridParamsApi.js";
|
|
57
|
-
export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED } from "../hooks/features/rows/gridRowsUtils.js";
|
|
60
|
+
export { getRowIdFromRowModel, GRID_ID_AUTOGENERATED, getRowValue } from "../hooks/features/rows/gridRowsUtils.js";
|
|
58
61
|
export { gridAdditionalRowGroupsSelector, gridPinnedRowsSelector, gridRowSelector } from "../hooks/features/rows/gridRowsSelector.js";
|
|
59
62
|
export { headerFilteringStateInitializer, useGridHeaderFiltering } from "../hooks/features/headerFiltering/useGridHeaderFiltering.js";
|
|
60
63
|
export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
|
|
@@ -73,6 +76,7 @@ export * from "../hooks/features/virtualization/index.js";
|
|
|
73
76
|
export { useGridColumnResize, columnResizeStateInitializer } from "../hooks/features/columnResize/useGridColumnResize.js";
|
|
74
77
|
export { ROW_SELECTION_PROPAGATION_DEFAULT } from "../hooks/features/rowSelection/utils.js";
|
|
75
78
|
export { useGridListView, listViewStateInitializer } from "../hooks/features/listView/useGridListView.js";
|
|
79
|
+
export { useGridComponentRenderer } from "../hooks/utils/useGridComponentRenderer.js";
|
|
76
80
|
export { useTimeout } from "../hooks/utils/useTimeout.js";
|
|
77
81
|
export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibleRows.js";
|
|
78
82
|
export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
|
|
@@ -104,4 +108,5 @@ export { serializeCellValue } from "../hooks/features/export/serializers/csvSeri
|
|
|
104
108
|
export * from "./utils/index.js";
|
|
105
109
|
export * from "./constants.js";
|
|
106
110
|
export type { Localization } from '../utils/getGridLocalization';
|
|
111
|
+
export * from "./demo/index.js";
|
|
107
112
|
export { GridSkeletonLoadingOverlayInner } from "../components/GridSkeletonLoadingOverlay.js";
|