@mui/x-data-grid 7.14.0 → 7.15.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/components/cell/GridActionsCell.js +3 -3
  3. package/components/panel/GridPanel.d.ts +1 -1
  4. package/hooks/core/gridCoreSelector.d.ts +1 -1
  5. package/hooks/core/gridCoreSelector.js +1 -1
  6. package/hooks/core/useGridInitialization.js +2 -2
  7. package/hooks/core/{useGridTheme.d.ts → useGridIsRtl.d.ts} +1 -1
  8. package/hooks/core/{useGridTheme.js → useGridIsRtl.js} +7 -7
  9. package/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -3
  10. package/hooks/features/columnResize/useGridColumnResize.js +5 -5
  11. package/hooks/features/columns/gridColumnsSelector.js +3 -3
  12. package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +19 -20
  13. package/hooks/features/scroll/useGridScroll.js +4 -4
  14. package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -2
  15. package/hooks/features/virtualization/useGridVirtualScroller.js +13 -13
  16. package/index.js +1 -1
  17. package/models/gridStateCommunity.d.ts +1 -2
  18. package/modern/components/cell/GridActionsCell.js +3 -3
  19. package/modern/hooks/core/gridCoreSelector.js +1 -1
  20. package/modern/hooks/core/useGridInitialization.js +2 -2
  21. package/modern/hooks/core/{useGridTheme.js → useGridIsRtl.js} +7 -7
  22. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +4 -3
  23. package/modern/hooks/features/columnResize/useGridColumnResize.js +5 -5
  24. package/modern/hooks/features/columns/gridColumnsSelector.js +3 -3
  25. package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +19 -20
  26. package/modern/hooks/features/scroll/useGridScroll.js +4 -4
  27. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +13 -13
  28. package/modern/index.js +1 -1
  29. package/node/components/cell/GridActionsCell.js +3 -3
  30. package/node/hooks/core/gridCoreSelector.js +3 -3
  31. package/node/hooks/core/useGridInitialization.js +2 -2
  32. package/node/hooks/core/{useGridTheme.js → useGridIsRtl.js} +9 -9
  33. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +3 -2
  34. package/node/hooks/features/columnResize/useGridColumnResize.js +5 -5
  35. package/node/hooks/features/columns/gridColumnsSelector.js +2 -2
  36. package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +19 -20
  37. package/node/hooks/features/scroll/useGridScroll.js +4 -4
  38. package/node/hooks/features/virtualization/useGridVirtualScroller.js +13 -13
  39. package/node/index.js +1 -1
  40. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,75 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 7.15.0
