@mui/x-data-grid 8.0.0-alpha.3 → 8.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +377 -0
  2. package/DataGrid/DataGrid.js +7 -11
  3. package/DataGrid/useDataGridProps.js +3 -3
  4. package/README.md +1 -1
  5. package/components/GridRow.js +13 -2
  6. package/components/cell/GridActionsCell.js +8 -1
  7. package/components/cell/GridActionsCellItem.js +4 -6
  8. package/components/cell/GridCell.js +1 -1
  9. package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
  10. package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
  11. package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
  12. package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  13. package/components/panel/GridColumnsPanel.js +1 -2
  14. package/components/panel/GridPanelContent.js +7 -3
  15. package/components/panel/GridPanelFooter.d.ts +1 -1
  16. package/components/panel/GridPanelFooter.js +4 -3
  17. package/components/panel/filterPanel/GridFilterForm.js +15 -15
  18. package/components/toolbar/GridToolbarDensitySelector.js +3 -5
  19. package/components/toolbar/GridToolbarFilterButton.d.ts +1 -1
  20. package/components/toolbar/GridToolbarFilterButton.js +3 -0
  21. package/components/toolbar/GridToolbarQuickFilter.js +27 -23
  22. package/components/virtualization/GridMainContainer.js +1 -1
  23. package/constants/dataGridPropsDefaultValues.js +1 -1
  24. package/hooks/core/useGridStateInitialization.js +3 -3
  25. package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
  26. package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  27. package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
  28. package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
  29. package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  30. package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
  31. package/hooks/features/columnResize/useGridColumnResize.js +9 -4
  32. package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
  33. package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
  34. package/hooks/features/columns/gridColumnsUtils.js +2 -1
  35. package/hooks/features/density/densitySelector.d.ts +1 -1
  36. package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
  37. package/hooks/features/filter/useGridFilter.js +1 -1
  38. package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
  39. package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
  40. package/hooks/features/overlays/useGridOverlays.js +3 -1
  41. package/hooks/features/pagination/gridPaginationSelector.d.ts +15 -9
  42. package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
  43. package/hooks/features/rowSelection/useGridRowSelection.js +5 -4
  44. package/hooks/features/rowSelection/utils.d.ts +1 -1
  45. package/hooks/features/rows/gridRowSpanningSelectors.d.ts +3 -3
  46. package/hooks/features/rows/gridRowsSelector.d.ts +23 -12
  47. package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
  48. package/hooks/features/rows/useGridRowSpanning.js +16 -8
  49. package/hooks/features/rows/useGridRows.js +5 -5
  50. package/hooks/features/sorting/gridSortingSelector.d.ts +10 -5
  51. package/hooks/features/sorting/gridSortingSelector.js +11 -0
  52. package/hooks/features/sorting/index.d.ts +2 -1
  53. package/hooks/features/sorting/index.js +1 -1
  54. package/hooks/features/sorting/useGridSorting.js +1 -1
  55. package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
  56. package/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  57. package/hooks/utils/useGridSelector.d.ts +4 -6
  58. package/hooks/utils/useGridSelector.js +6 -44
  59. package/index.js +1 -1
  60. package/internals/index.d.ts +2 -2
  61. package/internals/index.js +2 -2
  62. package/internals/utils/index.d.ts +0 -1
  63. package/internals/utils/index.js +0 -1
  64. package/locales/koKR.js +45 -49
  65. package/locales/roRO.js +18 -20
  66. package/material/index.js +30 -4
  67. package/models/api/gridStateApi.d.ts +1 -1
  68. package/models/controlStateItem.d.ts +2 -2
  69. package/models/gridBaseSlots.d.ts +21 -0
  70. package/models/gridBaseSlots.js +1 -0
  71. package/models/gridSlotsComponentsProps.d.ts +25 -5
  72. package/models/props/DataGridProps.d.ts +1 -6
  73. package/modern/DataGrid/DataGrid.js +7 -11
  74. package/modern/DataGrid/useDataGridProps.js +3 -3
  75. package/modern/components/GridRow.js +13 -2
  76. package/modern/components/cell/GridActionsCell.js +8 -1
  77. package/modern/components/cell/GridActionsCellItem.js +4 -6
  78. package/modern/components/cell/GridCell.js +1 -1
  79. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
  80. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
  81. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
  82. package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  83. package/modern/components/panel/GridColumnsPanel.js +1 -2
  84. package/modern/components/panel/GridPanelContent.js +7 -3
  85. package/modern/components/panel/GridPanelFooter.js +4 -3
  86. package/modern/components/panel/filterPanel/GridFilterForm.js +15 -15
  87. package/modern/components/toolbar/GridToolbarDensitySelector.js +3 -5
  88. package/modern/components/toolbar/GridToolbarFilterButton.js +3 -0
  89. package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
  90. package/modern/components/virtualization/GridMainContainer.js +1 -1
  91. package/modern/constants/dataGridPropsDefaultValues.js +1 -1
  92. package/modern/hooks/core/useGridStateInitialization.js +3 -3
  93. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  94. package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  95. package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
  96. package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
  97. package/modern/hooks/features/filter/useGridFilter.js +1 -1
  98. package/modern/hooks/features/overlays/useGridOverlays.js +3 -1
  99. package/modern/hooks/features/rowSelection/useGridRowSelection.js +5 -4
  100. package/modern/hooks/features/rows/useGridRowSpanning.js +16 -8
  101. package/modern/hooks/features/rows/useGridRows.js +5 -5
  102. package/modern/hooks/features/sorting/gridSortingSelector.js +11 -0
  103. package/modern/hooks/features/sorting/index.js +1 -1
  104. package/modern/hooks/features/sorting/useGridSorting.js +1 -1
  105. package/modern/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  106. package/modern/hooks/utils/useGridSelector.js +6 -44
  107. package/modern/index.js +1 -1
  108. package/modern/internals/index.js +2 -2
  109. package/modern/internals/utils/index.js +0 -1
  110. package/modern/locales/koKR.js +45 -49
  111. package/modern/locales/roRO.js +18 -20
  112. package/modern/material/index.js +30 -4
  113. package/modern/models/gridBaseSlots.js +1 -0
  114. package/modern/utils/createSelector.js +1 -120
  115. package/node/DataGrid/DataGrid.js +7 -11
  116. package/node/DataGrid/useDataGridProps.js +2 -2
  117. package/node/components/GridRow.js +13 -2
  118. package/node/components/cell/GridActionsCell.js +8 -1
  119. package/node/components/cell/GridActionsCellItem.js +3 -5
  120. package/node/components/cell/GridCell.js +1 -1
  121. package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
  122. package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
  123. package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
  124. package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
  125. package/node/components/panel/GridColumnsPanel.js +1 -2
  126. package/node/components/panel/GridPanelContent.js +7 -3
  127. package/node/components/panel/GridPanelFooter.js +5 -4
  128. package/node/components/panel/filterPanel/GridFilterForm.js +15 -15
  129. package/node/components/toolbar/GridToolbarDensitySelector.js +3 -5
  130. package/node/components/toolbar/GridToolbarFilterButton.js +3 -0
  131. package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
  132. package/node/components/virtualization/GridMainContainer.js +1 -1
  133. package/node/constants/dataGridPropsDefaultValues.js +1 -1
  134. package/node/hooks/core/useGridStateInitialization.js +3 -3
  135. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
  136. package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
  137. package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
  138. package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
  139. package/node/hooks/features/filter/useGridFilter.js +1 -1
  140. package/node/hooks/features/overlays/useGridOverlays.js +3 -1
  141. package/node/hooks/features/rowSelection/useGridRowSelection.js +5 -4
  142. package/node/hooks/features/rows/useGridRowSpanning.js +16 -8
  143. package/node/hooks/features/rows/useGridRows.js +5 -5
  144. package/node/hooks/features/sorting/gridSortingSelector.js +12 -1
  145. package/node/hooks/features/sorting/index.js +24 -16
  146. package/node/hooks/features/sorting/useGridSorting.js +1 -1
  147. package/node/hooks/features/virtualization/useGridVirtualScroller.js +11 -8
  148. package/node/hooks/utils/useGridSelector.js +8 -47
  149. package/node/index.js +1 -1
  150. package/node/internals/index.js +8 -22
  151. package/node/internals/utils/index.js +0 -11
  152. package/node/locales/koKR.js +45 -49
  153. package/node/locales/roRO.js +18 -20
  154. package/node/material/index.js +31 -4
  155. package/node/models/gridBaseSlots.js +5 -0
  156. package/node/utils/createSelector.js +4 -125
  157. package/package.json +2 -2
  158. package/utils/createSelector.d.ts +4 -16
  159. package/utils/createSelector.js +1 -120
  160. package/internals/utils/useProps.d.ts +0 -1
  161. package/internals/utils/useProps.js +0 -24
  162. package/joy/icons.d.ts +0 -32
  163. package/joy/icons.js +0 -431
  164. package/joy/index.d.ts +0 -2
  165. package/joy/index.js +0 -2
  166. package/joy/joySlots.d.ts +0 -3
  167. package/joy/joySlots.js +0 -389
  168. package/joy/package.json +0 -6
  169. package/modern/internals/utils/useProps.js +0 -24
  170. package/modern/joy/icons.js +0 -431
  171. package/modern/joy/index.js +0 -2
  172. package/modern/joy/joySlots.js +0 -389
  173. package/node/internals/utils/useProps.js +0 -30
  174. package/node/joy/icons.js +0 -439
  175. package/node/joy/index.js +0 -13
  176. package/node/joy/joySlots.js +0 -397
