@mui/x-data-grid 7.0.0-beta.3 → 7.0.0-beta.4
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 +226 -15
- package/colDef/gridActionsColDef.js +1 -0
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/components/GridScrollbarFillerCell.js +6 -21
- package/components/cell/GridCell.js +10 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/components/containers/GridRootStyles.js +50 -19
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/constants/gridClasses.d.ts +24 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -4
- package/hooks/features/editing/useGridRowEditing.js +3 -4
- package/hooks/features/sorting/useGridSorting.js +1 -2
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +6 -0
- package/modern/colDef/gridActionsColDef.js +1 -0
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/components/GridScrollbarFillerCell.js +6 -21
- package/modern/components/cell/GridCell.js +10 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/modern/components/containers/GridRootStyles.js +50 -19
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +3 -4
- package/modern/hooks/features/sorting/useGridSorting.js +1 -2
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/utils/keyboardUtils.js +20 -11
- package/node/colDef/gridActionsColDef.js +1 -0
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/components/GridScrollbarFillerCell.js +5 -20
- package/node/components/cell/GridCell.js +10 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -2
- package/node/components/containers/GridRootStyles.js +50 -19
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +2 -3
- package/node/hooks/features/sorting/useGridSorting.js +1 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/utils/keyboardUtils.js +25 -20
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +7 -6
- package/utils/keyboardUtils.js +20 -11
- 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,294 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import { gridPinnedRowsSelector } from './gridRowsSelector';
|
|
4
|
-
import { gridDimensionsSelector } from '../dimensions/gridDimensionsSelectors';
|
|
5
|
-
export var GRID_ROOT_GROUP_ID = "auto-generated-group-node-root";
|
|
6
|
-
export var GRID_ID_AUTOGENERATED = Symbol('mui.id_autogenerated');
|
|
7
|
-
export var buildRootGroup = function buildRootGroup() {
|
|
8
|
-
return {
|
|
9
|
-
type: 'group',
|
|
10
|
-
id: GRID_ROOT_GROUP_ID,
|
|
11
|
-
depth: -1,
|
|
12
|
-
groupingField: null,
|
|
13
|
-
groupingKey: null,
|
|
14
|
-
isAutoGenerated: true,
|
|
15
|
-
children: [],
|
|
16
|
-
childrenFromPath: {},
|
|
17
|
-
childrenExpanded: true,
|
|
18
|
-
parent: null
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* A helper function to check if the id provided is valid.
|
|
24
|
-
* @param {GridRowId} id Id as [[GridRowId]].
|
|
25
|
-
* @param {GridRowModel | Partial<GridRowModel>} row Row as [[GridRowModel]].
|
|
26
|
-
* @param {string} detailErrorMessage A custom error message to display for invalid IDs
|
|
27
|
-
*/
|
|
28
|
-
export function checkGridRowIdIsValid(id, row) {
|
|
29
|
-
var detailErrorMessage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'A row was provided without id in the rows prop:';
|
|
30
|
-
if (id == null) {
|
|
31
|
-
throw new Error(['MUI X: The data grid component requires all rows to have a unique `id` property.', 'Alternatively, you can use the `getRowId` prop to specify a custom id for each row.', detailErrorMessage, JSON.stringify(row)].join('\n'));
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export var getRowIdFromRowModel = function getRowIdFromRowModel(rowModel, getRowId, detailErrorMessage) {
|
|
35
|
-
var id = getRowId ? getRowId(rowModel) : rowModel.id;
|
|
36
|
-
checkGridRowIdIsValid(id, rowModel, detailErrorMessage);
|
|
37
|
-
return id;
|
|
38
|
-
};
|
|
39
|
-
export var createRowsInternalCache = function createRowsInternalCache(_ref) {
|
|
40
|
-
var rows = _ref.rows,
|
|
41
|
-
getRowId = _ref.getRowId,
|
|
42
|
-
loading = _ref.loading,
|
|
43
|
-
rowCount = _ref.rowCount;
|
|
44
|
-
var updates = {
|
|
45
|
-
type: 'full',
|
|
46
|
-
rows: []
|
|
47
|
-
};
|
|
48
|
-
var dataRowIdToModelLookup = {};
|
|
49
|
-
var dataRowIdToIdLookup = {};
|
|
50
|
-
for (var i = 0; i < rows.length; i += 1) {
|
|
51
|
-
var model = rows[i];
|
|
52
|
-
var _id = getRowIdFromRowModel(model, getRowId);
|
|
53
|
-
dataRowIdToModelLookup[_id] = model;
|
|
54
|
-
dataRowIdToIdLookup[_id] = _id;
|
|
55
|
-
updates.rows.push(_id);
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
rowsBeforePartialUpdates: rows,
|
|
59
|
-
loadingPropBeforePartialUpdates: loading,
|
|
60
|
-
rowCountPropBeforePartialUpdates: rowCount,
|
|
61
|
-
updates: updates,
|
|
62
|
-
dataRowIdToIdLookup: dataRowIdToIdLookup,
|
|
63
|
-
dataRowIdToModelLookup: dataRowIdToModelLookup
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
export var getTopLevelRowCount = function getTopLevelRowCount(_ref2) {
|
|
67
|
-
var tree = _ref2.tree,
|
|
68
|
-
_ref2$rowCountProp = _ref2.rowCountProp,
|
|
69
|
-
rowCountProp = _ref2$rowCountProp === void 0 ? 0 : _ref2$rowCountProp;
|
|
70
|
-
var rootGroupNode = tree[GRID_ROOT_GROUP_ID];
|
|
71
|
-
return Math.max(rowCountProp, rootGroupNode.children.length + (rootGroupNode.footerId == null ? 0 : 1));
|
|
72
|
-
};
|
|
73
|
-
export var getRowsStateFromCache = function getRowsStateFromCache(_ref3) {
|
|
74
|
-
var apiRef = _ref3.apiRef,
|
|
75
|
-
_ref3$rowCountProp = _ref3.rowCountProp,
|
|
76
|
-
rowCountProp = _ref3$rowCountProp === void 0 ? 0 : _ref3$rowCountProp,
|
|
77
|
-
loadingProp = _ref3.loadingProp,
|
|
78
|
-
previousTree = _ref3.previousTree,
|
|
79
|
-
previousTreeDepths = _ref3.previousTreeDepths;
|
|
80
|
-
var cache = apiRef.current.caches.rows;
|
|
81
|
-
|
|
82
|
-
// 1. Apply the "rowTreeCreation" family processing.
|
|
83
|
-
var _apiRef$current$apply = apiRef.current.applyStrategyProcessor('rowTreeCreation', {
|
|
84
|
-
previousTree: previousTree,
|
|
85
|
-
previousTreeDepths: previousTreeDepths,
|
|
86
|
-
updates: cache.updates,
|
|
87
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
88
|
-
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
89
|
-
}),
|
|
90
|
-
unProcessedTree = _apiRef$current$apply.tree,
|
|
91
|
-
unProcessedTreeDepths = _apiRef$current$apply.treeDepths,
|
|
92
|
-
unProcessedDataRowIds = _apiRef$current$apply.dataRowIds,
|
|
93
|
-
groupingName = _apiRef$current$apply.groupingName;
|
|
94
|
-
|
|
95
|
-
// 2. Apply the "hydrateRows" pipe-processing.
|
|
96
|
-
var groupingParamsWithHydrateRows = apiRef.current.unstable_applyPipeProcessors('hydrateRows', {
|
|
97
|
-
tree: unProcessedTree,
|
|
98
|
-
treeDepths: unProcessedTreeDepths,
|
|
99
|
-
dataRowIdToIdLookup: cache.dataRowIdToIdLookup,
|
|
100
|
-
dataRowIds: unProcessedDataRowIds,
|
|
101
|
-
dataRowIdToModelLookup: cache.dataRowIdToModelLookup
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// 3. Reset the cache updates
|
|
105
|
-
apiRef.current.caches.rows.updates = {
|
|
106
|
-
type: 'partial',
|
|
107
|
-
actions: {
|
|
108
|
-
insert: [],
|
|
109
|
-
modify: [],
|
|
110
|
-
remove: []
|
|
111
|
-
},
|
|
112
|
-
idToActionLookup: {}
|
|
113
|
-
};
|
|
114
|
-
return _extends({}, groupingParamsWithHydrateRows, {
|
|
115
|
-
totalRowCount: Math.max(rowCountProp, groupingParamsWithHydrateRows.dataRowIds.length),
|
|
116
|
-
totalTopLevelRowCount: getTopLevelRowCount({
|
|
117
|
-
tree: groupingParamsWithHydrateRows.tree,
|
|
118
|
-
rowCountProp: rowCountProp
|
|
119
|
-
}),
|
|
120
|
-
groupingName: groupingName,
|
|
121
|
-
loading: loadingProp
|
|
122
|
-
});
|
|
123
|
-
};
|
|
124
|
-
export var isAutoGeneratedRow = function isAutoGeneratedRow(rowNode) {
|
|
125
|
-
return rowNode.type === 'skeletonRow' || rowNode.type === 'footer' || rowNode.type === 'group' && rowNode.isAutoGenerated || rowNode.type === 'pinnedRow' && rowNode.isAutoGenerated;
|
|
126
|
-
};
|
|
127
|
-
export var getTreeNodeDescendants = function getTreeNodeDescendants(tree, parentId, skipAutoGeneratedRows) {
|
|
128
|
-
var node = tree[parentId];
|
|
129
|
-
if (node.type !== 'group') {
|
|
130
|
-
return [];
|
|
131
|
-
}
|
|
132
|
-
var validDescendants = [];
|
|
133
|
-
for (var i = 0; i < node.children.length; i += 1) {
|
|
134
|
-
var child = node.children[i];
|
|
135
|
-
if (!skipAutoGeneratedRows || !isAutoGeneratedRow(tree[child])) {
|
|
136
|
-
validDescendants.push(child);
|
|
137
|
-
}
|
|
138
|
-
var childDescendants = getTreeNodeDescendants(tree, child, skipAutoGeneratedRows);
|
|
139
|
-
for (var j = 0; j < childDescendants.length; j += 1) {
|
|
140
|
-
validDescendants.push(childDescendants[j]);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (!skipAutoGeneratedRows && node.footerId != null) {
|
|
144
|
-
validDescendants.push(node.footerId);
|
|
145
|
-
}
|
|
146
|
-
return validDescendants;
|
|
147
|
-
};
|
|
148
|
-
export var updateCacheWithNewRows = function updateCacheWithNewRows(_ref4) {
|
|
149
|
-
var _previousCache$update, _previousCache$update2, _previousCache$update3;
|
|
150
|
-
var previousCache = _ref4.previousCache,
|
|
151
|
-
getRowId = _ref4.getRowId,
|
|
152
|
-
updates = _ref4.updates;
|
|
153
|
-
if (previousCache.updates.type === 'full') {
|
|
154
|
-
throw new Error('MUI X: Unable to prepare a partial update if a full update is not applied yet.');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// Remove duplicate updates.
|
|
158
|
-
// A server can batch updates, and send several updates for the same row in one fn call.
|
|
159
|
-
var uniqueUpdates = new Map();
|
|
160
|
-
updates.forEach(function (update) {
|
|
161
|
-
var id = getRowIdFromRowModel(update, getRowId, 'A row was provided without id when calling updateRows():');
|
|
162
|
-
if (uniqueUpdates.has(id)) {
|
|
163
|
-
uniqueUpdates.set(id, _extends({}, uniqueUpdates.get(id), update));
|
|
164
|
-
} else {
|
|
165
|
-
uniqueUpdates.set(id, update);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
var partialUpdates = {
|
|
169
|
-
type: 'partial',
|
|
170
|
-
actions: {
|
|
171
|
-
insert: _toConsumableArray((_previousCache$update = previousCache.updates.actions.insert) != null ? _previousCache$update : []),
|
|
172
|
-
modify: _toConsumableArray((_previousCache$update2 = previousCache.updates.actions.modify) != null ? _previousCache$update2 : []),
|
|
173
|
-
remove: _toConsumableArray((_previousCache$update3 = previousCache.updates.actions.remove) != null ? _previousCache$update3 : [])
|
|
174
|
-
},
|
|
175
|
-
idToActionLookup: _extends({}, previousCache.updates.idToActionLookup)
|
|
176
|
-
};
|
|
177
|
-
var dataRowIdToModelLookup = _extends({}, previousCache.dataRowIdToModelLookup);
|
|
178
|
-
var dataRowIdToIdLookup = _extends({}, previousCache.dataRowIdToIdLookup);
|
|
179
|
-
var alreadyAppliedActionsToRemove = {
|
|
180
|
-
insert: {},
|
|
181
|
-
modify: {},
|
|
182
|
-
remove: {}
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// Depending on the action already applied to the data row,
|
|
186
|
-
// We might want drop the already-applied-update.
|
|
187
|
-
// For instance:
|
|
188
|
-
// - if you delete then insert, then you don't want to apply the deletion in the tree.
|
|
189
|
-
// - if you insert, then modify, then you just want to apply the insertion in the tree.
|
|
190
|
-
uniqueUpdates.forEach(function (partialRow, id) {
|
|
191
|
-
var actionAlreadyAppliedToRow = partialUpdates.idToActionLookup[id];
|
|
192
|
-
|
|
193
|
-
// Action === "delete"
|
|
194
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
195
|
-
if (partialRow._action === 'delete') {
|
|
196
|
-
// If the data row has been removed since the last state update,
|
|
197
|
-
// Then do nothing.
|
|
198
|
-
if (actionAlreadyAppliedToRow === 'remove' || !dataRowIdToModelLookup[id]) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
// If the data row has been inserted / modified since the last state update,
|
|
203
|
-
// Then drop this "insert" / "modify" update.
|
|
204
|
-
if (actionAlreadyAppliedToRow != null) {
|
|
205
|
-
alreadyAppliedActionsToRemove[actionAlreadyAppliedToRow][id] = true;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Remove the data row from the lookups and add it to the "delete" update.
|
|
209
|
-
partialUpdates.actions.remove.push(id);
|
|
210
|
-
delete dataRowIdToModelLookup[id];
|
|
211
|
-
delete dataRowIdToIdLookup[id];
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
var oldRow = dataRowIdToModelLookup[id];
|
|
215
|
-
|
|
216
|
-
// Action === "modify"
|
|
217
|
-
if (oldRow) {
|
|
218
|
-
// If the data row has been removed since the last state update,
|
|
219
|
-
// Then drop this "remove" update and add it to the "modify" update instead.
|
|
220
|
-
if (actionAlreadyAppliedToRow === 'remove') {
|
|
221
|
-
alreadyAppliedActionsToRemove.remove[id] = true;
|
|
222
|
-
partialUpdates.actions.modify.push(id);
|
|
223
|
-
}
|
|
224
|
-
// If the date has not been inserted / modified since the last state update,
|
|
225
|
-
// Then add it to the "modify" update (if it has been inserted it should just remain "inserted").
|
|
226
|
-
else if (actionAlreadyAppliedToRow == null) {
|
|
227
|
-
partialUpdates.actions.modify.push(id);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
// Update the data row lookups.
|
|
231
|
-
dataRowIdToModelLookup[id] = _extends({}, oldRow, partialRow);
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// Action === "insert"
|
|
236
|
-
// If the data row has been removed since the last state update,
|
|
237
|
-
// Then drop the "remove" update and add it to the "insert" update instead.
|
|
238
|
-
if (actionAlreadyAppliedToRow === 'remove') {
|
|
239
|
-
alreadyAppliedActionsToRemove.remove[id] = true;
|
|
240
|
-
partialUpdates.actions.insert.push(id);
|
|
241
|
-
}
|
|
242
|
-
// If the data row has not been inserted since the last state update,
|
|
243
|
-
// Then add it to the "insert" update.
|
|
244
|
-
// `actionAlreadyAppliedToRow` can't be equal to "modify", otherwise we would have an `oldRow` above.
|
|
245
|
-
else if (actionAlreadyAppliedToRow == null) {
|
|
246
|
-
partialUpdates.actions.insert.push(id);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// Update the data row lookups.
|
|
250
|
-
dataRowIdToModelLookup[id] = partialRow;
|
|
251
|
-
dataRowIdToIdLookup[id] = id;
|
|
252
|
-
});
|
|
253
|
-
var actionTypeWithActionsToRemove = Object.keys(alreadyAppliedActionsToRemove);
|
|
254
|
-
var _loop = function _loop() {
|
|
255
|
-
var actionType = actionTypeWithActionsToRemove[i];
|
|
256
|
-
var idsToRemove = alreadyAppliedActionsToRemove[actionType];
|
|
257
|
-
if (Object.keys(idsToRemove).length > 0) {
|
|
258
|
-
partialUpdates.actions[actionType] = partialUpdates.actions[actionType].filter(function (id) {
|
|
259
|
-
return !idsToRemove[id];
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
};
|
|
263
|
-
for (var i = 0; i < actionTypeWithActionsToRemove.length; i += 1) {
|
|
264
|
-
_loop();
|
|
265
|
-
}
|
|
266
|
-
return {
|
|
267
|
-
dataRowIdToModelLookup: dataRowIdToModelLookup,
|
|
268
|
-
dataRowIdToIdLookup: dataRowIdToIdLookup,
|
|
269
|
-
updates: partialUpdates,
|
|
270
|
-
rowsBeforePartialUpdates: previousCache.rowsBeforePartialUpdates,
|
|
271
|
-
loadingPropBeforePartialUpdates: previousCache.loadingPropBeforePartialUpdates,
|
|
272
|
-
rowCountPropBeforePartialUpdates: previousCache.rowCountPropBeforePartialUpdates
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
export function calculatePinnedRowsHeight(apiRef) {
|
|
276
|
-
var _pinnedRows$top, _pinnedRows$bottom;
|
|
277
|
-
var pinnedRows = gridPinnedRowsSelector(apiRef);
|
|
278
|
-
var topPinnedRowsHeight = (pinnedRows == null || (_pinnedRows$top = pinnedRows.top) == null ? void 0 : _pinnedRows$top.reduce(function (acc, value) {
|
|
279
|
-
acc += apiRef.current.unstable_getRowHeight(value.id);
|
|
280
|
-
return acc;
|
|
281
|
-
}, 0)) || 0;
|
|
282
|
-
var bottomPinnedRowsHeight = (pinnedRows == null || (_pinnedRows$bottom = pinnedRows.bottom) == null ? void 0 : _pinnedRows$bottom.reduce(function (acc, value) {
|
|
283
|
-
acc += apiRef.current.unstable_getRowHeight(value.id);
|
|
284
|
-
return acc;
|
|
285
|
-
}, 0)) || 0;
|
|
286
|
-
return {
|
|
287
|
-
top: topPinnedRowsHeight,
|
|
288
|
-
bottom: bottomPinnedRowsHeight
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
export function getMinimalContentHeight(apiRef) {
|
|
292
|
-
var dimensions = gridDimensionsSelector(apiRef.current.state);
|
|
293
|
-
return "var(--DataGrid-overlayHeight, ".concat(2 * dimensions.rowHeight, "px)");
|
|
294
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export * from './gridRowsMetaSelector';
|
|
2
|
-
export * from './gridRowsMetaState';
|
|
3
|
-
export { gridRowCountSelector, gridRowsLoadingSelector, gridTopLevelRowCountSelector, gridRowsLookupSelector, gridRowsDataRowIdToIdLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridRowMaximumTreeDepthSelector, gridDataRowIdsSelector } from './gridRowsSelector';
|
|
4
|
-
export { GRID_ROOT_GROUP_ID, checkGridRowIdIsValid } from './gridRowsUtils';
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _wrapNativeSuper from "@babel/runtime/helpers/esm/wrapNativeSuper";
|
|
7
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
|
-
import * as React from 'react';
|
|
10
|
-
import { getGridCellElement, getGridColumnHeaderElement, getGridRowElement } from '../../../utils/domUtils';
|
|
11
|
-
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
12
|
-
import { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';
|
|
13
|
-
export var MissingRowIdError = /*#__PURE__*/function (_Error) {
|
|
14
|
-
_inherits(MissingRowIdError, _Error);
|
|
15
|
-
function MissingRowIdError() {
|
|
16
|
-
_classCallCheck(this, MissingRowIdError);
|
|
17
|
-
return _callSuper(this, MissingRowIdError, arguments);
|
|
18
|
-
}
|
|
19
|
-
return _createClass(MissingRowIdError);
|
|
20
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @requires useGridColumns (method)
|
|
24
|
-
* @requires useGridRows (method)
|
|
25
|
-
* @requires useGridFocus (state)
|
|
26
|
-
* @requires useGridEditing (method)
|
|
27
|
-
* TODO: Impossible priority - useGridEditing also needs to be after useGridParamsApi
|
|
28
|
-
* TODO: Impossible priority - useGridFocus also needs to be after useGridParamsApi
|
|
29
|
-
*/
|
|
30
|
-
export function useGridParamsApi(apiRef) {
|
|
31
|
-
var getColumnHeaderParams = React.useCallback(function (field) {
|
|
32
|
-
return {
|
|
33
|
-
field: field,
|
|
34
|
-
colDef: apiRef.current.getColumn(field)
|
|
35
|
-
};
|
|
36
|
-
}, [apiRef]);
|
|
37
|
-
var getRowParams = React.useCallback(function (id) {
|
|
38
|
-
var row = apiRef.current.getRow(id);
|
|
39
|
-
if (!row) {
|
|
40
|
-
throw new MissingRowIdError("No row with id #".concat(id, " found"));
|
|
41
|
-
}
|
|
42
|
-
var params = {
|
|
43
|
-
id: id,
|
|
44
|
-
columns: apiRef.current.getAllColumns(),
|
|
45
|
-
row: row
|
|
46
|
-
};
|
|
47
|
-
return params;
|
|
48
|
-
}, [apiRef]);
|
|
49
|
-
var getCellParams = React.useCallback(function (id, field) {
|
|
50
|
-
var colDef = apiRef.current.getColumn(field);
|
|
51
|
-
var value = apiRef.current.getCellValue(id, field);
|
|
52
|
-
var row = apiRef.current.getRow(id);
|
|
53
|
-
var rowNode = apiRef.current.getRowNode(id);
|
|
54
|
-
if (!row || !rowNode) {
|
|
55
|
-
throw new MissingRowIdError("No row with id #".concat(id, " found"));
|
|
56
|
-
}
|
|
57
|
-
var cellFocus = gridFocusCellSelector(apiRef);
|
|
58
|
-
var cellTabIndex = gridTabIndexCellSelector(apiRef);
|
|
59
|
-
var params = {
|
|
60
|
-
id: id,
|
|
61
|
-
field: field,
|
|
62
|
-
row: row,
|
|
63
|
-
rowNode: rowNode,
|
|
64
|
-
colDef: colDef,
|
|
65
|
-
cellMode: apiRef.current.getCellMode(id, field),
|
|
66
|
-
hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,
|
|
67
|
-
tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1,
|
|
68
|
-
value: value,
|
|
69
|
-
formattedValue: value,
|
|
70
|
-
isEditable: false
|
|
71
|
-
};
|
|
72
|
-
if (colDef && colDef.valueFormatter) {
|
|
73
|
-
params.formattedValue = colDef.valueFormatter(value, row, colDef, apiRef);
|
|
74
|
-
}
|
|
75
|
-
params.isEditable = colDef && apiRef.current.isCellEditable(params);
|
|
76
|
-
return params;
|
|
77
|
-
}, [apiRef]);
|
|
78
|
-
var getCellValue = React.useCallback(function (id, field) {
|
|
79
|
-
var colDef = apiRef.current.getColumn(field);
|
|
80
|
-
if (!colDef || !colDef.valueGetter) {
|
|
81
|
-
var rowModel = apiRef.current.getRow(id);
|
|
82
|
-
if (!rowModel) {
|
|
83
|
-
throw new MissingRowIdError("No row with id #".concat(id, " found"));
|
|
84
|
-
}
|
|
85
|
-
return rowModel[field];
|
|
86
|
-
}
|
|
87
|
-
var row = apiRef.current.getRow(id);
|
|
88
|
-
if (!row) {
|
|
89
|
-
throw new MissingRowIdError("No row with id #".concat(id, " found"));
|
|
90
|
-
}
|
|
91
|
-
var value = row[colDef.field];
|
|
92
|
-
return colDef.valueGetter(value, row, colDef, apiRef);
|
|
93
|
-
}, [apiRef]);
|
|
94
|
-
var getRowValue = React.useCallback(function (row, colDef) {
|
|
95
|
-
var field = colDef.field;
|
|
96
|
-
if (!colDef || !colDef.valueGetter) {
|
|
97
|
-
return row[field];
|
|
98
|
-
}
|
|
99
|
-
var value = row[colDef.field];
|
|
100
|
-
return colDef.valueGetter(value, row, colDef, apiRef);
|
|
101
|
-
}, [apiRef]);
|
|
102
|
-
var getRowFormattedValue = React.useCallback(function (row, colDef) {
|
|
103
|
-
var value = getRowValue(row, colDef);
|
|
104
|
-
if (!colDef || !colDef.valueFormatter) {
|
|
105
|
-
return value;
|
|
106
|
-
}
|
|
107
|
-
return colDef.valueFormatter(value, row, colDef, apiRef);
|
|
108
|
-
}, [apiRef, getRowValue]);
|
|
109
|
-
var getColumnHeaderElement = React.useCallback(function (field) {
|
|
110
|
-
if (!apiRef.current.rootElementRef.current) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
return getGridColumnHeaderElement(apiRef.current.rootElementRef.current, field);
|
|
114
|
-
}, [apiRef]);
|
|
115
|
-
var getRowElement = React.useCallback(function (id) {
|
|
116
|
-
if (!apiRef.current.rootElementRef.current) {
|
|
117
|
-
return null;
|
|
118
|
-
}
|
|
119
|
-
return getGridRowElement(apiRef.current.rootElementRef.current, id);
|
|
120
|
-
}, [apiRef]);
|
|
121
|
-
var getCellElement = React.useCallback(function (id, field) {
|
|
122
|
-
if (!apiRef.current.rootElementRef.current) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
return getGridCellElement(apiRef.current.rootElementRef.current, {
|
|
126
|
-
id: id,
|
|
127
|
-
field: field
|
|
128
|
-
});
|
|
129
|
-
}, [apiRef]);
|
|
130
|
-
var paramsApi = {
|
|
131
|
-
getCellValue: getCellValue,
|
|
132
|
-
getCellParams: getCellParams,
|
|
133
|
-
getCellElement: getCellElement,
|
|
134
|
-
getRowValue: getRowValue,
|
|
135
|
-
getRowFormattedValue: getRowFormattedValue,
|
|
136
|
-
getRowParams: getRowParams,
|
|
137
|
-
getRowElement: getRowElement,
|
|
138
|
-
getColumnHeaderParams: getColumnHeaderParams,
|
|
139
|
-
getColumnHeaderElement: getColumnHeaderElement
|
|
140
|
-
};
|
|
141
|
-
useGridApiMethod(apiRef, paramsApi, 'public');
|
|
142
|
-
}
|