7
+
8
+ _Aug 29, 2024_
9
+
10
+ We'd like to offer a big thanks to the 8 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 💫 Support Material UI v6 (`@mui/material@6`) peer dependency (#14142) @cherniavskii
13
+
14
+ You can now use MUI X components with either v5 or v6 of `@mui/material` package 🎉
15
+
16
+ - 🐞 Bugfixes
17
+
18
+ ### Data Grid
19
+
20
+ #### `@mui/x-data-grid-pro@7.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
21
+
22
+ - [DataGridPro] Export `GridRowReorderCell` component (#14079) @genepaul
23
+
24
+ #### `@mui/x-data-grid-premium@7.15.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
25
+
26
+ Same changes as in `@mui/x-data-grid-pro@7.15.0`.
27
+
28
+ ### Date and Time Pickers
29
+
30
+ #### `@mui/x-date-pickers@7.15.0`
31
+
32
+ - [pickers] Add `onTouchStart` handler for `TimeClock` (#14305) @arthurbalduini
33
+
34
+ #### `@mui/x-date-pickers-pro@7.15.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
35
+
36
+ Same changes as in `@mui/x-date-pickers@7.15.0`, plus:
37
+
38
+ - [DateTimeRangePicker] Fix date format resolving from views on 24hr locales (#14341) @arthurbalduini
39
+
40
+ ### Charts
41
+
42
+ #### `@mui/x-charts@7.15.0`
43
+
44
+ - [charts] Add missing `themeAugmentation` in pro plan (#14313) @lhilgert9
45
+ - [charts] Fix `LineChart` transition stopping before completion (#14366) @JCQuintas
46
+ - [charts] Fix tooltip with horizontal layout (#14337) @alexfauquette
47
+ - [charts] Keep axis root classe usage explicit (#14378) @alexfauquette
48
+
49
+ #### `@mui/x-charts-pro@7.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
50
+
51
+ Same changes as in `@mui/x-charts@7.15.0`, plus:
52
+
53
+ - [charts pro] Avoid relative reference to `@mui/x-charts` package (#14335) @LukasTy
54
+
55
+ ### Docs
56
+
57
+ - [docs] Fix sentence case `h2` @oliviertassinari
58
+ - [docs] Clarify contribution guide references @oliviertassinari
59
+ - [docs] Fix Stack Overflow issue canned response @oliviertassinari
60
+ - [docs] Fix outdated link to support page @oliviertassinari
61
+ - [docs] Fix use of Material UI @oliviertassinari
62
+ - [docs] Update deprecated props in docs (#14295) @JCQuintas
63
+
64
+ ### Core
65
+
66
+ - [core] Allow only v5.x for `MUI Core` renovate group (#14382) @LukasTy
67
+ - [core] Avoid visual regression when using `@mui/material@6` (#14357) @cherniavskii
68
+ - [core] Remove renovate rule targeting only `next` releases of `@mui/docs` (#14364) @LukasTy
69
+ - [core] Support `@mui/material@6` peer dependency (#14142) @cherniavskii
70
+ - [core] Use `useRtl` instead of `useTheme` to access direction (#14359) @LukasTy
71
+ - [code-infra] Typecheck nested folders in playground (#14352) @JCQuintas
72
+ - [infra] Fix Issue cleanup action @oliviertassinari
73
+ - [license] Prepare renaming of argument names @oliviertassinari
74
+
6
75
  ## 7.14.0
7
76
 
8
77
  _Aug 23, 2024_
@@ -4,7 +4,7 @@ const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "va
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import MenuList from '@mui/material/MenuList';
7
- import { useTheme } from '@mui/material/styles';
7
+ import { useRtl } from '@mui/system/RtlProvider';
8
8
  import { unstable_useId as useId } from '@mui/utils';
9
9
  import { gridClasses } from '../../constants/gridClasses';
10
10
  import { GridMenu } from '../menu/GridMenu';
@@ -29,7 +29,7 @@ function GridActionsCell(props) {
29
29
  const buttonRef = React.useRef(null);
30
30
  const ignoreCallToFocus = React.useRef(false);
31
31
  const touchRippleRefs = React.useRef({});
32
- const theme = useTheme();
32
+ const isRtl = useRtl();
33
33
  const menuId = useId();
34
34
  const buttonId = useId();
35
35
  const rootProps = useGridRootProps();
@@ -110,7 +110,7 @@ function GridActionsCell(props) {
110
110
  }
111
111
 
112
112
  // for rtl mode we need to reverse the direction
113
- const rtlMod = theme.direction === 'rtl' ? -1 : 1;
113
+ const rtlMod = isRtl ? -1 : 1;
114
114
  const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
115
115
 
116
116
  // if the button that should receive focus is disabled go one more step
@@ -16,7 +16,7 @@ export interface GridPanelProps extends Partial<React.ComponentProps<typeof Grid
16
16
  open: boolean;
17
17
  }
18
18
  export declare const gridPanelClasses: Record<keyof GridPanelClasses, string>;
19
- declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Popper").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "slots" | "slotProps" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
19
+ declare const GridPanelRoot: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Popper").PopperProps & React.RefAttributes<HTMLDivElement>, "hidden" | "color" | "content" | "style" | "open" | "translate" | "container" | "transition" | "slot" | "title" | "ref" | "suppressHydrationWarning" | "className" | "id" | "lang" | "role" | "tabIndex" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "nonce" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "component" | "sx" | "components" | "componentsProps" | "placement" | "disablePortal" | "modifiers" | "anchorEl" | "keepMounted" | "popperOptions" | "popperRef" | "slotProps" | "slots"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
20
20
  ownerState: OwnerState;
21
21
  }, {}, {}>;
22
22
  declare const GridPanel: React.ForwardRefExoticComponent<Omit<GridPanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -3,4 +3,4 @@ import { GridStateCommunity } from '../../models/gridStateCommunity';
3
3
  * Get the theme state
4
4
  * @category Core
5
5
  */
6
- export declare const gridThemeSelector: (state: GridStateCommunity) => import("@mui/material").Theme;
6
+ export declare const gridIsRtlSelector: (state: GridStateCommunity) => boolean;
@@ -2,4 +2,4 @@
2
2
  * Get the theme state
3
3
  * @category Core
4
4
  */
5
- export const gridThemeSelector = state => state.theme;
5
+ export const gridIsRtlSelector = state => state.isRtl;
@@ -1,5 +1,5 @@
1
1
  import { useGridRefs } from './useGridRefs';
2
- import { useGridTheme } from './useGridTheme';
2
+ import { useGridIsRtl } from './useGridIsRtl';
3
3
  import { useGridLoggerFactory } from './useGridLoggerFactory';
4
4
  import { useGridApiInitialization } from './useGridApiInitialization';
5
5
  import { useGridLocaleText } from './useGridLocaleText';
@@ -13,7 +13,7 @@ import { useGridStateInitialization } from './useGridStateInitialization';
13
13
  export const useGridInitialization = (inputApiRef, props) => {
14
14
  const privateApiRef = useGridApiInitialization(inputApiRef, props);
15
15
  useGridRefs(privateApiRef);
16
- useGridTheme(privateApiRef);
16
+ useGridIsRtl(privateApiRef);
17
17
  useGridLoggerFactory(privateApiRef, props);
18
18
  useGridStateInitialization(privateApiRef);
19
19
  useGridPipeProcessing(privateApiRef);
@@ -1,3 +1,3 @@
1
1
  import * as React from 'react';
2
2
  import { GridPrivateApiCommon } from '../../models/api/gridApiCommon';
3
- export declare const useGridTheme: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
3
+ export declare const useGridIsRtl: (apiRef: React.MutableRefObject<GridPrivateApiCommon>) => void;
@@ -1,10 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useTheme } from '@mui/material/styles';
4
- export const useGridTheme = apiRef => {
5
- const theme = useTheme();
6
- if (!apiRef.current.state.theme) {
7
- apiRef.current.state.theme = theme;
3
+ import { useRtl } from '@mui/system/RtlProvider';
4
+ export const useGridIsRtl = apiRef => {
5
+ const isRtl = useRtl();
6
+ if (apiRef.current.state.isRtl === undefined) {
7
+ apiRef.current.state.isRtl = isRtl;
8
8
  }
9
9
  const isFirstEffect = React.useRef(true);
10
10
  React.useEffect(() => {
@@ -12,8 +12,8 @@ export const useGridTheme = apiRef => {
12
12
  isFirstEffect.current = false;
13
13
  } else {
14
14
  apiRef.current.setState(state => _extends({}, state, {
15
- theme
15
+ isRtl
16
16
  }));
17
17
  }
18
- }, [apiRef, theme]);
18
+ }, [apiRef, isRtl]);
19
19
  };
@@ -1,7 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import clsx from 'clsx';
4
- import { styled, useTheme } from '@mui/material/styles';
4
+ import { styled } from '@mui/material/styles';
5
+ import { useRtl } from '@mui/system/RtlProvider';
5
6
  import { useGridSelector } from '../../utils';
6
7
  import { useGridRootProps } from '../../utils/useGridRootProps';
7
8
  import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
@@ -44,7 +45,7 @@ export const useGridColumnHeaders = props => {
44
45
  const [dragCol, setDragCol] = React.useState('');
45
46
  const [resizeCol, setResizeCol] = React.useState('');
46
47
  const apiRef = useGridPrivateApiContext();
47
- const theme = useTheme();
48
+ const isRtl = useRtl();
48
49
  const rootProps = useGridRootProps();
49
50
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
50
51
  const hasVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
@@ -53,7 +54,7 @@ export const useGridColumnHeaders = props => {
53
54
  const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
54
55
  const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
55
56
  const pinnedRows = useGridSelector(apiRef, gridPinnedRowsSelector);
56
- const offsetLeft = computeOffsetLeft(columnPositions, renderContext, theme.direction, pinnedColumns.left.length);
57
+ const offsetLeft = computeOffsetLeft(columnPositions, renderContext, isRtl, pinnedColumns.left.length);
57
58
  const gridHasFiller = dimensions.columnsTotalWidth < dimensions.viewportOuterSize.width;
58
59
  React.useEffect(() => {
59
60
  apiRef.current.columnHeadersContainerRef.current.scrollLeft = 0;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import { unstable_ownerDocument as ownerDocument, unstable_useEventCallback as useEventCallback } from '@mui/utils';
4
4
  import useLazyRef from '@mui/utils/useLazyRef';
5
- import { useTheme } from '@mui/material/styles';
5
+ import { useRtl } from '@mui/system/RtlProvider';
6
6
  import { findGridCellElementsFromCol, findGridElement, findLeftPinnedCellsAfterCol, findRightPinnedCellsBeforeCol, getFieldFromHeaderElem, findHeaderElementFromField, getFieldsFromGroupHeaderElem, findGroupHeaderElementsFromField, findGridHeader, findGridCells, findParentElementFromClassName, findLeftPinnedHeadersAfterCol, findRightPinnedHeadersBeforeCol, escapeOperandAttributeSelector } from '../../../utils/domUtils';
7
7
  import { DEFAULT_GRID_AUTOSIZE_OPTIONS } from './gridColumnResizeApi';
8
8
  import { gridClasses } from '../../../constants/gridClasses';
@@ -52,9 +52,9 @@ function flipResizeDirection(side) {
52
52
  }
53
53
  return 'Right';
54
54
  }
55
- function getResizeDirection(separator, direction) {
55
+ function getResizeDirection(separator, isRtl) {
56
56
  const side = separator.classList.contains(gridClasses['columnSeparator--sideRight']) ? 'Right' : 'Left';
57
- if (direction === 'rtl') {
57
+ if (isRtl) {
58
58
  // Resizing logic should be mirrored in the RTL case
59
59
  return flipResizeDirection(side);
60
60
  }
@@ -177,7 +177,7 @@ function createResizeRefs() {
177
177
  * TODO: improve experience for last column
178
178
  */
179
179
  export const useGridColumnResize = (apiRef, props) => {
180
- const theme = useTheme();
180
+ const isRtl = useRtl();
181
181
  const logger = useGridLogger(apiRef, 'useGridColumnResize');
182
182
  const refs = useLazyRef(createResizeRefs).current;
183
183
 
@@ -317,7 +317,7 @@ export const useGridColumnResize = (apiRef, props) => {
317
317
  refs.rightPinnedCellsBefore = pinnedPosition !== GridPinnedColumnPosition.RIGHT ? [] : findRightPinnedCellsBeforeCol(apiRef.current, refs.columnHeaderElement);
318
318
  refs.leftPinnedHeadersAfter = pinnedPosition !== GridPinnedColumnPosition.LEFT ? [] : findLeftPinnedHeadersAfterCol(apiRef.current, refs.columnHeaderElement);
319
319
  refs.rightPinnedHeadersBefore = pinnedPosition !== GridPinnedColumnPosition.RIGHT ? [] : findRightPinnedHeadersBeforeCol(apiRef.current, refs.columnHeaderElement);
320
- resizeDirection.current = getResizeDirection(separator, theme.direction);
320
+ resizeDirection.current = getResizeDirection(separator, isRtl);
321
321
  initialOffsetToSeparator.current = computeOffsetToSeparator(xStart, refs.columnHeaderElement.getBoundingClientRect(), resizeDirection.current);
322
322
  };
323
323
  const handleResizeMouseUp = useEventCallback(finishResize);
@@ -1,6 +1,6 @@
1
1
  import { createSelector, createSelectorMemoized } from '../../../utils/createSelector';
2
2
  import { EMPTY_PINNED_COLUMN_FIELDS } from './gridColumnsInterfaces';
3
- import { gridThemeSelector } from '../../core/gridCoreSelector';
3
+ import { gridIsRtlSelector } from '../../core/gridCoreSelector';
4
4
 
5
5
  /**
6
6
  * Get the columns state
@@ -55,8 +55,8 @@ export const gridPinnedColumnsSelector = state => state.pinnedColumns;
55
55
  * Get the visible pinned columns.
56
56
  * @category Visible Columns
57
57
  */
58
- export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridThemeSelector, (columnsState, model, visibleColumnFields, theme) => {
59
- const visiblePinnedFields = filterVisibleColumns(model, visibleColumnFields, theme.direction === 'rtl');
58
+ export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridIsRtlSelector, (columnsState, model, visibleColumnFields, isRtl) => {
59
+ const visiblePinnedFields = filterVisibleColumns(model, visibleColumnFields, isRtl);
60
60
  const visiblePinnedColumns = {
61
61
  left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),
62
62
  right: visiblePinnedFields.right.map(field => columnsState.lookup[field])
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useTheme } from '@mui/material/styles';
2
+ import { useRtl } from '@mui/system/RtlProvider';
3
3
  import { gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';
4
4
  import { useGridLogger } from '../../utils/useGridLogger';
5
5
  import { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';
@@ -24,13 +24,13 @@ const getLeftColumnIndex = ({
24
24
  currentColIndex,
25
25
  firstColIndex,
26
26
  lastColIndex,
27
- direction
27
+ isRtl
28
28
  }) => {
29
- if (direction === 'rtl') {
29
+ if (isRtl) {
30
30
  if (currentColIndex < lastColIndex) {
31
31
  return currentColIndex + 1;
32
32
  }
33
- } else if (direction === 'ltr') {
33
+ } else if (!isRtl) {
34
34
  if (currentColIndex > firstColIndex) {
35
35
  return currentColIndex - 1;
36
36
  }
@@ -41,13 +41,13 @@ const getRightColumnIndex = ({
41
41
  currentColIndex,
42
42
  firstColIndex,
43
43
  lastColIndex,
44
- direction
44
+ isRtl
45
45
  }) => {
46
- if (direction === 'rtl') {
46
+ if (isRtl) {
47
47
  if (currentColIndex > firstColIndex) {
48
48
  return currentColIndex - 1;
49
49
  }
50
- } else if (direction === 'ltr') {
50
+ } else if (!isRtl) {
51
51
  if (currentColIndex < lastColIndex) {
52
52
  return currentColIndex + 1;
53
53
  }
@@ -67,7 +67,7 @@ const getRightColumnIndex = ({
67
67
  export const useGridKeyboardNavigation = (apiRef, props) => {
68
68
  const logger = useGridLogger(apiRef, 'useGridKeyboardNavigation');
69
69
  const initialCurrentPageRows = useGridVisibleRows(apiRef, props).rows;
70
- const theme = useTheme();
70
+ const isRtl = useRtl();
71
71
  const currentPageRows = React.useMemo(() => enrichPageRowsWithPinnedRows(apiRef, initialCurrentPageRows), [apiRef, initialCurrentPageRows]);
72
72
  const headerFilteringEnabled = props.signature !== 'DataGrid' && props.headerFilters;
73
73
 
@@ -161,7 +161,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
161
161
  currentColIndex: colIndexBefore,
162
162
  firstColIndex,
163
163
  lastColIndex,
164
- direction: theme.direction
164
+ isRtl
165
165
  });
166
166
  if (rightColIndex !== null) {
167
167
  goToHeader(rightColIndex, event);
@@ -174,7 +174,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
174
174
  currentColIndex: colIndexBefore,
175
175
  firstColIndex,
176
176
  lastColIndex,
177
- direction: theme.direction
177
+ isRtl
178
178
  });
179
179
  if (leftColIndex !== null) {
180
180
  goToHeader(leftColIndex, event);
@@ -225,7 +225,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
225
225
  if (shouldPreventDefault) {
226
226
  event.preventDefault();
227
227
  }
228
- }, [apiRef, currentPageRows.length, headerFilteringEnabled, goToHeaderFilter, goToCell, getRowIdFromIndex, theme.direction, goToHeader, goToGroupHeader]);
228
+ }, [apiRef, currentPageRows.length, headerFilteringEnabled, goToHeaderFilter, goToCell, getRowIdFromIndex, isRtl, goToHeader, goToGroupHeader]);
229
229
  const handleHeaderFilterKeyDown = React.useCallback((params, event) => {
230
230
  const isEditing = gridHeaderFilteringEditFieldSelector(apiRef) === params.field;
231
231
  const isHeaderMenuOpen = gridHeaderFilteringMenuSelector(apiRef) === params.field;
@@ -254,7 +254,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
254
254
  currentColIndex: colIndexBefore,
255
255
  firstColIndex,
256
256
  lastColIndex,
257
- direction: theme.direction
257
+ isRtl
258
258
  });
259
259
  if (rightColIndex !== null) {
260
260
  goToHeaderFilter(rightColIndex, event);
@@ -267,7 +267,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
267
267
  currentColIndex: colIndexBefore,
268
268
  firstColIndex,
269
269
  lastColIndex,
270
- direction: theme.direction
270
+ isRtl
271
271
  });
272
272
  if (leftColIndex !== null) {
273
273
  goToHeaderFilter(leftColIndex, event);
@@ -311,7 +311,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
311
311
  if (shouldPreventDefault) {
312
312
  event.preventDefault();
313
313
  }
314
- }, [apiRef, currentPageRows.length, goToHeaderFilter, theme.direction, goToHeader, goToCell, getRowIdFromIndex]);
314
+ }, [apiRef, currentPageRows.length, goToHeaderFilter, isRtl, goToHeader, goToCell, getRowIdFromIndex]);
315
315
  const handleColumnGroupHeaderKeyDown = React.useCallback((params, event) => {
316
316
  const focusedColumnGroup = gridFocusColumnGroupHeaderSelector(apiRef);
317
317
  if (focusedColumnGroup === null) {
@@ -419,7 +419,6 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
419
419
  if (currentPageRows.length === 0) {
420
420
  return;
421
421
  }
422
- const direction = theme.direction;
423
422
  const viewportPageSize = apiRef.current.getViewportPageSize();
424
423
  const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;
425
424
  const rowIndexBefore = currentPageRows.findIndex(row => row.id === params.id);
@@ -454,10 +453,10 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
454
453
  currentColIndex: colIndexBefore,
455
454
  firstColIndex,
456
455
  lastColIndex,
457
- direction
456
+ isRtl
458
457
  });
459
458
  if (rightColIndex !== null) {
460
- goToCell(rightColIndex, getRowIdFromIndex(rowIndexBefore), direction === 'rtl' ? 'left' : 'right');
459
+ goToCell(rightColIndex, getRowIdFromIndex(rowIndexBefore), isRtl ? 'left' : 'right');
461
460
  }
462
461
  break;
463
462
  }
@@ -467,10 +466,10 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
467
466
  currentColIndex: colIndexBefore,
468
467
  firstColIndex,
469
468
  lastColIndex,
470
- direction
469
+ isRtl
471
470
  });
472
471
  if (leftColIndex !== null) {
473
- goToCell(leftColIndex, getRowIdFromIndex(rowIndexBefore), direction === 'rtl' ? 'right' : 'left');
472
+ goToCell(leftColIndex, getRowIdFromIndex(rowIndexBefore), isRtl ? 'right' : 'left');
474
473
  }
475
474
  break;
476
475
  }
@@ -545,7 +544,7 @@ export const useGridKeyboardNavigation = (apiRef, props) => {
545
544
  if (shouldPreventDefault) {
546
545
  event.preventDefault();
547
546
  }
548
- }, [apiRef, currentPageRows, theme.direction, goToCell, getRowIdFromIndex, headerFilteringEnabled, goToHeaderFilter, goToHeader]);
547
+ }, [apiRef, currentPageRows, isRtl, goToCell, getRowIdFromIndex, headerFilteringEnabled, goToHeaderFilter, goToHeader]);
549
548
  const checkIfCanStartEditing = React.useCallback((initialValue, {
550
549
  event
551
550
  }) => {
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useTheme } from '@mui/material/styles';
2
+ import { useRtl } from '@mui/system/RtlProvider';
3
3
  import { useGridLogger } from '../../utils/useGridLogger';
4
4
  import { gridColumnPositionsSelector, gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';
5
5
  import { useGridSelector } from '../../utils/useGridSelector';
@@ -43,7 +43,7 @@ function scrollIntoView(dimensions) {
43
43
  * @requires useGridColumnSpanning (method)
44
44
  */
45
45
  export const useGridScroll = (apiRef, props) => {
46
- const theme = useTheme();
46
+ const isRtl = useRtl();
47
47
  const logger = useGridLogger(apiRef, 'useGridScroll');
48
48
  const colRef = apiRef.current.columnHeadersContainerRef;
49
49
  const virtualScrollerRef = apiRef.current.virtualScrollerRef;
@@ -101,7 +101,7 @@ export const useGridScroll = (apiRef, props) => {
101
101
  }, [logger, apiRef, virtualScrollerRef, props.pagination, visibleSortedRows]);
102
102
  const scroll = React.useCallback(params => {
103
103
  if (virtualScrollerRef.current && params.left !== undefined && colRef.current) {
104
- const direction = theme.direction === 'rtl' ? -1 : 1;
104
+ const direction = isRtl ? -1 : 1;
105
105
  colRef.current.scrollLeft = params.left;
106
106
  virtualScrollerRef.current.scrollLeft = direction * params.left;
107
107
  logger.debug(`Scrolling left: ${params.left}`);
@@ -111,7 +111,7 @@ export const useGridScroll = (apiRef, props) => {
111
111
  logger.debug(`Scrolling top: ${params.top}`);
112
112
  }
113
113
  logger.debug(`Scrolling, updating container, and viewport`);
114
- }, [virtualScrollerRef, theme.direction, colRef, logger]);
114
+ }, [virtualScrollerRef, isRtl, colRef, logger]);
115
115
  const getScrollPosition = React.useCallback(() => {
116
116
  if (!virtualScrollerRef?.current) {
117
117
  return {
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import { Theme } from '@mui/material/styles';
3
2
  import { GridPinnedRowsPosition } from '../rows/gridRowsInterfaces';
4
3
  import type { GridRenderContext, GridColumnsRenderContext, GridRowEntry, GridRowId } from '../../../models';
5
4
  export type VirtualScroller = ReturnType<typeof useGridVirtualScroller>;
@@ -41,4 +40,4 @@ export declare const useGridVirtualScroller: () => {
41
40
  };
42
41
  };
43
42
  export declare function areRenderContextsEqual(context1: GridRenderContext, context2: GridRenderContext): boolean;
44
- export declare function computeOffsetLeft(columnPositions: number[], renderContext: GridColumnsRenderContext, direction: Theme['direction'], pinnedLeftLength: number): number;
43
+ export declare function computeOffsetLeft(columnPositions: number[], renderContext: GridColumnsRenderContext, isRtl: boolean, pinnedLeftLength: number): number;
@@ -5,7 +5,7 @@ import { unstable_useEnhancedEffect as useEnhancedEffect, unstable_useEventCallb
5
5
  import useLazyRef from '@mui/utils/useLazyRef';
6
6
  import useTimeout from '@mui/utils/useTimeout';
7
7
  import { useResizeObserver } from '@mui/x-internals/useResizeObserver';
8
- import { useTheme } from '@mui/material/styles';
8
+ import { useRtl } from '@mui/system/RtlProvider';
9
9
  import { useGridPrivateApiContext } from '../../utils/useGridPrivateApiContext';
10
10
  import { useGridRootProps } from '../../utils/useGridRootProps';
11
11
  import { useGridSelector } from '../../utils/useGridSelector';
@@ -39,9 +39,9 @@ const EMPTY_SCROLL_POSITION = {
39
39
  left: 0
40
40
  };
41
41
  export const EMPTY_DETAIL_PANELS = Object.freeze(new Map());
42
- const createScrollCache = (mode, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) => ({
42
+ const createScrollCache = (isRtl, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) => ({
43
43
  direction: ScrollDirection.NONE,
44
- buffer: bufferForDirection(mode, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
44
+ buffer: bufferForDirection(isRtl, ScrollDirection.NONE, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer)
45
45
  });
46
46
  let isJSDOM = false;
47
47
  try {
@@ -63,7 +63,7 @@ export const useGridVirtualScroller = () => {
63
63
  const pinnedColumns = useGridSelector(apiRef, gridVisiblePinnedColumnDefinitionsSelector);
64
64
  const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
65
65
  const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
66
- const theme = useTheme();
66
+ const isRtl = useRtl();
67
67
  const cellFocus = useGridSelector(apiRef, gridFocusCellSelector);
68
68
  const cellTabIndex = useGridSelector(apiRef, gridTabIndexCellSelector);
69
69
  const rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);
@@ -100,7 +100,7 @@ export const useGridVirtualScroller = () => {
100
100
  const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
101
101
  const scrollTimeout = useTimeout();
102
102
  const frozenContext = React.useRef(undefined);
103
- const scrollCache = useLazyRef(() => createScrollCache(theme.direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
103
+ const scrollCache = useLazyRef(() => createScrollCache(isRtl, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6)).current;
104
104
  const focusedCell = {
105
105
  rowIndex: React.useMemo(() => cellFocus ? currentPage.rows.findIndex(row => row.id === cellFocus.id) : -1, [cellFocus, currentPage.rows]),
106
106
  columnIndex: React.useMemo(() => cellFocus ? visibleColumns.findIndex(column => column.field === cellFocus.field) : -1, [cellFocus, visibleColumns])
@@ -165,7 +165,7 @@ export const useGridVirtualScroller = () => {
165
165
  }
166
166
  }
167
167
  scrollCache.direction = direction;
168
- scrollCache.buffer = bufferForDirection(theme.direction, direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);
168
+ scrollCache.buffer = bufferForDirection(isRtl, direction, rootProps.rowBufferPx, rootProps.columnBufferPx, dimensions.rowHeight * 15, MINIMUM_COLUMN_WIDTH * 6);
169
169
  const inputs = inputsSelector(apiRef, rootProps, enabled, enabledForColumns);
170
170
  const nextRenderContext = computeRenderContext(inputs, scrollPosition.current, scrollCache);
171
171
 
@@ -193,12 +193,12 @@ export const useGridVirtualScroller = () => {
193
193
  if (scrollTop < 0) {
194
194
  return;
195
195
  }
196
- if (theme.direction === 'ltr') {
196
+ if (!isRtl) {
197
197
  if (scrollLeft < 0) {
198
198
  return;
199
199
  }
200
200
  }
201
- if (theme.direction === 'rtl') {
201
+ if (isRtl) {
202
202
  if (scrollLeft > 0) {
203
203
  return;
204
204
  }
@@ -325,7 +325,7 @@ export const useGridVirtualScroller = () => {
325
325
  if (!isPinnedSection && frozenContext.current && rowIndexInPage >= frozenContext.current.firstRowIndex && rowIndexInPage < frozenContext.current.lastRowIndex) {
326
326
  currentRenderContext = frozenContext.current;
327
327
  }
328
- const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, theme.direction, pinnedColumns.left.length);
328
+ const offsetLeft = computeOffsetLeft(columnPositions, currentRenderContext, isRtl, pinnedColumns.left.length);
329
329
  const showBottomBorder = isLastVisibleInSection && params.position === 'top';
330
330
  rows.push( /*#__PURE__*/_jsx(rootProps.slots.row, _extends({
331
331
  row: model,
@@ -645,8 +645,8 @@ export function areRenderContextsEqual(context1, context2) {
645
645
  }
646
646
  return context1.firstRowIndex === context2.firstRowIndex && context1.lastRowIndex === context2.lastRowIndex && context1.firstColumnIndex === context2.firstColumnIndex && context1.lastColumnIndex === context2.lastColumnIndex;
647
647
  }
648
- export function computeOffsetLeft(columnPositions, renderContext, direction, pinnedLeftLength) {
649
- const factor = direction === 'ltr' ? 1 : -1;
648
+ export function computeOffsetLeft(columnPositions, renderContext, isRtl, pinnedLeftLength) {
649
+ const factor = isRtl ? -1 : 1;
650
650
  const left = factor * (columnPositions[renderContext.firstColumnIndex] ?? 0) - (columnPositions[pinnedLeftLength] ?? 0);
651
651
  return Math.abs(left);
652
652
  }
@@ -670,8 +670,8 @@ function directionForDelta(dx, dy) {
670
670
  }
671
671
  /* eslint-enable */
672
672
  }
673
- function bufferForDirection(mode, direction, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) {
674
- if (mode === 'rtl') {
673
+ function bufferForDirection(isRtl, direction, rowBufferPx, columnBufferPx, verticalBuffer, horizontalBuffer) {
674
+ if (isRtl) {
675
675
  switch (direction) {
676
676
  case ScrollDirection.LEFT:
677
677
  direction = ScrollDirection.RIGHT;
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.14.0
2
+ * @mui/x-data-grid v7.15.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,4 +1,3 @@
1
- import type { Theme } from '@mui/material/styles';
2
1
  import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridColumnPinningState, GridDensityState, GridDimensionsState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState, GridVirtualizationState } from '../hooks';
3
2
  import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
4
3
  import type { GridEditingState } from './gridEditRowModel';
@@ -10,7 +9,7 @@ import type { GridColumnResizeState } from '../hooks/features/columnResize';
10
9
  * The state of `DataGrid`.
11
10
  */
12
11
  export interface GridStateCommunity {
13
- theme: Theme;
12
+ isRtl: boolean;
14
13
  dimensions: GridDimensionsState;
15
14
  rows: GridRowsState;
16
15
  visibleRowsLookup: GridVisibleRowsLookupState;
@@ -4,7 +4,7 @@ const _excluded = ["api", "colDef", "id", "hasFocus", "isEditable", "field", "va
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import MenuList from '@mui/material/MenuList';
7
- import { useTheme } from '@mui/material/styles';
7
+ import { useRtl } from '@mui/system/RtlProvider';
8
8
  import { unstable_useId as useId } from '@mui/utils';
9
9
  import { gridClasses } from '../../constants/gridClasses';
10
10
  import { GridMenu } from '../menu/GridMenu';
@@ -29,7 +29,7 @@ function GridActionsCell(props) {
29
29
  const buttonRef = React.useRef(null);
30
30
  const ignoreCallToFocus = React.useRef(false);
31
31
  const touchRippleRefs = React.useRef({});
32
- const theme = useTheme();
32
+ const isRtl = useRtl();
33
33
  const menuId = useId();
34
34
  const buttonId = useId();
35
35
  const rootProps = useGridRootProps();
@@ -110,7 +110,7 @@ function GridActionsCell(props) {
110
110
  }
111
111
 
112
112
  // for rtl mode we need to reverse the direction
113
- const rtlMod = theme.direction === 'rtl' ? -1 : 1;
113
+ const rtlMod = isRtl ? -1 : 1;
114
114
  const indexMod = (direction === 'left' ? -1 : 1) * rtlMod;
115
115
 
116
116
  // if the button that should receive focus is disabled go one more step
@@ -2,4 +2,4 @@
2
2
  * Get the theme state
3
3
  * @category Core
4
4
  */
5
- export const gridThemeSelector = state => state.theme;
5
+ export const gridIsRtlSelector = state => state.isRtl;