@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,13 +0,0 @@
|
|
|
1
|
-
// Based on https://stackoverflow.com/a/59518678
|
|
2
|
-
var cachedSupportsPreventScroll;
|
|
3
|
-
export function doesSupportPreventScroll() {
|
|
4
|
-
if (cachedSupportsPreventScroll === undefined) {
|
|
5
|
-
document.createElement('div').focus({
|
|
6
|
-
get preventScroll() {
|
|
7
|
-
cachedSupportsPreventScroll = true;
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return cachedSupportsPreventScroll;
|
|
13
|
-
}
|
package/legacy/utils/domUtils.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { gridClasses } from '../constants/gridClasses';
|
|
2
|
-
export function isOverflown(element) {
|
|
3
|
-
return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
|
|
4
|
-
}
|
|
5
|
-
export function findParentElementFromClassName(elem, className) {
|
|
6
|
-
return elem.closest(".".concat(className));
|
|
7
|
-
}
|
|
8
|
-
function escapeOperandAttributeSelector(operand) {
|
|
9
|
-
return operand.replace(/["\\]/g, '\\$&');
|
|
10
|
-
}
|
|
11
|
-
export function getGridColumnHeaderElement(root, field) {
|
|
12
|
-
return root.querySelector("[role=\"columnheader\"][data-field=\"".concat(escapeOperandAttributeSelector(field), "\"]"));
|
|
13
|
-
}
|
|
14
|
-
function getGridRowElementSelector(id) {
|
|
15
|
-
return ".".concat(gridClasses.row, "[data-id=\"").concat(escapeOperandAttributeSelector(String(id)), "\"]");
|
|
16
|
-
}
|
|
17
|
-
export function getGridRowElement(root, id) {
|
|
18
|
-
return root.querySelector(getGridRowElementSelector(id));
|
|
19
|
-
}
|
|
20
|
-
export function getGridCellElement(root, _ref) {
|
|
21
|
-
var id = _ref.id,
|
|
22
|
-
field = _ref.field;
|
|
23
|
-
var rowSelector = getGridRowElementSelector(id);
|
|
24
|
-
var cellSelector = ".".concat(gridClasses.cell, "[data-field=\"").concat(escapeOperandAttributeSelector(field), "\"]");
|
|
25
|
-
var selector = "".concat(rowSelector, " ").concat(cellSelector);
|
|
26
|
-
return root.querySelector(selector);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/
|
|
30
|
-
export var getActiveElement = function getActiveElement() {
|
|
31
|
-
var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
32
|
-
var activeEl = root.activeElement;
|
|
33
|
-
if (!activeEl) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
if (activeEl.shadowRoot) {
|
|
37
|
-
return getActiveElement(activeEl.shadowRoot);
|
|
38
|
-
}
|
|
39
|
-
return activeEl;
|
|
40
|
-
};
|
|
41
|
-
export function isEventTargetInPortal(event) {
|
|
42
|
-
if (
|
|
43
|
-
// The target is not an element when triggered by a Select inside the cell
|
|
44
|
-
// See https://github.com/mui/material-ui/issues/10534
|
|
45
|
-
event.target.nodeType === 1 && !event.currentTarget.contains(event.target)) {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
return false;
|
|
49
|
-
}
|
package/legacy/utils/exportAs.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* I have hesitated to use https://github.com/eligrey/FileSaver.js.
|
|
3
|
-
* If we get bug reports that this project solves, we should consider using it.
|
|
4
|
-
*
|
|
5
|
-
* Related resources.
|
|
6
|
-
* https://blog.logrocket.com/programmatic-file-downloads-in-the-browser-9a5186298d5c/
|
|
7
|
-
* https://github.com/mbrn/filefy/blob/ec4ed0b7415d93be7158c23029f2ea1fa0b8e2d9/src/core/BaseBuilder.ts
|
|
8
|
-
* https://unpkg.com/browse/@progress/kendo-file-saver@1.0.7/dist/es/save-as.js
|
|
9
|
-
* https://github.com/ag-grid/ag-grid/blob/9565c219b6210aa85fa833c929d0728f9d163a91/community-modules/csv-export/src/csvExport/downloader.ts
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export function exportAs(blob) {
|
|
13
|
-
var extension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'csv';
|
|
14
|
-
var filename = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.title || 'untitled';
|
|
15
|
-
var fullName = "".concat(filename, ".").concat(extension);
|
|
16
|
-
|
|
17
|
-
// Test download attribute first
|
|
18
|
-
// https://github.com/eligrey/FileSaver.js/issues/193
|
|
19
|
-
if ('download' in HTMLAnchorElement.prototype) {
|
|
20
|
-
// Create an object URL for the blob object
|
|
21
|
-
var url = URL.createObjectURL(blob);
|
|
22
|
-
|
|
23
|
-
// Create a new anchor element
|
|
24
|
-
var a = document.createElement('a');
|
|
25
|
-
a.href = url;
|
|
26
|
-
a.download = fullName;
|
|
27
|
-
|
|
28
|
-
// Programmatically trigger a click on the anchor element
|
|
29
|
-
// Useful if you want the download to happen automatically
|
|
30
|
-
// Without attaching the anchor element to the DOM
|
|
31
|
-
a.click();
|
|
32
|
-
|
|
33
|
-
// https://github.com/eligrey/FileSaver.js/issues/205
|
|
34
|
-
setTimeout(function () {
|
|
35
|
-
URL.revokeObjectURL(url);
|
|
36
|
-
});
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
throw new Error('MUI X: exportAs not supported.');
|
|
40
|
-
}
|
package/legacy/utils/fastMemo.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var is = Object.is;
|
|
2
|
-
export function fastObjectShallowCompare(a, b) {
|
|
3
|
-
if (a === b) {
|
|
4
|
-
return true;
|
|
5
|
-
}
|
|
6
|
-
if (!(a instanceof Object) || !(b instanceof Object)) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
var aLength = 0;
|
|
10
|
-
var bLength = 0;
|
|
11
|
-
|
|
12
|
-
/* eslint-disable no-restricted-syntax */
|
|
13
|
-
/* eslint-disable guard-for-in */
|
|
14
|
-
for (var key in a) {
|
|
15
|
-
aLength += 1;
|
|
16
|
-
if (!is(a[key], b[key])) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
if (!(key in b)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
|
|
25
|
-
for (var _ in b) {
|
|
26
|
-
bLength += 1;
|
|
27
|
-
}
|
|
28
|
-
/* eslint-enable no-restricted-syntax */
|
|
29
|
-
/* eslint-enable guard-for-in */
|
|
30
|
-
|
|
31
|
-
return aLength === bLength;
|
|
32
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
export var getGridLocalization = function getGridLocalization(gridTranslations, coreTranslations) {
|
|
3
|
-
var _coreTranslations$com;
|
|
4
|
-
return {
|
|
5
|
-
components: {
|
|
6
|
-
MuiDataGrid: {
|
|
7
|
-
defaultProps: {
|
|
8
|
-
localeText: _extends({}, gridTranslations, {
|
|
9
|
-
MuiTablePagination: (coreTranslations == null || (_coreTranslations$com = coreTranslations.components) == null || (_coreTranslations$com = _coreTranslations$com.MuiTablePagination) == null ? void 0 : _coreTranslations$com.defaultProps) || {}
|
|
10
|
-
})
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
};
|
package/legacy/utils/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export var isEscapeKey = function isEscapeKey(key) {
|
|
2
|
-
return key === 'Escape';
|
|
3
|
-
}; // TODO remove
|
|
4
|
-
export var isEnterKey = function isEnterKey(key) {
|
|
5
|
-
return key === 'Enter';
|
|
6
|
-
}; // TODO remove
|
|
7
|
-
export var isTabKey = function isTabKey(key) {
|
|
8
|
-
return key === 'Tab';
|
|
9
|
-
}; // TODO remove
|
|
10
|
-
|
|
11
|
-
export var isSpaceKey = function isSpaceKey(key) {
|
|
12
|
-
return key === ' ';
|
|
13
|
-
};
|
|
14
|
-
export var isArrowKeys = function isArrowKeys(key) {
|
|
15
|
-
return key.indexOf('Arrow') === 0;
|
|
16
|
-
};
|
|
17
|
-
export var isHomeOrEndKeys = function isHomeOrEndKeys(key) {
|
|
18
|
-
return key === 'Home' || key === 'End';
|
|
19
|
-
};
|
|
20
|
-
export var isPageKeys = function isPageKeys(key) {
|
|
21
|
-
return key.indexOf('Page') === 0;
|
|
22
|
-
};
|
|
23
|
-
export var isDeleteKeys = function isDeleteKeys(key) {
|
|
24
|
-
return key === 'Delete' || key === 'Backspace';
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// Non printable keys have a name, e.g. "ArrowRight", see the whole list:
|
|
28
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values
|
|
29
|
-
// So event.key.length === 1 is often enough.
|
|
30
|
-
//
|
|
31
|
-
// However, we also need to ignore shortcuts, for example: select all:
|
|
32
|
-
// - Windows: Ctrl+A, event.ctrlKey is true
|
|
33
|
-
// - macOS: ⌘ Command+A, event.metaKey is true
|
|
34
|
-
export function isPrintableKey(event) {
|
|
35
|
-
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
|
|
36
|
-
}
|
|
37
|
-
export var GRID_MULTIPLE_SELECTION_KEYS = ['Meta', 'Control', 'Shift'];
|
|
38
|
-
export var GRID_CELL_EXIT_EDIT_MODE_KEYS = ['Enter', 'Escape', 'Tab'];
|
|
39
|
-
export var GRID_CELL_EDIT_COMMIT_KEYS = ['Enter', 'Tab'];
|
|
40
|
-
export var isMultipleKey = function isMultipleKey(key) {
|
|
41
|
-
return GRID_MULTIPLE_SELECTION_KEYS.indexOf(key) > -1;
|
|
42
|
-
};
|
|
43
|
-
export var isCellEnterEditModeKeys = function isCellEnterEditModeKeys(event) {
|
|
44
|
-
return isEnterKey(event.key) || isDeleteKeys(event.key) || isPrintableKey(event);
|
|
45
|
-
};
|
|
46
|
-
export var isCellExitEditModeKeys = function isCellExitEditModeKeys(key) {
|
|
47
|
-
return GRID_CELL_EXIT_EDIT_MODE_KEYS.indexOf(key) > -1;
|
|
48
|
-
};
|
|
49
|
-
export var isCellEditCommitKeys = function isCellEditCommitKeys(key) {
|
|
50
|
-
return GRID_CELL_EDIT_COMMIT_KEYS.indexOf(key) > -1;
|
|
51
|
-
};
|
|
52
|
-
export var isNavigationKey = function isNavigationKey(key) {
|
|
53
|
-
return isHomeOrEndKeys(key) || isArrowKeys(key) || isPageKeys(key) || isSpaceKey(key);
|
|
54
|
-
};
|
|
55
|
-
export var isKeyboardEvent = function isKeyboardEvent(event) {
|
|
56
|
-
return !!event.key;
|
|
57
|
-
};
|
|
58
|
-
export var isHideMenuKey = function isHideMenuKey(key) {
|
|
59
|
-
return isTabKey(key) || isEscapeKey(key);
|
|
60
|
-
};
|
package/legacy/utils/utils.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
2
|
-
export function isNumber(value) {
|
|
3
|
-
return typeof value === 'number' && !Number.isNaN(value);
|
|
4
|
-
}
|
|
5
|
-
export function isFunction(value) {
|
|
6
|
-
return typeof value === 'function';
|
|
7
|
-
}
|
|
8
|
-
export function isObject(value) {
|
|
9
|
-
return _typeof(value) === 'object' && value !== null;
|
|
10
|
-
}
|
|
11
|
-
export function localStorageAvailable() {
|
|
12
|
-
try {
|
|
13
|
-
// Incognito mode might reject access to the localStorage for security reasons.
|
|
14
|
-
// window isn't defined on Node.js
|
|
15
|
-
// https://stackoverflow.com/questions/16427636/check-if-localstorage-is-available
|
|
16
|
-
var key = '__some_random_key_you_are_not_going_to_use__';
|
|
17
|
-
window.localStorage.setItem(key, key);
|
|
18
|
-
window.localStorage.removeItem(key);
|
|
19
|
-
return true;
|
|
20
|
-
} catch (err) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export function escapeRegExp(value) {
|
|
25
|
-
return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Follows the CSS specification behavior for min and max
|
|
30
|
-
* If min > max, then the min have priority
|
|
31
|
-
*/
|
|
32
|
-
export var clamp = function clamp(value, min, max) {
|
|
33
|
-
return Math.max(min, Math.min(max, value));
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Based on `fast-deep-equal`
|
|
38
|
-
*
|
|
39
|
-
* MIT License
|
|
40
|
-
*
|
|
41
|
-
* Copyright (c) 2017 Evgeny Poberezkin
|
|
42
|
-
*
|
|
43
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
44
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
45
|
-
* in the Software without restriction, including without limitation the rights
|
|
46
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
47
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
48
|
-
* furnished to do so, subject to the following conditions:
|
|
49
|
-
*
|
|
50
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
51
|
-
* copies or substantial portions of the Software.
|
|
52
|
-
*
|
|
53
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
54
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
55
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
56
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
57
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
58
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
59
|
-
* SOFTWARE.
|
|
60
|
-
* We only type the public interface to avoid dozens of `as` in the function.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
export function isDeepEqual(a, b) {
|
|
64
|
-
if (a === b) {
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {
|
|
68
|
-
if (a.constructor !== b.constructor) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
if (Array.isArray(a)) {
|
|
72
|
-
var _length = a.length;
|
|
73
|
-
if (_length !== b.length) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
for (var i = 0; i < _length; i += 1) {
|
|
77
|
-
if (!isDeepEqual(a[i], b[i])) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
if (a instanceof Map && b instanceof Map) {
|
|
84
|
-
if (a.size !== b.size) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
var entriesA = Array.from(a.entries());
|
|
88
|
-
for (var _i = 0; _i < entriesA.length; _i += 1) {
|
|
89
|
-
if (!b.has(entriesA[_i][0])) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
for (var _i2 = 0; _i2 < entriesA.length; _i2 += 1) {
|
|
94
|
-
var entryA = entriesA[_i2];
|
|
95
|
-
if (!isDeepEqual(entryA[1], b.get(entryA[0]))) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
if (a instanceof Set && b instanceof Set) {
|
|
102
|
-
if (a.size !== b.size) {
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
var entries = Array.from(a.entries());
|
|
106
|
-
for (var _i3 = 0; _i3 < entries.length; _i3 += 1) {
|
|
107
|
-
if (!b.has(entries[_i3][0])) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
114
|
-
var _length2 = a.length;
|
|
115
|
-
if (_length2 !== b.length) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
for (var _i4 = 0; _i4 < _length2; _i4 += 1) {
|
|
119
|
-
if (a[_i4] !== b[_i4]) {
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
if (a.constructor === RegExp) {
|
|
126
|
-
return a.source === b.source && a.flags === b.flags;
|
|
127
|
-
}
|
|
128
|
-
if (a.valueOf !== Object.prototype.valueOf) {
|
|
129
|
-
return a.valueOf() === b.valueOf();
|
|
130
|
-
}
|
|
131
|
-
if (a.toString !== Object.prototype.toString) {
|
|
132
|
-
return a.toString() === b.toString();
|
|
133
|
-
}
|
|
134
|
-
var keys = Object.keys(a);
|
|
135
|
-
var length = keys.length;
|
|
136
|
-
if (length !== Object.keys(b).length) {
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
for (var _i5 = 0; _i5 < length; _i5 += 1) {
|
|
140
|
-
if (!Object.prototype.hasOwnProperty.call(b, keys[_i5])) {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
for (var _i6 = 0; _i6 < length; _i6 += 1) {
|
|
145
|
-
var key = keys[_i6];
|
|
146
|
-
if (!isDeepEqual(a[key], b[key])) {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// true if both NaN, false otherwise
|
|
154
|
-
// eslint-disable-next-line no-self-compare
|
|
155
|
-
return a !== a && b !== b;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Pseudo random number. See https://stackoverflow.com/a/47593316
|
|
159
|
-
function mulberry32(a) {
|
|
160
|
-
return function () {
|
|
161
|
-
/* eslint-disable */
|
|
162
|
-
var t = a += 0x6d2b79f5;
|
|
163
|
-
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
164
|
-
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
165
|
-
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
166
|
-
/* eslint-enable */
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
export function randomNumberBetween(seed, min, max) {
|
|
170
|
-
var random = mulberry32(seed);
|
|
171
|
-
return function () {
|
|
172
|
-
return min + (max - min) * random();
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export function deepClone(obj) {
|
|
176
|
-
if (typeof structuredClone === 'function') {
|
|
177
|
-
return structuredClone(obj);
|
|
178
|
-
}
|
|
179
|
-
return JSON.parse(JSON.stringify(obj));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
183
|
-
/**
|
|
184
|
-
* Mark a value as used so eslint doesn't complain. Use this instead
|
|
185
|
-
* of a `eslint-disable-next-line react-hooks/exhaustive-deps` because
|
|
186
|
-
* that hint disables checks on all values instead of just one.
|
|
187
|
-
*/
|
|
188
|
-
export function eslintUseValue(_) {}
|
|
189
|
-
/* eslint-enable @typescript-eslint/no-unused-vars */
|
package/legacy/utils/warning.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export var buildWarning = function buildWarning(message) {
|
|
2
|
-
var gravity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warning';
|
|
3
|
-
var alreadyWarned = false;
|
|
4
|
-
var cleanMessage = Array.isArray(message) ? message.join('\n') : message;
|
|
5
|
-
return function () {
|
|
6
|
-
if (!alreadyWarned) {
|
|
7
|
-
alreadyWarned = true;
|
|
8
|
-
if (gravity === 'error') {
|
|
9
|
-
console.error(cleanMessage);
|
|
10
|
-
} else {
|
|
11
|
-
console.warn(cleanMessage);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
export var wrapWithWarningOnCall = function wrapWithWarningOnCall(method, message) {
|
|
17
|
-
if (process.env.NODE_ENV === 'production') {
|
|
18
|
-
return method;
|
|
19
|
-
}
|
|
20
|
-
var warning = buildWarning(message);
|
|
21
|
-
return function () {
|
|
22
|
-
warning();
|
|
23
|
-
return method.apply(void 0, arguments);
|
|
24
|
-
};
|
|
25
|
-
};
|