@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
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { gridClasses as c } from "../../constants/gridClasses.js";
|
|
4
|
+
import { vars } from "../../constants/cssVariables.js";
|
|
4
5
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
5
6
|
import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
|
|
6
|
-
function getBorderColor(theme) {
|
|
7
|
-
if (theme.vars) {
|
|
8
|
-
return theme.vars.palette.TableCell.border;
|
|
9
|
-
}
|
|
10
|
-
if (theme.palette.mode === 'light') {
|
|
11
|
-
return lighten(alpha(theme.palette.divider, 1), 0.88);
|
|
12
|
-
}
|
|
13
|
-
return darken(alpha(theme.palette.divider, 1), 0.68);
|
|
14
|
-
}
|
|
15
7
|
const columnHeaderStyles = {
|
|
16
8
|
[`& .${c.iconButtonContainer}`]: {
|
|
17
9
|
visibility: 'visible',
|
|
@@ -261,42 +253,38 @@ export const GridRootStyles = styled('div', {
|
|
|
261
253
|
}, {
|
|
262
254
|
[`& .${c.withBorderColor}`]: styles.withBorderColor
|
|
263
255
|
}]
|
|
264
|
-
})(({
|
|
265
|
-
theme: t
|
|
266
|
-
}) => {
|
|
256
|
+
})(() => {
|
|
267
257
|
const apiRef = useGridPrivateApiContext();
|
|
268
258
|
const shouldShowBorderTopRightRadius = useGridSelector(apiRef, shouldShowBorderTopRightRadiusSelector);
|
|
269
|
-
const
|
|
270
|
-
const
|
|
271
|
-
const
|
|
272
|
-
const
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
const
|
|
282
|
-
const
|
|
259
|
+
const baseBackground = vars.colors.background.base;
|
|
260
|
+
const headerBackground = vars.header.background.base;
|
|
261
|
+
const pinnedBackground = vars.cell.background.pinned;
|
|
262
|
+
const hoverColor = vars.colors.interactive.hover;
|
|
263
|
+
const hoverOpacity = vars.colors.interactive.hoverOpacity;
|
|
264
|
+
const selectedColor = vars.colors.interactive.selected;
|
|
265
|
+
const selectedOpacity = vars.colors.interactive.selectedOpacity;
|
|
266
|
+
const selectedHoverColor = selectedColor;
|
|
267
|
+
const selectedHoverOpacity = `calc(${selectedOpacity} + ${hoverOpacity})`;
|
|
268
|
+
const hoverBackground = mix(baseBackground, hoverColor, hoverOpacity);
|
|
269
|
+
const selectedBackground = mix(baseBackground, selectedColor, selectedOpacity);
|
|
270
|
+
const selectedHoverBackground = mix(baseBackground, selectedHoverColor, selectedHoverOpacity);
|
|
271
|
+
const pinnedHoverBackground = mix(pinnedBackground, hoverColor, hoverOpacity);
|
|
272
|
+
const pinnedSelectedBackground = mix(pinnedBackground, selectedColor, selectedOpacity);
|
|
273
|
+
const pinnedSelectedHoverBackground = mix(pinnedBackground, selectedHoverColor, selectedHoverOpacity);
|
|
283
274
|
const getPinnedBackgroundStyles = backgroundColor => ({
|
|
284
275
|
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
285
276
|
backgroundColor,
|
|
286
277
|
'&.Mui-selected': {
|
|
287
|
-
backgroundColor:
|
|
278
|
+
backgroundColor: mix(backgroundColor, selectedBackground, selectedOpacity),
|
|
288
279
|
'&:hover': {
|
|
289
|
-
backgroundColor:
|
|
280
|
+
backgroundColor: mix(backgroundColor, selectedHoverBackground, selectedHoverOpacity)
|
|
290
281
|
}
|
|
291
282
|
}
|
|
292
283
|
}
|
|
293
284
|
});
|
|
294
|
-
const
|
|
295
|
-
const
|
|
296
|
-
const
|
|
297
|
-
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackgroundColor);
|
|
298
|
-
const pinnedSelectedHoverBackgroundColor = blendFn(pinnedBackground, selectedHoverBackground, selectedHoverOpacity);
|
|
299
|
-
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackgroundColor);
|
|
285
|
+
const pinnedHoverStyles = getPinnedBackgroundStyles(pinnedHoverBackground);
|
|
286
|
+
const pinnedSelectedStyles = getPinnedBackgroundStyles(pinnedSelectedBackground);
|
|
287
|
+
const pinnedSelectedHoverStyles = getPinnedBackgroundStyles(pinnedSelectedHoverBackground);
|
|
300
288
|
const selectedStyles = {
|
|
301
289
|
backgroundColor: selectedBackground,
|
|
302
290
|
'&:hover': {
|
|
@@ -308,13 +296,9 @@ export const GridRootStyles = styled('div', {
|
|
|
308
296
|
}
|
|
309
297
|
};
|
|
310
298
|
const gridStyle = _extends({
|
|
311
|
-
'--unstable_DataGrid-radius':
|
|
312
|
-
'--unstable_DataGrid-headWeight':
|
|
313
|
-
'--
|
|
314
|
-
'--DataGrid-background': background,
|
|
315
|
-
'--DataGrid-headerBackground': headerBackground,
|
|
316
|
-
'--DataGrid-pinnedBackground': pinnedBackground,
|
|
317
|
-
'--DataGrid-rowBorderColor': borderColor,
|
|
299
|
+
'--unstable_DataGrid-radius': vars.radius.base,
|
|
300
|
+
'--unstable_DataGrid-headWeight': vars.typography.fontWeight.medium,
|
|
301
|
+
'--DataGrid-rowBorderColor': vars.colors.border.base,
|
|
318
302
|
'--DataGrid-cellOffsetMultiplier': 2,
|
|
319
303
|
'--DataGrid-width': '0px',
|
|
320
304
|
'--DataGrid-hasScrollX': '0',
|
|
@@ -333,11 +317,11 @@ export const GridRootStyles = styled('div', {
|
|
|
333
317
|
position: 'relative',
|
|
334
318
|
borderWidth: '1px',
|
|
335
319
|
borderStyle: 'solid',
|
|
336
|
-
borderColor,
|
|
320
|
+
borderColor: vars.colors.border.base,
|
|
337
321
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
338
|
-
backgroundColor:
|
|
339
|
-
color:
|
|
340
|
-
},
|
|
322
|
+
backgroundColor: vars.colors.background.base,
|
|
323
|
+
color: vars.colors.foreground.base
|
|
324
|
+
}, vars.typography.body, {
|
|
341
325
|
outline: 'none',
|
|
342
326
|
height: '100%',
|
|
343
327
|
display: 'flex',
|
|
@@ -384,11 +368,11 @@ export const GridRootStyles = styled('div', {
|
|
|
384
368
|
boxSizing: 'border-box'
|
|
385
369
|
},
|
|
386
370
|
[`& .${c.columnHeader}:focus-within, & .${c.cell}:focus-within`]: {
|
|
387
|
-
outline: `solid ${
|
|
371
|
+
outline: `solid ${setOpacity(vars.colors.interactive.focus, 0.5)} ${focusOutlineWidth}px`,
|
|
388
372
|
outlineOffset: focusOutlineWidth * -1
|
|
389
373
|
},
|
|
390
374
|
[`& .${c.columnHeader}:focus, & .${c.cell}:focus`]: {
|
|
391
|
-
outline: `solid ${
|
|
375
|
+
outline: `solid ${vars.colors.interactive.focus} ${focusOutlineWidth}px`,
|
|
392
376
|
outlineOffset: focusOutlineWidth * -1
|
|
393
377
|
},
|
|
394
378
|
// Hide the column separator when:
|
|
@@ -430,7 +414,8 @@ export const GridRootStyles = styled('div', {
|
|
|
430
414
|
[`& .${c.columnHeader}`]: {
|
|
431
415
|
position: 'relative',
|
|
432
416
|
display: 'flex',
|
|
433
|
-
alignItems: 'center'
|
|
417
|
+
alignItems: 'center',
|
|
418
|
+
backgroundColor: headerBackground
|
|
434
419
|
},
|
|
435
420
|
[`& .${c['columnHeader--filter']}`]: {
|
|
436
421
|
paddingTop: 8,
|
|
@@ -448,14 +433,14 @@ export const GridRootStyles = styled('div', {
|
|
|
448
433
|
},
|
|
449
434
|
[`& .${c.columnHeader}:not(.${c['columnHeader--sorted']}) .${c.sortIcon}`]: {
|
|
450
435
|
opacity: 0,
|
|
451
|
-
transition:
|
|
452
|
-
duration:
|
|
436
|
+
transition: vars.transition(['opacity'], {
|
|
437
|
+
duration: vars.transitions.duration.short
|
|
453
438
|
})
|
|
454
439
|
},
|
|
455
440
|
[`& .${c.columnHeaderTitleContainer}`]: {
|
|
456
441
|
display: 'flex',
|
|
457
442
|
alignItems: 'center',
|
|
458
|
-
gap:
|
|
443
|
+
gap: vars.spacing(0.25),
|
|
459
444
|
minWidth: 0,
|
|
460
445
|
flex: 1,
|
|
461
446
|
whiteSpace: 'nowrap',
|
|
@@ -491,13 +476,13 @@ export const GridRootStyles = styled('div', {
|
|
|
491
476
|
marginLeft: -5
|
|
492
477
|
},
|
|
493
478
|
[`& .${c['columnHeader--moving']}`]: {
|
|
494
|
-
backgroundColor:
|
|
479
|
+
backgroundColor: hoverBackground
|
|
495
480
|
},
|
|
496
481
|
[`& .${c['columnHeader--pinnedLeft']}, & .${c['columnHeader--pinnedRight']}`]: {
|
|
497
482
|
position: 'sticky',
|
|
498
483
|
zIndex: 4,
|
|
499
484
|
// Should be above the column separator
|
|
500
|
-
background:
|
|
485
|
+
background: vars.header.background.base
|
|
501
486
|
},
|
|
502
487
|
[`& .${c.columnSeparator}`]: {
|
|
503
488
|
position: 'absolute',
|
|
@@ -508,11 +493,11 @@ export const GridRootStyles = styled('div', {
|
|
|
508
493
|
justifyContent: 'center',
|
|
509
494
|
alignItems: 'center',
|
|
510
495
|
maxWidth: columnSeparatorTargetSize,
|
|
511
|
-
color:
|
|
496
|
+
color: vars.colors.border.base
|
|
512
497
|
},
|
|
513
498
|
[`& .${c.columnHeaders}`]: {
|
|
514
499
|
width: 'var(--DataGrid-rowWidth)',
|
|
515
|
-
backgroundColor:
|
|
500
|
+
backgroundColor: headerBackground
|
|
516
501
|
},
|
|
517
502
|
'@media (hover: hover)': {
|
|
518
503
|
[`& .${c.columnHeader}:hover`]: columnHeaderStyles,
|
|
@@ -525,7 +510,7 @@ export const GridRootStyles = styled('div', {
|
|
|
525
510
|
[`& .${c.columnHeader}:focus,
|
|
526
511
|
& .${c['columnHeader--siblingFocused']}`]: {
|
|
527
512
|
[`.${c['columnSeparator--resizable']}`]: {
|
|
528
|
-
color:
|
|
513
|
+
color: vars.colors.foreground.accent
|
|
529
514
|
}
|
|
530
515
|
}
|
|
531
516
|
},
|
|
@@ -545,7 +530,7 @@ export const GridRootStyles = styled('div', {
|
|
|
545
530
|
cursor: 'col-resize',
|
|
546
531
|
touchAction: 'none',
|
|
547
532
|
[`&.${c['columnSeparator--resizing']}`]: {
|
|
548
|
-
color:
|
|
533
|
+
color: vars.colors.foreground.accent
|
|
549
534
|
},
|
|
550
535
|
// Always appear as draggable on touch devices
|
|
551
536
|
'@media (hover: none)': {
|
|
@@ -553,7 +538,7 @@ export const GridRootStyles = styled('div', {
|
|
|
553
538
|
},
|
|
554
539
|
'@media (hover: hover)': {
|
|
555
540
|
'&:hover': {
|
|
556
|
-
color:
|
|
541
|
+
color: vars.colors.foreground.accent,
|
|
557
542
|
[`& .${c.iconSeparator} rect`]: separatorIconDragStyles
|
|
558
543
|
}
|
|
559
544
|
},
|
|
@@ -563,8 +548,8 @@ export const GridRootStyles = styled('div', {
|
|
|
563
548
|
},
|
|
564
549
|
[`& .${c.iconSeparator}`]: {
|
|
565
550
|
color: 'inherit',
|
|
566
|
-
transition:
|
|
567
|
-
duration:
|
|
551
|
+
transition: vars.transition(['color', 'width'], {
|
|
552
|
+
duration: vars.transitions.duration.short
|
|
568
553
|
})
|
|
569
554
|
},
|
|
570
555
|
[`& .${c.menuIcon}`]: {
|
|
@@ -606,7 +591,7 @@ export const GridRootStyles = styled('div', {
|
|
|
606
591
|
'--rowBorderColor': 'transparent'
|
|
607
592
|
},
|
|
608
593
|
'&:hover': {
|
|
609
|
-
backgroundColor:
|
|
594
|
+
backgroundColor: hoverBackground,
|
|
610
595
|
// Reset on touch devices, it doesn't add specificity
|
|
611
596
|
'@media (hover: none)': {
|
|
612
597
|
backgroundColor: 'transparent'
|
|
@@ -617,6 +602,11 @@ export const GridRootStyles = styled('div', {
|
|
|
617
602
|
},
|
|
618
603
|
'&.Mui-selected': selectedStyles
|
|
619
604
|
},
|
|
605
|
+
[`& .${c['container--top']}, & .${c['container--bottom']}`]: {
|
|
606
|
+
'[role=row]': {
|
|
607
|
+
background: vars.colors.background.base
|
|
608
|
+
}
|
|
609
|
+
},
|
|
620
610
|
/* Cell styles */
|
|
621
611
|
[`& .${c.cell}`]: {
|
|
622
612
|
flex: '0 0 auto',
|
|
@@ -636,9 +626,9 @@ export const GridRootStyles = styled('div', {
|
|
|
636
626
|
borderTopColor: 'transparent'
|
|
637
627
|
},
|
|
638
628
|
[`& .${c.pinnedRows} .${c.row}, .${c.aggregationRowOverlayWrapper} .${c.row}`]: {
|
|
639
|
-
backgroundColor:
|
|
629
|
+
backgroundColor: pinnedBackground,
|
|
640
630
|
'&:hover': {
|
|
641
|
-
backgroundColor:
|
|
631
|
+
backgroundColor: pinnedHoverBackground
|
|
642
632
|
}
|
|
643
633
|
},
|
|
644
634
|
[`& .${c['pinnedRows--top']} :first-of-type`]: {
|
|
@@ -664,19 +654,19 @@ export const GridRootStyles = styled('div', {
|
|
|
664
654
|
[`& .${c.cell}.${c['cell--editing']}`]: {
|
|
665
655
|
padding: 1,
|
|
666
656
|
display: 'flex',
|
|
667
|
-
boxShadow:
|
|
668
|
-
backgroundColor:
|
|
657
|
+
boxShadow: vars.shadows.base,
|
|
658
|
+
backgroundColor: vars.colors.background.overlay,
|
|
669
659
|
'&:focus-within': {
|
|
670
|
-
outline: `${focusOutlineWidth}px solid ${
|
|
660
|
+
outline: `${focusOutlineWidth}px solid ${vars.colors.interactive.focus}`,
|
|
671
661
|
outlineOffset: focusOutlineWidth * -1
|
|
672
662
|
}
|
|
673
663
|
},
|
|
674
664
|
[`& .${c['row--editing']}`]: {
|
|
675
|
-
boxShadow:
|
|
665
|
+
boxShadow: vars.shadows.base
|
|
676
666
|
},
|
|
677
667
|
[`& .${c['row--editing']} .${c.cell}`]: {
|
|
678
|
-
boxShadow:
|
|
679
|
-
backgroundColor:
|
|
668
|
+
boxShadow: 'none',
|
|
669
|
+
backgroundColor: vars.colors.background.overlay
|
|
680
670
|
},
|
|
681
671
|
[`& .${c.editBooleanCell}`]: {
|
|
682
672
|
display: 'flex',
|
|
@@ -686,22 +676,22 @@ export const GridRootStyles = styled('div', {
|
|
|
686
676
|
justifyContent: 'center'
|
|
687
677
|
},
|
|
688
678
|
[`& .${c.booleanCell}[data-value="true"]`]: {
|
|
689
|
-
color:
|
|
679
|
+
color: vars.colors.foreground.muted
|
|
690
680
|
},
|
|
691
681
|
[`& .${c.booleanCell}[data-value="false"]`]: {
|
|
692
|
-
color:
|
|
682
|
+
color: vars.colors.foreground.disabled
|
|
693
683
|
},
|
|
694
684
|
[`& .${c.actionsCell}`]: {
|
|
695
685
|
display: 'inline-flex',
|
|
696
686
|
alignItems: 'center',
|
|
697
|
-
gridGap:
|
|
687
|
+
gridGap: vars.spacing(1)
|
|
698
688
|
},
|
|
699
689
|
[`& .${c.rowReorderCell}`]: {
|
|
700
690
|
display: 'inline-flex',
|
|
701
691
|
flex: 1,
|
|
702
692
|
alignItems: 'center',
|
|
703
693
|
justifyContent: 'center',
|
|
704
|
-
opacity:
|
|
694
|
+
opacity: vars.colors.interactive.disabledOpacity
|
|
705
695
|
},
|
|
706
696
|
[`& .${c['rowReorderCell--draggable']}`]: {
|
|
707
697
|
cursor: 'move',
|
|
@@ -713,7 +703,7 @@ export const GridRootStyles = styled('div', {
|
|
|
713
703
|
alignItems: 'stretch'
|
|
714
704
|
},
|
|
715
705
|
[`.${c.withBorderColor}`]: {
|
|
716
|
-
borderColor
|
|
706
|
+
borderColor: vars.colors.border.base
|
|
717
707
|
},
|
|
718
708
|
[`& .${c['cell--withLeftBorder']}, & .${c['columnHeader--withLeftBorder']}`]: {
|
|
719
709
|
borderLeftColor: 'var(--DataGrid-rowBorderColor)',
|
|
@@ -745,9 +735,9 @@ export const GridRootStyles = styled('div', {
|
|
|
745
735
|
[`& .${c['cell--pinnedLeft']}, & .${c['cell--pinnedRight']}`]: {
|
|
746
736
|
position: 'sticky',
|
|
747
737
|
zIndex: 3,
|
|
748
|
-
background:
|
|
738
|
+
background: vars.cell.background.pinned,
|
|
749
739
|
'&.Mui-selected': {
|
|
750
|
-
backgroundColor:
|
|
740
|
+
backgroundColor: pinnedSelectedBackground
|
|
751
741
|
}
|
|
752
742
|
},
|
|
753
743
|
[`& .${c.row}`]: {
|
|
@@ -774,16 +764,16 @@ export const GridRootStyles = styled('div', {
|
|
|
774
764
|
display: 'none'
|
|
775
765
|
},
|
|
776
766
|
[`& .${c['columnHeader--dragging']}, & .${c['row--dragging']}`]: {
|
|
777
|
-
background:
|
|
767
|
+
background: vars.colors.background.overlay,
|
|
778
768
|
padding: '0 12px',
|
|
779
769
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
780
|
-
opacity:
|
|
770
|
+
opacity: vars.colors.interactive.disabledOpacity
|
|
781
771
|
},
|
|
782
772
|
[`& .${c['row--dragging']}`]: {
|
|
783
|
-
background:
|
|
773
|
+
background: vars.colors.background.overlay,
|
|
784
774
|
padding: '0 12px',
|
|
785
775
|
borderRadius: 'var(--unstable_DataGrid-radius)',
|
|
786
|
-
opacity:
|
|
776
|
+
opacity: vars.colors.interactive.disabledOpacity,
|
|
787
777
|
[`& .${c.rowReorderCellPlaceholder}`]: {
|
|
788
778
|
display: 'flex'
|
|
789
779
|
}
|
|
@@ -796,7 +786,7 @@ export const GridRootStyles = styled('div', {
|
|
|
796
786
|
[`& .${c.treeDataGroupingCellToggle}`]: {
|
|
797
787
|
flex: '0 0 28px',
|
|
798
788
|
alignSelf: 'stretch',
|
|
799
|
-
marginRight:
|
|
789
|
+
marginRight: vars.spacing(2)
|
|
800
790
|
},
|
|
801
791
|
[`& .${c.treeDataGroupingCellLoadingContainer}, .${c.groupingCriteriaCellLoadingContainer}`]: {
|
|
802
792
|
display: 'flex',
|
|
@@ -812,7 +802,7 @@ export const GridRootStyles = styled('div', {
|
|
|
812
802
|
[`& .${c.groupingCriteriaCellToggle}`]: {
|
|
813
803
|
flex: '0 0 28px',
|
|
814
804
|
alignSelf: 'stretch',
|
|
815
|
-
marginRight:
|
|
805
|
+
marginRight: vars.spacing(2)
|
|
816
806
|
},
|
|
817
807
|
/* ScrollbarFiller styles */
|
|
818
808
|
[`.${c.scrollbarFiller}`]: {
|
|
@@ -825,7 +815,7 @@ export const GridRootStyles = styled('div', {
|
|
|
825
815
|
borderBottom: '1px solid var(--DataGrid-rowBorderColor)'
|
|
826
816
|
},
|
|
827
817
|
[`&.${c['scrollbarFiller--pinnedRight']}`]: {
|
|
828
|
-
backgroundColor:
|
|
818
|
+
backgroundColor: vars.cell.background.pinned,
|
|
829
819
|
position: 'sticky',
|
|
830
820
|
right: 0
|
|
831
821
|
}
|
|
@@ -852,22 +842,9 @@ export const GridRootStyles = styled('div', {
|
|
|
852
842
|
});
|
|
853
843
|
return gridStyle;
|
|
854
844
|
});
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
* Blend a transparent overlay color with a background color, resulting in a single
|
|
858
|
-
* RGB color.
|
|
859
|
-
*/
|
|
860
|
-
function blend(background, overlay, opacity, gamma = 1) {
|
|
861
|
-
const f = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);
|
|
862
|
-
const backgroundColor = decomposeColor(background);
|
|
863
|
-
const overlayColor = decomposeColor(overlay);
|
|
864
|
-
const rgb = [f(backgroundColor.values[0], overlayColor.values[0]), f(backgroundColor.values[1], overlayColor.values[1]), f(backgroundColor.values[2], overlayColor.values[2])];
|
|
865
|
-
return recomposeColor({
|
|
866
|
-
type: 'rgb',
|
|
867
|
-
values: rgb
|
|
868
|
-
});
|
|
845
|
+
function setOpacity(color, opacity) {
|
|
846
|
+
return `rgba(from ${color} r g b / ${opacity})`;
|
|
869
847
|
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
return `color-mix(in srgb,${background}, ${removeOpacity(overlay)} calc(${opacity} * 100%))`;
|
|
848
|
+
function mix(background, overlay, opacity) {
|
|
849
|
+
return `color-mix(in srgb,${background}, ${overlay} calc(${opacity} * 100%))`;
|
|
873
850
|
}
|
|
@@ -7,6 +7,7 @@ import clsx from 'clsx';
|
|
|
7
7
|
import { styled } from '@mui/system';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
9
|
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
10
|
+
import { vars } from "../../constants/cssVariables.js";
|
|
10
11
|
import { getDataGridUtilityClass } from "../../constants/gridClasses.js";
|
|
11
12
|
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -23,15 +24,13 @@ const GridToolbarContainerRoot = styled('div', {
|
|
|
23
24
|
name: 'MuiDataGrid',
|
|
24
25
|
slot: 'ToolbarContainer',
|
|
25
26
|
overridesResolver: (_, styles) => styles.toolbarContainer
|
|
26
|
-
})(
|
|
27
|
-
theme
|
|
28
|
-
}) => ({
|
|
27
|
+
})({
|
|
29
28
|
display: 'flex',
|
|
30
29
|
alignItems: 'center',
|
|
31
30
|
flexWrap: 'wrap',
|
|
32
|
-
gap:
|
|
33
|
-
padding:
|
|
34
|
-
})
|
|
31
|
+
gap: vars.spacing(1),
|
|
32
|
+
padding: vars.spacing(0.5, 0.5, 0)
|
|
33
|
+
});
|
|
35
34
|
const GridToolbarContainer = forwardRef(function GridToolbarContainer(props, ref) {
|
|
36
35
|
const {
|
|
37
36
|
className,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { RenderProp } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
3
|
+
import { GridCsvExportOptions } from "../../models/gridExport.js";
|
|
4
|
+
import type { GridSlotProps } from '../../models';
|
|
5
|
+
export type ExportCsvProps = GridSlotProps['baseButton'] & {
|
|
6
|
+
/**
|
|
7
|
+
* A function to customize rendering of the component.
|
|
8
|
+
*/
|
|
9
|
+
render?: RenderProp<GridSlotProps['baseButton']>;
|
|
10
|
+
/**
|
|
11
|
+
* The options to apply on the CSV export.
|
|
12
|
+
* @demos
|
|
13
|
+
* - [CSV export](/x/react-data-grid/export/#csv-export)
|
|
14
|
+
*/
|
|
15
|
+
options?: GridCsvExportOptions;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* A button that triggers a CSV export.
|
|
19
|
+
* It renders the `baseButton` slot.
|
|
20
|
+
*
|
|
21
|
+
* Demos:
|
|
22
|
+
*
|
|
23
|
+
* - [Export](https://mui.com/x/react-data-grid/components/export/)
|
|
24
|
+
*
|
|
25
|
+
* API:
|
|
26
|
+
*
|
|
27
|
+
* - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
|
|
28
|
+
*/
|
|
29
|
+
declare const ExportCsv: React.ForwardRefExoticComponent<ExportCsvProps> | React.ForwardRefExoticComponent<Omit<ExportCsvProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
export { ExportCsv };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["render", "options", "onClick"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
7
|
+
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
8
|
+
import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
|
|
9
|
+
import { useGridComponentRenderer } from "../../hooks/utils/useGridComponentRenderer.js";
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
/**
|
|
12
|
+
* A button that triggers a CSV export.
|
|
13
|
+
* It renders the `baseButton` slot.
|
|
14
|
+
*
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [Export](https://mui.com/x/react-data-grid/components/export/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [ExportCsv API](https://mui.com/x/api/data-grid/export-csv/)
|
|
22
|
+
*/
|
|
23
|
+
const ExportCsv = forwardRef(function ExportCsv(props, ref) {
|
|
24
|
+
const {
|
|
25
|
+
render,
|
|
26
|
+
options,
|
|
27
|
+
onClick
|
|
28
|
+
} = props,
|
|
29
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
30
|
+
const rootProps = useGridRootProps();
|
|
31
|
+
const apiRef = useGridApiContext();
|
|
32
|
+
const handleClick = event => {
|
|
33
|
+
apiRef.current.exportDataAsCsv(options);
|
|
34
|
+
onClick?.(event);
|
|
35
|
+
};
|
|
36
|
+
const element = useGridComponentRenderer(rootProps.slots.baseButton, render, _extends({}, rootProps.slotProps?.baseButton, {
|
|
37
|
+
onClick: handleClick
|
|
38
|
+
}, other, {
|
|
39
|
+
ref
|
|
40
|
+
}));
|
|
41
|
+
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
42
|
+
children: element
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
process.env.NODE_ENV !== "production" ? ExportCsv.propTypes = {
|
|
46
|
+
// ----------------------------- Warning --------------------------------
|
|
47
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
48
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
49
|
+
// ----------------------------------------------------------------------
|
|
50
|
+
/**
|
|
51
|
+
* A ref for imperative actions.
|
|
52
|
+
* It currently only supports `focusVisible()` action.
|
|
53
|
+
*/
|
|
54
|
+
action: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
55
|
+
current: PropTypes.shape({
|
|
56
|
+
focusVisible: PropTypes.func.isRequired
|
|
57
|
+
})
|
|
58
|
+
})]),
|
|
59
|
+
/**
|
|
60
|
+
* If `true`, the ripples are centered.
|
|
61
|
+
* They won't start at the cursor interaction position.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
centerRipple: PropTypes.bool,
|
|
65
|
+
className: PropTypes.string,
|
|
66
|
+
/**
|
|
67
|
+
* The color of the component.
|
|
68
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
69
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
|
|
70
|
+
* @default 'primary'
|
|
71
|
+
*/
|
|
72
|
+
color: PropTypes.oneOf(['error', 'info', 'inherit', 'primary', 'secondary', 'success', 'warning']),
|
|
73
|
+
component: PropTypes.elementType,
|
|
74
|
+
/**
|
|
75
|
+
* If `true`, the component is disabled.
|
|
76
|
+
*/
|
|
77
|
+
disabled: PropTypes.bool,
|
|
78
|
+
/**
|
|
79
|
+
* If `true`, no elevation is used.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
disableElevation: PropTypes.bool,
|
|
83
|
+
/**
|
|
84
|
+
* If `true`, the keyboard focus ripple is disabled.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
disableFocusRipple: PropTypes.bool,
|
|
88
|
+
/**
|
|
89
|
+
* If `true`, the ripple effect is disabled.
|
|
90
|
+
*
|
|
91
|
+
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
|
92
|
+
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
disableRipple: PropTypes.bool,
|
|
96
|
+
/**
|
|
97
|
+
* If `true`, the touch ripple effect is disabled.
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
disableTouchRipple: PropTypes.bool,
|
|
101
|
+
/**
|
|
102
|
+
* Element placed after the children.
|
|
103
|
+
*/
|
|
104
|
+
endIcon: PropTypes.node,
|
|
105
|
+
/**
|
|
106
|
+
* If `true`, the base button will have a keyboard focus ripple.
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
focusRipple: PropTypes.bool,
|
|
110
|
+
/**
|
|
111
|
+
* This prop can help identify which element has keyboard focus.
|
|
112
|
+
* The class name will be applied when the element gains the focus through keyboard interaction.
|
|
113
|
+
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
|
114
|
+
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
|
115
|
+
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
|
116
|
+
* if needed.
|
|
117
|
+
*/
|
|
118
|
+
focusVisibleClassName: PropTypes.string,
|
|
119
|
+
/**
|
|
120
|
+
* If `true`, the button will take up the full width of its container.
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
fullWidth: PropTypes.bool,
|
|
124
|
+
/**
|
|
125
|
+
* The URL to link to when the button is clicked.
|
|
126
|
+
* If defined, an `a` element will be used as the root node.
|
|
127
|
+
*/
|
|
128
|
+
href: PropTypes.string,
|
|
129
|
+
/**
|
|
130
|
+
* The component used to render a link when the `href` prop is provided.
|
|
131
|
+
* @default 'a'
|
|
132
|
+
*/
|
|
133
|
+
LinkComponent: PropTypes.elementType,
|
|
134
|
+
/**
|
|
135
|
+
* Callback fired when the component is focused with a keyboard.
|
|
136
|
+
* We trigger a `onFocus` callback too.
|
|
137
|
+
*/
|
|
138
|
+
onFocusVisible: PropTypes.func,
|
|
139
|
+
/**
|
|
140
|
+
* The options to apply on the CSV export.
|
|
141
|
+
* @demos
|
|
142
|
+
* - [CSV export](/x/react-data-grid/export/#csv-export)
|
|
143
|
+
*/
|
|
144
|
+
options: PropTypes.shape({
|
|
145
|
+
allColumns: PropTypes.bool,
|
|
146
|
+
delimiter: PropTypes.string,
|
|
147
|
+
escapeFormulas: PropTypes.bool,
|
|
148
|
+
fields: PropTypes.arrayOf(PropTypes.string),
|
|
149
|
+
fileName: PropTypes.string,
|
|
150
|
+
getRowsToExport: PropTypes.func,
|
|
151
|
+
includeColumnGroupsHeaders: PropTypes.bool,
|
|
152
|
+
includeHeaders: PropTypes.bool,
|
|
153
|
+
shouldAppendQuotes: PropTypes.bool,
|
|
154
|
+
utf8WithBom: PropTypes.bool
|
|
155
|
+
}),
|
|
156
|
+
/**
|
|
157
|
+
* A function to customize rendering of the component.
|
|
158
|
+
*/
|
|
159
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
160
|
+
/**
|
|
161
|
+
* The size of the component.
|
|
162
|
+
* `small` is equivalent to the dense button styling.
|
|
163
|
+
*/
|
|
164
|
+
size: PropTypes.oneOf(['large', 'medium', 'small']),
|
|
165
|
+
/**
|
|
166
|
+
* Element placed before the children.
|
|
167
|
+
*/
|
|
168
|
+
startIcon: PropTypes.node,
|
|
169
|
+
style: PropTypes.object,
|
|
170
|
+
/**
|
|
171
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
172
|
+
*/
|
|
173
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
174
|
+
tabIndex: PropTypes.number,
|
|
175
|
+
/**
|
|
176
|
+
* Props applied to the `TouchRipple` element.
|
|
177
|
+
*/
|
|
178
|
+
TouchRippleProps: PropTypes.object,
|
|
179
|
+
/**
|
|
180
|
+
* A ref that points to the `TouchRipple` element.
|
|
181
|
+
*/
|
|
182
|
+
touchRippleRef: PropTypes.any,
|
|
183
|
+
/**
|
|
184
|
+
* The variant to use.
|
|
185
|
+
* @default 'text'
|
|
186
|
+
*/
|
|
187
|
+
variant: PropTypes.oneOf(['contained', 'outlined', 'text'])
|
|
188
|
+
} : void 0;
|
|
189
|
+
export { ExportCsv };
|