@mui/x-data-grid 7.0.0-beta.3 → 7.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +357 -22
- package/DataGrid/DataGrid.js +2 -0
- package/colDef/gridActionsColDef.js +1 -0
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridBooleanOperators.js +1 -1
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/components/GridRow.d.ts +7 -9
- package/components/GridRow.js +36 -47
- package/components/GridScrollbarFillerCell.js +6 -21
- package/components/cell/GridCell.d.ts +2 -1
- package/components/cell/GridCell.js +17 -15
- package/components/cell/GridSkeletonCell.d.ts +3 -2
- package/components/cell/GridSkeletonCell.js +14 -6
- package/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/components/containers/GridRootStyles.js +59 -21
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/components/virtualization/GridBottomContainer.js +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScroller.js +2 -2
- package/components/virtualization/GridVirtualScrollerRenderZone.js +9 -3
- package/constants/gridClasses.d.ts +24 -8
- package/constants/gridClasses.js +1 -1
- package/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/hooks/features/columns/gridColumnsSelector.d.ts +6 -0
- package/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/hooks/features/columns/useGridColumns.js +4 -0
- package/hooks/features/editing/useGridCellEditing.js +3 -4
- package/hooks/features/editing/useGridRowEditing.js +4 -6
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/rows/useGridRows.js +8 -4
- package/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/hooks/features/sorting/useGridSorting.js +1 -2
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +0 -9
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +3 -0
- package/hooks/features/virtualization/useGridVirtualScroller.js +82 -138
- package/hooks/features/virtualization/useGridVirtualization.d.ts +0 -8
- package/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/hooks/utils/useTimeout.d.ts +5 -3
- package/hooks/utils/useTimeout.js +13 -5
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/models/colDef/gridColDef.d.ts +13 -0
- package/modern/DataGrid/DataGrid.js +2 -0
- package/modern/colDef/gridActionsColDef.js +1 -0
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridBooleanOperators.js +1 -1
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/components/GridRow.js +35 -46
- package/modern/components/GridScrollbarFillerCell.js +6 -21
- package/modern/components/cell/GridCell.js +17 -15
- package/modern/components/cell/GridSkeletonCell.js +14 -6
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/modern/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/modern/components/containers/GridRootStyles.js +59 -21
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/modern/components/virtualization/GridBottomContainer.js +1 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScroller.js +2 -2
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +8 -3
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -8
- package/modern/hooks/features/columns/gridColumnsSelector.js +8 -1
- package/modern/hooks/features/columns/useGridColumns.js +2 -0
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -4
- package/modern/hooks/features/editing/useGridRowEditing.js +4 -6
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/rows/useGridRows.js +8 -4
- package/modern/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/modern/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/modern/hooks/features/sorting/useGridSorting.js +1 -2
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -7
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +80 -136
- package/modern/hooks/features/virtualization/useGridVirtualization.js +1 -6
- package/modern/hooks/utils/useTimeout.js +13 -5
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/utils/keyboardUtils.js +20 -11
- package/modern/utils/utils.js +9 -0
- package/node/DataGrid/DataGrid.js +1 -0
- package/node/colDef/gridActionsColDef.js +1 -0
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridBooleanOperators.js +1 -1
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/components/GridRow.js +35 -46
- package/node/components/GridScrollbarFillerCell.js +5 -20
- package/node/components/cell/GridCell.js +17 -15
- package/node/components/cell/GridSkeletonCell.js +15 -7
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +7 -6
- package/node/components/columnsManagement/GridColumnsManagement.js +1 -1
- package/node/components/containers/GridRootStyles.js +59 -21
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +8 -2
- package/node/components/virtualization/GridBottomContainer.js +1 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScroller.js +2 -2
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +7 -2
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -5
- package/node/hooks/features/columns/gridColumnsSelector.js +9 -2
- package/node/hooks/features/columns/useGridColumns.js +2 -0
- package/node/hooks/features/editing/useGridCellEditing.js +2 -3
- package/node/hooks/features/editing/useGridRowEditing.js +3 -5
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/rows/useGridRows.js +8 -4
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -13
- package/node/hooks/features/sorting/gridSortingUtils.js +9 -1
- package/node/hooks/features/sorting/useGridSorting.js +1 -2
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +1 -8
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +81 -136
- package/node/hooks/features/virtualization/useGridVirtualization.js +2 -7
- package/node/hooks/utils/useTimeout.js +13 -4
- package/node/index.js +1 -1
- package/node/internals/index.js +7 -0
- package/node/utils/keyboardUtils.js +25 -20
- package/node/utils/utils.js +12 -1
- package/package.json +1 -1
- package/utils/keyboardUtils.d.ts +7 -6
- package/utils/keyboardUtils.js +20 -11
- package/utils/utils.d.ts +4 -0
- package/utils/utils.js +9 -0
- package/legacy/DataGrid/DataGrid.js +0 -664
- package/legacy/DataGrid/index.js +0 -2
- package/legacy/DataGrid/useDataGridComponent.js +0 -81
- package/legacy/DataGrid/useDataGridProps.js +0 -98
- package/legacy/colDef/gridActionsColDef.js +0 -18
- package/legacy/colDef/gridBooleanColDef.js +0 -42
- package/legacy/colDef/gridBooleanOperators.js +0 -16
- package/legacy/colDef/gridCheckboxSelectionColDef.js +0 -33
- package/legacy/colDef/gridDateColDef.js +0 -62
- package/legacy/colDef/gridDateOperators.js +0 -115
- package/legacy/colDef/gridDefaultColumnTypes.js +0 -19
- package/legacy/colDef/gridNumericColDef.js +0 -19
- package/legacy/colDef/gridNumericOperators.js +0 -145
- package/legacy/colDef/gridSingleSelectColDef.js +0 -64
- package/legacy/colDef/gridSingleSelectOperators.js +0 -46
- package/legacy/colDef/gridStringColDef.js +0 -27
- package/legacy/colDef/gridStringOperators.js +0 -112
- package/legacy/colDef/index.js +0 -13
- package/legacy/components/GridApiContext.js +0 -5
- package/legacy/components/GridColumnHeaders.js +0 -94
- package/legacy/components/GridDetailPanels.js +0 -4
- package/legacy/components/GridFooter.js +0 -42
- package/legacy/components/GridHeader.js +0 -13
- package/legacy/components/GridHeaders.js +0 -53
- package/legacy/components/GridLoadingOverlay.js +0 -21
- package/legacy/components/GridNoResultsOverlay.js +0 -14
- package/legacy/components/GridNoRowsOverlay.js +0 -23
- package/legacy/components/GridPagination.js +0 -85
- package/legacy/components/GridPinnedRows.js +0 -4
- package/legacy/components/GridRow.js +0 -465
- package/legacy/components/GridRowCount.js +0 -63
- package/legacy/components/GridScrollbarFillerCell.js +0 -34
- package/legacy/components/GridSelectedRowCount.js +0 -66
- package/legacy/components/base/GridBody.js +0 -2
- package/legacy/components/base/GridFooterPlaceholder.js +0 -12
- package/legacy/components/base/GridOverlays.js +0 -122
- package/legacy/components/base/index.js +0 -3
- package/legacy/components/cell/GridActionsCell.js +0 -294
- package/legacy/components/cell/GridActionsCellItem.js +0 -69
- package/legacy/components/cell/GridBooleanCell.js +0 -121
- package/legacy/components/cell/GridCell.js +0 -350
- package/legacy/components/cell/GridEditBooleanCell.js +0 -174
- package/legacy/components/cell/GridEditDateCell.js +0 -230
- package/legacy/components/cell/GridEditInputCell.js +0 -198
- package/legacy/components/cell/GridEditSingleSelectCell.js +0 -231
- package/legacy/components/cell/GridSkeletonCell.js +0 -52
- package/legacy/components/cell/index.js +0 -9
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +0 -59
- package/legacy/components/columnHeaders/GridBaseColumnHeaders.js +0 -41
- package/legacy/components/columnHeaders/GridColumnGroupHeader.js +0 -132
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +0 -93
- package/legacy/components/columnHeaders/GridColumnHeaderItem.js +0 -212
- package/legacy/components/columnHeaders/GridColumnHeaderSeparator.js +0 -71
- package/legacy/components/columnHeaders/GridColumnHeaderSortIcon.js +0 -79
- package/legacy/components/columnHeaders/GridColumnHeaderTitle.js +0 -84
- package/legacy/components/columnHeaders/GridColumnHeadersInner.js +0 -55
- package/legacy/components/columnHeaders/GridGenericColumnHeaderItem.js +0 -107
- package/legacy/components/columnHeaders/GridIconButtonContainer.js +0 -41
- package/legacy/components/columnHeaders/index.js +0 -5
- package/legacy/components/columnSelection/GridCellCheckboxRenderer.js +0 -160
- package/legacy/components/columnSelection/GridHeaderCheckbox.js +0 -134
- package/legacy/components/columnSelection/index.js +0 -2
- package/legacy/components/columnsManagement/GridColumnsManagement.js +0 -307
- package/legacy/components/columnsManagement/index.js +0 -1
- package/legacy/components/columnsManagement/utils.js +0 -22
- package/legacy/components/containers/GridFooterContainer.js +0 -50
- package/legacy/components/containers/GridOverlay.js +0 -52
- package/legacy/components/containers/GridRoot.js +0 -79
- package/legacy/components/containers/GridRootStyles.js +0 -395
- package/legacy/components/containers/GridToolbarContainer.js +0 -59
- package/legacy/components/containers/index.js +0 -4
- package/legacy/components/index.js +0 -19
- package/legacy/components/menu/GridMenu.js +0 -132
- package/legacy/components/menu/columnMenu/GridColumnHeaderMenu.js +0 -61
- package/legacy/components/menu/columnMenu/GridColumnMenu.js +0 -81
- package/legacy/components/menu/columnMenu/GridColumnMenuContainer.js +0 -56
- package/legacy/components/menu/columnMenu/GridColumnMenuItemProps.js +0 -1
- package/legacy/components/menu/columnMenu/GridColumnMenuProps.js +0 -1
- package/legacy/components/menu/columnMenu/index.js +0 -9
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.js +0 -21
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +0 -60
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +0 -41
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +0 -80
- package/legacy/components/menu/columnMenu/menuItems/index.js +0 -5
- package/legacy/components/menu/index.js +0 -2
- package/legacy/components/panel/GridColumnsPanel.js +0 -22
- package/legacy/components/panel/GridPanel.js +0 -137
- package/legacy/components/panel/GridPanelContent.js +0 -49
- package/legacy/components/panel/GridPanelFooter.js +0 -50
- package/legacy/components/panel/GridPanelHeader.js +0 -48
- package/legacy/components/panel/GridPanelWrapper.js +0 -64
- package/legacy/components/panel/GridPreferencesPanel.js +0 -26
- package/legacy/components/panel/filterPanel/GridFilterForm.js +0 -528
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +0 -118
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +0 -121
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +0 -116
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +0 -102
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +0 -149
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +0 -106
- package/legacy/components/panel/filterPanel/GridFilterInputValueProps.js +0 -1
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +0 -264
- package/legacy/components/panel/filterPanel/filterPanelUtils.js +0 -22
- package/legacy/components/panel/filterPanel/index.js +0 -9
- package/legacy/components/panel/index.js +0 -7
- package/legacy/components/reexportable.js +0 -1
- package/legacy/components/toolbar/GridToolbar.js +0 -64
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +0 -68
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +0 -142
- package/legacy/components/toolbar/GridToolbarExport.js +0 -80
- package/legacy/components/toolbar/GridToolbarExportContainer.js +0 -105
- package/legacy/components/toolbar/GridToolbarFilterButton.js +0 -136
- package/legacy/components/toolbar/GridToolbarQuickFilter.js +0 -164
- package/legacy/components/toolbar/index.js +0 -7
- package/legacy/components/virtualization/GridBottomContainer.js +0 -25
- package/legacy/components/virtualization/GridMainContainer.js +0 -20
- package/legacy/components/virtualization/GridTopContainer.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollbar.js +0 -129
- package/legacy/components/virtualization/GridVirtualScroller.js +0 -93
- package/legacy/components/virtualization/GridVirtualScrollerContent.js +0 -35
- package/legacy/components/virtualization/GridVirtualScrollerFiller.js +0 -70
- package/legacy/components/virtualization/GridVirtualScrollerRenderZone.js +0 -49
- package/legacy/constants/defaultGridSlotsComponents.js +0 -33
- package/legacy/constants/envConstants.js +0 -19
- package/legacy/constants/gridClasses.js +0 -5
- package/legacy/constants/gridDetailPanelToggleField.js +0 -2
- package/legacy/constants/index.js +0 -3
- package/legacy/constants/localeTextConstants.js +0 -158
- package/legacy/context/GridContextProvider.js +0 -21
- package/legacy/context/GridRootPropsContext.js +0 -6
- package/legacy/context/index.js +0 -1
- package/legacy/hooks/core/gridCoreSelector.js +0 -7
- package/legacy/hooks/core/index.js +0 -1
- package/legacy/hooks/core/pipeProcessing/gridPipeProcessingApi.js +0 -1
- package/legacy/hooks/core/pipeProcessing/index.js +0 -4
- package/legacy/hooks/core/pipeProcessing/useGridPipeProcessing.js +0 -114
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeApplier.js +0 -26
- package/legacy/hooks/core/pipeProcessing/useGridRegisterPipeProcessor.js +0 -26
- package/legacy/hooks/core/strategyProcessing/gridStrategyProcessingApi.js +0 -1
- package/legacy/hooks/core/strategyProcessing/index.js +0 -3
- package/legacy/hooks/core/strategyProcessing/useGridRegisterStrategyProcessor.js +0 -18
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +0 -116
- package/legacy/hooks/core/useGridApiInitialization.js +0 -124
- package/legacy/hooks/core/useGridInitialization.js +0 -26
- package/legacy/hooks/core/useGridLocaleText.js +0 -12
- package/legacy/hooks/core/useGridLoggerFactory.js +0 -51
- package/legacy/hooks/core/useGridRefs.js +0 -13
- package/legacy/hooks/core/useGridStateInitialization.js +0 -106
- package/legacy/hooks/core/useGridTheme.js +0 -21
- package/legacy/hooks/features/clipboard/useGridClipboard.js +0 -92
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsInterfaces.js +0 -1
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsSelector.js +0 -24
- package/legacy/hooks/features/columnGrouping/gridColumnGroupsUtils.js +0 -92
- package/legacy/hooks/features/columnGrouping/index.js +0 -2
- package/legacy/hooks/features/columnGrouping/useGridColumnGrouping.js +0 -140
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +0 -272
- package/legacy/hooks/features/columnMenu/columnMenuInterfaces.js +0 -1
- package/legacy/hooks/features/columnMenu/columnMenuSelector.js +0 -3
- package/legacy/hooks/features/columnMenu/index.js +0 -2
- package/legacy/hooks/features/columnMenu/useGridColumnMenu.js +0 -108
- package/legacy/hooks/features/columnMenu/useGridColumnMenuSlots.js +0 -71
- package/legacy/hooks/features/columns/gridColumnsInterfaces.js +0 -9
- package/legacy/hooks/features/columns/gridColumnsSelector.js +0 -174
- package/legacy/hooks/features/columns/gridColumnsUtils.js +0 -338
- package/legacy/hooks/features/columns/index.js +0 -2
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +0 -105
- package/legacy/hooks/features/columns/useGridColumns.js +0 -319
- package/legacy/hooks/features/density/densitySelector.js +0 -10
- package/legacy/hooks/features/density/densityState.js +0 -1
- package/legacy/hooks/features/density/index.js +0 -2
- package/legacy/hooks/features/density/useGridDensity.js +0 -48
- package/legacy/hooks/features/dimensions/gridDimensionsApi.js +0 -1
- package/legacy/hooks/features/dimensions/gridDimensionsSelectors.js +0 -3
- package/legacy/hooks/features/dimensions/index.js +0 -2
- package/legacy/hooks/features/dimensions/useGridDimensions.js +0 -302
- package/legacy/hooks/features/editing/gridEditingSelectors.js +0 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +0 -456
- package/legacy/hooks/features/editing/useGridEditing.js +0 -145
- package/legacy/hooks/features/editing/useGridRowEditing.js +0 -567
- package/legacy/hooks/features/events/useGridEvents.js +0 -23
- package/legacy/hooks/features/export/serializers/csvSerializer.js +0 -155
- package/legacy/hooks/features/export/useGridCsvExport.js +0 -75
- package/legacy/hooks/features/export/useGridPrintExport.js +0 -313
- package/legacy/hooks/features/export/utils.js +0 -49
- package/legacy/hooks/features/filter/gridFilterSelector.js +0 -165
- package/legacy/hooks/features/filter/gridFilterState.js +0 -20
- package/legacy/hooks/features/filter/gridFilterUtils.js +0 -330
- package/legacy/hooks/features/filter/index.js +0 -2
- package/legacy/hooks/features/filter/useGridFilter.js +0 -378
- package/legacy/hooks/features/focus/gridFocusState.js +0 -1
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +0 -31
- package/legacy/hooks/features/focus/index.js +0 -2
- package/legacy/hooks/features/focus/useGridFocus.js +0 -408
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +0 -10
- package/legacy/hooks/features/headerFiltering/index.js +0 -1
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +0 -93
- package/legacy/hooks/features/index.js +0 -16
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +0 -565
- package/legacy/hooks/features/pagination/gridPaginationInterfaces.js +0 -1
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +0 -115
- package/legacy/hooks/features/pagination/gridPaginationUtils.js +0 -31
- package/legacy/hooks/features/pagination/index.js +0 -2
- package/legacy/hooks/features/pagination/useGridPagination.js +0 -175
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelSelector.js +0 -3
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelState.js +0 -1
- package/legacy/hooks/features/preferencesPanel/gridPreferencePanelsValue.js +0 -6
- package/legacy/hooks/features/preferencesPanel/index.js +0 -3
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +0 -125
- package/legacy/hooks/features/rowSelection/gridRowSelectionSelector.js +0 -19
- package/legacy/hooks/features/rowSelection/index.js +0 -1
- package/legacy/hooks/features/rowSelection/useGridRowSelection.js +0 -419
- package/legacy/hooks/features/rowSelection/useGridRowSelectionPreProcessors.js +0 -45
- package/legacy/hooks/features/rowSelection/utils.js +0 -8
- package/legacy/hooks/features/rows/gridRowsInterfaces.js +0 -1
- package/legacy/hooks/features/rows/gridRowsMetaSelector.js +0 -3
- package/legacy/hooks/features/rows/gridRowsMetaState.js +0 -1
- package/legacy/hooks/features/rows/gridRowsSelector.js +0 -90
- package/legacy/hooks/features/rows/gridRowsUtils.js +0 -294
- package/legacy/hooks/features/rows/index.js +0 -4
- package/legacy/hooks/features/rows/useGridParamsApi.js +0 -142
- package/legacy/hooks/features/rows/useGridRows.js +0 -466
- package/legacy/hooks/features/rows/useGridRowsMeta.js +0 -236
- package/legacy/hooks/features/rows/useGridRowsPreProcessors.js +0 -82
- package/legacy/hooks/features/scroll/useGridScroll.js +0 -133
- package/legacy/hooks/features/sorting/gridSortingSelector.js +0 -56
- package/legacy/hooks/features/sorting/gridSortingState.js +0 -1
- package/legacy/hooks/features/sorting/gridSortingUtils.js +0 -154
- package/legacy/hooks/features/sorting/index.js +0 -2
- package/legacy/hooks/features/sorting/useGridSorting.js +0 -276
- package/legacy/hooks/features/statePersistence/gridStatePersistenceInterface.js +0 -1
- package/legacy/hooks/features/statePersistence/index.js +0 -1
- package/legacy/hooks/features/statePersistence/useGridStatePersistence.js +0 -25
- package/legacy/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -61
- package/legacy/hooks/features/virtualization/index.js +0 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +0 -646
- package/legacy/hooks/features/virtualization/useGridVirtualization.js +0 -63
- package/legacy/hooks/index.js +0 -3
- package/legacy/hooks/utils/index.js +0 -9
- package/legacy/hooks/utils/useFirstRender.js +0 -8
- package/legacy/hooks/utils/useGridApiContext.js +0 -9
- package/legacy/hooks/utils/useGridApiEventHandler.js +0 -105
- package/legacy/hooks/utils/useGridApiMethod.js +0 -11
- package/legacy/hooks/utils/useGridApiRef.js +0 -7
- package/legacy/hooks/utils/useGridAriaAttributes.js +0 -25
- package/legacy/hooks/utils/useGridInitializeState.js +0 -8
- package/legacy/hooks/utils/useGridLogger.js +0 -10
- package/legacy/hooks/utils/useGridNativeEventListener.js +0 -32
- package/legacy/hooks/utils/useGridPrivateApiContext.js +0 -12
- package/legacy/hooks/utils/useGridRootProps.js +0 -9
- package/legacy/hooks/utils/useGridSelector.js +0 -54
- package/legacy/hooks/utils/useGridVisibleRows.js +0 -42
- package/legacy/hooks/utils/useLazyRef.js +0 -11
- package/legacy/hooks/utils/useOnMount.js +0 -7
- package/legacy/hooks/utils/useResizeObserver.js +0 -36
- package/legacy/hooks/utils/useRunOnce.js +0 -18
- package/legacy/hooks/utils/useTimeout.js +0 -38
- package/legacy/index.js +0 -38
- package/legacy/internals/index.js +0 -68
- package/legacy/internals/utils/computeSlots.js +0 -17
- package/legacy/internals/utils/index.js +0 -3
- package/legacy/internals/utils/propValidation.js +0 -21
- package/legacy/internals/utils/useProps.js +0 -32
- package/legacy/joy/icons.js +0 -432
- package/legacy/joy/index.js +0 -2
- package/legacy/joy/joySlots.js +0 -420
- package/legacy/locales/arSD.js +0 -160
- package/legacy/locales/beBY.js +0 -184
- package/legacy/locales/bgBG.js +0 -160
- package/legacy/locales/coreLocales.js +0 -62
- package/legacy/locales/csCZ.js +0 -181
- package/legacy/locales/daDK.js +0 -160
- package/legacy/locales/deDE.js +0 -160
- package/legacy/locales/elGR.js +0 -160
- package/legacy/locales/enUS.js +0 -4
- package/legacy/locales/esES.js +0 -160
- package/legacy/locales/faIR.js +0 -160
- package/legacy/locales/fiFI.js +0 -160
- package/legacy/locales/frFR.js +0 -160
- package/legacy/locales/heIL.js +0 -160
- package/legacy/locales/hrHR.js +0 -160
- package/legacy/locales/huHU.js +0 -160
- package/legacy/locales/index.js +0 -35
- package/legacy/locales/itIT.js +0 -160
- package/legacy/locales/jaJP.js +0 -160
- package/legacy/locales/koKR.js +0 -162
- package/legacy/locales/nbNO.js +0 -162
- package/legacy/locales/nlNL.js +0 -160
- package/legacy/locales/plPL.js +0 -163
- package/legacy/locales/ptBR.js +0 -160
- package/legacy/locales/ptPT.js +0 -160
- package/legacy/locales/roRO.js +0 -160
- package/legacy/locales/ruRU.js +0 -181
- package/legacy/locales/skSK.js +0 -181
- package/legacy/locales/svSE.js +0 -160
- package/legacy/locales/trTR.js +0 -161
- package/legacy/locales/ukUA.js +0 -182
- package/legacy/locales/urPK.js +0 -160
- package/legacy/locales/viVN.js +0 -160
- package/legacy/locales/zhCN.js +0 -160
- package/legacy/locales/zhHK.js +0 -160
- package/legacy/locales/zhTW.js +0 -160
- package/legacy/material/components/MUISelectOption.js +0 -14
- package/legacy/material/icons/GridColumnUnsortedIcon.js +0 -16
- package/legacy/material/icons/index.js +0 -89
- package/legacy/material/index.js +0 -69
- package/legacy/models/api/gridApiCommon.js +0 -1
- package/legacy/models/api/gridApiCommunity.js +0 -1
- package/legacy/models/api/gridCallbackDetails.js +0 -1
- package/legacy/models/api/gridColumnApi.js +0 -1
- package/legacy/models/api/gridColumnGroupingApi.js +0 -1
- package/legacy/models/api/gridColumnMenuApi.js +0 -1
- package/legacy/models/api/gridColumnSpanning.js +0 -1
- package/legacy/models/api/gridCoreApi.js +0 -1
- package/legacy/models/api/gridCsvExportApi.js +0 -1
- package/legacy/models/api/gridDensityApi.js +0 -1
- package/legacy/models/api/gridEditingApi.js +0 -1
- package/legacy/models/api/gridFilterApi.js +0 -1
- package/legacy/models/api/gridFocusApi.js +0 -1
- package/legacy/models/api/gridHeaderFilteringApi.js +0 -1
- package/legacy/models/api/gridLocaleTextApi.js +0 -1
- package/legacy/models/api/gridLoggerApi.js +0 -1
- package/legacy/models/api/gridParamsApi.js +0 -1
- package/legacy/models/api/gridPreferencesPanelApi.js +0 -1
- package/legacy/models/api/gridPrintExportApi.js +0 -1
- package/legacy/models/api/gridRowApi.js +0 -1
- package/legacy/models/api/gridRowSelectionApi.js +0 -1
- package/legacy/models/api/gridRowsMetaApi.js +0 -1
- package/legacy/models/api/gridScrollApi.js +0 -1
- package/legacy/models/api/gridSortApi.js +0 -1
- package/legacy/models/api/gridStateApi.js +0 -1
- package/legacy/models/api/gridVirtualizationApi.js +0 -1
- package/legacy/models/api/index.js +0 -16
- package/legacy/models/colDef/gridColDef.js +0 -1
- package/legacy/models/colDef/gridColType.js +0 -1
- package/legacy/models/colDef/gridColumnTypesRecord.js +0 -1
- package/legacy/models/colDef/index.js +0 -6
- package/legacy/models/controlStateItem.js +0 -1
- package/legacy/models/cursorCoordinates.js +0 -1
- package/legacy/models/elementSize.js +0 -1
- package/legacy/models/events/gridEventListener.js +0 -1
- package/legacy/models/events/gridEventLookup.js +0 -1
- package/legacy/models/events/gridEventPublisher.js +0 -1
- package/legacy/models/events/index.js +0 -3
- package/legacy/models/gridApiCaches.js +0 -1
- package/legacy/models/gridCell.js +0 -1
- package/legacy/models/gridCellClass.js +0 -1
- package/legacy/models/gridColumnGrouping.js +0 -11
- package/legacy/models/gridColumnHeaderClass.js +0 -1
- package/legacy/models/gridColumnSpanning.js +0 -1
- package/legacy/models/gridDensity.js +0 -1
- package/legacy/models/gridEditRowModel.js +0 -16
- package/legacy/models/gridExport.js +0 -1
- package/legacy/models/gridFeatureMode.js +0 -1
- package/legacy/models/gridFilterItem.js +0 -11
- package/legacy/models/gridFilterModel.js +0 -1
- package/legacy/models/gridFilterOperator.js +0 -1
- package/legacy/models/gridHeaderFilteringModel.js +0 -1
- package/legacy/models/gridIconSlotsComponent.js +0 -1
- package/legacy/models/gridPaginationProps.js +0 -1
- package/legacy/models/gridRenderContextProps.js +0 -1
- package/legacy/models/gridRowSelectionModel.js +0 -1
- package/legacy/models/gridRows.js +0 -1
- package/legacy/models/gridSlotsComponent.js +0 -1
- package/legacy/models/gridSlotsComponentsProps.js +0 -1
- package/legacy/models/gridSortModel.js +0 -1
- package/legacy/models/gridStateCommunity.js +0 -1
- package/legacy/models/index.js +0 -29
- package/legacy/models/logger.js +0 -1
- package/legacy/models/muiEvent.js +0 -1
- package/legacy/models/params/gridCellParams.js +0 -1
- package/legacy/models/params/gridColumnGroupHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnHeaderParams.js +0 -1
- package/legacy/models/params/gridColumnOrderChangeParams.js +0 -1
- package/legacy/models/params/gridColumnResizeParams.js +0 -1
- package/legacy/models/params/gridEditCellParams.js +0 -27
- package/legacy/models/params/gridHeaderSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridMenuParams.js +0 -1
- package/legacy/models/params/gridPreferencePanelParams.js +0 -1
- package/legacy/models/params/gridRowParams.js +0 -44
- package/legacy/models/params/gridRowSelectionCheckboxParams.js +0 -1
- package/legacy/models/params/gridScrollParams.js +0 -1
- package/legacy/models/params/gridValueOptionsParams.js +0 -1
- package/legacy/models/params/index.js +0 -13
- package/legacy/models/props/DataGridProps.js +0 -1
- package/legacy/themeAugmentation/index.js +0 -4
- package/legacy/themeAugmentation/overrides.js +0 -1
- package/legacy/themeAugmentation/props.js +0 -1
- package/legacy/utils/EventManager.js +0 -91
- package/legacy/utils/Store.js +0 -34
- package/legacy/utils/cleanupTracking/CleanupTracking.js +0 -1
- package/legacy/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.js +0 -29
- package/legacy/utils/cleanupTracking/TimerBasedCleanupTracking.js +0 -52
- package/legacy/utils/createControllablePromise.js +0 -11
- package/legacy/utils/createSelector.js +0 -120
- package/legacy/utils/doesSupportPreventScroll.js +0 -13
- package/legacy/utils/domUtils.js +0 -49
- package/legacy/utils/exportAs.js +0 -40
- package/legacy/utils/fastMemo.js +0 -5
- package/legacy/utils/fastObjectShallowCompare.js +0 -32
- package/legacy/utils/getGridLocalization.js +0 -15
- package/legacy/utils/getPublicApiRef.js +0 -5
- package/legacy/utils/index.js +0 -1
- package/legacy/utils/keyboardUtils.js +0 -60
- package/legacy/utils/utils.js +0 -189
- package/legacy/utils/warning.js +0 -25
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useFirstRender } from '../../utils/useFirstRender';
|
|
3
|
-
export var useGridRegisterPipeApplier = function useGridRegisterPipeApplier(apiRef, group, callback) {
|
|
4
|
-
var cleanup = React.useRef();
|
|
5
|
-
var id = React.useRef("mui-".concat(Math.round(Math.random() * 1e9)));
|
|
6
|
-
var registerPreProcessor = React.useCallback(function () {
|
|
7
|
-
cleanup.current = apiRef.current.registerPipeApplier(group, id.current, callback);
|
|
8
|
-
}, [apiRef, callback, group]);
|
|
9
|
-
useFirstRender(function () {
|
|
10
|
-
registerPreProcessor();
|
|
11
|
-
});
|
|
12
|
-
var isFirstRender = React.useRef(true);
|
|
13
|
-
React.useEffect(function () {
|
|
14
|
-
if (isFirstRender.current) {
|
|
15
|
-
isFirstRender.current = false;
|
|
16
|
-
} else {
|
|
17
|
-
registerPreProcessor();
|
|
18
|
-
}
|
|
19
|
-
return function () {
|
|
20
|
-
if (cleanup.current) {
|
|
21
|
-
cleanup.current();
|
|
22
|
-
cleanup.current = null;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}, [registerPreProcessor]);
|
|
26
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useFirstRender } from '../../utils/useFirstRender';
|
|
3
|
-
export var useGridRegisterPipeProcessor = function useGridRegisterPipeProcessor(apiRef, group, callback) {
|
|
4
|
-
var cleanup = React.useRef();
|
|
5
|
-
var id = React.useRef("mui-".concat(Math.round(Math.random() * 1e9)));
|
|
6
|
-
var registerPreProcessor = React.useCallback(function () {
|
|
7
|
-
cleanup.current = apiRef.current.registerPipeProcessor(group, id.current, callback);
|
|
8
|
-
}, [apiRef, callback, group]);
|
|
9
|
-
useFirstRender(function () {
|
|
10
|
-
registerPreProcessor();
|
|
11
|
-
});
|
|
12
|
-
var isFirstRender = React.useRef(true);
|
|
13
|
-
React.useEffect(function () {
|
|
14
|
-
if (isFirstRender.current) {
|
|
15
|
-
isFirstRender.current = false;
|
|
16
|
-
} else {
|
|
17
|
-
registerPreProcessor();
|
|
18
|
-
}
|
|
19
|
-
return function () {
|
|
20
|
-
if (cleanup.current) {
|
|
21
|
-
cleanup.current();
|
|
22
|
-
cleanup.current = null;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}, [registerPreProcessor]);
|
|
26
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useFirstRender } from '../../utils/useFirstRender';
|
|
3
|
-
export var useGridRegisterStrategyProcessor = function useGridRegisterStrategyProcessor(apiRef, strategyName, group, processor) {
|
|
4
|
-
var registerPreProcessor = React.useCallback(function () {
|
|
5
|
-
apiRef.current.registerStrategyProcessor(strategyName, group, processor);
|
|
6
|
-
}, [apiRef, processor, group, strategyName]);
|
|
7
|
-
useFirstRender(function () {
|
|
8
|
-
registerPreProcessor();
|
|
9
|
-
});
|
|
10
|
-
var isFirstRender = React.useRef(true);
|
|
11
|
-
React.useEffect(function () {
|
|
12
|
-
if (isFirstRender.current) {
|
|
13
|
-
isFirstRender.current = false;
|
|
14
|
-
} else {
|
|
15
|
-
registerPreProcessor();
|
|
16
|
-
}
|
|
17
|
-
}, [registerPreProcessor]);
|
|
18
|
-
};
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
-
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { useGridApiMethod } from '../../utils/useGridApiMethod';
|
|
6
|
-
export var GRID_DEFAULT_STRATEGY = 'none';
|
|
7
|
-
export var GRID_STRATEGIES_PROCESSORS = {
|
|
8
|
-
rowTreeCreation: 'rowTree',
|
|
9
|
-
filtering: 'rowTree',
|
|
10
|
-
sorting: 'rowTree',
|
|
11
|
-
visibleRowsLookupCreation: 'rowTree'
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Implements a variant of the Strategy Pattern (see https://en.wikipedia.org/wiki/Strategy_pattern)
|
|
15
|
-
*
|
|
16
|
-
* More information and detailed example in (TODO add link to technical doc when ready)
|
|
17
|
-
*
|
|
18
|
-
* Some plugins contains custom logic that must only be applied if the right strategy is active.
|
|
19
|
-
* For instance, the row grouping plugin has a custom filtering algorithm.
|
|
20
|
-
* This algorithm must be applied by the filtering plugin if the row grouping is the current way of grouping rows,
|
|
21
|
-
* but not if the tree data is the current way of grouping rows.
|
|
22
|
-
*
|
|
23
|
-
* =====================================================================================================================
|
|
24
|
-
*
|
|
25
|
-
* The plugin containing the custom logic must use:
|
|
26
|
-
*
|
|
27
|
-
* - `useGridRegisterStrategyProcessor` to register their processor.
|
|
28
|
-
* When the processor of the active strategy changes, it will fire `"activeStrategyProcessorChange"` to re-apply the processor.
|
|
29
|
-
*
|
|
30
|
-
* - `apiRef.current.setStrategyAvailability` to tell if their strategy can be used.
|
|
31
|
-
*
|
|
32
|
-
* =====================================================================================================================
|
|
33
|
-
*
|
|
34
|
-
* The plugin or component that needs to apply the custom logic of the current strategy must use:
|
|
35
|
-
*
|
|
36
|
-
* - `apiRef.current.applyStrategyProcessor` to run the processor of the active strategy for a given processor name.
|
|
37
|
-
*
|
|
38
|
-
* - the "strategyAvailabilityChange" event to update something when the active strategy changes.
|
|
39
|
-
* Warning: Be careful not to apply the processor several times.
|
|
40
|
-
* For instance "rowsSet" is fired by `useGridRows` whenever the active strategy changes.
|
|
41
|
-
* So listening to both would most likely run your logic twice.
|
|
42
|
-
*
|
|
43
|
-
* - The "activeStrategyProcessorChange" event to update something when the processor of the active strategy changes.
|
|
44
|
-
*
|
|
45
|
-
* =====================================================================================================================
|
|
46
|
-
*
|
|
47
|
-
* Each processor name is part of a strategy group which can only have one active strategy at the time.
|
|
48
|
-
* For now, there is only one strategy group named `rowTree` which customize
|
|
49
|
-
* - row tree creation algorithm.
|
|
50
|
-
* - sorting algorithm.
|
|
51
|
-
* - filtering algorithm.
|
|
52
|
-
*/
|
|
53
|
-
export var useGridStrategyProcessing = function useGridStrategyProcessing(apiRef) {
|
|
54
|
-
var availableStrategies = React.useRef(new Map());
|
|
55
|
-
var strategiesCache = React.useRef({});
|
|
56
|
-
var registerStrategyProcessor = React.useCallback(function (strategyName, processorName, processor) {
|
|
57
|
-
var cleanup = function cleanup() {
|
|
58
|
-
var _ref = strategiesCache.current[processorName],
|
|
59
|
-
removedPreProcessor = _ref[strategyName],
|
|
60
|
-
otherProcessors = _objectWithoutProperties(_ref, [strategyName].map(_toPropertyKey));
|
|
61
|
-
strategiesCache.current[processorName] = otherProcessors;
|
|
62
|
-
};
|
|
63
|
-
if (!strategiesCache.current[processorName]) {
|
|
64
|
-
strategiesCache.current[processorName] = {};
|
|
65
|
-
}
|
|
66
|
-
var groupPreProcessors = strategiesCache.current[processorName];
|
|
67
|
-
var previousProcessor = groupPreProcessors[strategyName];
|
|
68
|
-
groupPreProcessors[strategyName] = processor;
|
|
69
|
-
if (!previousProcessor || previousProcessor === processor) {
|
|
70
|
-
return cleanup;
|
|
71
|
-
}
|
|
72
|
-
if (strategyName === apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName])) {
|
|
73
|
-
apiRef.current.publishEvent('activeStrategyProcessorChange', processorName);
|
|
74
|
-
}
|
|
75
|
-
return cleanup;
|
|
76
|
-
}, [apiRef]);
|
|
77
|
-
var applyStrategyProcessor = React.useCallback(function (processorName, params) {
|
|
78
|
-
var activeStrategy = apiRef.current.getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName]);
|
|
79
|
-
if (activeStrategy == null) {
|
|
80
|
-
throw new Error("Can't apply a strategy processor before defining an active strategy");
|
|
81
|
-
}
|
|
82
|
-
var groupCache = strategiesCache.current[processorName];
|
|
83
|
-
if (!groupCache || !groupCache[activeStrategy]) {
|
|
84
|
-
throw new Error("No processor found for processor \"".concat(processorName, "\" on strategy \"").concat(activeStrategy, "\""));
|
|
85
|
-
}
|
|
86
|
-
var processor = groupCache[activeStrategy];
|
|
87
|
-
return processor(params);
|
|
88
|
-
}, [apiRef]);
|
|
89
|
-
var getActiveStrategy = React.useCallback(function (strategyGroup) {
|
|
90
|
-
var _availableStrategyEnt;
|
|
91
|
-
var strategyEntries = Array.from(availableStrategies.current.entries());
|
|
92
|
-
var availableStrategyEntry = strategyEntries.find(function (_ref2) {
|
|
93
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
94
|
-
strategy = _ref3[1];
|
|
95
|
-
if (strategy.group !== strategyGroup) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
return strategy.isAvailable();
|
|
99
|
-
});
|
|
100
|
-
return (_availableStrategyEnt = availableStrategyEntry == null ? void 0 : availableStrategyEntry[0]) != null ? _availableStrategyEnt : GRID_DEFAULT_STRATEGY;
|
|
101
|
-
}, []);
|
|
102
|
-
var setStrategyAvailability = React.useCallback(function (strategyGroup, strategyName, isAvailable) {
|
|
103
|
-
availableStrategies.current.set(strategyName, {
|
|
104
|
-
group: strategyGroup,
|
|
105
|
-
isAvailable: isAvailable
|
|
106
|
-
});
|
|
107
|
-
apiRef.current.publishEvent('strategyAvailabilityChange');
|
|
108
|
-
}, [apiRef]);
|
|
109
|
-
var strategyProcessingApi = {
|
|
110
|
-
registerStrategyProcessor: registerStrategyProcessor,
|
|
111
|
-
applyStrategyProcessor: applyStrategyProcessor,
|
|
112
|
-
getActiveStrategy: getActiveStrategy,
|
|
113
|
-
setStrategyAvailability: setStrategyAvailability
|
|
114
|
-
};
|
|
115
|
-
useGridApiMethod(apiRef, strategyProcessingApi, 'private');
|
|
116
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Store } from '../../utils/Store';
|
|
4
|
-
import { useGridApiMethod } from '../utils/useGridApiMethod';
|
|
5
|
-
import { GridSignature } from '../utils/useGridApiEventHandler';
|
|
6
|
-
import { EventManager } from '../../utils/EventManager';
|
|
7
|
-
var SYMBOL_API_PRIVATE = Symbol('mui.api_private');
|
|
8
|
-
var isSyntheticEvent = function isSyntheticEvent(event) {
|
|
9
|
-
return event.isPropagationStopped !== undefined;
|
|
10
|
-
};
|
|
11
|
-
export function unwrapPrivateAPI(publicApi) {
|
|
12
|
-
return publicApi[SYMBOL_API_PRIVATE];
|
|
13
|
-
}
|
|
14
|
-
var globalId = 0;
|
|
15
|
-
function createPrivateAPI(publicApiRef) {
|
|
16
|
-
var _publicApiRef$current;
|
|
17
|
-
var existingPrivateApi = (_publicApiRef$current = publicApiRef.current) == null ? void 0 : _publicApiRef$current[SYMBOL_API_PRIVATE];
|
|
18
|
-
if (existingPrivateApi) {
|
|
19
|
-
return existingPrivateApi;
|
|
20
|
-
}
|
|
21
|
-
var state = {};
|
|
22
|
-
var privateApi = {
|
|
23
|
-
state: state,
|
|
24
|
-
store: Store.create(state),
|
|
25
|
-
instanceId: {
|
|
26
|
-
id: globalId
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
globalId += 1;
|
|
30
|
-
privateApi.getPublicApi = function () {
|
|
31
|
-
return publicApiRef.current;
|
|
32
|
-
};
|
|
33
|
-
privateApi.register = function (visibility, methods) {
|
|
34
|
-
Object.keys(methods).forEach(function (methodName) {
|
|
35
|
-
var method = methods[methodName];
|
|
36
|
-
var currentPrivateMethod = privateApi[methodName];
|
|
37
|
-
if ((currentPrivateMethod == null ? void 0 : currentPrivateMethod.spying) === true) {
|
|
38
|
-
currentPrivateMethod.target = method;
|
|
39
|
-
} else {
|
|
40
|
-
privateApi[methodName] = method;
|
|
41
|
-
}
|
|
42
|
-
if (visibility === 'public') {
|
|
43
|
-
var publicApi = publicApiRef.current;
|
|
44
|
-
var currentPublicMethod = publicApi[methodName];
|
|
45
|
-
if ((currentPublicMethod == null ? void 0 : currentPublicMethod.spying) === true) {
|
|
46
|
-
currentPublicMethod.target = method;
|
|
47
|
-
} else {
|
|
48
|
-
publicApi[methodName] = method;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
privateApi.register('private', {
|
|
54
|
-
caches: {},
|
|
55
|
-
eventManager: new EventManager()
|
|
56
|
-
});
|
|
57
|
-
return privateApi;
|
|
58
|
-
}
|
|
59
|
-
function createPublicAPI(privateApiRef) {
|
|
60
|
-
var publicApi = _defineProperty({
|
|
61
|
-
get state() {
|
|
62
|
-
return privateApiRef.current.state;
|
|
63
|
-
},
|
|
64
|
-
get store() {
|
|
65
|
-
return privateApiRef.current.store;
|
|
66
|
-
},
|
|
67
|
-
get instanceId() {
|
|
68
|
-
return privateApiRef.current.instanceId;
|
|
69
|
-
}
|
|
70
|
-
}, SYMBOL_API_PRIVATE, privateApiRef.current);
|
|
71
|
-
return publicApi;
|
|
72
|
-
}
|
|
73
|
-
export function useGridApiInitialization(inputApiRef, props) {
|
|
74
|
-
var _inputApiRef$current;
|
|
75
|
-
var publicApiRef = React.useRef();
|
|
76
|
-
var privateApiRef = React.useRef();
|
|
77
|
-
if (!privateApiRef.current) {
|
|
78
|
-
privateApiRef.current = createPrivateAPI(publicApiRef);
|
|
79
|
-
}
|
|
80
|
-
if (!publicApiRef.current) {
|
|
81
|
-
publicApiRef.current = createPublicAPI(privateApiRef);
|
|
82
|
-
}
|
|
83
|
-
var publishEvent = React.useCallback(function () {
|
|
84
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
85
|
-
args[_key] = arguments[_key];
|
|
86
|
-
}
|
|
87
|
-
var name = args[0],
|
|
88
|
-
params = args[1],
|
|
89
|
-
_args$ = args[2],
|
|
90
|
-
event = _args$ === void 0 ? {} : _args$;
|
|
91
|
-
event.defaultMuiPrevented = false;
|
|
92
|
-
if (isSyntheticEvent(event) && event.isPropagationStopped()) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
var details = props.signature === GridSignature.DataGridPro ? {
|
|
96
|
-
api: privateApiRef.current.getPublicApi()
|
|
97
|
-
} : {};
|
|
98
|
-
privateApiRef.current.eventManager.emit(name, params, event, details);
|
|
99
|
-
}, [privateApiRef, props.signature]);
|
|
100
|
-
var subscribeEvent = React.useCallback(function (event, handler, options) {
|
|
101
|
-
privateApiRef.current.eventManager.on(event, handler, options);
|
|
102
|
-
var api = privateApiRef.current;
|
|
103
|
-
return function () {
|
|
104
|
-
api.eventManager.removeListener(event, handler);
|
|
105
|
-
};
|
|
106
|
-
}, [privateApiRef]);
|
|
107
|
-
useGridApiMethod(privateApiRef, {
|
|
108
|
-
subscribeEvent: subscribeEvent,
|
|
109
|
-
publishEvent: publishEvent
|
|
110
|
-
}, 'public');
|
|
111
|
-
if (inputApiRef && !((_inputApiRef$current = inputApiRef.current) != null && _inputApiRef$current.state)) {
|
|
112
|
-
inputApiRef.current = publicApiRef.current;
|
|
113
|
-
}
|
|
114
|
-
React.useImperativeHandle(inputApiRef, function () {
|
|
115
|
-
return publicApiRef.current;
|
|
116
|
-
}, [publicApiRef]);
|
|
117
|
-
React.useEffect(function () {
|
|
118
|
-
var api = privateApiRef.current;
|
|
119
|
-
return function () {
|
|
120
|
-
api.publishEvent('unmount');
|
|
121
|
-
};
|
|
122
|
-
}, [privateApiRef]);
|
|
123
|
-
return privateApiRef;
|
|
124
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useGridRefs } from './useGridRefs';
|
|
2
|
-
import { useGridTheme } from './useGridTheme';
|
|
3
|
-
import { useGridLoggerFactory } from './useGridLoggerFactory';
|
|
4
|
-
import { useGridApiInitialization } from './useGridApiInitialization';
|
|
5
|
-
import { useGridLocaleText } from './useGridLocaleText';
|
|
6
|
-
import { useGridPipeProcessing } from './pipeProcessing';
|
|
7
|
-
import { useGridStrategyProcessing } from './strategyProcessing';
|
|
8
|
-
import { useGridStateInitialization } from './useGridStateInitialization';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs
|
|
12
|
-
*/
|
|
13
|
-
export var useGridInitialization = function useGridInitialization(inputApiRef, props) {
|
|
14
|
-
var privateApiRef = useGridApiInitialization(inputApiRef, props);
|
|
15
|
-
useGridRefs(privateApiRef);
|
|
16
|
-
useGridTheme(privateApiRef);
|
|
17
|
-
useGridLoggerFactory(privateApiRef, props);
|
|
18
|
-
useGridStateInitialization(privateApiRef, props);
|
|
19
|
-
useGridPipeProcessing(privateApiRef);
|
|
20
|
-
useGridStrategyProcessing(privateApiRef);
|
|
21
|
-
useGridLocaleText(privateApiRef, props);
|
|
22
|
-
privateApiRef.current.register('private', {
|
|
23
|
-
rootProps: props
|
|
24
|
-
});
|
|
25
|
-
return privateApiRef;
|
|
26
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export var useGridLocaleText = function useGridLocaleText(apiRef, props) {
|
|
3
|
-
var getLocaleText = React.useCallback(function (key) {
|
|
4
|
-
if (props.localeText[key] == null) {
|
|
5
|
-
throw new Error("Missing translation for key ".concat(key, "."));
|
|
6
|
-
}
|
|
7
|
-
return props.localeText[key];
|
|
8
|
-
}, [props.localeText]);
|
|
9
|
-
apiRef.current.register('public', {
|
|
10
|
-
getLocaleText: getLocaleText
|
|
11
|
-
});
|
|
12
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { localStorageAvailable } from '../../utils/utils';
|
|
4
|
-
import { useGridApiMethod } from '../utils';
|
|
5
|
-
var forceDebug = localStorageAvailable() && window.localStorage.getItem('DEBUG') != null;
|
|
6
|
-
var noop = function noop() {};
|
|
7
|
-
var noopLogger = {
|
|
8
|
-
debug: noop,
|
|
9
|
-
info: noop,
|
|
10
|
-
warn: noop,
|
|
11
|
-
error: noop
|
|
12
|
-
};
|
|
13
|
-
var LOG_LEVELS = ['debug', 'info', 'warn', 'error'];
|
|
14
|
-
function getAppender(name, logLevel) {
|
|
15
|
-
var appender = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : console;
|
|
16
|
-
var minLogLevelIdx = LOG_LEVELS.indexOf(logLevel);
|
|
17
|
-
if (minLogLevelIdx === -1) {
|
|
18
|
-
throw new Error("MUI X: Log level ".concat(logLevel, " not recognized."));
|
|
19
|
-
}
|
|
20
|
-
var logger = LOG_LEVELS.reduce(function (loggerObj, method, idx) {
|
|
21
|
-
if (idx >= minLogLevelIdx) {
|
|
22
|
-
loggerObj[method] = function () {
|
|
23
|
-
var _ref;
|
|
24
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
|
-
args[_key] = arguments[_key];
|
|
26
|
-
}
|
|
27
|
-
var message = args[0],
|
|
28
|
-
other = args.slice(1);
|
|
29
|
-
(_ref = appender)[method].apply(_ref, ["MUI X: ".concat(name, " - ").concat(message)].concat(_toConsumableArray(other)));
|
|
30
|
-
};
|
|
31
|
-
} else {
|
|
32
|
-
loggerObj[method] = noop;
|
|
33
|
-
}
|
|
34
|
-
return loggerObj;
|
|
35
|
-
}, {});
|
|
36
|
-
return logger;
|
|
37
|
-
}
|
|
38
|
-
export var useGridLoggerFactory = function useGridLoggerFactory(apiRef, props) {
|
|
39
|
-
var getLogger = React.useCallback(function (name) {
|
|
40
|
-
if (forceDebug) {
|
|
41
|
-
return getAppender(name, 'debug', props.logger);
|
|
42
|
-
}
|
|
43
|
-
if (!props.logLevel) {
|
|
44
|
-
return noopLogger;
|
|
45
|
-
}
|
|
46
|
-
return getAppender(name, props.logLevel.toString(), props.logger);
|
|
47
|
-
}, [props.logLevel, props.logger]);
|
|
48
|
-
useGridApiMethod(apiRef, {
|
|
49
|
-
getLogger: getLogger
|
|
50
|
-
}, 'private');
|
|
51
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export var useGridRefs = function useGridRefs(apiRef) {
|
|
3
|
-
var rootElementRef = React.useRef(null);
|
|
4
|
-
var mainElementRef = React.useRef(null);
|
|
5
|
-
var virtualScrollerRef = React.useRef(null);
|
|
6
|
-
apiRef.current.register('public', {
|
|
7
|
-
rootElementRef: rootElementRef
|
|
8
|
-
});
|
|
9
|
-
apiRef.current.register('private', {
|
|
10
|
-
mainElementRef: mainElementRef,
|
|
11
|
-
virtualScrollerRef: virtualScrollerRef
|
|
12
|
-
});
|
|
13
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import { GridSignature } from '../utils/useGridApiEventHandler';
|
|
6
|
-
import { useGridApiMethod } from '../utils';
|
|
7
|
-
import { isFunction } from '../../utils/utils';
|
|
8
|
-
export var useGridStateInitialization = function useGridStateInitialization(apiRef, props) {
|
|
9
|
-
var controlStateMapRef = React.useRef({});
|
|
10
|
-
var _React$useState = React.useState(),
|
|
11
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12
|
-
rawForceUpdate = _React$useState2[1];
|
|
13
|
-
var registerControlState = React.useCallback(function (controlStateItem) {
|
|
14
|
-
controlStateMapRef.current[controlStateItem.stateId] = controlStateItem;
|
|
15
|
-
}, []);
|
|
16
|
-
var setState = React.useCallback(function (state, reason) {
|
|
17
|
-
var newState;
|
|
18
|
-
if (isFunction(state)) {
|
|
19
|
-
newState = state(apiRef.current.state);
|
|
20
|
-
} else {
|
|
21
|
-
newState = state;
|
|
22
|
-
}
|
|
23
|
-
if (apiRef.current.state === newState) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
var ignoreSetState = false;
|
|
27
|
-
|
|
28
|
-
// Apply the control state constraints
|
|
29
|
-
var updatedControlStateIds = [];
|
|
30
|
-
Object.keys(controlStateMapRef.current).forEach(function (stateId) {
|
|
31
|
-
var controlState = controlStateMapRef.current[stateId];
|
|
32
|
-
var oldSubState = controlState.stateSelector(apiRef.current.state, apiRef.current.instanceId);
|
|
33
|
-
var newSubState = controlState.stateSelector(newState, apiRef.current.instanceId);
|
|
34
|
-
if (newSubState === oldSubState) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
updatedControlStateIds.push({
|
|
38
|
-
stateId: controlState.stateId,
|
|
39
|
-
hasPropChanged: newSubState !== controlState.propModel
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// The state is controlled, the prop should always win
|
|
43
|
-
if (controlState.propModel !== undefined && newSubState !== controlState.propModel) {
|
|
44
|
-
ignoreSetState = true;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
if (updatedControlStateIds.length > 1) {
|
|
48
|
-
// Each hook modify its own state, and it should not leak
|
|
49
|
-
// Events are here to forward to other hooks and apply changes.
|
|
50
|
-
// You are trying to update several states in a no isolated way.
|
|
51
|
-
throw new Error("You're not allowed to update several sub-state in one transaction. You already updated ".concat(updatedControlStateIds[0].stateId, ", therefore, you're not allowed to update ").concat(updatedControlStateIds.map(function (el) {
|
|
52
|
-
return el.stateId;
|
|
53
|
-
}).join(', '), " in the same transaction."));
|
|
54
|
-
}
|
|
55
|
-
if (!ignoreSetState) {
|
|
56
|
-
// We always assign it as we mutate rows for perf reason.
|
|
57
|
-
apiRef.current.state = newState;
|
|
58
|
-
if (apiRef.current.publishEvent) {
|
|
59
|
-
apiRef.current.publishEvent('stateChange', newState);
|
|
60
|
-
}
|
|
61
|
-
apiRef.current.store.update(newState);
|
|
62
|
-
}
|
|
63
|
-
if (updatedControlStateIds.length === 1) {
|
|
64
|
-
var _updatedControlStateI = updatedControlStateIds[0],
|
|
65
|
-
stateId = _updatedControlStateI.stateId,
|
|
66
|
-
hasPropChanged = _updatedControlStateI.hasPropChanged;
|
|
67
|
-
var controlState = controlStateMapRef.current[stateId];
|
|
68
|
-
var model = controlState.stateSelector(newState, apiRef.current.instanceId);
|
|
69
|
-
if (controlState.propOnChange && hasPropChanged) {
|
|
70
|
-
var details = props.signature === GridSignature.DataGridPro ? {
|
|
71
|
-
api: apiRef.current,
|
|
72
|
-
reason: reason
|
|
73
|
-
} : {
|
|
74
|
-
reason: reason
|
|
75
|
-
};
|
|
76
|
-
controlState.propOnChange(model, details);
|
|
77
|
-
}
|
|
78
|
-
if (!ignoreSetState) {
|
|
79
|
-
apiRef.current.publishEvent(controlState.changeEvent, model, {
|
|
80
|
-
reason: reason
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return !ignoreSetState;
|
|
85
|
-
}, [apiRef, props.signature]);
|
|
86
|
-
var updateControlState = React.useCallback(function (key, state, reason) {
|
|
87
|
-
return apiRef.current.setState(function (previousState) {
|
|
88
|
-
return _extends({}, previousState, _defineProperty({}, key, state(previousState[key])));
|
|
89
|
-
}, reason);
|
|
90
|
-
}, [apiRef]);
|
|
91
|
-
var forceUpdate = React.useCallback(function () {
|
|
92
|
-
return rawForceUpdate(function () {
|
|
93
|
-
return apiRef.current.state;
|
|
94
|
-
});
|
|
95
|
-
}, [apiRef]);
|
|
96
|
-
var publicStateApi = {
|
|
97
|
-
setState: setState,
|
|
98
|
-
forceUpdate: forceUpdate
|
|
99
|
-
};
|
|
100
|
-
var privateStateApi = {
|
|
101
|
-
updateControlState: updateControlState,
|
|
102
|
-
registerControlState: registerControlState
|
|
103
|
-
};
|
|
104
|
-
useGridApiMethod(apiRef, publicStateApi, 'public');
|
|
105
|
-
useGridApiMethod(apiRef, privateStateApi, 'private');
|
|
106
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTheme } from '@mui/material/styles';
|
|
4
|
-
export var useGridTheme = function useGridTheme(apiRef) {
|
|
5
|
-
var theme = useTheme();
|
|
6
|
-
if (!apiRef.current.state.theme) {
|
|
7
|
-
apiRef.current.state.theme = theme;
|
|
8
|
-
}
|
|
9
|
-
var isFirstEffect = React.useRef(true);
|
|
10
|
-
React.useEffect(function () {
|
|
11
|
-
if (isFirstEffect.current) {
|
|
12
|
-
isFirstEffect.current = false;
|
|
13
|
-
} else {
|
|
14
|
-
apiRef.current.setState(function (state) {
|
|
15
|
-
return _extends({}, state, {
|
|
16
|
-
theme: theme
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}, [apiRef, theme]);
|
|
21
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useGridApiOptionHandler, useGridNativeEventListener } from '../../utils';
|
|
4
|
-
import { gridFocusCellSelector } from '../focus/gridFocusStateSelector';
|
|
5
|
-
import { serializeCellValue } from '../export/serializers/csvSerializer';
|
|
6
|
-
function writeToClipboardPolyfill(data) {
|
|
7
|
-
var span = document.createElement('span');
|
|
8
|
-
span.style.whiteSpace = 'pre';
|
|
9
|
-
span.style.userSelect = 'all';
|
|
10
|
-
span.style.opacity = '0px';
|
|
11
|
-
span.textContent = data;
|
|
12
|
-
document.body.appendChild(span);
|
|
13
|
-
var range = document.createRange();
|
|
14
|
-
range.selectNode(span);
|
|
15
|
-
var selection = window.getSelection();
|
|
16
|
-
selection.removeAllRanges();
|
|
17
|
-
selection.addRange(range);
|
|
18
|
-
try {
|
|
19
|
-
document.execCommand('copy');
|
|
20
|
-
} finally {
|
|
21
|
-
document.body.removeChild(span);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function copyToClipboard(data) {
|
|
25
|
-
if (navigator.clipboard) {
|
|
26
|
-
navigator.clipboard.writeText(data).catch(function () {
|
|
27
|
-
writeToClipboardPolyfill(data);
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
writeToClipboardPolyfill(data);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function hasNativeSelection(element) {
|
|
34
|
-
var _window$getSelection;
|
|
35
|
-
// When getSelection is called on an <iframe> that is not displayed Firefox will return null.
|
|
36
|
-
if ((_window$getSelection = window.getSelection()) != null && _window$getSelection.toString()) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// window.getSelection() returns an empty string in Firefox for selections inside a form element.
|
|
41
|
-
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=85686.
|
|
42
|
-
// Instead, we can use element.selectionStart that is only defined on form elements.
|
|
43
|
-
if (element && (element.selectionEnd || 0) - (element.selectionStart || 0) > 0) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @requires useGridCsvExport (method)
|
|
51
|
-
* @requires useGridSelection (method)
|
|
52
|
-
*/
|
|
53
|
-
export var useGridClipboard = function useGridClipboard(apiRef, props) {
|
|
54
|
-
var ignoreValueFormatterProp = props.ignoreValueFormatterDuringExport;
|
|
55
|
-
var ignoreValueFormatter = (_typeof(ignoreValueFormatterProp) === 'object' ? ignoreValueFormatterProp == null ? void 0 : ignoreValueFormatterProp.clipboardExport : ignoreValueFormatterProp) || false;
|
|
56
|
-
var clipboardCopyCellDelimiter = props.clipboardCopyCellDelimiter;
|
|
57
|
-
var handleCopy = React.useCallback(function (event) {
|
|
58
|
-
if (!((event.ctrlKey || event.metaKey) && event.key === 'c')) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Do nothing if there's a native selection
|
|
63
|
-
if (hasNativeSelection(event.target)) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
var textToCopy = '';
|
|
67
|
-
var selectedRows = apiRef.current.getSelectedRows();
|
|
68
|
-
if (selectedRows.size > 0) {
|
|
69
|
-
textToCopy = apiRef.current.getDataAsCsv({
|
|
70
|
-
includeHeaders: false,
|
|
71
|
-
// TODO: make it configurable
|
|
72
|
-
delimiter: clipboardCopyCellDelimiter
|
|
73
|
-
});
|
|
74
|
-
} else {
|
|
75
|
-
var focusedCell = gridFocusCellSelector(apiRef);
|
|
76
|
-
if (focusedCell) {
|
|
77
|
-
var cellParams = apiRef.current.getCellParams(focusedCell.id, focusedCell.field);
|
|
78
|
-
textToCopy = serializeCellValue(cellParams, {
|
|
79
|
-
delimiterCharacter: clipboardCopyCellDelimiter,
|
|
80
|
-
ignoreValueFormatter: ignoreValueFormatter
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
textToCopy = apiRef.current.unstable_applyPipeProcessors('clipboardCopy', textToCopy);
|
|
85
|
-
if (textToCopy) {
|
|
86
|
-
copyToClipboard(textToCopy);
|
|
87
|
-
apiRef.current.publishEvent('clipboardCopy', textToCopy);
|
|
88
|
-
}
|
|
89
|
-
}, [apiRef, ignoreValueFormatter, clipboardCopyCellDelimiter]);
|
|
90
|
-
useGridNativeEventListener(apiRef, apiRef.current.rootElementRef, 'keydown', handleCopy);
|
|
91
|
-
useGridApiOptionHandler(apiRef, 'clipboardCopy', props.onClipboardCopy);
|
|
92
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|