@mui/x-data-grid 6.4.0 → 6.6.0
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 +134 -2
- package/DataGrid/DataGrid.js +10 -3
- package/DataGrid/useDataGridProps.js +5 -12
- package/README.md +2 -2
- package/colDef/gridNumericOperators.js +0 -6
- package/components/GridColumnHeaders.js +4 -9
- package/components/GridHeader.d.ts +2 -2
- package/components/base/GridBody.d.ts +1 -1
- package/components/base/GridFooterPlaceholder.d.ts +2 -2
- package/components/base/GridOverlays.d.ts +2 -2
- package/components/cell/GridActionsCell.d.ts +3 -3
- package/components/cell/GridActionsCell.js +3 -3
- package/components/cell/GridBooleanCell.d.ts +1 -1
- package/components/cell/GridEditBooleanCell.d.ts +2 -2
- package/components/cell/GridEditDateCell.d.ts +2 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +4 -1
- package/components/cell/GridEditSingleSelectCell.d.ts +3 -3
- package/components/cell/GridEditSingleSelectCell.js +5 -5
- package/components/cell/GridSkeletonCell.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.d.ts +1 -1
- package/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +2 -2
- package/components/columnHeaders/GridColumnHeaderSeparator.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderSortIcon.d.ts +1 -1
- package/components/columnHeaders/GridColumnHeaderTitle.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -3
- package/components/index.d.ts +0 -1
- package/components/index.js +1 -2
- package/components/menu/GridMenu.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnHeaderMenu.d.ts +1 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuColumnsItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.d.ts +2 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.d.ts +2 -2
- package/components/panel/GridColumnsPanel.d.ts +2 -2
- package/components/panel/GridPanelContent.d.ts +1 -1
- package/components/panel/GridPanelFooter.d.ts +1 -1
- package/components/panel/GridPanelHeader.d.ts +1 -1
- package/components/panel/GridPreferencesPanel.js +3 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +15 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +9 -2
- package/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.d.ts +2 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +9 -2
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +11 -4
- package/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/components/panel/filterPanel/GridFilterPanel.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/components/panel/filterPanel/index.d.ts +3 -1
- package/components/panel/filterPanel/index.js +2 -1
- package/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExport.d.ts +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/components/toolbar/GridToolbarQuickFilter.d.ts +2 -2
- package/constants/localeTextConstants.js +26 -0
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/core/strategyProcessing/gridStrategyProcessingApi.d.ts +10 -2
- package/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +10 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editing/useGridEditing.js +0 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +2 -2
- package/hooks/features/filter/gridFilterSelector.js +2 -2
- package/hooks/features/filter/gridFilterState.d.ts +6 -6
- package/hooks/features/filter/gridFilterState.js +6 -0
- package/hooks/features/filter/useGridFilter.js +29 -9
- package/hooks/features/focus/gridFocusState.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.d.ts +2 -0
- package/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/hooks/features/focus/useGridFocus.js +55 -9
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +4 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/hooks/features/headerFiltering/index.d.ts +1 -0
- package/hooks/features/headerFiltering/index.js +1 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +91 -0
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +2 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.d.ts +1 -1
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/hooks/features/preferencesPanel/gridPreferencePanelState.d.ts +2 -0
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/hooks/features/rows/useGridRows.js +16 -1
- package/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/index.js +1 -1
- package/internals/index.d.ts +6 -1
- package/internals/index.js +4 -0
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/internals/utils/useProps.d.ts +8 -0
- package/internals/utils/useProps.js +33 -0
- package/legacy/DataGrid/DataGrid.js +10 -3
- package/legacy/DataGrid/useDataGridProps.js +8 -8
- package/legacy/colDef/gridNumericOperators.js +0 -6
- package/legacy/components/GridColumnHeaders.js +4 -9
- package/legacy/components/cell/GridActionsCell.js +3 -3
- package/legacy/components/cell/GridEditInputCell.js +4 -1
- package/legacy/components/cell/GridEditSingleSelectCell.js +5 -5
- package/legacy/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/legacy/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/legacy/components/containers/GridRoot.js +1 -3
- package/legacy/components/index.js +1 -2
- package/legacy/components/panel/GridPreferencesPanel.js +3 -1
- package/legacy/components/panel/filterPanel/GridFilterInputBoolean.js +79 -35
- package/legacy/components/panel/filterPanel/GridFilterInputDate.js +26 -5
- package/legacy/components/panel/filterPanel/GridFilterInputSingleSelect.js +55 -31
- package/legacy/components/panel/filterPanel/GridFilterInputValue.js +28 -5
- package/legacy/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/legacy/components/panel/filterPanel/index.js +2 -1
- package/legacy/components/toolbar/GridToolbarColumnsButton.js +11 -5
- package/legacy/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/legacy/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/legacy/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/legacy/constants/localeTextConstants.js +26 -0
- package/legacy/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/legacy/hooks/features/columnHeaders/useGridColumnHeaders.js +5 -5
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/legacy/hooks/features/editing/useGridEditing.js +0 -3
- package/legacy/hooks/features/filter/gridFilterSelector.js +4 -4
- package/legacy/hooks/features/filter/gridFilterState.js +6 -0
- package/legacy/hooks/features/filter/useGridFilter.js +29 -9
- package/legacy/hooks/features/focus/gridFocusStateSelector.js +10 -0
- package/legacy/hooks/features/focus/useGridFocus.js +58 -9
- package/legacy/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +11 -0
- package/legacy/hooks/features/headerFiltering/index.js +1 -0
- package/legacy/hooks/features/headerFiltering/useGridHeaderFiltering.js +93 -0
- package/legacy/hooks/features/index.js +2 -1
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/legacy/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/legacy/hooks/features/rows/useGridRows.js +16 -1
- package/legacy/hooks/features/rows/useGridRowsMeta.js +12 -20
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +4 -0
- package/legacy/internals/utils/index.js +2 -1
- package/legacy/internals/utils/useProps.js +33 -0
- package/legacy/locales/arSD.js +28 -0
- package/legacy/locales/beBY.js +28 -0
- package/legacy/locales/bgBG.js +28 -0
- package/legacy/locales/csCZ.js +36 -8
- package/legacy/locales/daDK.js +28 -0
- package/legacy/locales/deDE.js +28 -0
- package/legacy/locales/elGR.js +27 -0
- package/legacy/locales/esES.js +28 -0
- package/legacy/locales/faIR.js +28 -0
- package/legacy/locales/fiFI.js +28 -0
- package/legacy/locales/frFR.js +26 -0
- package/legacy/locales/heIL.js +30 -2
- package/legacy/locales/huHU.js +28 -0
- package/legacy/locales/itIT.js +28 -0
- package/legacy/locales/jaJP.js +28 -0
- package/legacy/locales/koKR.js +28 -0
- package/legacy/locales/nbNO.js +28 -0
- package/legacy/locales/nlNL.js +26 -0
- package/legacy/locales/plPL.js +28 -0
- package/legacy/locales/ptBR.js +28 -0
- package/legacy/locales/roRO.js +28 -0
- package/legacy/locales/ruRU.js +28 -0
- package/legacy/locales/skSK.js +28 -0
- package/legacy/locales/svSE.js +28 -0
- package/legacy/locales/trTR.js +28 -0
- package/legacy/locales/ukUA.js +28 -0
- package/legacy/locales/urPK.js +28 -0
- package/legacy/locales/viVN.js +27 -0
- package/legacy/locales/zhCN.js +28 -0
- package/legacy/locales/zhTW.js +28 -0
- package/legacy/material/index.js +2 -0
- package/legacy/models/api/gridHeaderFilteringApi.js +1 -0
- package/legacy/models/gridFilterItem.js +1 -1
- package/legacy/models/gridHeaderFilteringModel.js +1 -0
- package/legacy/models/index.js +0 -1
- package/locales/arSD.js +28 -0
- package/locales/beBY.js +28 -0
- package/locales/bgBG.js +28 -0
- package/locales/csCZ.js +36 -8
- package/locales/daDK.js +28 -0
- package/locales/deDE.js +28 -0
- package/locales/elGR.js +27 -0
- package/locales/esES.js +28 -0
- package/locales/faIR.js +28 -0
- package/locales/fiFI.js +28 -0
- package/locales/frFR.js +26 -0
- package/locales/heIL.js +30 -2
- package/locales/huHU.js +28 -0
- package/locales/itIT.js +28 -0
- package/locales/jaJP.js +28 -0
- package/locales/koKR.js +28 -0
- package/locales/nbNO.js +28 -0
- package/locales/nlNL.js +26 -0
- package/locales/plPL.js +28 -0
- package/locales/ptBR.js +28 -0
- package/locales/roRO.js +28 -0
- package/locales/ruRU.js +28 -0
- package/locales/skSK.js +28 -0
- package/locales/svSE.js +28 -0
- package/locales/trTR.js +28 -0
- package/locales/ukUA.js +28 -0
- package/locales/urPK.js +28 -0
- package/locales/viVN.js +27 -0
- package/locales/zhCN.js +28 -0
- package/locales/zhTW.js +28 -0
- package/material/components/MUISelectOption.d.ts +2 -2
- package/material/index.d.ts +3 -66
- package/material/index.js +2 -0
- package/models/api/gridApiCommon.d.ts +3 -2
- package/models/api/gridCoreApi.d.ts +4 -0
- package/models/api/gridFilterApi.d.ts +3 -1
- package/models/api/gridFocusApi.d.ts +6 -0
- package/models/api/gridHeaderFilteringApi.d.ts +30 -0
- package/models/api/gridHeaderFilteringApi.js +1 -0
- package/models/api/gridLocaleTextApi.d.ts +25 -0
- package/models/api/gridPreferencesPanelApi.d.ts +3 -1
- package/models/events/gridEventLookup.d.ts +27 -1
- package/models/gridFilterItem.d.ts +1 -1
- package/models/gridFilterItem.js +1 -1
- package/models/gridFilterOperator.d.ts +5 -1
- package/models/gridHeaderFilteringModel.d.ts +5 -0
- package/models/gridHeaderFilteringModel.js +1 -0
- package/models/gridSlotsComponent.d.ts +16 -4
- package/models/gridStateCommunity.d.ts +4 -0
- package/models/index.d.ts +1 -1
- package/models/index.js +0 -1
- package/models/props/DataGridProps.d.ts +5 -0
- package/modern/DataGrid/DataGrid.js +10 -3
- package/modern/DataGrid/useDataGridProps.js +5 -12
- package/modern/colDef/gridNumericOperators.js +0 -6
- package/modern/components/GridColumnHeaders.js +4 -9
- package/modern/components/cell/GridActionsCell.js +3 -3
- package/modern/components/cell/GridEditInputCell.js +4 -1
- package/modern/components/cell/GridEditSingleSelectCell.js +5 -5
- package/modern/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/modern/components/columnHeaders/GridColumnHeaderFilterIconButton.js +13 -4
- package/modern/components/containers/GridRoot.js +1 -3
- package/modern/components/index.js +1 -2
- package/modern/components/panel/GridPreferencesPanel.js +3 -1
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +80 -36
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/modern/components/panel/filterPanel/GridFilterPanel.js +1 -1
- package/modern/components/panel/filterPanel/index.js +2 -1
- package/modern/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/modern/components/toolbar/GridToolbarFilterButton.js +11 -4
- package/modern/constants/localeTextConstants.js +26 -0
- package/modern/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editing/useGridEditing.js +0 -3
- package/modern/hooks/features/filter/gridFilterSelector.js +2 -2
- package/modern/hooks/features/filter/gridFilterState.js +6 -0
- package/modern/hooks/features/filter/useGridFilter.js +29 -9
- package/modern/hooks/features/focus/gridFocusStateSelector.js +6 -0
- package/modern/hooks/features/focus/useGridFocus.js +55 -9
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +5 -0
- package/modern/hooks/features/headerFiltering/index.js +1 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +90 -0
- package/modern/hooks/features/index.js +2 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/modern/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/modern/hooks/features/rows/useGridRows.js +16 -1
- package/modern/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/modern/index.js +1 -1
- package/modern/internals/index.js +4 -0
- package/modern/internals/utils/index.js +2 -1
- package/modern/internals/utils/useProps.js +32 -0
- package/modern/locales/arSD.js +28 -0
- package/modern/locales/beBY.js +28 -0
- package/modern/locales/bgBG.js +28 -0
- package/modern/locales/csCZ.js +36 -8
- package/modern/locales/daDK.js +28 -0
- package/modern/locales/deDE.js +28 -0
- package/modern/locales/elGR.js +27 -0
- package/modern/locales/esES.js +28 -0
- package/modern/locales/faIR.js +28 -0
- package/modern/locales/fiFI.js +28 -0
- package/modern/locales/frFR.js +26 -0
- package/modern/locales/heIL.js +30 -2
- package/modern/locales/huHU.js +28 -0
- package/modern/locales/itIT.js +28 -0
- package/modern/locales/jaJP.js +28 -0
- package/modern/locales/koKR.js +28 -0
- package/modern/locales/nbNO.js +28 -0
- package/modern/locales/nlNL.js +26 -0
- package/modern/locales/plPL.js +28 -0
- package/modern/locales/ptBR.js +28 -0
- package/modern/locales/roRO.js +28 -0
- package/modern/locales/ruRU.js +28 -0
- package/modern/locales/skSK.js +28 -0
- package/modern/locales/svSE.js +28 -0
- package/modern/locales/trTR.js +28 -0
- package/modern/locales/ukUA.js +28 -0
- package/modern/locales/urPK.js +28 -0
- package/modern/locales/viVN.js +27 -0
- package/modern/locales/zhCN.js +28 -0
- package/modern/locales/zhTW.js +28 -0
- package/modern/material/index.js +2 -0
- package/modern/models/api/gridHeaderFilteringApi.js +1 -0
- package/modern/models/gridFilterItem.js +1 -1
- package/modern/models/gridHeaderFilteringModel.js +1 -0
- package/modern/models/index.js +0 -1
- package/node/DataGrid/DataGrid.js +10 -3
- package/node/DataGrid/useDataGridProps.js +4 -11
- package/node/colDef/gridNumericOperators.js +0 -6
- package/node/components/GridColumnHeaders.js +3 -8
- package/node/components/cell/GridActionsCell.js +3 -3
- package/node/components/cell/GridEditInputCell.js +4 -1
- package/node/components/cell/GridEditSingleSelectCell.js +5 -5
- package/node/components/columnHeaders/ColumnHeaderMenuIcon.js +3 -3
- package/node/components/columnHeaders/GridColumnHeaderFilterIconButton.js +12 -3
- package/node/components/containers/GridRoot.js +1 -3
- package/node/components/index.js +0 -11
- package/node/components/panel/GridPreferencesPanel.js +3 -1
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +78 -35
- package/node/components/panel/filterPanel/GridFilterInputDate.js +27 -6
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +56 -32
- package/node/components/panel/filterPanel/GridFilterInputValue.js +29 -6
- package/node/components/panel/filterPanel/GridFilterPanel.js +2 -1
- package/node/components/panel/filterPanel/index.js +26 -8
- package/node/components/toolbar/GridToolbarColumnsButton.js +11 -6
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +7 -7
- package/node/components/toolbar/GridToolbarFilterButton.js +10 -3
- package/node/constants/localeTextConstants.js +26 -0
- package/node/hooks/core/strategyProcessing/useGridStrategyProcessing.js +2 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editing/useGridEditing.js +0 -3
- package/node/hooks/features/filter/gridFilterSelector.js +2 -2
- package/node/hooks/features/filter/gridFilterState.js +6 -0
- package/node/hooks/features/filter/useGridFilter.js +30 -10
- package/node/hooks/features/focus/gridFocusStateSelector.js +9 -1
- package/node/hooks/features/focus/useGridFocus.js +55 -9
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +15 -0
- package/node/hooks/features/headerFiltering/index.js +16 -0
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +101 -0
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +113 -4
- package/node/hooks/features/preferencesPanel/useGridPreferencesPanel.js +4 -2
- package/node/hooks/features/rows/useGridRows.js +16 -1
- package/node/hooks/features/rows/useGridRowsMeta.js +11 -12
- package/node/index.js +1 -1
- package/node/internals/index.js +46 -0
- package/node/internals/utils/index.js +11 -0
- package/node/internals/utils/useProps.js +41 -0
- package/node/locales/arSD.js +28 -0
- package/node/locales/beBY.js +28 -0
- package/node/locales/bgBG.js +28 -0
- package/node/locales/csCZ.js +36 -8
- package/node/locales/daDK.js +28 -0
- package/node/locales/deDE.js +28 -0
- package/node/locales/elGR.js +27 -0
- package/node/locales/esES.js +28 -0
- package/node/locales/faIR.js +28 -0
- package/node/locales/fiFI.js +28 -0
- package/node/locales/frFR.js +26 -0
- package/node/locales/heIL.js +30 -2
- package/node/locales/huHU.js +28 -0
- package/node/locales/itIT.js +28 -0
- package/node/locales/jaJP.js +28 -0
- package/node/locales/koKR.js +28 -0
- package/node/locales/nbNO.js +28 -0
- package/node/locales/nlNL.js +26 -0
- package/node/locales/plPL.js +28 -0
- package/node/locales/ptBR.js +28 -0
- package/node/locales/roRO.js +28 -0
- package/node/locales/ruRU.js +28 -0
- package/node/locales/skSK.js +28 -0
- package/node/locales/svSE.js +28 -0
- package/node/locales/trTR.js +28 -0
- package/node/locales/ukUA.js +28 -0
- package/node/locales/urPK.js +28 -0
- package/node/locales/viVN.js +27 -0
- package/node/locales/zhCN.js +28 -0
- package/node/locales/zhTW.js +28 -0
- package/node/material/index.js +2 -0
- package/node/models/api/gridHeaderFilteringApi.js +5 -0
- package/node/models/gridFilterItem.js +1 -1
- package/node/models/gridHeaderFilteringModel.js +5 -0
- package/node/models/index.js +0 -11
- package/package.json +4 -4
- package/components/GridScrollArea.d.ts +0 -10
- package/components/GridScrollArea.js +0 -117
- package/legacy/components/GridScrollArea.js +0 -119
- package/legacy/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/index.d.ts +0 -18
- package/lib/createDetectElementResize/index.js +0 -145
- package/lib/createDetectElementResize/types.d.ts +0 -9
- package/modern/components/GridScrollArea.js +0 -117
- package/modern/lib/createDetectElementResize/index.js +0 -145
- package/node/components/GridScrollArea.js +0 -126
- package/node/lib/createDetectElementResize/index.js +0 -151
package/node/locales/viVN.js
CHANGED
|
@@ -66,6 +66,33 @@ const viVNGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'Rỗng',
|
|
67
67
|
filterOperatorIsNotEmpty: 'Khác rỗng',
|
|
68
68
|
// filterOperatorIsAnyOf: 'is any of',
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
|
+
|
|
76
|
+
// Header filter operators text
|
|
77
|
+
// headerFilterOperatorContains: 'Contains',
|
|
78
|
+
// headerFilterOperatorEquals: 'Equals',
|
|
79
|
+
// headerFilterOperatorStartsWith: 'Starts with',
|
|
80
|
+
// headerFilterOperatorEndsWith: 'Ends with',
|
|
81
|
+
// headerFilterOperatorIs: 'Is',
|
|
82
|
+
// headerFilterOperatorNot: 'Is not',
|
|
83
|
+
// headerFilterOperatorAfter: 'Is after',
|
|
84
|
+
// headerFilterOperatorOnOrAfter: 'Is on or after',
|
|
85
|
+
// headerFilterOperatorBefore: 'Is before',
|
|
86
|
+
// headerFilterOperatorOnOrBefore: 'Is on or before',
|
|
87
|
+
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
|
+
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
|
+
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Is greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Is greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Is less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Is less than or equal to',
|
|
69
96
|
|
|
70
97
|
// Filter values text
|
|
71
98
|
filterValueAny: 'bất kỳ giá trị nào',
|
package/node/locales/zhCN.js
CHANGED
|
@@ -66,6 +66,34 @@ const zhCNGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: '为空',
|
|
67
67
|
filterOperatorIsNotEmpty: '不为空',
|
|
68
68
|
filterOperatorIsAnyOf: '属于',
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
|
+
|
|
76
|
+
// Header filter operators text
|
|
77
|
+
// headerFilterOperatorContains: 'Contains',
|
|
78
|
+
// headerFilterOperatorEquals: 'Equals',
|
|
79
|
+
// headerFilterOperatorStartsWith: 'Starts with',
|
|
80
|
+
// headerFilterOperatorEndsWith: 'Ends with',
|
|
81
|
+
// headerFilterOperatorIs: 'Is',
|
|
82
|
+
// headerFilterOperatorNot: 'Is not',
|
|
83
|
+
// headerFilterOperatorAfter: 'Is after',
|
|
84
|
+
// headerFilterOperatorOnOrAfter: 'Is on or after',
|
|
85
|
+
// headerFilterOperatorBefore: 'Is before',
|
|
86
|
+
// headerFilterOperatorOnOrBefore: 'Is on or before',
|
|
87
|
+
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
|
+
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
|
+
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Is greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Is greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Is less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Is less than or equal to',
|
|
96
|
+
|
|
69
97
|
// Filter values text
|
|
70
98
|
filterValueAny: '任何',
|
|
71
99
|
filterValueTrue: '真',
|
package/node/locales/zhTW.js
CHANGED
|
@@ -66,6 +66,34 @@ const zhTWGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: '為空',
|
|
67
67
|
filterOperatorIsNotEmpty: '不為空',
|
|
68
68
|
filterOperatorIsAnyOf: '是其中之一',
|
|
69
|
+
// 'filterOperator=': '=',
|
|
70
|
+
// 'filterOperator!=': '!=',
|
|
71
|
+
// 'filterOperator>': '>',
|
|
72
|
+
// 'filterOperator>=': '>=',
|
|
73
|
+
// 'filterOperator<': '<',
|
|
74
|
+
// 'filterOperator<=': '<=',
|
|
75
|
+
|
|
76
|
+
// Header filter operators text
|
|
77
|
+
// headerFilterOperatorContains: 'Contains',
|
|
78
|
+
// headerFilterOperatorEquals: 'Equals',
|
|
79
|
+
// headerFilterOperatorStartsWith: 'Starts with',
|
|
80
|
+
// headerFilterOperatorEndsWith: 'Ends with',
|
|
81
|
+
// headerFilterOperatorIs: 'Is',
|
|
82
|
+
// headerFilterOperatorNot: 'Is not',
|
|
83
|
+
// headerFilterOperatorAfter: 'Is after',
|
|
84
|
+
// headerFilterOperatorOnOrAfter: 'Is on or after',
|
|
85
|
+
// headerFilterOperatorBefore: 'Is before',
|
|
86
|
+
// headerFilterOperatorOnOrBefore: 'Is on or before',
|
|
87
|
+
// headerFilterOperatorIsEmpty: 'Is empty',
|
|
88
|
+
// headerFilterOperatorIsNotEmpty: 'Is not empty',
|
|
89
|
+
// headerFilterOperatorIsAnyOf: 'Is any of',
|
|
90
|
+
// 'headerFilterOperator=': 'Equals',
|
|
91
|
+
// 'headerFilterOperator!=': 'Not equals',
|
|
92
|
+
// 'headerFilterOperator>': 'Is greater than',
|
|
93
|
+
// 'headerFilterOperator>=': 'Is greater than or equal to',
|
|
94
|
+
// 'headerFilterOperator<': 'Is less than',
|
|
95
|
+
// 'headerFilterOperator<=': 'Is less than or equal to',
|
|
96
|
+
|
|
69
97
|
// Filter values text
|
|
70
98
|
filterValueAny: '任何值',
|
|
71
99
|
filterValueTrue: '真',
|
package/node/material/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
|
13
13
|
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
14
14
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
15
15
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
16
|
+
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
16
17
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
17
18
|
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
|
18
19
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
@@ -65,6 +66,7 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
|
65
66
|
BaseSwitch: _Switch.default,
|
|
66
67
|
BaseButton: _Button.default,
|
|
67
68
|
BaseIconButton: _IconButton.default,
|
|
69
|
+
BaseInputAdornment: _InputAdornment.default,
|
|
68
70
|
BaseTooltip: _Tooltip.default,
|
|
69
71
|
BasePopper: _Popper.default,
|
|
70
72
|
BaseInputLabel: _InputLabel.default,
|
|
@@ -7,7 +7,7 @@ exports.GridLogicOperator = void 0;
|
|
|
7
7
|
/**
|
|
8
8
|
* Filter item definition interface.
|
|
9
9
|
* @demos
|
|
10
|
-
* - [Custom filter operator](/x/react-data-grid/filtering/#create-a-custom-operator)
|
|
10
|
+
* - [Custom filter operator](/x/react-data-grid/filtering/customization/#create-a-custom-operator)
|
|
11
11
|
*/
|
|
12
12
|
var GridLogicOperator = /*#__PURE__*/function (GridLogicOperator) {
|
|
13
13
|
GridLogicOperator["And"] = "and";
|
package/node/models/index.js
CHANGED
|
@@ -201,17 +201,6 @@ Object.keys(_gridIconSlotsComponent).forEach(function (key) {
|
|
|
201
201
|
}
|
|
202
202
|
});
|
|
203
203
|
});
|
|
204
|
-
var _gridSlotsComponent = require("./gridSlotsComponent");
|
|
205
|
-
Object.keys(_gridSlotsComponent).forEach(function (key) {
|
|
206
|
-
if (key === "default" || key === "__esModule") return;
|
|
207
|
-
if (key in exports && exports[key] === _gridSlotsComponent[key]) return;
|
|
208
|
-
Object.defineProperty(exports, key, {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
get: function () {
|
|
211
|
-
return _gridSlotsComponent[key];
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
204
|
var _gridSlotsComponentsProps = require("./gridSlotsComponentsProps");
|
|
216
205
|
Object.keys(_gridSlotsComponentsProps).forEach(function (key) {
|
|
217
206
|
if (key === "default" || key === "__esModule") return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.6.0",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.21.0",
|
|
39
|
-
"@mui/utils": "^5.
|
|
39
|
+
"@mui/utils": "^5.13.1",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^4.1.8"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@mui/material": "^5.4.1",
|
|
46
46
|
"@mui/system": "^5.4.1",
|
|
47
|
-
"react": "^17.0.
|
|
48
|
-
"react-dom": "^17.0.
|
|
47
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
48
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
49
49
|
},
|
|
50
50
|
"setupFiles": [
|
|
51
51
|
"<rootDir>/src/setupTests.js"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
interface ScrollAreaProps {
|
|
3
|
-
scrollDirection: 'left' | 'right';
|
|
4
|
-
}
|
|
5
|
-
declare function GridScrollAreaRaw(props: ScrollAreaProps): JSX.Element | null;
|
|
6
|
-
declare namespace GridScrollAreaRaw {
|
|
7
|
-
var propTypes: any;
|
|
8
|
-
}
|
|
9
|
-
declare const GridScrollArea: React.MemoExoticComponent<typeof GridScrollAreaRaw>;
|
|
10
|
-
export { GridScrollArea };
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
6
|
-
import { styled } from '@mui/system';
|
|
7
|
-
import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
|
|
8
|
-
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
9
|
-
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
10
|
-
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
11
|
-
import { gridDensityFactorSelector } from '../hooks/features/density/densitySelector';
|
|
12
|
-
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const CLIFF = 1;
|
|
15
|
-
const SLOP = 1.5;
|
|
16
|
-
const useUtilityClasses = ownerState => {
|
|
17
|
-
const {
|
|
18
|
-
scrollDirection,
|
|
19
|
-
classes
|
|
20
|
-
} = ownerState;
|
|
21
|
-
const slots = {
|
|
22
|
-
root: ['scrollArea', `scrollArea--${scrollDirection}`]
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
const GridScrollAreaRawRoot = styled('div', {
|
|
27
|
-
name: 'MuiDataGrid',
|
|
28
|
-
slot: 'ScrollArea',
|
|
29
|
-
overridesResolver: (props, styles) => [{
|
|
30
|
-
[`&.${gridClasses['scrollArea--left']}`]: styles['scrollArea--left']
|
|
31
|
-
}, {
|
|
32
|
-
[`&.${gridClasses['scrollArea--right']}`]: styles['scrollArea--right']
|
|
33
|
-
}, styles.scrollArea]
|
|
34
|
-
})(() => ({
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
zIndex: 101,
|
|
38
|
-
width: 20,
|
|
39
|
-
bottom: 0,
|
|
40
|
-
[`&.${gridClasses['scrollArea--left']}`]: {
|
|
41
|
-
left: 0
|
|
42
|
-
},
|
|
43
|
-
[`&.${gridClasses['scrollArea--right']}`]: {
|
|
44
|
-
right: 0
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
47
|
-
function GridScrollAreaRaw(props) {
|
|
48
|
-
const {
|
|
49
|
-
scrollDirection
|
|
50
|
-
} = props;
|
|
51
|
-
const rootRef = React.useRef(null);
|
|
52
|
-
const apiRef = useGridApiContext();
|
|
53
|
-
const timeout = React.useRef();
|
|
54
|
-
const [dragging, setDragging] = React.useState(false);
|
|
55
|
-
const densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
56
|
-
const scrollPosition = React.useRef({
|
|
57
|
-
left: 0,
|
|
58
|
-
top: 0
|
|
59
|
-
});
|
|
60
|
-
const rootProps = useGridRootProps();
|
|
61
|
-
const ownerState = _extends({}, rootProps, {
|
|
62
|
-
scrollDirection
|
|
63
|
-
});
|
|
64
|
-
const classes = useUtilityClasses(ownerState);
|
|
65
|
-
const headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
66
|
-
const handleScrolling = React.useCallback(newScrollPosition => {
|
|
67
|
-
scrollPosition.current = newScrollPosition;
|
|
68
|
-
}, []);
|
|
69
|
-
const handleDragOver = React.useCallback(event => {
|
|
70
|
-
let offset;
|
|
71
|
-
if (scrollDirection === 'left') {
|
|
72
|
-
offset = event.clientX - rootRef.current.getBoundingClientRect().right;
|
|
73
|
-
} else if (scrollDirection === 'right') {
|
|
74
|
-
offset = Math.max(1, event.clientX - rootRef.current.getBoundingClientRect().left);
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error('MUI: Wrong drag direction');
|
|
77
|
-
}
|
|
78
|
-
offset = (offset - CLIFF) * SLOP + CLIFF;
|
|
79
|
-
clearTimeout(timeout.current);
|
|
80
|
-
// Avoid freeze and inertia.
|
|
81
|
-
timeout.current = setTimeout(() => {
|
|
82
|
-
apiRef.current.scroll({
|
|
83
|
-
left: scrollPosition.current.left + offset,
|
|
84
|
-
top: scrollPosition.current.top
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, [scrollDirection, apiRef]);
|
|
88
|
-
React.useEffect(() => {
|
|
89
|
-
return () => {
|
|
90
|
-
clearTimeout(timeout.current);
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
const toggleDragging = React.useCallback(() => {
|
|
94
|
-
setDragging(prevDragging => !prevDragging);
|
|
95
|
-
}, []);
|
|
96
|
-
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
97
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', toggleDragging);
|
|
98
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', toggleDragging);
|
|
99
|
-
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
100
|
-
ref: rootRef,
|
|
101
|
-
className: clsx(classes.root),
|
|
102
|
-
ownerState: ownerState,
|
|
103
|
-
onDragOver: handleDragOver,
|
|
104
|
-
style: {
|
|
105
|
-
height: headerHeight
|
|
106
|
-
}
|
|
107
|
-
}) : null;
|
|
108
|
-
}
|
|
109
|
-
process.env.NODE_ENV !== "production" ? GridScrollAreaRaw.propTypes = {
|
|
110
|
-
// ----------------------------- Warning --------------------------------
|
|
111
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
112
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
113
|
-
// ----------------------------------------------------------------------
|
|
114
|
-
scrollDirection: PropTypes.oneOf(['left', 'right']).isRequired
|
|
115
|
-
} : void 0;
|
|
116
|
-
const GridScrollArea = /*#__PURE__*/React.memo(GridScrollAreaRaw);
|
|
117
|
-
export { GridScrollArea };
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import clsx from 'clsx';
|
|
7
|
-
import { unstable_composeClasses as composeClasses } from '@mui/utils';
|
|
8
|
-
import { styled } from '@mui/system';
|
|
9
|
-
import { useGridApiEventHandler } from '../hooks/utils/useGridApiEventHandler';
|
|
10
|
-
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
11
|
-
import { getDataGridUtilityClass, gridClasses } from '../constants/gridClasses';
|
|
12
|
-
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
13
|
-
import { gridDensityFactorSelector } from '../hooks/features/density/densitySelector';
|
|
14
|
-
import { useGridSelector } from '../hooks/utils/useGridSelector';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
var CLIFF = 1;
|
|
17
|
-
var SLOP = 1.5;
|
|
18
|
-
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
|
19
|
-
var scrollDirection = ownerState.scrollDirection,
|
|
20
|
-
classes = ownerState.classes;
|
|
21
|
-
var slots = {
|
|
22
|
-
root: ['scrollArea', "scrollArea--".concat(scrollDirection)]
|
|
23
|
-
};
|
|
24
|
-
return composeClasses(slots, getDataGridUtilityClass, classes);
|
|
25
|
-
};
|
|
26
|
-
var GridScrollAreaRawRoot = styled('div', {
|
|
27
|
-
name: 'MuiDataGrid',
|
|
28
|
-
slot: 'ScrollArea',
|
|
29
|
-
overridesResolver: function overridesResolver(props, styles) {
|
|
30
|
-
return [_defineProperty({}, "&.".concat(gridClasses['scrollArea--left']), styles['scrollArea--left']), _defineProperty({}, "&.".concat(gridClasses['scrollArea--right']), styles['scrollArea--right']), styles.scrollArea];
|
|
31
|
-
}
|
|
32
|
-
})(function () {
|
|
33
|
-
var _ref3;
|
|
34
|
-
return _ref3 = {
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
top: 0,
|
|
37
|
-
zIndex: 101,
|
|
38
|
-
width: 20,
|
|
39
|
-
bottom: 0
|
|
40
|
-
}, _defineProperty(_ref3, "&.".concat(gridClasses['scrollArea--left']), {
|
|
41
|
-
left: 0
|
|
42
|
-
}), _defineProperty(_ref3, "&.".concat(gridClasses['scrollArea--right']), {
|
|
43
|
-
right: 0
|
|
44
|
-
}), _ref3;
|
|
45
|
-
});
|
|
46
|
-
function GridScrollAreaRaw(props) {
|
|
47
|
-
var scrollDirection = props.scrollDirection;
|
|
48
|
-
var rootRef = React.useRef(null);
|
|
49
|
-
var apiRef = useGridApiContext();
|
|
50
|
-
var timeout = React.useRef();
|
|
51
|
-
var _React$useState = React.useState(false),
|
|
52
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
53
|
-
dragging = _React$useState2[0],
|
|
54
|
-
setDragging = _React$useState2[1];
|
|
55
|
-
var densityFactor = useGridSelector(apiRef, gridDensityFactorSelector);
|
|
56
|
-
var scrollPosition = React.useRef({
|
|
57
|
-
left: 0,
|
|
58
|
-
top: 0
|
|
59
|
-
});
|
|
60
|
-
var rootProps = useGridRootProps();
|
|
61
|
-
var ownerState = _extends({}, rootProps, {
|
|
62
|
-
scrollDirection: scrollDirection
|
|
63
|
-
});
|
|
64
|
-
var classes = useUtilityClasses(ownerState);
|
|
65
|
-
var headerHeight = Math.floor(rootProps.columnHeaderHeight * densityFactor);
|
|
66
|
-
var handleScrolling = React.useCallback(function (newScrollPosition) {
|
|
67
|
-
scrollPosition.current = newScrollPosition;
|
|
68
|
-
}, []);
|
|
69
|
-
var handleDragOver = React.useCallback(function (event) {
|
|
70
|
-
var offset;
|
|
71
|
-
if (scrollDirection === 'left') {
|
|
72
|
-
offset = event.clientX - rootRef.current.getBoundingClientRect().right;
|
|
73
|
-
} else if (scrollDirection === 'right') {
|
|
74
|
-
offset = Math.max(1, event.clientX - rootRef.current.getBoundingClientRect().left);
|
|
75
|
-
} else {
|
|
76
|
-
throw new Error('MUI: Wrong drag direction');
|
|
77
|
-
}
|
|
78
|
-
offset = (offset - CLIFF) * SLOP + CLIFF;
|
|
79
|
-
clearTimeout(timeout.current);
|
|
80
|
-
// Avoid freeze and inertia.
|
|
81
|
-
timeout.current = setTimeout(function () {
|
|
82
|
-
apiRef.current.scroll({
|
|
83
|
-
left: scrollPosition.current.left + offset,
|
|
84
|
-
top: scrollPosition.current.top
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}, [scrollDirection, apiRef]);
|
|
88
|
-
React.useEffect(function () {
|
|
89
|
-
return function () {
|
|
90
|
-
clearTimeout(timeout.current);
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
var toggleDragging = React.useCallback(function () {
|
|
94
|
-
setDragging(function (prevDragging) {
|
|
95
|
-
return !prevDragging;
|
|
96
|
-
});
|
|
97
|
-
}, []);
|
|
98
|
-
useGridApiEventHandler(apiRef, 'scrollPositionChange', handleScrolling);
|
|
99
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragStart', toggleDragging);
|
|
100
|
-
useGridApiEventHandler(apiRef, 'columnHeaderDragEnd', toggleDragging);
|
|
101
|
-
return dragging ? /*#__PURE__*/_jsx(GridScrollAreaRawRoot, {
|
|
102
|
-
ref: rootRef,
|
|
103
|
-
className: clsx(classes.root),
|
|
104
|
-
ownerState: ownerState,
|
|
105
|
-
onDragOver: handleDragOver,
|
|
106
|
-
style: {
|
|
107
|
-
height: headerHeight
|
|
108
|
-
}
|
|
109
|
-
}) : null;
|
|
110
|
-
}
|
|
111
|
-
process.env.NODE_ENV !== "production" ? GridScrollAreaRaw.propTypes = {
|
|
112
|
-
// ----------------------------- Warning --------------------------------
|
|
113
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
114
|
-
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
115
|
-
// ----------------------------------------------------------------------
|
|
116
|
-
scrollDirection: PropTypes.oneOf(['left', 'right']).isRequired
|
|
117
|
-
} : void 0;
|
|
118
|
-
var GridScrollArea = /*#__PURE__*/React.memo(GridScrollAreaRaw);
|
|
119
|
-
export { GridScrollArea };
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Detect Element Resize.
|
|
3
|
-
* https://github.com/sdecima/javascript-detect-element-resize
|
|
4
|
-
* Sebastian Decima
|
|
5
|
-
*
|
|
6
|
-
* Forked from version 0.5.3; includes the following modifications:
|
|
7
|
-
* 1) Guard against unsafe 'window' and 'document' references (to support SSR).
|
|
8
|
-
* 2) Defer initialization code via a top-level function wrapper (to support SSR).
|
|
9
|
-
* 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
|
|
10
|
-
* 4) Add nonce for style element.
|
|
11
|
-
*
|
|
12
|
-
* TODO replace with https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver
|
|
13
|
-
* once browser support allows it.
|
|
14
|
-
**/
|
|
15
|
-
export default function createDetectElementResize(nonce, hostWindow) {
|
|
16
|
-
var resetTriggers = function resetTriggers(element) {
|
|
17
|
-
var triggers = element.__resizeTriggers__,
|
|
18
|
-
expand = triggers.firstElementChild,
|
|
19
|
-
contract = triggers.lastElementChild,
|
|
20
|
-
expandChild = expand.firstElementChild;
|
|
21
|
-
contract.scrollLeft = contract.scrollWidth;
|
|
22
|
-
contract.scrollTop = contract.scrollHeight;
|
|
23
|
-
expandChild.style.width = expand.offsetWidth + 1 + 'px';
|
|
24
|
-
expandChild.style.height = expand.offsetHeight + 1 + 'px';
|
|
25
|
-
expand.scrollLeft = expand.scrollWidth;
|
|
26
|
-
expand.scrollTop = expand.scrollHeight;
|
|
27
|
-
};
|
|
28
|
-
var checkTriggers = function checkTriggers(element) {
|
|
29
|
-
return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;
|
|
30
|
-
};
|
|
31
|
-
var scrollListener = function scrollListener(e) {
|
|
32
|
-
// Don't measure (which forces) reflow for scrolls that happen inside of children!
|
|
33
|
-
if (e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
var element = this;
|
|
37
|
-
resetTriggers(this);
|
|
38
|
-
if (this.__resizeRAF__) {
|
|
39
|
-
hostWindow.cancelAnimationFrame(this.__resizeRAF__);
|
|
40
|
-
}
|
|
41
|
-
this.__resizeRAF__ = hostWindow.requestAnimationFrame(function () {
|
|
42
|
-
if (checkTriggers(element)) {
|
|
43
|
-
element.__resizeLast__.width = element.offsetWidth;
|
|
44
|
-
element.__resizeLast__.height = element.offsetHeight;
|
|
45
|
-
element.__resizeListeners__.forEach(function (fn) {
|
|
46
|
-
fn.call(element, e);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/* Detect CSS Animations support to detect element display/re-attach */
|
|
53
|
-
var animation = false,
|
|
54
|
-
keyframeprefix = '',
|
|
55
|
-
animationstartevent = 'animationstart',
|
|
56
|
-
domPrefixes = 'Webkit Moz O ms'.split(' '),
|
|
57
|
-
startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),
|
|
58
|
-
pfx = '';
|
|
59
|
-
{
|
|
60
|
-
var elm = document.createElement('fakeelement');
|
|
61
|
-
if (elm.style.animationName !== undefined) {
|
|
62
|
-
animation = true;
|
|
63
|
-
}
|
|
64
|
-
if (animation === false) {
|
|
65
|
-
for (var i = 0; i < domPrefixes.length; i++) {
|
|
66
|
-
if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
|
|
67
|
-
pfx = domPrefixes[i];
|
|
68
|
-
keyframeprefix = '-' + pfx.toLowerCase() + '-';
|
|
69
|
-
animationstartevent = startEvents[i];
|
|
70
|
-
animation = true;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
var animationName = 'resizeanim';
|
|
77
|
-
var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
|
|
78
|
-
var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
|
|
79
|
-
var createStyles = function createStyles(doc, root) {
|
|
80
|
-
if (!root.getElementById('muiDetectElementResize')) {
|
|
81
|
-
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
82
|
-
var css = (animationKeyframes ? animationKeyframes : '') + '.Mui-resizeTriggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.Mui-resizeTriggers, .Mui-resizeTriggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
|
|
83
|
-
container = root.constructor.name === 'ShadowRoot' ? root : doc.head || doc.getElementsByTagName('head')[0],
|
|
84
|
-
style = doc.createElement('style');
|
|
85
|
-
style.id = 'muiDetectElementResize';
|
|
86
|
-
style.type = 'text/css';
|
|
87
|
-
if (nonce != null) {
|
|
88
|
-
style.setAttribute('nonce', nonce);
|
|
89
|
-
}
|
|
90
|
-
if (style.styleSheet) {
|
|
91
|
-
style.styleSheet.cssText = css;
|
|
92
|
-
} else {
|
|
93
|
-
style.appendChild(doc.createTextNode(css));
|
|
94
|
-
}
|
|
95
|
-
container.appendChild(style);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var addResizeListener = function addResizeListener(element, fn) {
|
|
99
|
-
if (!element.__resizeTriggers__) {
|
|
100
|
-
var doc = element.ownerDocument;
|
|
101
|
-
var elementStyle = hostWindow.getComputedStyle(element);
|
|
102
|
-
if (elementStyle && elementStyle.position == 'static') {
|
|
103
|
-
element.style.position = 'relative';
|
|
104
|
-
}
|
|
105
|
-
createStyles(doc, element.getRootNode());
|
|
106
|
-
element.__resizeLast__ = {};
|
|
107
|
-
element.__resizeListeners__ = [];
|
|
108
|
-
(element.__resizeTriggers__ = doc.createElement('div')).className = 'Mui-resizeTriggers';
|
|
109
|
-
element.__resizeTriggers__.innerHTML = '<div class="expand-trigger"><div></div></div>' + '<div class="contract-trigger"></div>';
|
|
110
|
-
element.appendChild(element.__resizeTriggers__);
|
|
111
|
-
resetTriggers(element);
|
|
112
|
-
element.addEventListener('scroll', scrollListener, true);
|
|
113
|
-
|
|
114
|
-
/* Listen for a css animation to detect element display/re-attach */
|
|
115
|
-
if (animationstartevent) {
|
|
116
|
-
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
117
|
-
if (e.animationName == animationName) {
|
|
118
|
-
resetTriggers(element);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
element.__resizeListeners__.push(fn);
|
|
125
|
-
};
|
|
126
|
-
var removeResizeListener = function removeResizeListener(element, fn) {
|
|
127
|
-
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
|
128
|
-
if (!element.__resizeListeners__.length) {
|
|
129
|
-
element.removeEventListener('scroll', scrollListener, true);
|
|
130
|
-
if (element.__resizeTriggers__.__animationListener__) {
|
|
131
|
-
element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
|
|
132
|
-
element.__resizeTriggers__.__animationListener__ = null;
|
|
133
|
-
}
|
|
134
|
-
try {
|
|
135
|
-
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
|
|
136
|
-
} catch (e) {
|
|
137
|
-
// Preact compat; see developit/preact-compat/issues/228
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
return {
|
|
142
|
-
addResizeListener: addResizeListener,
|
|
143
|
-
removeResizeListener: removeResizeListener
|
|
144
|
-
};
|
|
145
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Detect Element Resize.
|
|
3
|
-
* https://github.com/sdecima/javascript-detect-element-resize
|
|
4
|
-
* Sebastian Decima
|
|
5
|
-
*
|
|
6
|
-
* Forked from version 0.5.3; includes the following modifications:
|
|
7
|
-
* 1) Guard against unsafe 'window' and 'document' references (to support SSR).
|
|
8
|
-
* 2) Defer initialization code via a top-level function wrapper (to support SSR).
|
|
9
|
-
* 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
|
|
10
|
-
* 4) Add nonce for style element.
|
|
11
|
-
*
|
|
12
|
-
* TODO replace with https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver
|
|
13
|
-
* once browser support allows it.
|
|
14
|
-
**/
|
|
15
|
-
export default function createDetectElementResize(nonce: any, hostWindow: any): {
|
|
16
|
-
addResizeListener: (element: any, fn: any) => void;
|
|
17
|
-
removeResizeListener: (element: any, fn: any) => void;
|
|
18
|
-
};
|