@@ -92,10 +92,7 @@ export const useGridVirtualScroller = () => {
92
92
  return undefined;
93
93
  }
94
94
  const initialRect = node.getBoundingClientRect();
95
- let lastSize = {
96
- width: initialRect.width,
97
- height: initialRect.height
98
- };
95
+ let lastSize = roundDimensions(initialRect);
99
96
  apiRef.current.publishEvent('resize', lastSize);
100
97
  if (typeof ResizeObserver === 'undefined') {
101
98
  return undefined;
@@ -105,10 +102,7 @@ export const useGridVirtualScroller = () => {
105
102
  if (!entry) {
106
103
  return;
107
104
  }
108
- const newSize = {
109
- width: entry.contentRect.width,
110
- height: entry.contentRect.height
111
- };
105
+ const newSize = roundDimensions(entry.contentRect);
112
106
  if (newSize.width === lastSize.width && newSize.height === lastSize.height) {
113
107
  return;
114
108
  }
@@ -784,4 +778,13 @@ function bufferForDirection(isRtl, direction, rowBufferPx, columnBufferPx, verti
784
778
  // eslint unable to figure out enum exhaustiveness
785
779
  throw new Error('unreachable');
786
780
  }
781
+ }
782
+
783
+ // Round to avoid issues with subpixel rendering
784
+ // https://github.com/mui/mui-x/issues/15721
785
+ function roundDimensions(dimensions) {
786
+ return {
787
+ width: Math.round(dimensions.width * 10) / 10,
788
+ height: Math.round(dimensions.height * 10) / 10
789
+ };
787
790
  }
@@ -1,10 +1,8 @@
1
1
  import * as React from 'react';
2
- import { fastObjectShallowCompare } from '@mui/x-internals/fastObjectShallowCompare';
3
2
  import type { GridApiCommon } from '../../models/api/gridApiCommon';
4
- import type { OutputSelector, OutputSelectorV8 } from '../../utils/createSelector';
5
- type Selector<Api extends GridApiCommon, Args, T> = ((state: Api['state']) => T) | OutputSelectorV8<Api['state'], Args, T>;
6
- export declare const objectShallowCompare: typeof fastObjectShallowCompare;
3
+ import type { OutputSelector } from '../../utils/createSelector';
4
+ type Selector<Api extends GridApiCommon, Args, T> = ((state: Api['state']) => T) | OutputSelector<Api['state'], Args, T>;
5
+ export declare const objectShallowCompare: (a: unknown, b: unknown) => boolean;
7
6
  export declare const argsEqual: (prev: any, curr: any) => boolean;
8
- export declare const useGridSelector: <Api extends GridApiCommon, T>(apiRef: React.MutableRefObject<Api>, selector: ((state: Api["state"]) => T) | OutputSelector<Api["state"], T>, equals?: (a: T, b: T) => boolean) => T;
9
- export declare const useGridSelectorV8: <Api extends GridApiCommon, Args, T>(apiRef: React.MutableRefObject<Api>, selector: Selector<Api, Args, T>, args?: Args, equals?: <U = T>(a: U, b: U) => boolean) => T;
7
+ export declare const useGridSelector: <Api extends GridApiCommon, Args, T>(apiRef: React.MutableRefObject<Api>, selector: Selector<Api, Args, T>, args?: Args, equals?: <U = T>(a: U, b: U) => boolean) => T;
10
8
  export {};
@@ -6,20 +6,11 @@ import { useOnMount } from "./useOnMount.js";
6
6
  function isOutputSelector(selector) {
7
7
  return selector.acceptsApiRef;
8
8
  }
9
- // TODO v8: Remove this function
10
- function applySelector(apiRef, selector) {
11
- if (isOutputSelector(selector)) {
12
- return selector(apiRef);
13
- }
14
- return selector(apiRef.current.state);
15
- }
16
-
17
- // TODO v8: Rename this function to `applySelector`
18
- function applySelectorV8(apiRef, selector, args, instanceId) {
9
+ function applySelector(apiRef, selector, args, instanceId) {
19
10
  if (isOutputSelector(selector)) {
20
11
  return selector(apiRef, args);
21
12
  }
22
- return selector(apiRef.current.state, instanceId);
13
+ return selector(apiRef.current.state, args, instanceId);
23
14
  }
24
15
  const defaultCompare = Object.is;
25
16
  export const objectShallowCompare = fastObjectShallowCompare;
@@ -44,36 +35,7 @@ const createRefs = () => ({
44
35
  selector: null,
45
36
  args: null
46
37
  });
47
-
48
- // TODO v8: Remove this function
49
- export const useGridSelector = (apiRef, selector, equals = defaultCompare) => {
50
- if (process.env.NODE_ENV !== 'production') {
51
- if (!apiRef.current.state) {
52
- warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
53
- }
54
- }
55
- const refs = useLazyRef(createRefs);
56
- const didInit = refs.current.selector !== null;
57
- const [state, setState] = React.useState(
58
- // We don't use an initialization function to avoid allocations
59
- didInit ? null : applySelector(apiRef, selector));
60
- refs.current.state = state;
61
- refs.current.equals = equals;
62
- refs.current.selector = selector;
63
- useOnMount(() => {
64
- return apiRef.current.store.subscribe(() => {
65
- const newState = applySelector(apiRef, refs.current.selector);
66
- if (!refs.current.equals(refs.current.state, newState)) {
67
- refs.current.state = newState;
68
- setState(newState);
69
- }
70
- });
71
- });
72
- return state;
73
- };
74
-
75
- // TODO v8: Rename this function to `useGridSelector`
76
- export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = defaultCompare) => {
38
+ export const useGridSelector = (apiRef, selector, args = undefined, equals = defaultCompare) => {
77
39
  if (process.env.NODE_ENV !== 'production') {
78
40
  if (!apiRef.current.state) {
79
41
  warnOnce(['MUI X: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);
@@ -83,14 +45,14 @@ export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = d
83
45
  const didInit = refs.current.selector !== null;
84
46
  const [state, setState] = React.useState(
85
47
  // We don't use an initialization function to avoid allocations
86
- didInit ? null : applySelectorV8(apiRef, selector, args, apiRef.current.instanceId));
48
+ didInit ? null : applySelector(apiRef, selector, args, apiRef.current.instanceId));
87
49
  refs.current.state = state;
88
50
  refs.current.equals = equals;
89
51
  refs.current.selector = selector;
90
52
  const prevArgs = refs.current.args;
91
53
  refs.current.args = args;
92
54
  if (didInit && !argsEqual(prevArgs, args)) {
93
- const newState = applySelectorV8(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
55
+ const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
94
56
  if (!refs.current.equals(refs.current.state, newState)) {
95
57
  refs.current.state = newState;
96
58
  setState(newState);
@@ -98,7 +60,7 @@ export const useGridSelectorV8 = (apiRef, selector, args = undefined, equals = d
98
60
  }
99
61
  useOnMount(() => {
100
62
  return apiRef.current.store.subscribe(() => {
101
- const newState = applySelectorV8(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
63
+ const newState = applySelector(apiRef, refs.current.selector, refs.current.args, apiRef.current.instanceId);
102
64
  if (!refs.current.equals(refs.current.state, newState)) {
103
65
  refs.current.state = newState;
104
66
  setState(newState);
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.0.0-alpha.3
2
+ * @mui/x-data-grid v8.0.0-alpha.5
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -58,6 +58,7 @@ export { useGridRowSelection, rowSelectionStateInitializer, } from '../hooks/fea
58
58
  export { useGridRowSelectionPreProcessors } from '../hooks/features/rowSelection/useGridRowSelectionPreProcessors';
59
59
  export { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';
60
60
  export type { GridSortingModelApplier } from '../hooks/features/sorting/gridSortingState';
61
+ export { gridSortedRowIndexLookupSelector } from '../hooks/features/sorting/gridSortingSelector';
61
62
  export { useGridScroll } from '../hooks/features/scroll/useGridScroll';
62
63
  export { useGridEvents } from '../hooks/features/events/useGridEvents';
63
64
  export { dimensionsStateInitializer, useGridDimensions, } from '../hooks/features/dimensions/useGridDimensions';
@@ -76,8 +77,7 @@ export type * from '../models/props/DataGridProps';
76
77
  export type * from '../models/gridDataSource';
77
78
  export { getColumnsToExport, defaultGetRowsToExport } from '../hooks/features/export/utils';
78
79
  export * from '../utils/createControllablePromise';
79
- export { createSelector, createSelectorV8, createSelectorMemoized, createSelectorMemoizedV8, } from '../utils/createSelector';
80
- export { useGridSelectorV8 } from '../hooks/utils/useGridSelector';
80
+ export { createSelector, createSelectorMemoized } from '../utils/createSelector';
81
81
  export { gridRowGroupsToFetchSelector } from '../hooks/features/rows/gridRowsSelector';
82
82
  export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal, } from '../utils/domUtils';
83
83
  export { isNavigationKey, isPasteShortcut, isCopyShortcut } from '../utils/keyboardUtils';
@@ -47,6 +47,7 @@ export { calculatePinnedRowsHeight } from "../hooks/features/rows/gridRowsUtils.
47
47
  export { useGridRowSelection, rowSelectionStateInitializer } from "../hooks/features/rowSelection/useGridRowSelection.js";
48
48
  export { useGridRowSelectionPreProcessors } from "../hooks/features/rowSelection/useGridRowSelectionPreProcessors.js";
49
49
  export { useGridSorting, sortingStateInitializer } from "../hooks/features/sorting/useGridSorting.js";
50
+ export { gridSortedRowIndexLookupSelector } from "../hooks/features/sorting/gridSortingSelector.js";
50
51
  export { useGridScroll } from "../hooks/features/scroll/useGridScroll.js";
51
52
  export { useGridEvents } from "../hooks/features/events/useGridEvents.js";
52
53
  export { dimensionsStateInitializer, useGridDimensions } from "../hooks/features/dimensions/useGridDimensions.js";
@@ -61,8 +62,7 @@ export { useGridVisibleRows, getVisibleRows } from "../hooks/utils/useGridVisibl
61
62
  export { useGridInitializeState } from "../hooks/utils/useGridInitializeState.js";
62
63
  export { getColumnsToExport, defaultGetRowsToExport } from "../hooks/features/export/utils.js";
63
64
  export * from "../utils/createControllablePromise.js";
64
- export { createSelector, createSelectorV8, createSelectorMemoized, createSelectorMemoizedV8 } from "../utils/createSelector.js";
65
- export { useGridSelectorV8 } from "../hooks/utils/useGridSelector.js";
65
+ export { createSelector, createSelectorMemoized } from "../utils/createSelector.js";
66
66
  export { gridRowGroupsToFetchSelector } from "../hooks/features/rows/gridRowsSelector.js";
67
67
  export { findParentElementFromClassName, getActiveElement, isEventTargetInPortal } from "../utils/domUtils.js";
68
68
  export { isNavigationKey, isPasteShortcut, isCopyShortcut } from "../utils/keyboardUtils.js";
@@ -1,4 +1,3 @@
1
1
  export * from './computeSlots';
2
- export * from './useProps';
3
2
  export * from './propValidation';
4
3
  export * from './gridRowGroupingUtils';
@@ -1,4 +1,3 @@
1
1
  export * from "./computeSlots.js";
2
- export * from "./useProps.js";
3
2
  export * from "./propValidation.js";
4
3
  export * from "./gridRowGroupingUtils.js";
package/locales/koKR.js CHANGED
@@ -24,16 +24,15 @@ const koKRGrid = {
24
24
  toolbarQuickFilterLabel: '검색',
25
25
  toolbarQuickFilterDeleteIconLabel: '초기화',
26
26
  // Prompt toolbar field
27
- // toolbarPromptControlPlaceholder: 'Type a prompt…',
28
- // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…',
29
- // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…',
30
- // toolbarPromptControlLabel: 'Prompt input',
31
- // toolbarPromptControlRecordButtonDefaultLabel: 'Record',
32
- // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording',
33
- // toolbarPromptControlSendActionLabel: 'Send',
34
- // toolbarPromptControlSendActionAriaLabel: 'Send prompt',
35
- // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.',
36
-
27
+ toolbarPromptControlPlaceholder: '프롬프트 입력…',
28
+ toolbarPromptControlWithRecordingPlaceholder: '프롬프트 입력 또는 녹음…',
29
+ toolbarPromptControlRecordingPlaceholder: '녹음 중…',
30
+ toolbarPromptControlLabel: '프롬프트 입력',
31
+ toolbarPromptControlRecordButtonDefaultLabel: '녹음',
32
+ toolbarPromptControlRecordButtonActiveLabel: '녹음 정지',
33
+ toolbarPromptControlSendActionLabel: '전송',
34
+ toolbarPromptControlSendActionAriaLabel: '프롬프트 전송',
35
+ toolbarPromptControlErrorMessage: '요청을 처리하는 동안 오류가 발생했습니다. 다른 프롬프트로 다시 시도하십시오.',
37
36
  // Export selector toolbar button text
38
37
  toolbarExport: '내보내기',
39
38
  toolbarExportLabel: '내보내기',
@@ -41,15 +40,14 @@ const koKRGrid = {
41
40
  toolbarExportPrint: '프린트',
42
41
  toolbarExportExcel: 'Excel로 내보내기',
43
42
  // Columns management text
44
- // columnsManagementSearchTitle: 'Search',
45
- // columnsManagementNoColumns: 'No columns',
46
- // columnsManagementShowHideAllText: 'Show/Hide All',
47
- // columnsManagementReset: 'Reset',
48
- // columnsManagementDeleteIconLabel: 'Clear',
49
-
43
+ columnsManagementSearchTitle: '검색',
44
+ columnsManagementNoColumns: '열이 없습니다.',
45
+ columnsManagementShowHideAllText: '모두 보기/숨기기',
46
+ columnsManagementReset: '초기화',
47
+ columnsManagementDeleteIconLabel: '제거',
50
48
  // Filter panel text
51
49
  filterPanelAddFilter: '필터 추가',
52
- // filterPanelRemoveAll: 'Remove all',
50
+ filterPanelRemoveAll: '모두 삭제',
53
51
  filterPanelDeleteIconLabel: '삭제',
54
52
  filterPanelLogicOperator: '논리 연산자',
55
53
  filterPanelOperator: '연산자',
@@ -60,9 +58,9 @@ const koKRGrid = {
60
58
  filterPanelInputPlaceholder: '값 입력',
61
59
  // Filter operators text
62
60
  filterOperatorContains: '포함하는',
63
- // filterOperatorDoesNotContain: 'does not contain',
61
+ filterOperatorDoesNotContain: '포함하지 않는',
64
62
  filterOperatorEquals: '값이 같은',
65
- // filterOperatorDoesNotEqual: 'does not equal',
63
+ filterOperatorDoesNotEqual: '값이 다른',
66
64
  filterOperatorStartsWith: '시작하는',
67
65
  filterOperatorEndsWith: '끝나는',
68
66
  filterOperatorIs: '~인',
@@ -74,36 +72,34 @@ const koKRGrid = {
74
72
  filterOperatorIsEmpty: '값이 없는',
75
73
  filterOperatorIsNotEmpty: '값이 있는',
76
74
  filterOperatorIsAnyOf: '값 중 하나인',
77
- // 'filterOperator=': '=',
78
- // 'filterOperator!=': '!=',
79
- // 'filterOperator>': '>',
80
- // 'filterOperator>=': '>=',
81
- // 'filterOperator<': '<',
82
- // 'filterOperator<=': '<=',
83
-
75
+ 'filterOperator=': '=',
76
+ 'filterOperator!=': '!=',
77
+ 'filterOperator>': '>',
78
+ 'filterOperator>=': '>=',
79
+ 'filterOperator<': '<',
80
+ 'filterOperator<=': '<=',
84
81
  // Header filter operators text
85
- // headerFilterOperatorContains: 'Contains',
86
- // headerFilterOperatorDoesNotContain: 'Does not contain',
87
- // headerFilterOperatorEquals: 'Equals',
88
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
89
- // headerFilterOperatorStartsWith: 'Starts with',
90
- // headerFilterOperatorEndsWith: 'Ends with',
91
- // headerFilterOperatorIs: 'Is',
92
- // headerFilterOperatorNot: 'Is not',
93
- // headerFilterOperatorAfter: 'Is after',
94
- // headerFilterOperatorOnOrAfter: 'Is on or after',
95
- // headerFilterOperatorBefore: 'Is before',
96
- // headerFilterOperatorOnOrBefore: 'Is on or before',
97
- // headerFilterOperatorIsEmpty: 'Is empty',
98
- // headerFilterOperatorIsNotEmpty: 'Is not empty',
99
- // headerFilterOperatorIsAnyOf: 'Is any of',
100
- // 'headerFilterOperator=': 'Equals',
101
- // 'headerFilterOperator!=': 'Not equals',
102
- // 'headerFilterOperator>': 'Greater than',
103
- // 'headerFilterOperator>=': 'Greater than or equal to',
104
- // 'headerFilterOperator<': 'Less than',
105
- // 'headerFilterOperator<=': 'Less than or equal to',
106
-
82
+ headerFilterOperatorContains: '포함하는',
83
+ headerFilterOperatorDoesNotContain: '포함하지 않는',
84
+ headerFilterOperatorEquals: '값이 같은',
85
+ headerFilterOperatorDoesNotEqual: '값이 다른',
86
+ headerFilterOperatorStartsWith: '시작하는',
87
+ headerFilterOperatorEndsWith: '끝나는',
88
+ headerFilterOperatorIs: '~인',
89
+ headerFilterOperatorNot: '~아닌',
90
+ headerFilterOperatorAfter: ' 이후',
91
+ headerFilterOperatorOnOrAfter: '이후',
92
+ headerFilterOperatorBefore: ' 이전',
93
+ headerFilterOperatorOnOrBefore: '이전',
94
+ headerFilterOperatorIsEmpty: '값이 없는',
95
+ headerFilterOperatorIsNotEmpty: '값이 있는',
96
+ headerFilterOperatorIsAnyOf: ' 하나인',
97
+ 'headerFilterOperator=': '값이 같은',
98
+ 'headerFilterOperator!=': '값이 다른',
99
+ 'headerFilterOperator>': ' ',
100
+ 'headerFilterOperator>=': '같거나 ',
101
+ 'headerFilterOperator<': ' 작은',
102
+ 'headerFilterOperator<=': '같거나 작은',
107
103
  // Filter values text
108
104
  filterValueAny: '아무값',
109
105
  filterValueTrue: '참',
@@ -111,7 +107,7 @@ const koKRGrid = {
111
107
  // Column menu text
112
108
  columnMenuLabel: '메뉴',
113
109
  columnMenuShowColumns: '열 표시',
114
- // columnMenuManageColumns: 'Manage columns',
110
+ columnMenuManageColumns: ' 관리',
115
111
  columnMenuFilter: '필터',
116
112
  columnMenuHideColumn: '열 숨기기',
117
113
  columnMenuUnsort: '정렬 해제',
package/locales/roRO.js CHANGED
@@ -24,16 +24,15 @@ const roROGrid = {
24
24
  toolbarQuickFilterLabel: 'Căutare',
25
25
  toolbarQuickFilterDeleteIconLabel: 'Ștergere',
26
26
  // Prompt toolbar field
27
- // toolbarPromptControlPlaceholder: 'Type a prompt…',
28
- // toolbarPromptControlWithRecordingPlaceholder: 'Type or record a prompt…',
29
- // toolbarPromptControlRecordingPlaceholder: 'Listening for prompt…',
30
- // toolbarPromptControlLabel: 'Prompt input',
31
- // toolbarPromptControlRecordButtonDefaultLabel: 'Record',
32
- // toolbarPromptControlRecordButtonActiveLabel: 'Stop recording',
33
- // toolbarPromptControlSendActionLabel: 'Send',
34
- // toolbarPromptControlSendActionAriaLabel: 'Send prompt',
35
- // toolbarPromptControlErrorMessage: 'An error occurred while processing the request. Please try again with a different prompt.',
36
-
27
+ toolbarPromptControlPlaceholder: 'Scrie un prompt…',
28
+ toolbarPromptControlWithRecordingPlaceholder: 'Scrie sau înregistrează un prompt…',
29
+ toolbarPromptControlRecordingPlaceholder: 'Ascultare prompt…',
30
+ toolbarPromptControlLabel: 'Introducere prompt',
31
+ toolbarPromptControlRecordButtonDefaultLabel: 'Înregistrează',
32
+ toolbarPromptControlRecordButtonActiveLabel: 'Oprește înregistrare',
33
+ toolbarPromptControlSendActionLabel: 'Trimite',
34
+ toolbarPromptControlSendActionAriaLabel: 'Trimite prompt',
35
+ toolbarPromptControlErrorMessage: 'A apărut o eroare la procesare. Încercați din nou cu un alt prompt.',
37
36
  // Export selector toolbar button text
38
37
  toolbarExport: 'Export',
39
38
  toolbarExportLabel: 'Export',
@@ -41,12 +40,11 @@ const roROGrid = {
41
40
  toolbarExportPrint: 'Printare',
42
41
  toolbarExportExcel: 'Download în format Excel',
43
42
  // Columns management text
44
- // columnsManagementSearchTitle: 'Search',
45
- // columnsManagementNoColumns: 'No columns',
46
- // columnsManagementShowHideAllText: 'Show/Hide All',
47
- // columnsManagementReset: 'Reset',
48
- // columnsManagementDeleteIconLabel: 'Clear',
49
-
43
+ columnsManagementSearchTitle: 'Caută',
44
+ columnsManagementNoColumns: 'Nicio coloană',
45
+ columnsManagementShowHideAllText: 'Arată/Ascunde tot',
46
+ columnsManagementReset: 'Resetează',
47
+ columnsManagementDeleteIconLabel: 'Șterge',
50
48
  // Filter panel text
51
49
  filterPanelAddFilter: 'Adăugare filtru',
52
50
  filterPanelRemoveAll: 'Șterge tot',
@@ -60,9 +58,9 @@ const roROGrid = {
60
58
  filterPanelInputPlaceholder: 'Filtrare valoare',
61
59
  // Filter operators text
62
60
  filterOperatorContains: 'conține',
63
- // filterOperatorDoesNotContain: 'does not contain',
61
+ filterOperatorDoesNotContain: 'nu conține',
64
62
  filterOperatorEquals: 'este egal cu',
65
- // filterOperatorDoesNotEqual: 'does not equal',
63
+ filterOperatorDoesNotEqual: 'nu este egal cu',
66
64
  filterOperatorStartsWith: 'începe cu',
67
65
  filterOperatorEndsWith: 'se termină cu',
68
66
  filterOperatorIs: 'este',
@@ -82,9 +80,9 @@ const roROGrid = {
82
80
  'filterOperator<=': '<=',
83
81
  // Header filter operators text
84
82
  headerFilterOperatorContains: 'Conține',
85
- // headerFilterOperatorDoesNotContain: 'Does not contain',
83
+ headerFilterOperatorDoesNotContain: 'Nu conține',
86
84
  headerFilterOperatorEquals: 'Egal cu',
87
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
85
+ headerFilterOperatorDoesNotEqual: 'Nu este egal cu',
88
86
  headerFilterOperatorStartsWith: 'Începe cu',
89
87
  headerFilterOperatorEndsWith: 'Se termină cu',
90
88
  headerFilterOperatorIs: 'Este',
package/material/index.js CHANGED
@@ -1,7 +1,12 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
1
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["inert", "iconStart", "iconEnd", "children"];
4
+ import * as React from 'react';
2
5
  import MUIBadge from '@mui/material/Badge';
3
6
  import MUICheckbox from '@mui/material/Checkbox';
4
7
  import MUIDivider from '@mui/material/Divider';
8
+ import MUIListItemIcon from '@mui/material/ListItemIcon';
9
+ import MUIListItemText from '@mui/material/ListItemText';
5
10
  import MUIMenuList from '@mui/material/MenuList';
6
11
  import MUIMenuItem from '@mui/material/MenuItem';
7
12
  import MUITextField from '@mui/material/TextField';
@@ -17,6 +22,7 @@ import MUIChip from '@mui/material/Chip';
17
22
  import { GridColumnUnsortedIcon } from "./icons/GridColumnUnsortedIcon.js";
18
23
  import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from "./icons/index.js";
19
24
  import MUISelectOption from "./components/MUISelectOption.js";
25
+ import { jsx as _jsx } from "react/jsx-runtime";
20
26
  const iconSlots = {
21
27
  booleanCellTrueIcon: GridCheckIcon,
22
28
  booleanCellFalseIcon: GridCloseIcon,
@@ -54,12 +60,12 @@ const iconSlots = {
54
60
  filterPanelRemoveAllIcon: GridDeleteForeverIcon,
55
61
  columnReorderIcon: GridDragIcon
56
62
  };
57
- const materialSlots = _extends({}, iconSlots, {
63
+ const baseSlots = {
58
64
  baseBadge: MUIBadge,
59
65
  baseCheckbox: MUICheckbox,
60
66
  baseDivider: MUIDivider,
61
67
  baseMenuList: MUIMenuList,
62
- baseMenuItem: MUIMenuItem,
68
+ baseMenuItem: BaseMenuItem,
63
69
  baseTextField: MUITextField,
64
70
  baseFormControl: MUIFormControl,
65
71
  baseSelect: MUISelect,
@@ -71,5 +77,25 @@ const materialSlots = _extends({}, iconSlots, {
71
77
  baseInputLabel: MUIInputLabel,
72
78
  baseSelectOption: MUISelectOption,
73
79
  baseChip: MUIChip
74
- });
75
- export default materialSlots;
80
+ };
81
+ const materialSlots = _extends({}, baseSlots, iconSlots);
82
+ export default materialSlots;
83
+ function BaseMenuItem(props) {
84
+ const {
85
+ inert,
86
+ iconStart,
87
+ iconEnd,
88
+ children
89
+ } = props,
90
+ other = _objectWithoutPropertiesLoose(props, _excluded);
91
+ if (inert) {
92
+ other.disableRipple = true;
93
+ }
94
+ return /*#__PURE__*/React.createElement(MUIMenuItem, other, [iconStart && /*#__PURE__*/_jsx(MUIListItemIcon, {
95
+ children: iconStart
96
+ }, "1"), /*#__PURE__*/_jsx(MUIListItemText, {
97
+ children: children
98
+ }, "2"), iconEnd && /*#__PURE__*/_jsx(MUIListItemIcon, {
99
+ children: iconEnd
100
+ }, "3")]);
101
+ }
@@ -33,5 +33,5 @@ export interface GridStatePrivateApi<State extends GridStateCommunity> {
33
33
  * Updates a control state that binds the model, the onChange prop, and the grid state together.
34
34
  * @param {GridControlStateItem>} controlState The [[GridControlStateItem]] to be registered.
35
35
  */
36
- registerControlState: <E extends keyof GridControlledStateEventLookup>(controlState: GridControlStateItem<State, E>) => void;
36
+ registerControlState: <E extends keyof GridControlledStateEventLookup, Args>(controlState: GridControlStateItem<State, Args, E>) => void;
37
37
  }
@@ -2,10 +2,10 @@ import { GridCallbackDetails } from './api/gridCallbackDetails';
2
2
  import type { GridEventLookup, GridControlledStateEventLookup } from './events';
3
3
  import type { OutputSelector } from '../utils/createSelector';
4
4
  import { GridStateCommunity } from './gridStateCommunity';
5
- export interface GridControlStateItem<State extends GridStateCommunity, E extends keyof GridControlledStateEventLookup> {
5
+ export interface GridControlStateItem<State extends GridStateCommunity, Args, E extends keyof GridControlledStateEventLookup> {
6
6
  stateId: string;
7
7
  propModel?: GridEventLookup[E]['params'];
8
- stateSelector: OutputSelector<State, GridControlledStateEventLookup[E]['params']> | ((state: State) => GridControlledStateEventLookup[E]['params']);
8
+ stateSelector: OutputSelector<State, Args, GridControlledStateEventLookup[E]['params']> | ((state: State) => GridControlledStateEventLookup[E]['params']);
9
9
  propOnChange?: (model: GridControlledStateEventLookup[E]['params'], details: GridCallbackDetails) => void;
10
10
  changeEvent: E;
11
11
  }
@@ -0,0 +1,21 @@
1
+ export type BadgeProps = {
2
+ badgeContent?: React.ReactNode;
3
+ children: React.ReactNode;
4
+ color?: 'primary' | 'default' | 'error';
5
+ overlap?: 'circular';
6
+ variant?: 'dot';
7
+ invisible?: boolean;
8
+ };
9
+ export type DividerProps = {};
10
+ export type MenuItemProps = {
11
+ autoFocus?: boolean;
12
+ children: React.ReactNode;
13
+ /** For items that aren't interactive themselves (but may contain an interactive widget) */
14
+ inert?: boolean;
15
+ disabled?: boolean;
16
+ onClick?: React.MouseEventHandler<HTMLElement>;
17
+ iconStart?: React.ReactNode;
18
+ iconEnd?: React.ReactNode;
19
+ selected?: boolean;
20
+ value?: number | string | readonly string[];
21
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
- import type { BadgeProps } from '@mui/material/Badge';
2
+ import type { BadgeProps as MUIBadgeProps } from '@mui/material/Badge';
3
3
  import type { CheckboxProps } from '@mui/material/Checkbox';
4
4
  import type { MenuListProps } from '@mui/material/MenuList';
5
- import type { MenuItemProps } from '@mui/material/MenuItem';
5
+ import type { MenuItemProps as MUIMenuItemProps } from '@mui/material/MenuItem';
6
6
  import type { TextFieldProps } from '@mui/material/TextField';
7
7
  import type { FormControlProps } from '@mui/material/FormControl';
8
8
  import type { SelectProps } from '@mui/material/Select';
@@ -33,7 +33,9 @@ import type { GridColumnsManagementProps } from '../components/columnsManagement
33
33
  import type { GridLoadingOverlayProps } from '../components/GridLoadingOverlay';
34
34
  import type { GridRowCountProps } from '../components/GridRowCount';
35
35
  import type { GridColumnHeaderSortIconProps } from '../components/columnHeaders/GridColumnHeaderSortIcon';
36
- type DividerProps = {};
36
+ import type { BadgeProps, DividerProps, MenuItemProps } from './gridBaseSlots';
37
+ type RootProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
38
+ type MainProps = React.HTMLAttributes<HTMLDivElement> & Record<`data-${string}`, string>;
37
39
  export interface BaseBadgePropsOverrides {
38
40
  }
39
41
  export interface BaseCheckboxPropsOverrides {
@@ -106,7 +108,7 @@ export interface SkeletonCellPropsOverrides {
106
108
  }
107
109
  export interface RowPropsOverrides {
108
110
  }
109
- export interface GridSlotProps {
111
+ interface BaseSlotProps {
110
112
  baseBadge: BadgeProps & BaseBadgePropsOverrides;
111
113
  baseCheckbox: CheckboxProps & BaseCheckboxPropsOverrides;
112
114
  baseDivider: DividerProps & BaseDividerPropsOverrides;
@@ -128,6 +130,12 @@ export interface GridSlotProps {
128
130
  children?: React.ReactNode;
129
131
  } & BaseSelectOptionPropsOverrides;
130
132
  baseChip: ChipProps & BaseChipPropsOverrides;
133
+ }
134
+ interface MaterialSlotProps {
135
+ baseBadge: MUIBadgeProps;
136
+ baseMenuItem: MUIMenuItemProps;
137
+ }
138
+ interface ElementSlotProps {
131
139
  cell: GridCellProps & CellPropsOverrides;
132
140
  columnHeaders: GridColumnHeadersProps;
133
141
  columnHeaderFilterIconButton: ColumnHeaderFilterIconButtonProps & ColumnHeaderFilterIconButtonPropsOverrides;
@@ -148,7 +156,19 @@ export interface GridSlotProps {
148
156
  row: GridRowProps & RowPropsOverrides;
149
157
  skeletonCell: GridSkeletonCellProps & SkeletonCellPropsOverrides;
150
158
  toolbar: GridToolbarProps & ToolbarPropsOverrides;
151
- }
159
+ /**
160
+ * Props passed to the `.main` (role="grid") element
161
+ */
162
+ main: MainProps;
163
+ /**
164
+ * Props passed to the `.root` element
165
+ */
166
+ root: RootProps;
167
+ }
168
+ type Merge<A, B> = {
169
+ [K in keyof A | keyof B]: K extends keyof A & keyof B ? A[K] & B[K] : K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
170
+ };
171
+ export type GridSlotProps = Merge<BaseSlotProps, MaterialSlotProps> & ElementSlotProps;
152
172
  /**
153
173
  * Overridable components props dynamically passed to the component at rendering.
154
174
  */
@@ -352,7 +352,7 @@ export interface DataGridPropsWithDefaultValues<R extends GridValidRowModel = an
352
352
  * If `true`, the Data Grid will auto span the cells over the rows having the same value.
353
353
  * @default false
354
354
  */
355
- unstable_rowSpanning: boolean;
355
+ rowSpanning: boolean;
356
356
  /**
357
357
  * If `true`, the Data Grid enables column virtualization when `getRowHeight` is set to `() => 'auto'`.
358
358
  * By default, column virtualization is disabled when dynamic row height is enabled to measure the row height correctly.
@@ -370,11 +370,6 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
370
370
  * The ref object that allows Data Grid manipulation. Can be instantiated with `useGridApiRef()`.
371
371
  */
372
372
  apiRef?: React.MutableRefObject<GridApiCommunity>;
373
- /**
374
- * Forwarded props for the Data Grid root element.
375
- * @ignore - do not document.
376
- */
377
- forwardedProps?: Record<string, unknown>;
378
373
  /**
379
374
  * Signal to the underlying logic what version of the public component API
380
375
  * of the Data Grid is exposed [[GridSignature]].