@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface QuickFilterState {
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface QuickFilterContextValue {
|
|
6
|
+
state: QuickFilterState;
|
|
7
|
+
controlRef: React.RefObject<HTMLInputElement | null>;
|
|
8
|
+
triggerRef: React.RefObject<HTMLButtonElement | null>;
|
|
9
|
+
onValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
clearValue: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const QuickFilterContext: React.Context<QuickFilterContextValue | undefined>;
|
|
13
|
+
export declare function useQuickFilterContext(): QuickFilterContextValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export const QuickFilterContext = /*#__PURE__*/React.createContext(undefined);
|
|
3
|
+
export function useQuickFilterContext() {
|
|
4
|
+
const context = React.useContext(QuickFilterContext);
|
|
5
|
+
if (context === undefined) {
|
|
6
|
+
throw new Error('MUI X: Missing context. Quick Filter subcomponents must be placed within a <QuickFilter /> component.');
|
|
7
|
+
}
|
|
8
|
+
return context;
|
|
9
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
3
|
+
import type { GridSlotProps } from '../../models';
|
|
4
|
+
import { QuickFilterState } from "./QuickFilterContext.js";
|
|
5
|
+
export type QuickFilterControlProps = Omit<GridSlotProps['baseTextField'], 'className'> & {
|
|
6
|
+
/**
|
|
7
|
+
* A function to customize rendering of the component.
|
|
8
|
+
*/
|
|
9
|
+
render?: RenderProp<GridSlotProps['baseTextField'], QuickFilterState>;
|
|
10
|
+
/**
|
|
11
|
+
* Override or extend the styles applied to the component.
|
|
12
|
+
*/
|
|
13
|
+
className?: string | ((state: QuickFilterState) => string);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A component that takes user input and filters row data.
|
|
17
|
+
* It renders the `baseTextField` slot.
|
|
18
|
+
*
|
|
19
|
+
* Demos:
|
|
20
|
+
*
|
|
21
|
+
* - [Quick Filter](https://mui.com/x/react-data-grid/components/quick-filter/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [QuickFilterControl API](https://mui.com/x/api/data-grid/quick-filter-control/)
|
|
26
|
+
*/
|
|
27
|
+
declare const QuickFilterControl: React.ForwardRefExoticComponent<QuickFilterControlProps> | React.ForwardRefExoticComponent<Omit<QuickFilterControlProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export { QuickFilterControl };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["render", "className"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
7
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
10
|
+
import { useQuickFilterContext } from "./QuickFilterContext.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* A component that takes user input and filters row data.
|
|
14
|
+
* It renders the `baseTextField` slot.
|
|
15
|
+
*
|
|
16
|
+
* Demos:
|
|
17
|
+
*
|
|
18
|
+
* - [Quick Filter](https://mui.com/x/react-data-grid/components/quick-filter/)
|
|
19
|
+
*
|
|
20
|
+
* API:
|
|
21
|
+
*
|
|
22
|
+
* - [QuickFilterControl API](https://mui.com/x/api/data-grid/quick-filter-control/)
|
|
23
|
+
*/
|
|
24
|
+
const QuickFilterControl = forwardRef(function QuickFilterControl(props, ref) {
|
|
25
|
+
const {
|
|
26
|
+
render,
|
|
27
|
+
className
|
|
28
|
+
} = props,
|
|
29
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
|
+
const rootProps = useGridRootProps();
|
|
31
|
+
const {
|
|
32
|
+
state,
|
|
33
|
+
controlRef,
|
|
34
|
+
onValueChange,
|
|
35
|
+
clearValue
|
|
36
|
+
} = useQuickFilterContext();
|
|
37
|
+
const resolvedClassName = typeof className === 'function' ? className(state) : className;
|
|
38
|
+
const handleRef = useForkRef(controlRef, ref);
|
|
39
|
+
const handleKeyDown = event => {
|
|
40
|
+
if (event.key === 'Escape') {
|
|
41
|
+
clearValue();
|
|
42
|
+
}
|
|
43
|
+
props.onKeyDown?.(event);
|
|
44
|
+
};
|
|
45
|
+
const element = useGridComponentRenderer(rootProps.slots.baseTextField, render, _extends({}, rootProps.slotProps?.baseTextField, {
|
|
46
|
+
slotProps: _extends({
|
|
47
|
+
htmlInput: _extends({
|
|
48
|
+
role: 'searchbox'
|
|
49
|
+
}, props.slotProps?.htmlInput)
|
|
50
|
+
}, props.slotProps),
|
|
51
|
+
value: state.value,
|
|
52
|
+
className: resolvedClassName,
|
|
53
|
+
onChange: onValueChange,
|
|
54
|
+
onKeyDown: handleKeyDown
|
|
55
|
+
}, other, {
|
|
56
|
+
ref: handleRef
|
|
57
|
+
}), state);
|
|
58
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
59
|
+
children: element
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
process.env.NODE_ENV !== "production" ? QuickFilterControl.propTypes = {
|
|
63
|
+
// ----------------------------- Warning --------------------------------
|
|
64
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
65
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
66
|
+
// ----------------------------------------------------------------------
|
|
67
|
+
autoComplete: PropTypes.string,
|
|
68
|
+
/**
|
|
69
|
+
* Override or extend the styles applied to the component.
|
|
70
|
+
*/
|
|
71
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
72
|
+
color: PropTypes.oneOf(['error', 'primary']),
|
|
73
|
+
disabled: PropTypes.bool,
|
|
74
|
+
error: PropTypes.bool,
|
|
75
|
+
fullWidth: PropTypes.bool,
|
|
76
|
+
helperText: PropTypes.string,
|
|
77
|
+
id: PropTypes.string,
|
|
78
|
+
inputRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
79
|
+
current: PropTypes.object
|
|
80
|
+
})]),
|
|
81
|
+
label: PropTypes.node,
|
|
82
|
+
onChange: PropTypes.func,
|
|
83
|
+
onKeyDown: PropTypes.func,
|
|
84
|
+
placeholder: PropTypes.string,
|
|
85
|
+
/**
|
|
86
|
+
* A function to customize rendering of the component.
|
|
87
|
+
*/
|
|
88
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
89
|
+
role: PropTypes.string,
|
|
90
|
+
size: PropTypes.oneOf(['medium', 'small']),
|
|
91
|
+
slotProps: PropTypes.object,
|
|
92
|
+
style: PropTypes.object,
|
|
93
|
+
tabIndex: PropTypes.number,
|
|
94
|
+
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'hidden', 'image', 'month', 'number', 'password', 'radio', 'range', 'reset', 'search', 'submit', 'tel', 'text', 'time', 'url', 'week']), PropTypes.object]),
|
|
95
|
+
value: PropTypes.string
|
|
96
|
+
} : void 0;
|
|
97
|
+
export { QuickFilterControl };
|
|
@@ -5,7 +5,7 @@ import { GridToolbarQuickFilterProps } from "./GridToolbarQuickFilter.js";
|
|
|
5
5
|
export interface GridToolbarProps extends GridToolbarContainerProps, GridToolbarExportProps {
|
|
6
6
|
/**
|
|
7
7
|
* Show the quick filter component.
|
|
8
|
-
* @default
|
|
8
|
+
* @default true
|
|
9
9
|
*/
|
|
10
10
|
showQuickFilter?: boolean;
|
|
11
11
|
/**
|
|
@@ -20,7 +20,7 @@ const GridToolbar = forwardRef(function GridToolbar(props, ref) {
|
|
|
20
20
|
csvOptions,
|
|
21
21
|
printOptions,
|
|
22
22
|
excelOptions,
|
|
23
|
-
showQuickFilter =
|
|
23
|
+
showQuickFilter = true,
|
|
24
24
|
quickFilterProps = {}
|
|
25
25
|
} = _ref,
|
|
26
26
|
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -62,7 +62,7 @@ process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
|
62
62
|
}),
|
|
63
63
|
/**
|
|
64
64
|
* Show the quick filter component.
|
|
65
|
-
* @default
|
|
65
|
+
* @default true
|
|
66
66
|
*/
|
|
67
67
|
showQuickFilter: PropTypes.bool,
|
|
68
68
|
/**
|
|
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, unstable_useId as useId } from '@mui/utils';
|
|
6
6
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { vars } from "../../constants/cssVariables.js";
|
|
7
8
|
import { gridColumnLookupSelector } from "../../hooks/features/columns/gridColumnsSelector.js";
|
|
8
9
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
9
10
|
import { gridFilterActiveItemsSelector } from "../../hooks/features/filter/gridFilterSelector.js";
|
|
@@ -26,12 +27,10 @@ const GridToolbarFilterListRoot = styled('ul', {
|
|
|
26
27
|
name: 'MuiDataGrid',
|
|
27
28
|
slot: 'ToolbarFilterList',
|
|
28
29
|
overridesResolver: (_props, styles) => styles.toolbarFilterList
|
|
29
|
-
})(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
padding: theme.spacing(0, 1)
|
|
34
|
-
}));
|
|
30
|
+
})({
|
|
31
|
+
margin: vars.spacing(1, 1, 0.5),
|
|
32
|
+
padding: vars.spacing(0, 1)
|
|
33
|
+
});
|
|
35
34
|
|
|
36
35
|
// FIXME(v8:romgrk): override slotProps
|
|
37
36
|
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["quickFilterParser", "quickFilterFormatter", "debounceMs", "className", "slotProps"]
|
|
3
|
+
const _excluded = ["quickFilterParser", "quickFilterFormatter", "debounceMs", "className", "slotProps"],
|
|
4
|
+
_excluded2 = ["ref", "slotProps"];
|
|
4
5
|
import * as React from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import { styled } from '@mui/material/styles';
|
|
8
|
-
import { unstable_debounce as debounce } from '@mui/utils';
|
|
9
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
10
|
-
import {
|
|
8
|
+
import { styled } from '@mui/system';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
// import { NotRendered } from '../../utils/assert';
|
|
11
|
+
|
|
11
12
|
import { getDataGridUtilityClass } from "../../constants/index.js";
|
|
12
13
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
13
14
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
|
-
import {
|
|
15
|
-
import { gridQuickFilterValuesSelector } from "../../hooks/features/filter/index.js";
|
|
16
|
-
import { isDeepEqual } from "../../utils/utils.js";
|
|
15
|
+
import { QuickFilter, QuickFilterClear, QuickFilterControl } from "../quickFilter/index.js";
|
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
17
|
const useUtilityClasses = ownerState => {
|
|
19
18
|
const {
|
|
@@ -24,106 +23,69 @@ const useUtilityClasses = ownerState => {
|
|
|
24
23
|
};
|
|
25
24
|
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
26
25
|
};
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
// TODO: Use NotRendered from /utils/assert
|
|
28
|
+
// Currently causes react-docgen to fail
|
|
29
|
+
const GridToolbarQuickFilterRoot = styled(_props => {
|
|
30
|
+
throw new Error('Failed assertion: should not be rendered');
|
|
31
|
+
}, {
|
|
28
32
|
name: 'MuiDataGrid',
|
|
29
|
-
slot: 'ToolbarQuickFilter'
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})
|
|
34
|
-
[`.${outlinedInputClasses.root}`]: {
|
|
35
|
-
fontSize: theme.typography.body2.fontSize
|
|
36
|
-
},
|
|
37
|
-
[`& input[type="search"]::-webkit-search-decoration,
|
|
38
|
-
& input[type="search"]::-webkit-search-cancel-button,
|
|
39
|
-
& input[type="search"]::-webkit-search-results-button,
|
|
40
|
-
& input[type="search"]::-webkit-search-results-decoration`]: {
|
|
41
|
-
/* clears the 'X' icon from Chrome */
|
|
42
|
-
display: 'none'
|
|
43
|
-
}
|
|
44
|
-
}));
|
|
45
|
-
const defaultSearchValueParser = searchText => searchText.split(' ').filter(word => word !== '');
|
|
46
|
-
const defaultSearchValueFormatter = values => values.join(' ');
|
|
33
|
+
slot: 'ToolbarQuickFilter'
|
|
34
|
+
})({
|
|
35
|
+
width: 260,
|
|
36
|
+
marginLeft: 'auto'
|
|
37
|
+
});
|
|
47
38
|
function GridToolbarQuickFilter(props) {
|
|
48
39
|
const apiRef = useGridApiContext();
|
|
49
40
|
const rootProps = useGridRootProps();
|
|
50
41
|
const classes = useUtilityClasses(rootProps);
|
|
51
|
-
const quickFilterValues = useGridSelector(apiRef, gridQuickFilterValuesSelector);
|
|
52
42
|
const {
|
|
53
|
-
quickFilterParser
|
|
54
|
-
quickFilterFormatter
|
|
55
|
-
debounceMs
|
|
43
|
+
quickFilterParser,
|
|
44
|
+
quickFilterFormatter,
|
|
45
|
+
debounceMs,
|
|
56
46
|
className,
|
|
57
47
|
slotProps
|
|
58
48
|
} = props,
|
|
59
49
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}, other, {
|
|
98
|
-
slotProps: _extends({}, slotProps?.root.slotProps, {
|
|
99
|
-
input: _extends({
|
|
100
|
-
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {
|
|
101
|
-
position: "start",
|
|
102
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {
|
|
103
|
-
fontSize: "small"
|
|
104
|
-
})
|
|
105
|
-
}),
|
|
106
|
-
endAdornment: /*#__PURE__*/_jsx(rootProps.slots.baseInputAdornment, {
|
|
107
|
-
position: "end",
|
|
108
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
109
|
-
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
110
|
-
size: "small",
|
|
111
|
-
edge: "end",
|
|
112
|
-
style: searchValue ? {
|
|
113
|
-
visibility: 'visible'
|
|
114
|
-
} : {
|
|
115
|
-
visibility: 'hidden'
|
|
116
|
-
},
|
|
117
|
-
onClick: handleSearchReset
|
|
118
|
-
}, rootProps.slotProps?.baseIconButton, {
|
|
119
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
120
|
-
fontSize: "small"
|
|
121
|
-
})
|
|
122
|
-
}))
|
|
123
|
-
})
|
|
124
|
-
}, slotProps?.root.slotProps?.input)
|
|
50
|
+
return /*#__PURE__*/_jsx(QuickFilter, {
|
|
51
|
+
parser: quickFilterParser,
|
|
52
|
+
formatter: quickFilterFormatter,
|
|
53
|
+
debounceMs: debounceMs,
|
|
54
|
+
children: /*#__PURE__*/_jsx(QuickFilterControl, {
|
|
55
|
+
render: _ref => {
|
|
56
|
+
let {
|
|
57
|
+
ref,
|
|
58
|
+
slotProps: controlSlotProps
|
|
59
|
+
} = _ref,
|
|
60
|
+
controlProps = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
61
|
+
return /*#__PURE__*/_jsx(GridToolbarQuickFilterRoot, _extends({
|
|
62
|
+
as: rootProps.slots.baseTextField,
|
|
63
|
+
className: clsx(classes.root, className),
|
|
64
|
+
inputRef: ref,
|
|
65
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterLabel'),
|
|
66
|
+
placeholder: apiRef.current.getLocaleText('toolbarQuickFilterPlaceholder'),
|
|
67
|
+
size: "small",
|
|
68
|
+
slotProps: _extends({
|
|
69
|
+
input: _extends({
|
|
70
|
+
startAdornment: /*#__PURE__*/_jsx(rootProps.slots.quickFilterIcon, {
|
|
71
|
+
fontSize: "small"
|
|
72
|
+
}),
|
|
73
|
+
endAdornment: controlProps.value ? /*#__PURE__*/_jsx(QuickFilterClear, {
|
|
74
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, {
|
|
75
|
+
size: "small",
|
|
76
|
+
edge: "end",
|
|
77
|
+
"aria-label": apiRef.current.getLocaleText('toolbarQuickFilterDeleteIconLabel'),
|
|
78
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.quickFilterClearIcon, {
|
|
79
|
+
fontSize: "small"
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}) : null
|
|
83
|
+
}, controlSlotProps?.input)
|
|
84
|
+
}, controlSlotProps)
|
|
85
|
+
}, rootProps.slotProps?.baseTextField, controlProps, slotProps?.root, other));
|
|
86
|
+
}
|
|
125
87
|
})
|
|
126
|
-
}
|
|
88
|
+
});
|
|
127
89
|
}
|
|
128
90
|
process.env.NODE_ENV !== "production" ? GridToolbarQuickFilter.propTypes = {
|
|
129
91
|
// ----------------------------- Warning --------------------------------
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GridSlotProps } from "../../models/gridSlotsComponentsProps.js";
|
|
3
|
+
interface GridToolbarInternalProps {
|
|
4
|
+
additionalExportMenuItems?: (onMenuItemClick: () => void) => React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export type GridToolbarProps = GridSlotProps['toolbar'] & GridToolbarInternalProps;
|
|
7
|
+
declare function GridToolbar(props: GridToolbarProps): React.JSX.Element;
|
|
8
|
+
declare namespace GridToolbar {
|
|
9
|
+
var propTypes: any;
|
|
10
|
+
}
|
|
11
|
+
export { GridToolbar };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import Menu from '@mui/material/Menu';
|
|
5
|
+
import useId from '@mui/utils/useId';
|
|
6
|
+
import { styled } from '@mui/system';
|
|
7
|
+
import { Toolbar } from "./Toolbar.js";
|
|
8
|
+
import { ToolbarButton } from "./ToolbarButton.js";
|
|
9
|
+
import { FilterPanelTrigger } from "../filterPanel/index.js";
|
|
10
|
+
import { ColumnsPanelTrigger } from "../columnsPanel/index.js";
|
|
11
|
+
import { ExportCsv, ExportPrint } from "../export/index.js";
|
|
12
|
+
import { GridToolbarQuickFilter } from "../toolbar/GridToolbarQuickFilter.js";
|
|
13
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
14
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
15
|
+
import { NotRendered } from "../../utils/assert.js";
|
|
16
|
+
import { vars } from "../../constants/cssVariables.js";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
const Divider = styled(NotRendered, {
|
|
19
|
+
name: 'MuiDataGrid',
|
|
20
|
+
slot: 'ToolbarDivider'
|
|
21
|
+
})({
|
|
22
|
+
height: '50%',
|
|
23
|
+
margin: vars.spacing(0, 0.5)
|
|
24
|
+
});
|
|
25
|
+
function GridToolbar(props) {
|
|
26
|
+
const {
|
|
27
|
+
showQuickFilter = true,
|
|
28
|
+
quickFilterProps,
|
|
29
|
+
csvOptions,
|
|
30
|
+
printOptions,
|
|
31
|
+
additionalExportMenuItems
|
|
32
|
+
} = props;
|
|
33
|
+
const apiRef = useGridApiContext();
|
|
34
|
+
const rootProps = useGridRootProps();
|
|
35
|
+
const [exportMenuOpen, setExportMenuOpen] = React.useState(false);
|
|
36
|
+
const exportMenuTriggerRef = React.useRef(null);
|
|
37
|
+
const exportMenuId = useId();
|
|
38
|
+
const exportMenuTriggerId = useId();
|
|
39
|
+
const showExportMenu = !csvOptions?.disableToolbarButton || !printOptions?.disableToolbarButton || additionalExportMenuItems;
|
|
40
|
+
const closeExportMenu = () => setExportMenuOpen(false);
|
|
41
|
+
return /*#__PURE__*/_jsxs(Toolbar, {
|
|
42
|
+
children: [!rootProps.disableColumnSelector && /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
43
|
+
title: apiRef.current.getLocaleText('toolbarColumns'),
|
|
44
|
+
children: /*#__PURE__*/_jsx(ColumnsPanelTrigger, {
|
|
45
|
+
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
46
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.columnSelectorIcon, {
|
|
47
|
+
fontSize: "small"
|
|
48
|
+
})
|
|
49
|
+
})
|
|
50
|
+
}), !rootProps.disableColumnFilter && /*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
51
|
+
title: apiRef.current.getLocaleText('toolbarFilters'),
|
|
52
|
+
children: /*#__PURE__*/_jsx(FilterPanelTrigger, {
|
|
53
|
+
render: (triggerProps, state) => /*#__PURE__*/_jsx(ToolbarButton, _extends({}, triggerProps, {
|
|
54
|
+
color: "default",
|
|
55
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.baseBadge, {
|
|
56
|
+
badgeContent: state.filterCount,
|
|
57
|
+
color: "primary",
|
|
58
|
+
variant: "dot",
|
|
59
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.openFilterButtonIcon, {
|
|
60
|
+
fontSize: "small"
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}))
|
|
64
|
+
})
|
|
65
|
+
}), showExportMenu && (!rootProps.disableColumnFilter || !rootProps.disableColumnSelector) && /*#__PURE__*/_jsx(Divider, {
|
|
66
|
+
as: rootProps.slots.baseDivider,
|
|
67
|
+
orientation: "vertical"
|
|
68
|
+
}), showExportMenu && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
69
|
+
children: [/*#__PURE__*/_jsx(rootProps.slots.baseTooltip, {
|
|
70
|
+
title: apiRef.current.getLocaleText('toolbarExport'),
|
|
71
|
+
children: /*#__PURE__*/_jsx(ToolbarButton, {
|
|
72
|
+
ref: exportMenuTriggerRef,
|
|
73
|
+
id: exportMenuTriggerId,
|
|
74
|
+
"aria-controls": exportMenuId,
|
|
75
|
+
"aria-haspopup": "true",
|
|
76
|
+
"aria-expanded": exportMenuOpen ? 'true' : undefined,
|
|
77
|
+
onClick: () => setExportMenuOpen(true),
|
|
78
|
+
children: /*#__PURE__*/_jsx(rootProps.slots.exportIcon, {
|
|
79
|
+
fontSize: "small"
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/_jsxs(Menu, {
|
|
83
|
+
id: exportMenuId,
|
|
84
|
+
anchorEl: exportMenuTriggerRef.current,
|
|
85
|
+
open: exportMenuOpen,
|
|
86
|
+
onClose: closeExportMenu,
|
|
87
|
+
MenuListProps: {
|
|
88
|
+
'aria-labelledby': exportMenuTriggerId
|
|
89
|
+
},
|
|
90
|
+
children: [!printOptions?.disableToolbarButton && /*#__PURE__*/_jsx(ExportPrint, {
|
|
91
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({}, rootProps.slotProps?.baseMenuItem)),
|
|
92
|
+
options: printOptions,
|
|
93
|
+
onClick: closeExportMenu,
|
|
94
|
+
children: apiRef.current.getLocaleText('toolbarExportPrint')
|
|
95
|
+
}), !csvOptions?.disableToolbarButton && /*#__PURE__*/_jsx(ExportCsv, {
|
|
96
|
+
render: /*#__PURE__*/_jsx(rootProps.slots.baseMenuItem, _extends({}, rootProps.slotProps?.baseMenuItem)),
|
|
97
|
+
options: csvOptions,
|
|
98
|
+
onClick: closeExportMenu,
|
|
99
|
+
children: apiRef.current.getLocaleText('toolbarExportCSV')
|
|
100
|
+
}), additionalExportMenuItems?.(closeExportMenu)]
|
|
101
|
+
})]
|
|
102
|
+
}), showQuickFilter && /*#__PURE__*/_jsx(GridToolbarQuickFilter, _extends({}, quickFilterProps))]
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
process.env.NODE_ENV !== "production" ? GridToolbar.propTypes = {
|
|
106
|
+
// ----------------------------- Warning --------------------------------
|
|
107
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
108
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
109
|
+
// ----------------------------------------------------------------------
|
|
110
|
+
additionalExportMenuItems: PropTypes.func,
|
|
111
|
+
csvOptions: PropTypes.object,
|
|
112
|
+
printOptions: PropTypes.object,
|
|
113
|
+
/**
|
|
114
|
+
* Props passed to the quick filter component.
|
|
115
|
+
*/
|
|
116
|
+
quickFilterProps: PropTypes.shape({
|
|
117
|
+
className: PropTypes.string,
|
|
118
|
+
debounceMs: PropTypes.number,
|
|
119
|
+
quickFilterFormatter: PropTypes.func,
|
|
120
|
+
quickFilterParser: PropTypes.func,
|
|
121
|
+
slotProps: PropTypes.object
|
|
122
|
+
}),
|
|
123
|
+
/**
|
|
124
|
+
* Show the quick filter component.
|
|
125
|
+
* @default true
|
|
126
|
+
*/
|
|
127
|
+
showQuickFilter: PropTypes.bool,
|
|
128
|
+
/**
|
|
129
|
+
* The props used for each slot inside.
|
|
130
|
+
* @default {}
|
|
131
|
+
*/
|
|
132
|
+
slotProps: PropTypes.object,
|
|
133
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])
|
|
134
|
+
} : void 0;
|
|
135
|
+
export { GridToolbar };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
3
|
+
import type { DataGridProcessedProps } from '../../models/props/DataGridProps';
|
|
4
|
+
export type ToolbarProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
/**
|
|
6
|
+
* A function to customize rendering of the component.
|
|
7
|
+
*/
|
|
8
|
+
render?: RenderProp<React.ComponentProps<typeof ToolbarRoot>>;
|
|
9
|
+
};
|
|
10
|
+
type OwnerState = DataGridProcessedProps;
|
|
11
|
+
declare const ToolbarRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
12
|
+
ownerState: OwnerState;
|
|
13
|
+
}, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
|
|
14
|
+
/**
|
|
15
|
+
* The top level Toolbar component that provides context to child components.
|
|
16
|
+
* It renders a styled `<div />` element.
|
|
17
|
+
*
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [Toolbar](https://mui.com/x/react-data-grid/components/toolbar/)
|
|
21
|
+
*
|
|
22
|
+
* API:
|
|
23
|
+
*
|
|
24
|
+
* - [Toolbar API](https://mui.com/x/api/data-grid/toolbar/)
|
|
25
|
+
*/
|
|
26
|
+
declare const Toolbar: React.ForwardRefExoticComponent<ToolbarProps> | React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
27
|
+
/**
|
|
28
|
+
* A function to customize rendering of the component.
|
|
29
|
+
*/
|
|
30
|
+
render?: RenderProp<React.ComponentProps<typeof ToolbarRoot>>;
|
|
31
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export { Toolbar };
|