@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,230 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "inputProps", "isValidating", "isProcessingProps", "onValueChange"];
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
10
|
-
import InputBase from '@mui/material/InputBase';
|
|
11
|
-
import { styled } from '@mui/material/styles';
|
|
12
|
-
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
13
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
var StyledInputBase = styled(InputBase)({
|
|
17
|
-
fontSize: 'inherit'
|
|
18
|
-
});
|
|
19
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
20
|
-
var classes = ownerState.classes;
|
|
21
|
-
var slots = {
|
|
22
|
-
root: ['editInputCell']
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
function GridEditDateCell(props) {
|
|
27
|
-
var id = props.id,
|
|
28
|
-
valueProp = props.value,
|
|
29
|
-
formattedValue = props.formattedValue,
|
|
30
|
-
api = props.api,
|
|
31
|
-
field = props.field,
|
|
32
|
-
row = props.row,
|
|
33
|
-
rowNode = props.rowNode,
|
|
34
|
-
colDef = props.colDef,
|
|
35
|
-
cellMode = props.cellMode,
|
|
36
|
-
isEditable = props.isEditable,
|
|
37
|
-
tabIndex = props.tabIndex,
|
|
38
|
-
hasFocus = props.hasFocus,
|
|
39
|
-
inputProps = props.inputProps,
|
|
40
|
-
isValidating = props.isValidating,
|
|
41
|
-
isProcessingProps = props.isProcessingProps,
|
|
42
|
-
onValueChange = props.onValueChange,
|
|
43
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
44
|
-
var isDateTime = colDef.type === 'dateTime';
|
|
45
|
-
var apiRef = useGridApiContext();
|
|
46
|
-
var inputRef = React.useRef();
|
|
47
|
-
var valueTransformed = React.useMemo(function () {
|
|
48
|
-
var parsedDate;
|
|
49
|
-
if (valueProp == null) {
|
|
50
|
-
parsedDate = null;
|
|
51
|
-
} else if (valueProp instanceof Date) {
|
|
52
|
-
parsedDate = valueProp;
|
|
53
|
-
} else {
|
|
54
|
-
parsedDate = new Date((valueProp != null ? valueProp : '').toString());
|
|
55
|
-
}
|
|
56
|
-
var formattedDate;
|
|
57
|
-
if (parsedDate == null || Number.isNaN(parsedDate.getTime())) {
|
|
58
|
-
formattedDate = '';
|
|
59
|
-
} else {
|
|
60
|
-
var localDate = new Date(parsedDate.getTime() - parsedDate.getTimezoneOffset() * 60 * 1000);
|
|
61
|
-
formattedDate = localDate.toISOString().substr(0, isDateTime ? 16 : 10);
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
parsed: parsedDate,
|
|
65
|
-
formatted: formattedDate
|
|
66
|
-
};
|
|
67
|
-
}, [valueProp, isDateTime]);
|
|
68
|
-
var _React$useState = React.useState(valueTransformed),
|
|
69
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
70
|
-
valueState = _React$useState2[0],
|
|
71
|
-
setValueState = _React$useState2[1];
|
|
72
|
-
var rootProps = useGridRootProps();
|
|
73
|
-
var ownerState = {
|
|
74
|
-
classes: rootProps.classes
|
|
75
|
-
};
|
|
76
|
-
var classes = useUtilityClasses(ownerState);
|
|
77
|
-
var parseValueToDate = React.useCallback(function (value) {
|
|
78
|
-
if (value === '') {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
var _value$split = value.split('T'),
|
|
82
|
-
_value$split2 = _slicedToArray(_value$split, 2),
|
|
83
|
-
date = _value$split2[0],
|
|
84
|
-
time = _value$split2[1];
|
|
85
|
-
var _date$split = date.split('-'),
|
|
86
|
-
_date$split2 = _slicedToArray(_date$split, 3),
|
|
87
|
-
year = _date$split2[0],
|
|
88
|
-
month = _date$split2[1],
|
|
89
|
-
day = _date$split2[2];
|
|
90
|
-
var parsedDate = new Date();
|
|
91
|
-
parsedDate.setFullYear(Number(year), Number(month) - 1, Number(day));
|
|
92
|
-
parsedDate.setHours(0, 0, 0, 0);
|
|
93
|
-
if (time) {
|
|
94
|
-
var _time$split = time.split(':'),
|
|
95
|
-
_time$split2 = _slicedToArray(_time$split, 2),
|
|
96
|
-
hours = _time$split2[0],
|
|
97
|
-
minutes = _time$split2[1];
|
|
98
|
-
parsedDate.setHours(Number(hours), Number(minutes), 0, 0);
|
|
99
|
-
}
|
|
100
|
-
return parsedDate;
|
|
101
|
-
}, []);
|
|
102
|
-
var handleChange = React.useCallback( /*#__PURE__*/function () {
|
|
103
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
104
|
-
var newFormattedDate, newParsedDate;
|
|
105
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
106
|
-
while (1) switch (_context.prev = _context.next) {
|
|
107
|
-
case 0:
|
|
108
|
-
newFormattedDate = event.target.value;
|
|
109
|
-
newParsedDate = parseValueToDate(newFormattedDate);
|
|
110
|
-
if (!onValueChange) {
|
|
111
|
-
_context.next = 5;
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
_context.next = 5;
|
|
115
|
-
return onValueChange(event, newParsedDate);
|
|
116
|
-
case 5:
|
|
117
|
-
setValueState({
|
|
118
|
-
parsed: newParsedDate,
|
|
119
|
-
formatted: newFormattedDate
|
|
120
|
-
});
|
|
121
|
-
apiRef.current.setEditCellValue({
|
|
122
|
-
id: id,
|
|
123
|
-
field: field,
|
|
124
|
-
value: newParsedDate
|
|
125
|
-
}, event);
|
|
126
|
-
case 7:
|
|
127
|
-
case "end":
|
|
128
|
-
return _context.stop();
|
|
129
|
-
}
|
|
130
|
-
}, _callee);
|
|
131
|
-
}));
|
|
132
|
-
return function (_x) {
|
|
133
|
-
return _ref.apply(this, arguments);
|
|
134
|
-
};
|
|
135
|
-
}(), [apiRef, field, id, onValueChange, parseValueToDate]);
|
|
136
|
-
React.useEffect(function () {
|
|
137
|
-
setValueState(function (state) {
|
|
138
|
-
var _valueTransformed$par, _state$parsed;
|
|
139
|
-
if (valueTransformed.parsed !== state.parsed && ((_valueTransformed$par = valueTransformed.parsed) == null ? void 0 : _valueTransformed$par.getTime()) !== ((_state$parsed = state.parsed) == null ? void 0 : _state$parsed.getTime())) {
|
|
140
|
-
return valueTransformed;
|
|
141
|
-
}
|
|
142
|
-
return state;
|
|
143
|
-
});
|
|
144
|
-
}, [valueTransformed]);
|
|
145
|
-
useEnhancedEffect(function () {
|
|
146
|
-
if (hasFocus) {
|
|
147
|
-
inputRef.current.focus();
|
|
148
|
-
}
|
|
149
|
-
}, [hasFocus]);
|
|
150
|
-
return /*#__PURE__*/_jsx(StyledInputBase, _extends({
|
|
151
|
-
inputRef: inputRef,
|
|
152
|
-
fullWidth: true,
|
|
153
|
-
className: classes.root,
|
|
154
|
-
type: isDateTime ? 'datetime-local' : 'date',
|
|
155
|
-
inputProps: _extends({
|
|
156
|
-
max: isDateTime ? '9999-12-31T23:59' : '9999-12-31'
|
|
157
|
-
}, inputProps),
|
|
158
|
-
value: valueState.formatted,
|
|
159
|
-
onChange: handleChange
|
|
160
|
-
}, other));
|
|
161
|
-
}
|
|
162
|
-
process.env.NODE_ENV !== "production" ? GridEditDateCell.propTypes = {
|
|
163
|
-
// ----------------------------- Warning --------------------------------
|
|
164
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
165
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
166
|
-
// ----------------------------------------------------------------------
|
|
167
|
-
/**
|
|
168
|
-
* GridApi that let you manipulate the grid.
|
|
169
|
-
*/
|
|
170
|
-
api: PropTypes.object.isRequired,
|
|
171
|
-
/**
|
|
172
|
-
* The mode of the cell.
|
|
173
|
-
*/
|
|
174
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
175
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
176
|
-
/**
|
|
177
|
-
* The column of the row that the current cell belongs to.
|
|
178
|
-
*/
|
|
179
|
-
colDef: PropTypes.object.isRequired,
|
|
180
|
-
/**
|
|
181
|
-
* The column field of the cell that triggered the event.
|
|
182
|
-
*/
|
|
183
|
-
field: PropTypes.string.isRequired,
|
|
184
|
-
/**
|
|
185
|
-
* The cell value formatted with the column valueFormatter.
|
|
186
|
-
*/
|
|
187
|
-
formattedValue: PropTypes.any,
|
|
188
|
-
/**
|
|
189
|
-
* If true, the cell is the active element.
|
|
190
|
-
*/
|
|
191
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
192
|
-
/**
|
|
193
|
-
* The grid row id.
|
|
194
|
-
*/
|
|
195
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
196
|
-
/**
|
|
197
|
-
* If true, the cell is editable.
|
|
198
|
-
*/
|
|
199
|
-
isEditable: PropTypes.bool,
|
|
200
|
-
isProcessingProps: PropTypes.bool,
|
|
201
|
-
isValidating: PropTypes.bool,
|
|
202
|
-
/**
|
|
203
|
-
* Callback called when the value is changed by the user.
|
|
204
|
-
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
205
|
-
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
206
|
-
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
207
|
-
*/
|
|
208
|
-
onValueChange: PropTypes.func,
|
|
209
|
-
/**
|
|
210
|
-
* The row model of the row that the current cell belongs to.
|
|
211
|
-
*/
|
|
212
|
-
row: PropTypes.any.isRequired,
|
|
213
|
-
/**
|
|
214
|
-
* The node of the row that the current cell belongs to.
|
|
215
|
-
*/
|
|
216
|
-
rowNode: PropTypes.object.isRequired,
|
|
217
|
-
/**
|
|
218
|
-
* the tabIndex value.
|
|
219
|
-
*/
|
|
220
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
221
|
-
/**
|
|
222
|
-
* The cell value.
|
|
223
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
224
|
-
*/
|
|
225
|
-
value: PropTypes.any
|
|
226
|
-
} : void 0;
|
|
227
|
-
export { GridEditDateCell };
|
|
228
|
-
export var renderEditDateCell = function renderEditDateCell(params) {
|
|
229
|
-
return /*#__PURE__*/_jsx(GridEditDateCell, _extends({}, params));
|
|
230
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "hasFocus", "isValidating", "debounceMs", "isProcessingProps", "onValueChange"];
|
|
6
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import { unstable_composeClasses as composeClasses, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
10
|
-
import { styled } from '@mui/material/styles';
|
|
11
|
-
import InputBase from '@mui/material/InputBase';
|
|
12
|
-
import { getDataGridUtilityClass } from '../../constants/gridClasses';
|
|
13
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
17
|
-
var classes = ownerState.classes;
|
|
18
|
-
var slots = {
|
|
19
|
-
root: ['editInputCell']
|
|
20
|
-
};
|
|
21
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
22
|
-
};
|
|
23
|
-
var GridEditInputCellRoot = styled(InputBase, {
|
|
24
|
-
name: 'MuiDataGrid',
|
|
25
|
-
slot: 'EditInputCell',
|
|
26
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
27
|
-
return styles.editInputCell;
|
|
28
|
-
}
|
|
29
|
-
})(function (_ref) {
|
|
30
|
-
var theme = _ref.theme;
|
|
31
|
-
return _extends({}, theme.typography.body2, {
|
|
32
|
-
padding: '1px 0',
|
|
33
|
-
'& input': {
|
|
34
|
-
padding: '0 16px',
|
|
35
|
-
height: '100%'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var GridEditInputCell = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
40
|
-
var rootProps = useGridRootProps();
|
|
41
|
-
var id = props.id,
|
|
42
|
-
value = props.value,
|
|
43
|
-
formattedValue = props.formattedValue,
|
|
44
|
-
api = props.api,
|
|
45
|
-
field = props.field,
|
|
46
|
-
row = props.row,
|
|
47
|
-
rowNode = props.rowNode,
|
|
48
|
-
colDef = props.colDef,
|
|
49
|
-
cellMode = props.cellMode,
|
|
50
|
-
isEditable = props.isEditable,
|
|
51
|
-
tabIndex = props.tabIndex,
|
|
52
|
-
hasFocus = props.hasFocus,
|
|
53
|
-
isValidating = props.isValidating,
|
|
54
|
-
_props$debounceMs = props.debounceMs,
|
|
55
|
-
debounceMs = _props$debounceMs === void 0 ? 200 : _props$debounceMs,
|
|
56
|
-
isProcessingProps = props.isProcessingProps,
|
|
57
|
-
onValueChange = props.onValueChange,
|
|
58
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
59
|
-
var apiRef = useGridApiContext();
|
|
60
|
-
var inputRef = React.useRef();
|
|
61
|
-
var _React$useState = React.useState(value),
|
|
62
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
63
|
-
valueState = _React$useState2[0],
|
|
64
|
-
setValueState = _React$useState2[1];
|
|
65
|
-
var classes = useUtilityClasses(rootProps);
|
|
66
|
-
var handleChange = React.useCallback( /*#__PURE__*/function () {
|
|
67
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
68
|
-
var newValue, column, parsedValue;
|
|
69
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
70
|
-
while (1) switch (_context.prev = _context.next) {
|
|
71
|
-
case 0:
|
|
72
|
-
newValue = event.target.value;
|
|
73
|
-
if (!onValueChange) {
|
|
74
|
-
_context.next = 4;
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
_context.next = 4;
|
|
78
|
-
return onValueChange(event, newValue);
|
|
79
|
-
case 4:
|
|
80
|
-
column = apiRef.current.getColumn(field);
|
|
81
|
-
parsedValue = newValue;
|
|
82
|
-
if (column.valueParser) {
|
|
83
|
-
parsedValue = column.valueParser(newValue, apiRef.current.getRow(id), column, apiRef);
|
|
84
|
-
}
|
|
85
|
-
setValueState(parsedValue);
|
|
86
|
-
apiRef.current.setEditCellValue({
|
|
87
|
-
id: id,
|
|
88
|
-
field: field,
|
|
89
|
-
value: parsedValue,
|
|
90
|
-
debounceMs: debounceMs,
|
|
91
|
-
unstable_skipValueParser: true
|
|
92
|
-
}, event);
|
|
93
|
-
case 9:
|
|
94
|
-
case "end":
|
|
95
|
-
return _context.stop();
|
|
96
|
-
}
|
|
97
|
-
}, _callee);
|
|
98
|
-
}));
|
|
99
|
-
return function (_x) {
|
|
100
|
-
return _ref2.apply(this, arguments);
|
|
101
|
-
};
|
|
102
|
-
}(), [apiRef, debounceMs, field, id, onValueChange]);
|
|
103
|
-
var meta = apiRef.current.unstable_getEditCellMeta(id, field);
|
|
104
|
-
React.useEffect(function () {
|
|
105
|
-
if ((meta == null ? void 0 : meta.changeReason) !== 'debouncedSetEditCellValue') {
|
|
106
|
-
setValueState(value);
|
|
107
|
-
}
|
|
108
|
-
}, [meta, value]);
|
|
109
|
-
useEnhancedEffect(function () {
|
|
110
|
-
if (hasFocus) {
|
|
111
|
-
inputRef.current.focus();
|
|
112
|
-
}
|
|
113
|
-
}, [hasFocus]);
|
|
114
|
-
return /*#__PURE__*/_jsx(GridEditInputCellRoot, _extends({
|
|
115
|
-
ref: ref,
|
|
116
|
-
inputRef: inputRef,
|
|
117
|
-
className: classes.root,
|
|
118
|
-
ownerState: rootProps,
|
|
119
|
-
fullWidth: true,
|
|
120
|
-
type: colDef.type === 'number' ? colDef.type : 'text',
|
|
121
|
-
value: valueState != null ? valueState : '',
|
|
122
|
-
onChange: handleChange,
|
|
123
|
-
endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(rootProps.slots.loadIcon, {
|
|
124
|
-
fontSize: "small",
|
|
125
|
-
color: "action"
|
|
126
|
-
}) : undefined
|
|
127
|
-
}, other));
|
|
128
|
-
});
|
|
129
|
-
process.env.NODE_ENV !== "production" ? GridEditInputCell.propTypes = {
|
|
130
|
-
// ----------------------------- Warning --------------------------------
|
|
131
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
132
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
133
|
-
// ----------------------------------------------------------------------
|
|
134
|
-
/**
|
|
135
|
-
* GridApi that let you manipulate the grid.
|
|
136
|
-
*/
|
|
137
|
-
api: PropTypes.object.isRequired,
|
|
138
|
-
/**
|
|
139
|
-
* The mode of the cell.
|
|
140
|
-
*/
|
|
141
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
142
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
143
|
-
/**
|
|
144
|
-
* The column of the row that the current cell belongs to.
|
|
145
|
-
*/
|
|
146
|
-
colDef: PropTypes.object.isRequired,
|
|
147
|
-
debounceMs: PropTypes.number,
|
|
148
|
-
/**
|
|
149
|
-
* The column field of the cell that triggered the event.
|
|
150
|
-
*/
|
|
151
|
-
field: PropTypes.string.isRequired,
|
|
152
|
-
/**
|
|
153
|
-
* The cell value formatted with the column valueFormatter.
|
|
154
|
-
*/
|
|
155
|
-
formattedValue: PropTypes.any,
|
|
156
|
-
/**
|
|
157
|
-
* If true, the cell is the active element.
|
|
158
|
-
*/
|
|
159
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
160
|
-
/**
|
|
161
|
-
* The grid row id.
|
|
162
|
-
*/
|
|
163
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
164
|
-
/**
|
|
165
|
-
* If true, the cell is editable.
|
|
166
|
-
*/
|
|
167
|
-
isEditable: PropTypes.bool,
|
|
168
|
-
isProcessingProps: PropTypes.bool,
|
|
169
|
-
isValidating: PropTypes.bool,
|
|
170
|
-
/**
|
|
171
|
-
* Callback called when the value is changed by the user.
|
|
172
|
-
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
173
|
-
* @param {Date | null} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
174
|
-
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
175
|
-
*/
|
|
176
|
-
onValueChange: PropTypes.func,
|
|
177
|
-
/**
|
|
178
|
-
* The row model of the row that the current cell belongs to.
|
|
179
|
-
*/
|
|
180
|
-
row: PropTypes.any.isRequired,
|
|
181
|
-
/**
|
|
182
|
-
* The node of the row that the current cell belongs to.
|
|
183
|
-
*/
|
|
184
|
-
rowNode: PropTypes.object.isRequired,
|
|
185
|
-
/**
|
|
186
|
-
* the tabIndex value.
|
|
187
|
-
*/
|
|
188
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
189
|
-
/**
|
|
190
|
-
* The cell value.
|
|
191
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
192
|
-
*/
|
|
193
|
-
value: PropTypes.any
|
|
194
|
-
} : void 0;
|
|
195
|
-
export { GridEditInputCell };
|
|
196
|
-
export var renderEditInputCell = function renderEditInputCell(params) {
|
|
197
|
-
return /*#__PURE__*/_jsx(GridEditInputCell, _extends({}, params));
|
|
198
|
-
};
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["id", "value", "formattedValue", "api", "field", "row", "rowNode", "colDef", "cellMode", "isEditable", "tabIndex", "className", "hasFocus", "isValidating", "isProcessingProps", "error", "onValueChange", "initialOpen"],
|
|
6
|
-
_excluded2 = ["MenuProps"];
|
|
7
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
-
import * as React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';
|
|
11
|
-
import { GridCellEditStopReasons } from '../../models/params/gridEditCellParams';
|
|
12
|
-
import { isEscapeKey } from '../../utils/keyboardUtils';
|
|
13
|
-
import { useGridRootProps } from '../../hooks/utils/useGridRootProps';
|
|
14
|
-
import { GridEditModes } from '../../models/gridEditRowModel';
|
|
15
|
-
import { getValueFromValueOptions, getValueOptions, isSingleSelectColDef } from '../panel/filterPanel/filterPanelUtils';
|
|
16
|
-
import { useGridApiContext } from '../../hooks/utils/useGridApiContext';
|
|
17
|
-
import { createElement as _createElement } from "react";
|
|
18
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
-
function isKeyboardEvent(event) {
|
|
20
|
-
return !!event.key;
|
|
21
|
-
}
|
|
22
|
-
function GridEditSingleSelectCell(props) {
|
|
23
|
-
var _rootProps$slotProps, _baseSelectProps$nati, _rootProps$slotProps2;
|
|
24
|
-
var rootProps = useGridRootProps();
|
|
25
|
-
var id = props.id,
|
|
26
|
-
valueProp = props.value,
|
|
27
|
-
formattedValue = props.formattedValue,
|
|
28
|
-
api = props.api,
|
|
29
|
-
field = props.field,
|
|
30
|
-
row = props.row,
|
|
31
|
-
rowNode = props.rowNode,
|
|
32
|
-
colDef = props.colDef,
|
|
33
|
-
cellMode = props.cellMode,
|
|
34
|
-
isEditable = props.isEditable,
|
|
35
|
-
tabIndex = props.tabIndex,
|
|
36
|
-
className = props.className,
|
|
37
|
-
hasFocus = props.hasFocus,
|
|
38
|
-
isValidating = props.isValidating,
|
|
39
|
-
isProcessingProps = props.isProcessingProps,
|
|
40
|
-
error = props.error,
|
|
41
|
-
onValueChange = props.onValueChange,
|
|
42
|
-
_props$initialOpen = props.initialOpen,
|
|
43
|
-
initialOpen = _props$initialOpen === void 0 ? rootProps.editMode === GridEditModes.Cell : _props$initialOpen,
|
|
44
|
-
other = _objectWithoutProperties(props, _excluded);
|
|
45
|
-
var apiRef = useGridApiContext();
|
|
46
|
-
var ref = React.useRef();
|
|
47
|
-
var inputRef = React.useRef();
|
|
48
|
-
var _React$useState = React.useState(initialOpen),
|
|
49
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
50
|
-
open = _React$useState2[0],
|
|
51
|
-
setOpen = _React$useState2[1];
|
|
52
|
-
var baseSelectProps = ((_rootProps$slotProps = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps.baseSelect) || {};
|
|
53
|
-
var isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;
|
|
54
|
-
var _ref = ((_rootProps$slotProps2 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps2.baseSelect) || {},
|
|
55
|
-
MenuProps = _ref.MenuProps,
|
|
56
|
-
otherBaseSelectProps = _objectWithoutProperties(_ref, _excluded2);
|
|
57
|
-
useEnhancedEffect(function () {
|
|
58
|
-
if (hasFocus) {
|
|
59
|
-
var _inputRef$current;
|
|
60
|
-
(_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
|
|
61
|
-
}
|
|
62
|
-
}, [hasFocus]);
|
|
63
|
-
if (!isSingleSelectColDef(colDef)) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
var valueOptions = getValueOptions(colDef, {
|
|
67
|
-
id: id,
|
|
68
|
-
row: row
|
|
69
|
-
});
|
|
70
|
-
if (!valueOptions) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
var getOptionValue = colDef.getOptionValue;
|
|
74
|
-
var getOptionLabel = colDef.getOptionLabel;
|
|
75
|
-
var handleChange = /*#__PURE__*/function () {
|
|
76
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(event) {
|
|
77
|
-
var target, formattedTargetValue;
|
|
78
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
79
|
-
while (1) switch (_context.prev = _context.next) {
|
|
80
|
-
case 0:
|
|
81
|
-
if (!(!isSingleSelectColDef(colDef) || !valueOptions)) {
|
|
82
|
-
_context.next = 2;
|
|
83
|
-
break;
|
|
84
|
-
}
|
|
85
|
-
return _context.abrupt("return");
|
|
86
|
-
case 2:
|
|
87
|
-
setOpen(false);
|
|
88
|
-
target = event.target; // NativeSelect casts the value to a string.
|
|
89
|
-
formattedTargetValue = getValueFromValueOptions(target.value, valueOptions, getOptionValue);
|
|
90
|
-
if (!onValueChange) {
|
|
91
|
-
_context.next = 8;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
_context.next = 8;
|
|
95
|
-
return onValueChange(event, formattedTargetValue);
|
|
96
|
-
case 8:
|
|
97
|
-
_context.next = 10;
|
|
98
|
-
return apiRef.current.setEditCellValue({
|
|
99
|
-
id: id,
|
|
100
|
-
field: field,
|
|
101
|
-
value: formattedTargetValue
|
|
102
|
-
}, event);
|
|
103
|
-
case 10:
|
|
104
|
-
case "end":
|
|
105
|
-
return _context.stop();
|
|
106
|
-
}
|
|
107
|
-
}, _callee);
|
|
108
|
-
}));
|
|
109
|
-
return function handleChange(_x) {
|
|
110
|
-
return _ref2.apply(this, arguments);
|
|
111
|
-
};
|
|
112
|
-
}();
|
|
113
|
-
var handleClose = function handleClose(event, reason) {
|
|
114
|
-
if (rootProps.editMode === GridEditModes.Row) {
|
|
115
|
-
setOpen(false);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
if (reason === 'backdropClick' || isEscapeKey(event.key)) {
|
|
119
|
-
var params = apiRef.current.getCellParams(id, field);
|
|
120
|
-
apiRef.current.publishEvent('cellEditStop', _extends({}, params, {
|
|
121
|
-
reason: isEscapeKey(event.key) ? GridCellEditStopReasons.escapeKeyDown : GridCellEditStopReasons.cellFocusOut
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
var handleOpen = function handleOpen(event) {
|
|
126
|
-
if (isKeyboardEvent(event) && event.key === 'Enter') {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
setOpen(true);
|
|
130
|
-
};
|
|
131
|
-
if (!valueOptions || !colDef) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
return /*#__PURE__*/_jsx(rootProps.slots.baseSelect, _extends({
|
|
135
|
-
ref: ref,
|
|
136
|
-
inputRef: inputRef,
|
|
137
|
-
value: valueProp,
|
|
138
|
-
onChange: handleChange,
|
|
139
|
-
open: open,
|
|
140
|
-
onOpen: handleOpen,
|
|
141
|
-
MenuProps: _extends({
|
|
142
|
-
onClose: handleClose
|
|
143
|
-
}, MenuProps),
|
|
144
|
-
error: error,
|
|
145
|
-
native: isSelectNative,
|
|
146
|
-
fullWidth: true
|
|
147
|
-
}, other, otherBaseSelectProps, {
|
|
148
|
-
children: valueOptions.map(function (valueOption) {
|
|
149
|
-
var _rootProps$slotProps3;
|
|
150
|
-
var value = getOptionValue(valueOption);
|
|
151
|
-
return /*#__PURE__*/_createElement(rootProps.slots.baseSelectOption, _extends({}, ((_rootProps$slotProps3 = rootProps.slotProps) == null ? void 0 : _rootProps$slotProps3.baseSelectOption) || {}, {
|
|
152
|
-
native: isSelectNative,
|
|
153
|
-
key: value,
|
|
154
|
-
value: value
|
|
155
|
-
}), getOptionLabel(valueOption));
|
|
156
|
-
})
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
|
-
process.env.NODE_ENV !== "production" ? GridEditSingleSelectCell.propTypes = {
|
|
160
|
-
// ----------------------------- Warning --------------------------------
|
|
161
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
162
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
163
|
-
// ----------------------------------------------------------------------
|
|
164
|
-
/**
|
|
165
|
-
* GridApi that let you manipulate the grid.
|
|
166
|
-
*/
|
|
167
|
-
api: PropTypes.object.isRequired,
|
|
168
|
-
/**
|
|
169
|
-
* The mode of the cell.
|
|
170
|
-
*/
|
|
171
|
-
cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,
|
|
172
|
-
changeReason: PropTypes.oneOf(['debouncedSetEditCellValue', 'setEditCellValue']),
|
|
173
|
-
/**
|
|
174
|
-
* The column of the row that the current cell belongs to.
|
|
175
|
-
*/
|
|
176
|
-
colDef: PropTypes.object.isRequired,
|
|
177
|
-
/**
|
|
178
|
-
* The column field of the cell that triggered the event.
|
|
179
|
-
*/
|
|
180
|
-
field: PropTypes.string.isRequired,
|
|
181
|
-
/**
|
|
182
|
-
* The cell value formatted with the column valueFormatter.
|
|
183
|
-
*/
|
|
184
|
-
formattedValue: PropTypes.any,
|
|
185
|
-
/**
|
|
186
|
-
* If true, the cell is the active element.
|
|
187
|
-
*/
|
|
188
|
-
hasFocus: PropTypes.bool.isRequired,
|
|
189
|
-
/**
|
|
190
|
-
* The grid row id.
|
|
191
|
-
*/
|
|
192
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
193
|
-
/**
|
|
194
|
-
* If true, the select opens by default.
|
|
195
|
-
*/
|
|
196
|
-
initialOpen: PropTypes.bool,
|
|
197
|
-
/**
|
|
198
|
-
* If true, the cell is editable.
|
|
199
|
-
*/
|
|
200
|
-
isEditable: PropTypes.bool,
|
|
201
|
-
isProcessingProps: PropTypes.bool,
|
|
202
|
-
isValidating: PropTypes.bool,
|
|
203
|
-
/**
|
|
204
|
-
* Callback called when the value is changed by the user.
|
|
205
|
-
* @param {SelectChangeEvent<any>} event The event source of the callback.
|
|
206
|
-
* @param {any} newValue The value that is going to be passed to `apiRef.current.setEditCellValue`.
|
|
207
|
-
* @returns {Promise<void> | void} A promise to be awaited before calling `apiRef.current.setEditCellValue`
|
|
208
|
-
*/
|
|
209
|
-
onValueChange: PropTypes.func,
|
|
210
|
-
/**
|
|
211
|
-
* The row model of the row that the current cell belongs to.
|
|
212
|
-
*/
|
|
213
|
-
row: PropTypes.any.isRequired,
|
|
214
|
-
/**
|
|
215
|
-
* The node of the row that the current cell belongs to.
|
|
216
|
-
*/
|
|
217
|
-
rowNode: PropTypes.object.isRequired,
|
|
218
|
-
/**
|
|
219
|
-
* the tabIndex value.
|
|
220
|
-
*/
|
|
221
|
-
tabIndex: PropTypes.oneOf([-1, 0]).isRequired,
|
|
222
|
-
/**
|
|
223
|
-
* The cell value.
|
|
224
|
-
* If the column has `valueGetter`, use `params.row` to directly access the fields.
|
|
225
|
-
*/
|
|
226
|
-
value: PropTypes.any
|
|
227
|
-
} : void 0;
|
|
228
|
-
export { GridEditSingleSelectCell };
|
|
229
|
-
export var renderEditSingleSelectCell = function renderEditSingleSelectCell(params) {
|
|
230
|
-
return /*#__PURE__*/_jsx(GridEditSingleSelectCell, _extends({}, params));
|
|
231
|
-
};
|