@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
|
@@ -10,7 +10,8 @@ exports.GridScrollArea = void 0;
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
|
-
var
|
|
13
|
+
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
14
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
15
|
var _system = require("@mui/system");
|
|
15
16
|
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
16
17
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
@@ -34,7 +35,7 @@ const useUtilityClasses = ownerState => {
|
|
|
34
35
|
const slots = {
|
|
35
36
|
root: ['scrollArea', `scrollArea--${scrollDirection}`]
|
|
36
37
|
};
|
|
37
|
-
return (0,
|
|
38
|
+
return (0, _composeClasses.default)(slots, _constants.getDataGridUtilityClass, classes);
|
|
38
39
|
};
|
|
39
40
|
const GridScrollAreaRawRoot = (0, _system.styled)('div', {
|
|
40
41
|
name: 'MuiDataGrid',
|
|
@@ -120,7 +121,7 @@ function GridScrollAreaContent(props) {
|
|
|
120
121
|
const handleScrolling = () => {
|
|
121
122
|
setCanScrollMore(getCanScrollMore);
|
|
122
123
|
};
|
|
123
|
-
const handleDragOver = (0,
|
|
124
|
+
const handleDragOver = (0, _useEventCallback.default)(event => {
|
|
124
125
|
let offset;
|
|
125
126
|
|
|
126
127
|
// Prevents showing the forbidden cursor
|
|
@@ -14,6 +14,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
14
14
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
15
15
|
var _system = require("@mui/system");
|
|
16
16
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
17
|
+
var _cssVariables = require("../constants/cssVariables");
|
|
17
18
|
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
18
19
|
var _gridClasses = require("../constants/gridClasses");
|
|
19
20
|
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
@@ -32,21 +33,19 @@ const GridSelectedRowCountRoot = (0, _system.styled)('div', {
|
|
|
32
33
|
name: 'MuiDataGrid',
|
|
33
34
|
slot: 'SelectedRowCount',
|
|
34
35
|
overridesResolver: (props, styles) => styles.selectedRowCount
|
|
35
|
-
})(
|
|
36
|
-
theme
|
|
37
|
-
}) => ({
|
|
36
|
+
})({
|
|
38
37
|
alignItems: 'center',
|
|
39
38
|
display: 'flex',
|
|
40
|
-
margin:
|
|
39
|
+
margin: _cssVariables.vars.spacing(0, 2),
|
|
41
40
|
visibility: 'hidden',
|
|
42
41
|
width: 0,
|
|
43
42
|
height: 0,
|
|
44
|
-
[
|
|
43
|
+
[_cssVariables.vars.breakpoints.up('sm')]: {
|
|
45
44
|
visibility: 'visible',
|
|
46
45
|
width: 'auto',
|
|
47
46
|
height: 'auto'
|
|
48
47
|
}
|
|
49
|
-
})
|
|
48
|
+
});
|
|
50
49
|
const GridSelectedRowCount = exports.GridSelectedRowCount = (0, _forwardRef.forwardRef)(function GridSelectedRowCount(props, ref) {
|
|
51
50
|
const {
|
|
52
51
|
className,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface GridShadowScrollAreaProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Adds scroll shadows above and below content in a scrollable container.
|
|
7
|
+
*/
|
|
8
|
+
export declare function GridShadowScrollArea(props: GridShadowScrollAreaProps): React.JSX.Element;
|
|
@@ -0,0 +1,82 @@
|
|
|
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.GridShadowScrollArea = GridShadowScrollArea;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _system = require("@mui/system");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
const _excluded = ["children"];
|
|
15
|
+
const reveal = (0, _system.keyframes)({
|
|
16
|
+
from: {
|
|
17
|
+
opacity: 0
|
|
18
|
+
},
|
|
19
|
+
to: {
|
|
20
|
+
opacity: 1
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const detectScroll = (0, _system.keyframes)({
|
|
24
|
+
'from, to': {
|
|
25
|
+
'--scrollable': '" "'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const ShadowScrollArea = (0, _system.styled)('div', {
|
|
29
|
+
name: 'MuiDataGrid',
|
|
30
|
+
slot: 'ShadowScrollArea'
|
|
31
|
+
})({
|
|
32
|
+
flex: 1,
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
animation: detectScroll,
|
|
36
|
+
animationTimeline: '--scroll-timeline',
|
|
37
|
+
animationFillMode: 'none',
|
|
38
|
+
boxSizing: 'border-box',
|
|
39
|
+
overflow: 'auto',
|
|
40
|
+
scrollTimeline: '--scroll-timeline block',
|
|
41
|
+
'&::before, &::after': {
|
|
42
|
+
content: '""',
|
|
43
|
+
flexShrink: 0,
|
|
44
|
+
display: 'block',
|
|
45
|
+
position: 'sticky',
|
|
46
|
+
left: 0,
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '4px',
|
|
49
|
+
animation: `${reveal} linear both`,
|
|
50
|
+
animationTimeline: '--scroll-timeline',
|
|
51
|
+
// Custom property toggle trick:
|
|
52
|
+
// - Detects if the element is scrollable
|
|
53
|
+
// - https://css-tricks.com/the-css-custom-property-toggle-trick/
|
|
54
|
+
'--visibility-scrollable': 'var(--scrollable) visible',
|
|
55
|
+
'--visibility-not-scrollable': 'hidden',
|
|
56
|
+
visibility: 'var(--visibility-scrollable, var(--visibility-not-scrollable))'
|
|
57
|
+
},
|
|
58
|
+
'&::before': {
|
|
59
|
+
top: 0,
|
|
60
|
+
background: 'linear-gradient(to bottom, rgba(0,0,0,0.05) 0, transparent 100%)',
|
|
61
|
+
animationRange: '0 4px'
|
|
62
|
+
},
|
|
63
|
+
'&::after': {
|
|
64
|
+
bottom: 0,
|
|
65
|
+
background: 'linear-gradient(to top, rgba(0,0,0,0.05) 0, transparent 100%)',
|
|
66
|
+
animationDirection: 'reverse',
|
|
67
|
+
animationRange: 'calc(100% - 4px) 100%'
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Adds scroll shadows above and below content in a scrollable container.
|
|
73
|
+
*/
|
|
74
|
+
function GridShadowScrollArea(props) {
|
|
75
|
+
const {
|
|
76
|
+
children
|
|
77
|
+
} = props,
|
|
78
|
+
rest = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ShadowScrollArea, (0, _extends2.default)({}, rest, {
|
|
80
|
+
children: children
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
@@ -14,6 +14,7 @@ var _utils = require("@mui/utils");
|
|
|
14
14
|
var _styles = require("@mui/material/styles");
|
|
15
15
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
16
|
var _assert = require("../../utils/assert");
|
|
17
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
17
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
18
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
20
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
@@ -31,9 +32,7 @@ const useUtilityClasses = ownerState => {
|
|
|
31
32
|
const GridEditInputCellRoot = (0, _styles.styled)(_assert.NotRendered, {
|
|
32
33
|
name: 'MuiDataGrid',
|
|
33
34
|
slot: 'EditInputCell'
|
|
34
|
-
})(({
|
|
35
|
-
theme
|
|
36
|
-
}) => (0, _extends2.default)({}, theme.typography.body2, {
|
|
35
|
+
})((0, _extends2.default)({}, _cssVariables.vars.typography.body, {
|
|
37
36
|
padding: '1px 0',
|
|
38
37
|
'& input': {
|
|
39
38
|
padding: '0 16px',
|
|
@@ -21,6 +21,7 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
21
21
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
22
22
|
var _gridFilterSelector = require("../../hooks/features/filter/gridFilterSelector");
|
|
23
23
|
var _gridPaginationSelector = require("../../hooks/features/pagination/gridPaginationSelector");
|
|
24
|
+
var _gridRowSelectionManager = require("../../models/gridRowSelectionManager");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["field", "colDef"];
|
|
26
27
|
const useUtilityClasses = ownerState => {
|
|
@@ -46,39 +47,72 @@ const GridHeaderCheckbox = exports.GridHeaderCheckbox = (0, _forwardRef.forwardR
|
|
|
46
47
|
const visibleRowIds = (0, _useGridSelector.useGridSelector)(apiRef, _gridFilterSelector.gridExpandedSortedRowIdsSelector);
|
|
47
48
|
const paginatedVisibleRowIds = (0, _useGridSelector.useGridSelector)(apiRef, _gridPaginationSelector.gridPaginatedVisibleSortedGridRowIdsSelector);
|
|
48
49
|
const filteredSelection = React.useMemo(() => {
|
|
49
|
-
|
|
50
|
+
const isRowSelectable = rootProps.isRowSelectable;
|
|
51
|
+
if (typeof isRowSelectable !== 'function') {
|
|
50
52
|
return selection;
|
|
51
53
|
}
|
|
52
|
-
|
|
54
|
+
if (selection.type === 'exclude') {
|
|
55
|
+
return selection;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// selection.type === 'include'
|
|
59
|
+
const selectionModel = {
|
|
60
|
+
type: 'include',
|
|
61
|
+
ids: new Set()
|
|
62
|
+
};
|
|
63
|
+
for (const id of selection.ids) {
|
|
53
64
|
if (rootProps.keepNonExistentRowsSelected) {
|
|
54
|
-
|
|
65
|
+
selectionModel.ids.add(id);
|
|
55
66
|
}
|
|
56
67
|
// The row might have been deleted
|
|
57
68
|
if (!apiRef.current.getRow(id)) {
|
|
58
|
-
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (isRowSelectable(apiRef.current.getRowParams(id))) {
|
|
72
|
+
selectionModel.ids.add(id);
|
|
59
73
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, [apiRef, rootProps.isRowSelectable,
|
|
74
|
+
}
|
|
75
|
+
return selectionModel;
|
|
76
|
+
}, [apiRef, rootProps.isRowSelectable, rootProps.keepNonExistentRowsSelected, selection]);
|
|
63
77
|
|
|
64
78
|
// All the rows that could be selected / unselected by toggling this checkbox
|
|
65
79
|
const selectionCandidates = React.useMemo(() => {
|
|
66
80
|
const rowIds = !rootProps.pagination || !rootProps.checkboxSelectionVisibleOnly ? visibleRowIds : paginatedVisibleRowIds;
|
|
67
81
|
|
|
68
|
-
// Convert to
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
// Convert to a Set to make O(1) checking if a row exists or not
|
|
83
|
+
const candidates = new Set();
|
|
84
|
+
for (let i = 0; i < rowIds.length; i += 1) {
|
|
85
|
+
const id = rowIds[i];
|
|
86
|
+
if (apiRef.current.isRowSelectable(id)) {
|
|
87
|
+
candidates.add(id);
|
|
73
88
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, {});
|
|
89
|
+
}
|
|
90
|
+
return candidates;
|
|
77
91
|
}, [apiRef, rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]);
|
|
78
92
|
|
|
79
93
|
// Amount of rows selected and that are visible in the current page
|
|
80
|
-
const currentSelectionSize = React.useMemo(() =>
|
|
81
|
-
|
|
94
|
+
const currentSelectionSize = React.useMemo(() => {
|
|
95
|
+
const selectionManager = (0, _gridRowSelectionManager.createRowSelectionManager)(filteredSelection);
|
|
96
|
+
let size = 0;
|
|
97
|
+
for (const id of selectionCandidates) {
|
|
98
|
+
if (selectionManager.has(id)) {
|
|
99
|
+
size += 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return size;
|
|
103
|
+
}, [filteredSelection, selectionCandidates]);
|
|
104
|
+
const isIndeterminate = React.useMemo(() => {
|
|
105
|
+
if (filteredSelection.ids.size === 0) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
const selectionManager = (0, _gridRowSelectionManager.createRowSelectionManager)(filteredSelection);
|
|
109
|
+
for (const rowId of selectionCandidates) {
|
|
110
|
+
if (!selectionManager.has(rowId)) {
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}, [filteredSelection, selectionCandidates]);
|
|
82
116
|
const isChecked = currentSelectionSize > 0;
|
|
83
117
|
const handleChange = event => {
|
|
84
118
|
const params = {
|
|
@@ -12,14 +12,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
13
13
|
var _styles = require("@mui/material/styles");
|
|
14
14
|
var _InputBase = require("@mui/material/InputBase");
|
|
15
|
+
var _cssVariables = require("../../constants/cssVariables");
|
|
15
16
|
var _gridColumnsSelector = require("../../hooks/features/columns/gridColumnsSelector");
|
|
16
17
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
17
18
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
18
19
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
19
20
|
var _gridClasses = require("../../constants/gridClasses");
|
|
20
|
-
var _useLazyRef = require("../../hooks/utils/useLazyRef");
|
|
21
21
|
var _utils = require("./utils");
|
|
22
22
|
var _assert = require("../../utils/assert");
|
|
23
|
+
var _GridShadowScrollArea = require("../GridShadowScrollArea");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
25
26
|
|
|
@@ -41,7 +42,7 @@ function GridColumnsManagement(props) {
|
|
|
41
42
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
42
43
|
const searchInputRef = React.useRef(null);
|
|
43
44
|
const columns = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnDefinitionsSelector);
|
|
44
|
-
const initialColumnVisibilityModel = (0,
|
|
45
|
+
const initialColumnVisibilityModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridInitialColumnVisibilityModelSelector);
|
|
45
46
|
const columnVisibilityModel = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridColumnVisibilityModelSelector);
|
|
46
47
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
47
48
|
const [searchValue, setSearchValue] = React.useState('');
|
|
@@ -141,20 +142,20 @@ function GridColumnsManagement(props) {
|
|
|
141
142
|
type: "search",
|
|
142
143
|
slotProps: {
|
|
143
144
|
input: {
|
|
144
|
-
startAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.
|
|
145
|
-
|
|
146
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterIcon, {})
|
|
145
|
+
startAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterIcon, {
|
|
146
|
+
fontSize: "small"
|
|
147
147
|
}),
|
|
148
148
|
endAdornment: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseIconButton, (0, _extends2.default)({
|
|
149
|
-
"aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
|
|
150
149
|
size: "small",
|
|
150
|
+
"aria-label": apiRef.current.getLocaleText('columnsManagementDeleteIconLabel'),
|
|
151
151
|
style: searchValue ? {
|
|
152
152
|
visibility: 'visible'
|
|
153
153
|
} : {
|
|
154
154
|
visibility: 'hidden'
|
|
155
155
|
},
|
|
156
156
|
tabIndex: -1,
|
|
157
|
-
onClick: handleSearchReset
|
|
157
|
+
onClick: handleSearchReset,
|
|
158
|
+
edge: "end"
|
|
158
159
|
}, rootProps.slotProps?.baseIconButton, {
|
|
159
160
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.quickFilterClearIcon, {
|
|
160
161
|
fontSize: "small"
|
|
@@ -168,25 +169,27 @@ function GridColumnsManagement(props) {
|
|
|
168
169
|
autoComplete: "off",
|
|
169
170
|
fullWidth: true
|
|
170
171
|
}, rootProps.slotProps?.baseTextField, searchInputProps))
|
|
171
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
172
|
-
className: classes.root,
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnsManagementScrollArea, {
|
|
173
173
|
ownerState: rootProps,
|
|
174
|
-
children:
|
|
175
|
-
className: classes.
|
|
176
|
-
disabled: column.hideable === false,
|
|
177
|
-
checked: columnVisibilityModel[column.field] !== false,
|
|
178
|
-
onClick: toggleColumn,
|
|
179
|
-
name: column.field,
|
|
180
|
-
inputRef: isFirstHideableColumn(column) ? firstSwitchRef : undefined,
|
|
181
|
-
label: column.headerName || column.field,
|
|
182
|
-
size: "medium",
|
|
183
|
-
density: "compact",
|
|
184
|
-
fullWidth: true
|
|
185
|
-
}, rootProps.slotProps?.baseCheckbox), column.field)), currentColumns.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnsManagementEmptyText, {
|
|
174
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridColumnsManagementBody, {
|
|
175
|
+
className: classes.root,
|
|
186
176
|
ownerState: rootProps,
|
|
187
|
-
children:
|
|
188
|
-
|
|
189
|
-
|
|
177
|
+
children: [currentColumns.map(column => /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseCheckbox, (0, _extends2.default)({
|
|
178
|
+
className: classes.row,
|
|
179
|
+
disabled: column.hideable === false,
|
|
180
|
+
checked: columnVisibilityModel[column.field] !== false,
|
|
181
|
+
onClick: toggleColumn,
|
|
182
|
+
name: column.field,
|
|
183
|
+
inputRef: isFirstHideableColumn(column) ? firstSwitchRef : undefined,
|
|
184
|
+
label: column.headerName || column.field,
|
|
185
|
+
density: "compact",
|
|
186
|
+
fullWidth: true
|
|
187
|
+
}, rootProps.slotProps?.baseCheckbox), column.field)), currentColumns.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnsManagementEmptyText, {
|
|
188
|
+
ownerState: rootProps,
|
|
189
|
+
children: apiRef.current.getLocaleText('columnsManagementNoColumns')
|
|
190
|
+
})]
|
|
191
|
+
})
|
|
192
|
+
}), !disableShowHideToggle || !disableResetButton ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(GridColumnsManagementFooter, {
|
|
190
193
|
ownerState: rootProps,
|
|
191
194
|
className: classes.footer,
|
|
192
195
|
children: [!disableShowHideToggle ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseCheckbox, (0, _extends2.default)({
|
|
@@ -195,7 +198,8 @@ function GridColumnsManagement(props) {
|
|
|
195
198
|
indeterminate: !allHideableColumnsVisible && !allHideableColumnsHidden,
|
|
196
199
|
onClick: () => toggleAllColumns(!allHideableColumnsVisible),
|
|
197
200
|
name: apiRef.current.getLocaleText('columnsManagementShowHideAllText'),
|
|
198
|
-
label: apiRef.current.getLocaleText('columnsManagementShowHideAllText')
|
|
201
|
+
label: apiRef.current.getLocaleText('columnsManagementShowHideAllText'),
|
|
202
|
+
density: "compact"
|
|
199
203
|
}, rootProps.slotProps?.baseCheckbox)) : /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {}), !disableResetButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseButton, (0, _extends2.default)({
|
|
200
204
|
onClick: () => apiRef.current.setColumnVisibilityModel(initialColumnVisibilityModel),
|
|
201
205
|
disabled: isResetDisabled
|
|
@@ -251,6 +255,7 @@ process.env.NODE_ENV !== "production" ? GridColumnsManagement.propTypes = {
|
|
|
251
255
|
onChange: _propTypes.default.func,
|
|
252
256
|
onKeyDown: _propTypes.default.func,
|
|
253
257
|
placeholder: _propTypes.default.string,
|
|
258
|
+
role: _propTypes.default.string,
|
|
254
259
|
size: _propTypes.default.oneOf(['medium', 'small']),
|
|
255
260
|
slotProps: _propTypes.default.object,
|
|
256
261
|
style: _propTypes.default.object,
|
|
@@ -271,56 +276,50 @@ process.env.NODE_ENV !== "production" ? GridColumnsManagement.propTypes = {
|
|
|
271
276
|
const GridColumnsManagementBody = (0, _styles.styled)('div', {
|
|
272
277
|
name: 'MuiDataGrid',
|
|
273
278
|
slot: 'ColumnsManagement'
|
|
274
|
-
})(
|
|
275
|
-
theme
|
|
276
|
-
}) => ({
|
|
277
|
-
padding: theme.spacing(0, 2, 1.5),
|
|
279
|
+
})({
|
|
278
280
|
display: 'flex',
|
|
279
281
|
flexDirection: 'column',
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
padding: _cssVariables.vars.spacing(0.5, 1.5)
|
|
283
|
+
});
|
|
284
|
+
const GridColumnsManagementScrollArea = (0, _styles.styled)(_GridShadowScrollArea.GridShadowScrollArea, {
|
|
285
|
+
name: 'MuiDataGrid',
|
|
286
|
+
slot: 'ColumnsManagementScrollArea'
|
|
287
|
+
})({
|
|
288
|
+
maxHeight: 400
|
|
289
|
+
});
|
|
285
290
|
const GridColumnsManagementHeader = (0, _styles.styled)('div', {
|
|
286
291
|
name: 'MuiDataGrid',
|
|
287
292
|
slot: 'ColumnsManagementHeader'
|
|
288
|
-
})(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}));
|
|
293
|
+
})({
|
|
294
|
+
padding: _cssVariables.vars.spacing(1.5, 2),
|
|
295
|
+
borderBottom: `1px solid ${_cssVariables.vars.colors.border.base}`
|
|
296
|
+
});
|
|
293
297
|
const SearchInput = (0, _styles.styled)(_assert.NotRendered, {
|
|
294
298
|
name: 'MuiDataGrid',
|
|
295
299
|
slot: 'ColumnsManagementSearchInput'
|
|
296
|
-
})(
|
|
297
|
-
theme
|
|
298
|
-
}) => ({
|
|
299
|
-
[`& .${_InputBase.inputBaseClasses.root}`]: {
|
|
300
|
-
padding: theme.spacing(0, 1.5, 0, 1.5)
|
|
301
|
-
},
|
|
300
|
+
})({
|
|
302
301
|
[`& .${_InputBase.inputBaseClasses.input}::-webkit-search-decoration,
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
302
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-cancel-button,
|
|
303
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-results-button,
|
|
304
|
+
& .${_InputBase.inputBaseClasses.input}::-webkit-search-results-decoration`]: {
|
|
306
305
|
/* clears the 'X' icon from Chrome */
|
|
307
306
|
display: 'none'
|
|
308
307
|
}
|
|
309
|
-
})
|
|
308
|
+
});
|
|
310
309
|
const GridColumnsManagementFooter = (0, _styles.styled)('div', {
|
|
311
310
|
name: 'MuiDataGrid',
|
|
312
311
|
slot: 'ColumnsManagementFooter'
|
|
313
|
-
})(
|
|
314
|
-
|
|
315
|
-
}) => ({
|
|
316
|
-
padding: theme.spacing(0.5, 1, 0.5, 3),
|
|
312
|
+
})({
|
|
313
|
+
padding: _cssVariables.vars.spacing(1, 1, 1, 1.5),
|
|
317
314
|
display: 'flex',
|
|
318
315
|
justifyContent: 'space-between',
|
|
319
|
-
borderTop: `1px solid ${
|
|
320
|
-
})
|
|
321
|
-
const GridColumnsManagementEmptyText = (0, _styles.styled)('div'
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
316
|
+
borderTop: `1px solid ${_cssVariables.vars.colors.border.base}`
|
|
317
|
+
});
|
|
318
|
+
const GridColumnsManagementEmptyText = (0, _styles.styled)('div', {
|
|
319
|
+
name: 'MuiDataGrid',
|
|
320
|
+
slot: 'ColumnsManagementEmptyText'
|
|
321
|
+
})({
|
|
322
|
+
padding: _cssVariables.vars.spacing(1, 0),
|
|
323
|
+
alignSelf: 'center',
|
|
324
|
+
fontSize: _cssVariables.vars.typography.body.fontSize
|
|
325
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
3
|
+
import type { GridSlotProps } from '../../models';
|
|
4
|
+
export interface ColumnsPanelState {
|
|
5
|
+
/**
|
|
6
|
+
* If `true`, the columns panel is open.
|
|
7
|
+
*/
|
|
8
|
+
open: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type ColumnsPanelTriggerProps = Omit<GridSlotProps['baseButton'], 'className'> & {
|
|
11
|
+
/**
|
|
12
|
+
* A function to customize rendering of the component.
|
|
13
|
+
*/
|
|
14
|
+
render?: RenderProp<GridSlotProps['baseButton'], ColumnsPanelState>;
|
|
15
|
+
/**
|
|
16
|
+
* Override or extend the styles applied to the component.
|
|
17
|
+
*/
|
|
18
|
+
className?: string | ((state: ColumnsPanelState) => string);
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A button that opens and closes the columns panel.
|
|
22
|
+
* It renders the `baseButton` slot.
|
|
23
|
+
*
|
|
24
|
+
* Demos:
|
|
25
|
+
*
|
|
26
|
+
* - [Columns Panel](https://mui.com/x/react-data-grid/components/columns-panel/)
|
|
27
|
+
*
|
|
28
|
+
* API:
|
|
29
|
+
*
|
|
30
|
+
* - [ColumnsPanelTrigger API](https://mui.com/x/api/data-grid/columns-panel-trigger/)
|
|
31
|
+
*/
|
|
32
|
+
declare const ColumnsPanelTrigger: React.ForwardRefExoticComponent<ColumnsPanelTriggerProps> | React.ForwardRefExoticComponent<Omit<ColumnsPanelTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
export { ColumnsPanelTrigger };
|