@mui/x-data-grid 7.0.0-beta.3 → 7.0.0-beta.5
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 +357 -22
- package/DataGrid/DataGrid.js +2 -0
- package/colDef/gridActionsColDef.js +1 -0
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridBooleanOperators.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/components/GridRow.d.ts +7 -9
- package/components/GridRow.js +36 -47
- package/components/GridScrollbarFillerCell.js +6 -21
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +17 -15
- package/components/cell/GridSkeletonCell.d.ts +3 -2
- package/components/cell/GridSkeletonCell.js +14 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/components/containers/GridRootStyles.js +59 -21
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/components/virtualization/GridBottomContainer.js +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -2
- package/components/virtualization/GridVirtualScrollerRenderZone.js +9 -3
- package/constants/gridClasses.d.ts +24 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/hooks/features/columns/gridColumnsSelector.d.ts +6 -0
- package/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/hooks/features/columns/useGridColumns.js +4 -0
- package/hooks/features/editing/useGridCellEditing.js +3 -4
- package/hooks/features/editing/useGridRowEditing.js +4 -6
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/rows/useGridRows.js +8 -4
- package/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/hooks/features/sorting/useGridSorting.js +1 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +0 -9
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +82 -138
- package/hooks/features/virtualization/useGridVirtualization.d.ts +0 -8
- package/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/hooks/utils/useTimeout.d.ts +5 -3
- package/hooks/utils/useTimeout.js +13 -5
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +13 -0
- package/modern/DataGrid/DataGrid.js +2 -0
- package/modern/colDef/gridActionsColDef.js +1 -0
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridBooleanOperators.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/components/GridRow.js +35 -46
- package/modern/components/GridScrollbarFillerCell.js +6 -21
- package/modern/components/cell/GridCell.js +17 -15
- package/modern/components/cell/GridSkeletonCell.js +14 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/modern/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/modern/components/containers/GridRootStyles.js +59 -21
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/modern/components/virtualization/GridBottomContainer.js +1 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -2
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +8 -3
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/modern/hooks/features/columns/useGridColumns.js +2 -0
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -6
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/rows/useGridRows.js +8 -4
- package/modern/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/modern/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +80 -136
- package/modern/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/modern/hooks/utils/useTimeout.js +13 -5
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/utils/keyboardUtils.js +20 -11
- package/modern/utils/utils.js +9 -0
- package/node/DataGrid/DataGrid.js +1 -0
- package/node/colDef/gridActionsColDef.js +1 -0
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridBooleanOperators.js +1 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/components/GridRow.js +35 -46
- package/node/components/GridScrollbarFillerCell.js +5 -20
- package/node/components/cell/GridCell.js +17 -15
- package/node/components/cell/GridSkeletonCell.js +15 -7
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/node/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/node/components/containers/GridRootStyles.js +59 -21
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/node/components/virtualization/GridBottomContainer.js +1 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +7 -2
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/columns/gridColumnsSelector.js +9 -2
- package/node/hooks/features/columns/useGridColumns.js +2 -0
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +3 -5
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/rows/useGridRows.js +8 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/node/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/node/hooks/features/sorting/useGridSorting.js +1 -2
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +1 -8
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +81 -136
- package/node/hooks/features/virtualization/useGridVirtualization.js +2 -7
- package/node/hooks/utils/useTimeout.js +13 -4
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/utils/keyboardUtils.js +25 -20
- package/node/utils/utils.js +12 -1
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +7 -6
- package/utils/keyboardUtils.js +20 -11
- package/utils/utils.d.ts +4 -0
- package/utils/utils.js +9 -0
- package/legacy/DataGrid/DataGrid.js +0 -664
- package/legacy/DataGrid/index.js +0 -2
- package/legacy/DataGrid/useDataGridComponent.js +0 -81
- package/legacy/DataGrid/useDataGridProps.js +0 -98
- package/legacy/colDef/gridActionsColDef.js +0 -18
- package/legacy/colDef/gridBooleanColDef.js +0 -42
- package/legacy/colDef/gridBooleanOperators.js +0 -16
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -33
- package/legacy/colDef/gridDateColDef.js +0 -62
- package/legacy/colDef/gridDateOperators.js +0 -115
- package/legacy/colDef/gridDefaultColumnTypes.js +0 -19
- package/legacy/colDef/gridNumericColDef.js +0 -19
- package/legacy/colDef/gridNumericOperators.js +0 -145
- package/legacy/colDef/gridSingleSelectColDef.js +0 -64
- package/legacy/colDef/gridSingleSelectOperators.js +0 -46
- package/legacy/colDef/gridStringColDef.js +0 -27
- package/legacy/colDef/gridStringOperators.js +0 -112
- package/legacy/colDef/index.js +0 -13
- package/legacy/components/GridApiContext.js +0 -5
- package/legacy/components/GridColumnHeaders.js +0 -94
- package/legacy/components/GridDetailPanels.js +0 -4
- package/legacy/components/GridFooter.js +0 -42
- package/legacy/components/GridHeader.js +0 -13
- package/legacy/components/GridHeaders.js +0 -53
- package/legacy/components/GridLoadingOverlay.js +0 -21
- package/legacy/components/GridNoResultsOverlay.js +0 -14
- package/legacy/components/GridNoRowsOverlay.js +0 -23
- package/legacy/components/GridPagination.js +0 -85
- package/legacy/components/GridPinnedRows.js +0 -4
- package/legacy/components/GridRow.js +0 -465
- package/legacy/components/GridRowCount.js +0 -63
- package/legacy/components/GridScrollbarFillerCell.js +0 -34
- package/legacy/components/GridSelectedRowCount.js +0 -66
- package/legacy/components/base/GridBody.js +0 -2
- package/legacy/components/base/GridFooterPlaceholder.js +0 -12
- package/legacy/components/base/GridOverlays.js +0 -122
- package/legacy/components/base/index.js +0 -3
- package/legacy/components/cell/GridActionsCell.js +0 -294
- package/legacy/components/cell/GridActionsCellItem.js +0 -69
- package/legacy/components/cell/GridBooleanCell.js +0 -121
- package/legacy/components/cell/GridCell.js +0 -350
- package/legacy/components/cell/GridEditBooleanCell.js +0 -174
- package/legacy/components/cell/GridEditDateCell.js +0 -230
- package/legacy/components/cell/GridEditInputCell.js +0 -198
- package/legacy/components/cell/GridEditSingleSelectCell.js +0 -231
- package/legacy/components/cell/GridSkeletonCell.js +0 -52
- package/legacy/components/cell/index.js +0 -9
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +0 -59
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +0 -41
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +0 -132
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -93
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +0 -212
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +0 -71
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +0 -79
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +0 -84
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +0 -55
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -107
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +0 -41
- package/legacy/components/columnHeaders/index.js +0 -5
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -160
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -134
- package/legacy/components/columnSelection/index.js +0 -2
- package/legacy/components/columnsManagement/GridColumnsManagement.js +0 -307
- package/legacy/components/columnsManagement/index.js +0 -1
- package/legacy/components/columnsManagement/utils.js +0 -22
- package/legacy/components/containers/GridFooterContainer.js +0 -50
- package/legacy/components/containers/GridOverlay.js +0 -52
- package/legacy/components/containers/GridRoot.js +0 -79
- package/legacy/components/containers/GridRootStyles.js +0 -395
- package/legacy/components/containers/GridToolbarContainer.js +0 -59
- package/legacy/components/containers/index.js +0 -4
- package/legacy/components/index.js +0 -19
- package/legacy/components/menu/GridMenu.js +0 -132
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +0 -61
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +0 -81
- package/legacy/components/menu/columnMenu/GridColumnMenuContainer.js +0 -56
- package/legacy/components/menu/columnMenu/GridColumnMenuItemProps.js +0 -1
- package/legacy/components/menu/columnMenu/GridColumnMenuProps.js +0 -1
- package/legacy/components/menu/columnMenu/index.js +0 -9
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +0 -21
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +0 -60
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +0 -80
- package/legacy/components/menu/columnMenu/menuItems/index.js +0 -5
- package/legacy/components/menu/index.js +0 -2
- package/legacy/components/panel/GridColumnsPanel.js +0 -22
- package/legacy/components/panel/GridPanel.js +0 -137
- package/legacy/components/panel/GridPanelContent.js +0 -49
- package/legacy/components/panel/GridPanelFooter.js +0 -50
- package/legacy/components/panel/GridPanelHeader.js +0 -48
- package/legacy/components/panel/GridPanelWrapper.js +0 -64
- package/legacy/components/panel/GridPreferencesPanel.js +0 -26
- package/legacy/components/panel/filterPanel/GridFilterForm.js +0 -528
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +0 -118
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +0 -121
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -116
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -102
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +0 -149
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +0 -106
- package/legacy/components/panel/filterPanel/GridFilterInputValueProps.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +0 -264
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +0 -22
- package/legacy/components/panel/filterPanel/index.js +0 -9
- package/legacy/components/panel/index.js +0 -7
- package/legacy/components/reexportable.js +0 -1
- package/legacy/components/toolbar/GridToolbar.js +0 -64
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -68
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -142
- package/legacy/components/toolbar/GridToolbarExport.js +0 -80
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -105
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -136
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +0 -164
- package/legacy/components/toolbar/index.js +0 -7
- package/legacy/components/virtualization/GridBottomContainer.js +0 -25
- package/legacy/components/virtualization/GridMainContainer.js +0 -20
- package/legacy/components/virtualization/GridTopContainer.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollbar.js +0 -129
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -93
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +0 -70
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +0 -49
- package/legacy/constants/defaultGridSlotsComponents.js +0 -33
- package/legacy/constants/envConstants.js +0 -19
- package/legacy/constants/gridClasses.js +0 -5
- package/legacy/constants/gridDetailPanelToggleField.js +0 -2
- package/legacy/constants/index.js +0 -3
- package/legacy/constants/localeTextConstants.js +0 -158
- package/legacy/context/GridContextProvider.js +0 -21
- package/legacy/context/GridRootPropsContext.js +0 -6
- package/legacy/context/index.js +0 -1
- package/legacy/hooks/core/gridCoreSelector.js +0 -7
- package/legacy/hooks/core/index.js +0 -1
- package/legacy/hooks/core/pipeProcessing/gridPipeProcessingApi.js +0 -1
- package/legacy/hooks/core/pipeProcessing/index.js +0 -4
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +0 -114
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +0 -26
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -26
- package/legacy/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +0 -1
- package/legacy/hooks/core/strategyProcessing/index.js +0 -3
- package/legacy/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +0 -18
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +0 -116
- package/legacy/hooks/core/useGridApiInitialization.js +0 -124
- package/legacy/hooks/core/useGridInitialization.js +0 -26
- package/legacy/hooks/core/useGridLocaleText.js +0 -12
- package/legacy/hooks/core/useGridLoggerFactory.js +0 -51
- package/legacy/hooks/core/useGridRefs.js +0 -13
- package/legacy/hooks/core/useGridStateInitialization.js +0 -106
- package/legacy/hooks/core/useGridTheme.js +0 -21
- package/legacy/hooks/features/clipboard/useGridClipboard.js +0 -92
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +0 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +0 -24
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +0 -92
- package/legacy/hooks/features/columnGrouping/index.js +0 -2
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +0 -140
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -272
- package/legacy/hooks/features/columnMenu/columnMenuInterfaces.js +0 -1
- package/legacy/hooks/features/columnMenu/columnMenuSelector.js +0 -3
- package/legacy/hooks/features/columnMenu/index.js +0 -2
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +0 -108
- package/legacy/hooks/features/columnMenu/useGridColumnMenuSlots.js +0 -71
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +0 -9
- package/legacy/hooks/features/columns/gridColumnsSelector.js +0 -174
- package/legacy/hooks/features/columns/gridColumnsUtils.js +0 -338
- package/legacy/hooks/features/columns/index.js +0 -2
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +0 -105
- package/legacy/hooks/features/columns/useGridColumns.js +0 -319
- package/legacy/hooks/features/density/densitySelector.js +0 -10
- package/legacy/hooks/features/density/densityState.js +0 -1
- package/legacy/hooks/features/density/index.js +0 -2
- package/legacy/hooks/features/density/useGridDensity.js +0 -48
- package/legacy/hooks/features/dimensions/gridDimensionsApi.js +0 -1
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +0 -3
- package/legacy/hooks/features/dimensions/index.js +0 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +0 -302
- package/legacy/hooks/features/editing/gridEditingSelectors.js +0 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -456
- package/legacy/hooks/features/editing/useGridEditing.js +0 -145
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -567
- package/legacy/hooks/features/events/useGridEvents.js +0 -23
- package/legacy/hooks/features/export/serializers/csvSerializer.js +0 -155
- package/legacy/hooks/features/export/useGridCsvExport.js +0 -75
- package/legacy/hooks/features/export/useGridPrintExport.js +0 -313
- package/legacy/hooks/features/export/utils.js +0 -49
- package/legacy/hooks/features/filter/gridFilterSelector.js +0 -165
- package/legacy/hooks/features/filter/gridFilterState.js +0 -20
- package/legacy/hooks/features/filter/gridFilterUtils.js +0 -330
- package/legacy/hooks/features/filter/index.js +0 -2
- package/legacy/hooks/features/filter/useGridFilter.js +0 -378
- package/legacy/hooks/features/focus/gridFocusState.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +0 -31
- package/legacy/hooks/features/focus/index.js +0 -2
- package/legacy/hooks/features/focus/useGridFocus.js +0 -408
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +0 -10
- package/legacy/hooks/features/headerFiltering/index.js +0 -1
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +0 -93
- package/legacy/hooks/features/index.js +0 -16
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +0 -565
- package/legacy/hooks/features/pagination/gridPaginationInterfaces.js +0 -1
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +0 -115
- package/legacy/hooks/features/pagination/gridPaginationUtils.js +0 -31
- package/legacy/hooks/features/pagination/index.js +0 -2
- package/legacy/hooks/features/pagination/useGridPagination.js +0 -175
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +0 -3
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelState.js +0 -1
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelsValue.js +0 -6
- package/legacy/hooks/features/preferencesPanel/index.js +0 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +0 -125
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +0 -19
- package/legacy/hooks/features/rowSelection/index.js +0 -1
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +0 -419
- package/legacy/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +0 -45
- package/legacy/hooks/features/rowSelection/utils.js +0 -8
- package/legacy/hooks/features/rows/gridRowsInterfaces.js +0 -1
- package/legacy/hooks/features/rows/gridRowsMetaSelector.js +0 -3
- package/legacy/hooks/features/rows/gridRowsMetaState.js +0 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +0 -90
- package/legacy/hooks/features/rows/gridRowsUtils.js +0 -294
- package/legacy/hooks/features/rows/index.js +0 -4
- package/legacy/hooks/features/rows/useGridParamsApi.js +0 -142
- package/legacy/hooks/features/rows/useGridRows.js +0 -466
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -236
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +0 -82
- package/legacy/hooks/features/scroll/useGridScroll.js +0 -133
- package/legacy/hooks/features/sorting/gridSortingSelector.js +0 -56
- package/legacy/hooks/features/sorting/gridSortingState.js +0 -1
- package/legacy/hooks/features/sorting/gridSortingUtils.js +0 -154
- package/legacy/hooks/features/sorting/index.js +0 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +0 -276
- package/legacy/hooks/features/statePersistence/gridStatePersistenceInterface.js +0 -1
- package/legacy/hooks/features/statePersistence/index.js +0 -1
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +0 -25
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -61
- package/legacy/hooks/features/virtualization/index.js +0 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -646
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +0 -63
- package/legacy/hooks/index.js +0 -3
- package/legacy/hooks/utils/index.js +0 -9
- package/legacy/hooks/utils/useFirstRender.js +0 -8
- package/legacy/hooks/utils/useGridApiContext.js +0 -9
- package/legacy/hooks/utils/useGridApiEventHandler.js +0 -105
- package/legacy/hooks/utils/useGridApiMethod.js +0 -11
- package/legacy/hooks/utils/useGridApiRef.js +0 -7
- package/legacy/hooks/utils/useGridAriaAttributes.js +0 -25
- package/legacy/hooks/utils/useGridInitializeState.js +0 -8
- package/legacy/hooks/utils/useGridLogger.js +0 -10
- package/legacy/hooks/utils/useGridNativeEventListener.js +0 -32
- package/legacy/hooks/utils/useGridPrivateApiContext.js +0 -12
- package/legacy/hooks/utils/useGridRootProps.js +0 -9
- package/legacy/hooks/utils/useGridSelector.js +0 -54
- package/legacy/hooks/utils/useGridVisibleRows.js +0 -42
- package/legacy/hooks/utils/useLazyRef.js +0 -11
- package/legacy/hooks/utils/useOnMount.js +0 -7
- package/legacy/hooks/utils/useResizeObserver.js +0 -36
- package/legacy/hooks/utils/useRunOnce.js +0 -18
- package/legacy/hooks/utils/useTimeout.js +0 -38
- package/legacy/index.js +0 -38
- package/legacy/internals/index.js +0 -68
- package/legacy/internals/utils/computeSlots.js +0 -17
- package/legacy/internals/utils/index.js +0 -3
- package/legacy/internals/utils/propValidation.js +0 -21
- package/legacy/internals/utils/useProps.js +0 -32
- package/legacy/joy/icons.js +0 -432
- package/legacy/joy/index.js +0 -2
- package/legacy/joy/joySlots.js +0 -420
- package/legacy/locales/arSD.js +0 -160
- package/legacy/locales/beBY.js +0 -184
- package/legacy/locales/bgBG.js +0 -160
- package/legacy/locales/coreLocales.js +0 -62
- package/legacy/locales/csCZ.js +0 -181
- package/legacy/locales/daDK.js +0 -160
- package/legacy/locales/deDE.js +0 -160
- package/legacy/locales/elGR.js +0 -160
- package/legacy/locales/enUS.js +0 -4
- package/legacy/locales/esES.js +0 -160
- package/legacy/locales/faIR.js +0 -160
- package/legacy/locales/fiFI.js +0 -160
- package/legacy/locales/frFR.js +0 -160
- package/legacy/locales/heIL.js +0 -160
- package/legacy/locales/hrHR.js +0 -160
- package/legacy/locales/huHU.js +0 -160
- package/legacy/locales/index.js +0 -35
- package/legacy/locales/itIT.js +0 -160
- package/legacy/locales/jaJP.js +0 -160
- package/legacy/locales/koKR.js +0 -162
- package/legacy/locales/nbNO.js +0 -162
- package/legacy/locales/nlNL.js +0 -160
- package/legacy/locales/plPL.js +0 -163
- package/legacy/locales/ptBR.js +0 -160
- package/legacy/locales/ptPT.js +0 -160
- package/legacy/locales/roRO.js +0 -160
- package/legacy/locales/ruRU.js +0 -181
- package/legacy/locales/skSK.js +0 -181
- package/legacy/locales/svSE.js +0 -160
- package/legacy/locales/trTR.js +0 -161
- package/legacy/locales/ukUA.js +0 -182
- package/legacy/locales/urPK.js +0 -160
- package/legacy/locales/viVN.js +0 -160
- package/legacy/locales/zhCN.js +0 -160
- package/legacy/locales/zhHK.js +0 -160
- package/legacy/locales/zhTW.js +0 -160
- package/legacy/material/components/MUISelectOption.js +0 -14
- package/legacy/material/icons/GridColumnUnsortedIcon.js +0 -16
- package/legacy/material/icons/index.js +0 -89
- package/legacy/material/index.js +0 -69
- package/legacy/models/api/gridApiCommon.js +0 -1
- package/legacy/models/api/gridApiCommunity.js +0 -1
- package/legacy/models/api/gridCallbackDetails.js +0 -1
- package/legacy/models/api/gridColumnApi.js +0 -1
- package/legacy/models/api/gridColumnGroupingApi.js +0 -1
- package/legacy/models/api/gridColumnMenuApi.js +0 -1
- package/legacy/models/api/gridColumnSpanning.js +0 -1
- package/legacy/models/api/gridCoreApi.js +0 -1
- package/legacy/models/api/gridCsvExportApi.js +0 -1
- package/legacy/models/api/gridDensityApi.js +0 -1
- package/legacy/models/api/gridEditingApi.js +0 -1
- package/legacy/models/api/gridFilterApi.js +0 -1
- package/legacy/models/api/gridFocusApi.js +0 -1
- package/legacy/models/api/gridHeaderFilteringApi.js +0 -1
- package/legacy/models/api/gridLocaleTextApi.js +0 -1
- package/legacy/models/api/gridLoggerApi.js +0 -1
- package/legacy/models/api/gridParamsApi.js +0 -1
- package/legacy/models/api/gridPreferencesPanelApi.js +0 -1
- package/legacy/models/api/gridPrintExportApi.js +0 -1
- package/legacy/models/api/gridRowApi.js +0 -1
- package/legacy/models/api/gridRowSelectionApi.js +0 -1
- package/legacy/models/api/gridRowsMetaApi.js +0 -1
- package/legacy/models/api/gridScrollApi.js +0 -1
- package/legacy/models/api/gridSortApi.js +0 -1
- package/legacy/models/api/gridStateApi.js +0 -1
- package/legacy/models/api/gridVirtualizationApi.js +0 -1
- package/legacy/models/api/index.js +0 -16
- package/legacy/models/colDef/gridColDef.js +0 -1
- package/legacy/models/colDef/gridColType.js +0 -1
- package/legacy/models/colDef/gridColumnTypesRecord.js +0 -1
- package/legacy/models/colDef/index.js +0 -6
- package/legacy/models/controlStateItem.js +0 -1
- package/legacy/models/cursorCoordinates.js +0 -1
- package/legacy/models/elementSize.js +0 -1
- package/legacy/models/events/gridEventListener.js +0 -1
- package/legacy/models/events/gridEventLookup.js +0 -1
- package/legacy/models/events/gridEventPublisher.js +0 -1
- package/legacy/models/events/index.js +0 -3
- package/legacy/models/gridApiCaches.js +0 -1
- package/legacy/models/gridCell.js +0 -1
- package/legacy/models/gridCellClass.js +0 -1
- package/legacy/models/gridColumnGrouping.js +0 -11
- package/legacy/models/gridColumnHeaderClass.js +0 -1
- package/legacy/models/gridColumnSpanning.js +0 -1
- package/legacy/models/gridDensity.js +0 -1
- package/legacy/models/gridEditRowModel.js +0 -16
- package/legacy/models/gridExport.js +0 -1
- package/legacy/models/gridFeatureMode.js +0 -1
- package/legacy/models/gridFilterItem.js +0 -11
- package/legacy/models/gridFilterModel.js +0 -1
- package/legacy/models/gridFilterOperator.js +0 -1
- package/legacy/models/gridHeaderFilteringModel.js +0 -1
- package/legacy/models/gridIconSlotsComponent.js +0 -1
- package/legacy/models/gridPaginationProps.js +0 -1
- package/legacy/models/gridRenderContextProps.js +0 -1
- package/legacy/models/gridRowSelectionModel.js +0 -1
- package/legacy/models/gridRows.js +0 -1
- package/legacy/models/gridSlotsComponent.js +0 -1
- package/legacy/models/gridSlotsComponentsProps.js +0 -1
- package/legacy/models/gridSortModel.js +0 -1
- package/legacy/models/gridStateCommunity.js +0 -1
- package/legacy/models/index.js +0 -29
- package/legacy/models/logger.js +0 -1
- package/legacy/models/muiEvent.js +0 -1
- package/legacy/models/params/gridCellParams.js +0 -1
- package/legacy/models/params/gridColumnGroupHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnOrderChangeParams.js +0 -1
- package/legacy/models/params/gridColumnResizeParams.js +0 -1
- package/legacy/models/params/gridEditCellParams.js +0 -27
- package/legacy/models/params/gridHeaderSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridMenuParams.js +0 -1
- package/legacy/models/params/gridPreferencePanelParams.js +0 -1
- package/legacy/models/params/gridRowParams.js +0 -44
- package/legacy/models/params/gridRowSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridScrollParams.js +0 -1
- package/legacy/models/params/gridValueOptionsParams.js +0 -1
- package/legacy/models/params/index.js +0 -13
- package/legacy/models/props/DataGridProps.js +0 -1
- package/legacy/themeAugmentation/index.js +0 -4
- package/legacy/themeAugmentation/overrides.js +0 -1
- package/legacy/themeAugmentation/props.js +0 -1
- package/legacy/utils/EventManager.js +0 -91
- package/legacy/utils/Store.js +0 -34
- package/legacy/utils/cleanupTracking/CleanupTracking.js +0 -1
- package/legacy/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -29
- package/legacy/utils/cleanupTracking/TimerBasedCleanupTracking.js +0 -52
- package/legacy/utils/createControllablePromise.js +0 -11
- package/legacy/utils/createSelector.js +0 -120
- package/legacy/utils/doesSupportPreventScroll.js +0 -13
- package/legacy/utils/domUtils.js +0 -49
- package/legacy/utils/exportAs.js +0 -40
- package/legacy/utils/fastMemo.js +0 -5
- package/legacy/utils/fastObjectShallowCompare.js +0 -32
- package/legacy/utils/getGridLocalization.js +0 -15
- package/legacy/utils/getPublicApiRef.js +0 -5
- package/legacy/utils/index.js +0 -1
- package/legacy/utils/keyboardUtils.js +0 -60
- package/legacy/utils/utils.js +0 -189
- package/legacy/utils/warning.js +0 -25
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { styled } from '@mui/system';
|
|
5
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { useGridSelector } from '../../hooks/utils/useGridSelector';
|
|
8
|
-
import { gridExpandedRowCountSelector } from '../../hooks/features/filter/gridFilterSelector';
|
|
9
|
-
import { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/features/rows/gridRowsSelector';
|
|
10
|
-
import { gridDimensionsSelector } from '../../hooks/features/dimensions';
|
|
11
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
12
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
|
-
import { useGridVisibleRows } from '../../hooks/utils/useGridVisibleRows';
|
|
14
|
-
import { getMinimalContentHeight } from '../../hooks/features/rows/gridRowsUtils';
|
|
15
|
-
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
-
var GridOverlayWrapperRoot = styled('div', {
|
|
18
|
-
name: 'MuiDataGrid',
|
|
19
|
-
slot: 'OverlayWrapper',
|
|
20
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
21
|
-
return prop !== 'overlayType';
|
|
22
|
-
},
|
|
23
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
24
|
-
return styles.overlayWrapper;
|
|
25
|
-
}
|
|
26
|
-
})(function (_ref) {
|
|
27
|
-
var overlayType = _ref.overlayType;
|
|
28
|
-
return {
|
|
29
|
-
position: 'sticky',
|
|
30
|
-
// To stay in place while scrolling
|
|
31
|
-
top: 'var(--DataGrid-headersTotalHeight)',
|
|
32
|
-
left: 0,
|
|
33
|
-
width: 0,
|
|
34
|
-
// To stay above the content instead of shifting it down
|
|
35
|
-
height: 0,
|
|
36
|
-
// To stay above the content instead of shifting it down
|
|
37
|
-
zIndex: overlayType === 'loadingOverlay' ? 5 // Should be above pinned columns, pinned rows, and detail panel
|
|
38
|
-
: 4 // Should be above pinned columns and detail panel
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
var GridOverlayWrapperInner = styled('div', {
|
|
42
|
-
name: 'MuiDataGrid',
|
|
43
|
-
slot: 'OverlayWrapperInner',
|
|
44
|
-
shouldForwardProp: function shouldForwardProp(prop) {
|
|
45
|
-
return prop !== 'overlayType';
|
|
46
|
-
},
|
|
47
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
48
|
-
return styles.overlayWrapperInner;
|
|
49
|
-
}
|
|
50
|
-
})({});
|
|
51
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
52
|
-
var classes = ownerState.classes;
|
|
53
|
-
var slots = {
|
|
54
|
-
root: ['overlayWrapper'],
|
|
55
|
-
inner: ['overlayWrapperInner']
|
|
56
|
-
};
|
|
57
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
58
|
-
};
|
|
59
|
-
function GridOverlayWrapper(props) {
|
|
60
|
-
var apiRef = useGridApiContext();
|
|
61
|
-
var rootProps = useGridRootProps();
|
|
62
|
-
var currentPage = useGridVisibleRows(apiRef, rootProps);
|
|
63
|
-
var dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
64
|
-
var height = dimensions.viewportOuterSize.height - dimensions.headersTotalHeight - (dimensions.hasScrollX ? dimensions.scrollbarSize : 0);
|
|
65
|
-
if (rootProps.autoHeight && currentPage.rows.length === 0 || height === 0) {
|
|
66
|
-
height = getMinimalContentHeight(apiRef);
|
|
67
|
-
}
|
|
68
|
-
var classes = useUtilityClasses(_extends({}, props, {
|
|
69
|
-
classes: rootProps.classes
|
|
70
|
-
}));
|
|
71
|
-
return /*#__PURE__*/_jsx(GridOverlayWrapperRoot, {
|
|
72
|
-
className: clsx(classes.root),
|
|
73
|
-
overlayType: props.overlayType,
|
|
74
|
-
children: /*#__PURE__*/_jsx(GridOverlayWrapperInner, _extends({
|
|
75
|
-
className: clsx(classes.inner),
|
|
76
|
-
style: {
|
|
77
|
-
height: height,
|
|
78
|
-
width: dimensions.viewportOuterSize.width
|
|
79
|
-
}
|
|
80
|
-
}, props))
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
process.env.NODE_ENV !== "production" ? GridOverlayWrapper.propTypes = {
|
|
84
|
-
// ----------------------------- Warning --------------------------------
|
|
85
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
86
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
87
|
-
// ----------------------------------------------------------------------
|
|
88
|
-
overlayType: PropTypes.string.isRequired
|
|
89
|
-
} : void 0;
|
|
90
|
-
export function GridOverlays() {
|
|
91
|
-
var apiRef = useGridApiContext();
|
|
92
|
-
var rootProps = useGridRootProps();
|
|
93
|
-
var totalRowCount = useGridSelector(apiRef, gridRowCountSelector);
|
|
94
|
-
var visibleRowCount = useGridSelector(apiRef, gridExpandedRowCountSelector);
|
|
95
|
-
var loading = useGridSelector(apiRef, gridRowsLoadingSelector);
|
|
96
|
-
var showNoRowsOverlay = !loading && totalRowCount === 0;
|
|
97
|
-
var showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;
|
|
98
|
-
var overlay = null;
|
|
99
|
-
var overlayType = '';
|
|
100
|
-
if (showNoRowsOverlay) {
|
|
101
|
-
var _rootProps$slotProps;
|
|
102
|
-
overlay = /*#__PURE__*/_jsx(rootProps.slots.noRowsOverlay, _extends({}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.noRowsOverlay));
|
|
103
|
-
overlayType = 'noRowsOverlay';
|
|
104
|
-
}
|
|
105
|
-
if (showNoResultsOverlay) {
|
|
106
|
-
var _rootProps$slotProps2;
|
|
107
|
-
overlay = /*#__PURE__*/_jsx(rootProps.slots.noResultsOverlay, _extends({}, (_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.noResultsOverlay));
|
|
108
|
-
overlayType = 'noResultsOverlay';
|
|
109
|
-
}
|
|
110
|
-
if (loading) {
|
|
111
|
-
var _rootProps$slotProps3;
|
|
112
|
-
overlay = /*#__PURE__*/_jsx(rootProps.slots.loadingOverlay, _extends({}, (_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.loadingOverlay));
|
|
113
|
-
overlayType = 'loadingOverlay';
|
|
114
|
-
}
|
|
115
|
-
if (overlay === null) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
return /*#__PURE__*/_jsx(GridOverlayWrapper, {
|
|
119
|
-
overlayType: overlayType,
|
|
120
|
-
children: overlay
|
|
121
|
-
});
|
|
122
|
-
}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "value", "formattedValue", "row", "rowNode", "cellMode", "tabIndex", "position", "focusElementRef"];
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import MenuList from '@mui/material/MenuList';
|
|
8
|
-
import { useTheme } from '@mui/material/styles';
|
|
9
|
-
import { unstable_useId as useId } from '@mui/utils';
|
|
10
|
-
import { gridClasses } from '../../constants/gridClasses';
|
|
11
|
-
import { GridMenu } from '../menu/GridMenu';
|
|
12
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
13
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
var hasActions = function hasActions(colDef) {
|
|
17
|
-
return typeof colDef.getActions === 'function';
|
|
18
|
-
};
|
|
19
|
-
function GridActionsCell(props) {
|
|
20
|
-
var _rootProps$slotProps;
|
|
21
|
-
var api = props.api,
|
|
22
|
-
colDef = props.colDef,
|
|
23
|
-
id = props.id,
|
|
24
|
-
hasFocus = props.hasFocus,
|
|
25
|
-
isEditable = props.isEditable,
|
|
26
|
-
field = props.field,
|
|
27
|
-
value = props.value,
|
|
28
|
-
formattedValue = props.formattedValue,
|
|
29
|
-
row = props.row,
|
|
30
|
-
rowNode = props.rowNode,
|
|
31
|
-
cellMode = props.cellMode,
|
|
32
|
-
tabIndex = props.tabIndex,
|
|
33
|
-
_props$position = props.position,
|
|
34
|
-
position = _props$position === void 0 ? 'bottom-end' : _props$position,
|
|
35
|
-
focusElementRef = props.focusElementRef,
|
|
36
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
37
|
-
var _React$useState = React.useState(-1),
|
|
38
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
39
|
-
focusedButtonIndex = _React$useState2[0],
|
|
40
|
-
setFocusedButtonIndex = _React$useState2[1];
|
|
41
|
-
var _React$useState3 = React.useState(false),
|
|
42
|
-
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
43
|
-
open = _React$useState4[0],
|
|
44
|
-
setOpen = _React$useState4[1];
|
|
45
|
-
var apiRef = useGridApiContext();
|
|
46
|
-
var rootRef = React.useRef(null);
|
|
47
|
-
var buttonRef = React.useRef(null);
|
|
48
|
-
var ignoreCallToFocus = React.useRef(false);
|
|
49
|
-
var touchRippleRefs = React.useRef({});
|
|
50
|
-
var theme = useTheme();
|
|
51
|
-
var menuId = useId();
|
|
52
|
-
var buttonId = useId();
|
|
53
|
-
var rootProps = useGridRootProps();
|
|
54
|
-
if (!hasActions(colDef)) {
|
|
55
|
-
throw new Error('MUI X: Missing the `getActions` property in the `GridColDef`.');
|
|
56
|
-
}
|
|
57
|
-
var options = colDef.getActions(apiRef.current.getRowParams(id));
|
|
58
|
-
var iconButtons = options.filter(function (option) {
|
|
59
|
-
return !option.props.showInMenu;
|
|
60
|
-
});
|
|
61
|
-
var menuButtons = options.filter(function (option) {
|
|
62
|
-
return option.props.showInMenu;
|
|
63
|
-
});
|
|
64
|
-
var numberOfButtons = iconButtons.length + (menuButtons.length ? 1 : 0);
|
|
65
|
-
React.useLayoutEffect(function () {
|
|
66
|
-
if (!hasFocus) {
|
|
67
|
-
Object.entries(touchRippleRefs.current).forEach(function (_ref) {
|
|
68
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
69
|
-
index = _ref2[0],
|
|
70
|
-
ref = _ref2[1];
|
|
71
|
-
ref == null || ref.stop({}, function () {
|
|
72
|
-
delete touchRippleRefs.current[index];
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
}, [hasFocus]);
|
|
77
|
-
React.useEffect(function () {
|
|
78
|
-
if (focusedButtonIndex < 0 || !rootRef.current) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (focusedButtonIndex >= rootRef.current.children.length) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
var child = rootRef.current.children[focusedButtonIndex];
|
|
85
|
-
child.focus({
|
|
86
|
-
preventScroll: true
|
|
87
|
-
});
|
|
88
|
-
}, [focusedButtonIndex]);
|
|
89
|
-
React.useEffect(function () {
|
|
90
|
-
if (!hasFocus) {
|
|
91
|
-
setFocusedButtonIndex(-1);
|
|
92
|
-
ignoreCallToFocus.current = false;
|
|
93
|
-
}
|
|
94
|
-
}, [hasFocus]);
|
|
95
|
-
React.useImperativeHandle(focusElementRef, function () {
|
|
96
|
-
return {
|
|
97
|
-
focus: function focus() {
|
|
98
|
-
// If ignoreCallToFocus is true, then one of the buttons was clicked and the focus is already set
|
|
99
|
-
if (!ignoreCallToFocus.current) {
|
|
100
|
-
// find the first focusable button and pass the index to the state
|
|
101
|
-
var focusableButtonIndex = options.findIndex(function (o) {
|
|
102
|
-
return !o.props.disabled;
|
|
103
|
-
});
|
|
104
|
-
setFocusedButtonIndex(focusableButtonIndex);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
}, [options]);
|
|
109
|
-
React.useEffect(function () {
|
|
110
|
-
if (focusedButtonIndex >= numberOfButtons) {
|
|
111
|
-
setFocusedButtonIndex(numberOfButtons - 1);
|
|
112
|
-
}
|
|
113
|
-
}, [focusedButtonIndex, numberOfButtons]);
|
|
114
|
-
var showMenu = function showMenu() {
|
|
115
|
-
setOpen(true);
|
|
116
|
-
setFocusedButtonIndex(numberOfButtons - 1);
|
|
117
|
-
ignoreCallToFocus.current = true;
|
|
118
|
-
};
|
|
119
|
-
var hideMenu = function hideMenu() {
|
|
120
|
-
setOpen(false);
|
|
121
|
-
};
|
|
122
|
-
var handleTouchRippleRef = function handleTouchRippleRef(index) {
|
|
123
|
-
return function (instance) {
|
|
124
|
-
touchRippleRefs.current[index] = instance;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
var handleButtonClick = function handleButtonClick(index, onClick) {
|
|
128
|
-
return function (event) {
|
|
129
|
-
setFocusedButtonIndex(index);
|
|
130
|
-
ignoreCallToFocus.current = true;
|
|
131
|
-
if (onClick) {
|
|
132
|
-
onClick(event);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
var handleRootKeyDown = function handleRootKeyDown(event) {
|
|
137
|
-
if (numberOfButtons <= 1) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
var getNewIndex = function getNewIndex(index, direction) {
|
|
141
|
-
var _options;
|
|
142
|
-
if (index < 0 || index > options.length) {
|
|
143
|
-
return index;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// for rtl mode we need to reverse the direction
|
|
147
|
-
var rtlMod = theme.direction === 'rtl' ? -1 : 1;
|
|
148
|
-
var indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
|
|
149
|
-
|
|
150
|
-
// if the button that should receive focus is disabled go one more step
|
|
151
|
-
return (_options = options[index + indexMod]) != null && _options.props.disabled ? getNewIndex(index + indexMod, direction) : index + indexMod;
|
|
152
|
-
};
|
|
153
|
-
var newIndex = focusedButtonIndex;
|
|
154
|
-
if (event.key === 'ArrowRight') {
|
|
155
|
-
newIndex = getNewIndex(focusedButtonIndex, 'right');
|
|
156
|
-
} else if (event.key === 'ArrowLeft') {
|
|
157
|
-
newIndex = getNewIndex(focusedButtonIndex, 'left');
|
|
158
|
-
}
|
|
159
|
-
if (newIndex < 0 || newIndex >= numberOfButtons) {
|
|
160
|
-
return; // We're already in the first or last item = do nothing and let the grid listen the event
|
|
161
|
-
}
|
|
162
|
-
if (newIndex !== focusedButtonIndex) {
|
|
163
|
-
event.preventDefault(); // Prevent scrolling
|
|
164
|
-
event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp
|
|
165
|
-
setFocusedButtonIndex(newIndex);
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
var handleListKeyDown = function handleListKeyDown(event) {
|
|
169
|
-
if (event.key === 'Tab') {
|
|
170
|
-
event.preventDefault();
|
|
171
|
-
}
|
|
172
|
-
if (['Tab', 'Escape'].includes(event.key)) {
|
|
173
|
-
hideMenu();
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
return /*#__PURE__*/_jsxs("div", _extends({
|
|
177
|
-
role: "menu",
|
|
178
|
-
ref: rootRef,
|
|
179
|
-
tabIndex: -1,
|
|
180
|
-
className: gridClasses.actionsCell,
|
|
181
|
-
onKeyDown: handleRootKeyDown
|
|
182
|
-
}, other, {
|
|
183
|
-
children: [iconButtons.map(function (button, index) {
|
|
184
|
-
return /*#__PURE__*/React.cloneElement(button, {
|
|
185
|
-
key: index,
|
|
186
|
-
touchRippleRef: handleTouchRippleRef(index),
|
|
187
|
-
onClick: handleButtonClick(index, button.props.onClick),
|
|
188
|
-
tabIndex: focusedButtonIndex === index ? tabIndex : -1
|
|
189
|
-
});
|
|
190
|
-
}), menuButtons.length > 0 && buttonId && /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
191
|
-
ref: buttonRef,
|
|
192
|
-
id: buttonId,
|
|
193
|
-
"aria-label": apiRef.current.getLocaleText('actionsCellMore'),
|
|
194
|
-
"aria-haspopup": "menu",
|
|
195
|
-
"aria-expanded": open,
|
|
196
|
-
"aria-controls": open ? menuId : undefined,
|
|
197
|
-
role: "menuitem",
|
|
198
|
-
size: "small",
|
|
199
|
-
onClick: showMenu,
|
|
200
|
-
touchRippleRef: handleTouchRippleRef(buttonId),
|
|
201
|
-
tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1
|
|
202
|
-
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
203
|
-
children: /*#__PURE__*/_jsx(rootProps.slots.moreActionsIcon, {
|
|
204
|
-
fontSize: "small"
|
|
205
|
-
})
|
|
206
|
-
})), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {
|
|
207
|
-
open: open,
|
|
208
|
-
target: buttonRef.current,
|
|
209
|
-
position: position,
|
|
210
|
-
onClose: hideMenu,
|
|
211
|
-
children: /*#__PURE__*/_jsx(MenuList, {
|
|
212
|
-
id: menuId,
|
|
213
|
-
className: gridClasses.menuList,
|
|
214
|
-
onKeyDown: handleListKeyDown,
|
|
215
|
-
"aria-labelledby": buttonId,
|
|
216
|
-
variant: "menu",
|
|
217
|
-
autoFocusItem: true,
|
|
218
|
-
children: menuButtons.map(function (button, index) {
|
|
219
|
-
return /*#__PURE__*/React.cloneElement(button, {
|
|
220
|
-
key: index,
|
|
221
|
-
closeMenu: hideMenu
|
|
222
|
-
});
|
|
223
|
-
})
|
|
224
|
-
})
|
|
225
|
-
})]
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
process.env.NODE_ENV !== "production" ? GridActionsCell.propTypes = {
|
|
229
|
-
// ----------------------------- Warning --------------------------------
|
|
230
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
231
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
232
|
-
// ----------------------------------------------------------------------
|
|
233
|
-
api: PropTypes.object,
|
|
234
|
-
/**
|
|
235
|
-
* The mode of the cell.
|
|
236
|
-
*/
|
|
237
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
238
|
-
/**
|
|
239
|
-
* The column of the row that the current cell belongs to.
|
|
240
|
-
*/
|
|
241
|
-
colDef: PropTypes.object.isRequired,
|
|
242
|
-
/**
|
|
243
|
-
* The column field of the cell that triggered the event.
|
|
244
|
-
*/
|
|
245
|
-
field: PropTypes.string.isRequired,
|
|
246
|
-
/**
|
|
247
|
-
* A ref allowing to set imperative focus.
|
|
248
|
-
* It can be passed to the element that should receive focus.
|
|
249
|
-
* @ignore - do not document.
|
|
250
|
-
*/
|
|
251
|
-
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
252
|
-
current: PropTypes.shape({
|
|
253
|
-
focus: PropTypes.func.isRequired
|
|
254
|
-
})
|
|
255
|
-
})]),
|
|
256
|
-
/**
|
|
257
|
-
* The cell value formatted with the column valueFormatter.
|
|
258
|
-
*/
|
|
259
|
-
formattedValue: PropTypes.any,
|
|
260
|
-
/**
|
|
261
|
-
* If true, the cell is the active element.
|
|
262
|
-
*/
|
|
263
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
264
|
-
/**
|
|
265
|
-
* The grid row id.
|
|
266
|
-
*/
|
|
267
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
268
|
-
/**
|
|
269
|
-
* If true, the cell is editable.
|
|
270
|
-
*/
|
|
271
|
-
isEditable: PropTypes.bool,
|
|
272
|
-
position: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),
|
|
273
|
-
/**
|
|
274
|
-
* The row model of the row that the current cell belongs to.
|
|
275
|
-
*/
|
|
276
|
-
row: PropTypes.any.isRequired,
|
|
277
|
-
/**
|
|
278
|
-
* The node of the row that the current cell belongs to.
|
|
279
|
-
*/
|
|
280
|
-
rowNode: PropTypes.object.isRequired,
|
|
281
|
-
/**
|
|
282
|
-
* the tabIndex value.
|
|
283
|
-
*/
|
|
284
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
285
|
-
/**
|
|
286
|
-
* The cell value.
|
|
287
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
288
|
-
*/
|
|
289
|
-
value: PropTypes.any
|
|
290
|
-
} : void 0;
|
|
291
|
-
export { GridActionsCell };
|
|
292
|
-
export var renderActionsCell = function renderActionsCell(params) {
|
|
293
|
-
return /*#__PURE__*/_jsx(GridActionsCell, _extends({}, params));
|
|
294
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["label", "icon", "showInMenu", "onClick"],
|
|
4
|
-
_excluded2 = ["label", "icon", "showInMenu", "onClick", "closeMenuOnClick", "closeMenu"];
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import PropTypes from 'prop-types';
|
|
7
|
-
import MenuItem from '@mui/material/MenuItem';
|
|
8
|
-
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
9
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var GridActionsCellItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
|
-
var rootProps = useGridRootProps();
|
|
14
|
-
if (!props.showInMenu) {
|
|
15
|
-
var _rootProps$slotProps;
|
|
16
|
-
var _label = props.label,
|
|
17
|
-
_icon = props.icon,
|
|
18
|
-
_showInMenu = props.showInMenu,
|
|
19
|
-
_onClick = props.onClick,
|
|
20
|
-
_other = _objectWithoutProperties(props, _excluded);
|
|
21
|
-
var _handleClick = function _handleClick(event) {
|
|
22
|
-
_onClick == null || _onClick(event);
|
|
23
|
-
};
|
|
24
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseIconButton, _extends({
|
|
25
|
-
ref: ref,
|
|
26
|
-
size: "small",
|
|
27
|
-
role: "menuitem",
|
|
28
|
-
"aria-label": _label
|
|
29
|
-
}, _other, {
|
|
30
|
-
onClick: _handleClick
|
|
31
|
-
}, (_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseIconButton, {
|
|
32
|
-
children: /*#__PURE__*/React.cloneElement(_icon, {
|
|
33
|
-
fontSize: 'small'
|
|
34
|
-
})
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
var label = props.label,
|
|
38
|
-
icon = props.icon,
|
|
39
|
-
showInMenu = props.showInMenu,
|
|
40
|
-
onClick = props.onClick,
|
|
41
|
-
_props$closeMenuOnCli = props.closeMenuOnClick,
|
|
42
|
-
closeMenuOnClick = _props$closeMenuOnCli === void 0 ? true : _props$closeMenuOnCli,
|
|
43
|
-
closeMenu = props.closeMenu,
|
|
44
|
-
other = _objectWithoutProperties(props, _excluded2);
|
|
45
|
-
var handleClick = function handleClick(event) {
|
|
46
|
-
onClick == null || onClick(event);
|
|
47
|
-
if (closeMenuOnClick) {
|
|
48
|
-
closeMenu == null || closeMenu();
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
return /*#__PURE__*/_jsxs(MenuItem, _extends({
|
|
52
|
-
ref: ref
|
|
53
|
-
}, other, {
|
|
54
|
-
onClick: handleClick,
|
|
55
|
-
children: [icon && /*#__PURE__*/_jsx(ListItemIcon, {
|
|
56
|
-
children: icon
|
|
57
|
-
}), label]
|
|
58
|
-
}));
|
|
59
|
-
});
|
|
60
|
-
process.env.NODE_ENV !== "production" ? GridActionsCellItem.propTypes = {
|
|
61
|
-
// ----------------------------- Warning --------------------------------
|
|
62
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
63
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
64
|
-
// ----------------------------------------------------------------------
|
|
65
|
-
icon: PropTypes.element,
|
|
66
|
-
label: PropTypes.string.isRequired,
|
|
67
|
-
showInMenu: PropTypes.bool
|
|
68
|
-
} : void 0;
|
|
69
|
-
export { GridActionsCellItem };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "hasFocus", "tabIndex"];
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
7
|
-
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
8
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
9
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
10
|
-
import { isAutoGeneratedRow } from '../../hooks/features/rows/gridRowsUtils';
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
13
|
-
var classes = ownerState.classes;
|
|
14
|
-
var slots = {
|
|
15
|
-
root: ['booleanCell']
|
|
16
|
-
};
|
|
17
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
18
|
-
};
|
|
19
|
-
function GridBooleanCellRaw(props) {
|
|
20
|
-
var id = props.id,
|
|
21
|
-
value = props.value,
|
|
22
|
-
formattedValue = props.formattedValue,
|
|
23
|
-
api = props.api,
|
|
24
|
-
field = props.field,
|
|
25
|
-
row = props.row,
|
|
26
|
-
rowNode = props.rowNode,
|
|
27
|
-
colDef = props.colDef,
|
|
28
|
-
cellMode = props.cellMode,
|
|
29
|
-
isEditable = props.isEditable,
|
|
30
|
-
hasFocus = props.hasFocus,
|
|
31
|
-
tabIndex = props.tabIndex,
|
|
32
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
33
|
-
var apiRef = useGridApiContext();
|
|
34
|
-
var rootProps = useGridRootProps();
|
|
35
|
-
var ownerState = {
|
|
36
|
-
classes: rootProps.classes
|
|
37
|
-
};
|
|
38
|
-
var classes = useUtilityClasses(ownerState);
|
|
39
|
-
var Icon = React.useMemo(function () {
|
|
40
|
-
return value ? rootProps.slots.booleanCellTrueIcon : rootProps.slots.booleanCellFalseIcon;
|
|
41
|
-
}, [rootProps.slots.booleanCellFalseIcon, rootProps.slots.booleanCellTrueIcon, value]);
|
|
42
|
-
return /*#__PURE__*/_jsx(Icon, _extends({
|
|
43
|
-
fontSize: "small",
|
|
44
|
-
className: classes.root,
|
|
45
|
-
titleAccess: apiRef.current.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),
|
|
46
|
-
"data-value": Boolean(value)
|
|
47
|
-
}, other));
|
|
48
|
-
}
|
|
49
|
-
process.env.NODE_ENV !== "production" ? GridBooleanCellRaw.propTypes = {
|
|
50
|
-
// ----------------------------- Warning --------------------------------
|
|
51
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
52
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
53
|
-
// ----------------------------------------------------------------------
|
|
54
|
-
/**
|
|
55
|
-
* GridApi that let you manipulate the grid.
|
|
56
|
-
*/
|
|
57
|
-
api: PropTypes.object.isRequired,
|
|
58
|
-
/**
|
|
59
|
-
* The mode of the cell.
|
|
60
|
-
*/
|
|
61
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
62
|
-
/**
|
|
63
|
-
* The column of the row that the current cell belongs to.
|
|
64
|
-
*/
|
|
65
|
-
colDef: PropTypes.object.isRequired,
|
|
66
|
-
/**
|
|
67
|
-
* The column field of the cell that triggered the event.
|
|
68
|
-
*/
|
|
69
|
-
field: PropTypes.string.isRequired,
|
|
70
|
-
/**
|
|
71
|
-
* A ref allowing to set imperative focus.
|
|
72
|
-
* It can be passed to the element that should receive focus.
|
|
73
|
-
* @ignore - do not document.
|
|
74
|
-
*/
|
|
75
|
-
focusElementRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
76
|
-
current: PropTypes.shape({
|
|
77
|
-
focus: PropTypes.func.isRequired
|
|
78
|
-
})
|
|
79
|
-
})]),
|
|
80
|
-
/**
|
|
81
|
-
* The cell value formatted with the column valueFormatter.
|
|
82
|
-
*/
|
|
83
|
-
formattedValue: PropTypes.any,
|
|
84
|
-
/**
|
|
85
|
-
* If true, the cell is the active element.
|
|
86
|
-
*/
|
|
87
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
88
|
-
/**
|
|
89
|
-
* The grid row id.
|
|
90
|
-
*/
|
|
91
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
92
|
-
/**
|
|
93
|
-
* If true, the cell is editable.
|
|
94
|
-
*/
|
|
95
|
-
isEditable: PropTypes.bool,
|
|
96
|
-
/**
|
|
97
|
-
* The row model of the row that the current cell belongs to.
|
|
98
|
-
*/
|
|
99
|
-
row: PropTypes.any.isRequired,
|
|
100
|
-
/**
|
|
101
|
-
* The node of the row that the current cell belongs to.
|
|
102
|
-
*/
|
|
103
|
-
rowNode: PropTypes.object.isRequired,
|
|
104
|
-
/**
|
|
105
|
-
* the tabIndex value.
|
|
106
|
-
*/
|
|
107
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
108
|
-
/**
|
|
109
|
-
* The cell value.
|
|
110
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
111
|
-
*/
|
|
112
|
-
value: PropTypes.any
|
|
113
|
-
} : void 0;
|
|
114
|
-
var GridBooleanCell = /*#__PURE__*/React.memo(GridBooleanCellRaw);
|
|
115
|
-
export { GridBooleanCell };
|
|
116
|
-
export var renderBooleanCell = function renderBooleanCell(params) {
|
|
117
|
-
if (isAutoGeneratedRow(params.rowNode)) {
|
|
118
|
-
return '';
|
|
119
|
-
}
|
|
120
|
-
return /*#__PURE__*/_jsx(GridBooleanCell, _extends({}, params));
|
|
121
|
-
};
|