@mui/x-data-grid 7.12.0 → 7.13.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 (122) hide show
  1. package/CHANGELOG.md +151 -2
  2. package/DataGrid/DataGrid.js +10 -1
  3. package/components/GridColumnHeaders.js +1 -1
  4. package/components/GridConfigurationContext.d.ts +2 -0
  5. package/components/GridConfigurationContext.js +5 -0
  6. package/components/GridHeaders.js +2 -5
  7. package/components/GridRow.js +6 -8
  8. package/components/GridScrollArea.js +1 -1
  9. package/components/GridSkeletonLoadingOverlay.js +1 -1
  10. package/components/cell/GridCell.js +1 -1
  11. package/components/cell/GridSkeletonCell.js +2 -2
  12. package/components/columnHeaders/GridColumnHeaderItem.js +1 -1
  13. package/components/containers/GridRootStyles.js +9 -2
  14. package/components/virtualization/GridMainContainer.js +3 -2
  15. package/components/virtualization/GridVirtualScrollerFiller.js +1 -1
  16. package/context/GridContextProvider.d.ts +3 -1
  17. package/context/GridContextProvider.js +12 -7
  18. package/hooks/core/useGridRefs.js +3 -1
  19. package/hooks/core/useGridStateInitialization.js +1 -3
  20. package/hooks/features/dimensions/useGridDimensions.js +1 -1
  21. package/hooks/features/export/serializers/csvSerializer.js +4 -3
  22. package/hooks/features/filter/gridFilterSelector.d.ts +20 -7
  23. package/hooks/features/filter/gridFilterSelector.js +34 -0
  24. package/hooks/features/filter/gridFilterState.d.ts +6 -0
  25. package/hooks/features/filter/index.d.ts +2 -1
  26. package/hooks/features/filter/index.js +1 -1
  27. package/hooks/features/filter/useGridFilter.js +3 -0
  28. package/hooks/features/rowSelection/useGridRowSelection.js +6 -4
  29. package/hooks/features/rows/useGridRowAriaAttributes.d.ts +2 -0
  30. package/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
  31. package/hooks/utils/useGridAriaAttributes.d.ts +2 -6
  32. package/hooks/utils/useGridAriaAttributes.js +5 -8
  33. package/hooks/utils/useGridConfiguration.d.ts +2 -0
  34. package/hooks/utils/useGridConfiguration.js +9 -0
  35. package/hooks/utils/useGridSelector.d.ts +1 -1
  36. package/hooks/utils/useGridSelector.js +1 -1
  37. package/index.js +1 -1
  38. package/internals/index.d.ts +3 -1
  39. package/internals/index.js +3 -1
  40. package/locales/viVN.js +4 -5
  41. package/models/api/gridCoreApi.d.ts +1 -1
  42. package/models/configuration/gridConfiguration.d.ts +10 -0
  43. package/models/configuration/gridConfiguration.js +1 -0
  44. package/models/configuration/gridRowConfiguration.d.ts +12 -0
  45. package/models/configuration/gridRowConfiguration.js +1 -0
  46. package/models/gridDataSource.d.ts +2 -1
  47. package/models/gridRows.d.ts +2 -2
  48. package/models/props/DataGridProps.d.ts +1 -1
  49. package/modern/DataGrid/DataGrid.js +10 -1
  50. package/modern/components/GridColumnHeaders.js +1 -1
  51. package/modern/components/GridConfigurationContext.js +5 -0
  52. package/modern/components/GridHeaders.js +2 -5
  53. package/modern/components/GridRow.js +6 -8
  54. package/modern/components/GridScrollArea.js +1 -1
  55. package/modern/components/GridSkeletonLoadingOverlay.js +1 -1
  56. package/modern/components/cell/GridCell.js +1 -1
  57. package/modern/components/cell/GridSkeletonCell.js +2 -2
  58. package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -1
  59. package/modern/components/containers/GridRootStyles.js +9 -2
  60. package/modern/components/virtualization/GridMainContainer.js +3 -2
  61. package/modern/components/virtualization/GridVirtualScrollerFiller.js +1 -1
  62. package/modern/context/GridContextProvider.js +12 -7
  63. package/modern/hooks/core/useGridRefs.js +3 -1
  64. package/modern/hooks/core/useGridStateInitialization.js +1 -3
  65. package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
  66. package/modern/hooks/features/export/serializers/csvSerializer.js +4 -3
  67. package/modern/hooks/features/filter/gridFilterSelector.js +34 -0
  68. package/modern/hooks/features/filter/index.js +1 -1
  69. package/modern/hooks/features/filter/useGridFilter.js +3 -0
  70. package/modern/hooks/features/rowSelection/useGridRowSelection.js +6 -4
  71. package/modern/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
  72. package/modern/hooks/utils/useGridAriaAttributes.js +5 -8
  73. package/modern/hooks/utils/useGridConfiguration.js +9 -0
  74. package/modern/hooks/utils/useGridSelector.js +1 -1
  75. package/modern/index.js +1 -1
  76. package/modern/internals/index.js +3 -1
  77. package/modern/locales/viVN.js +4 -5
  78. package/modern/models/configuration/gridConfiguration.js +1 -0
  79. package/modern/models/configuration/gridRowConfiguration.js +1 -0
  80. package/node/DataGrid/DataGrid.js +10 -1
  81. package/node/components/GridColumnHeaders.js +1 -1
  82. package/node/{utils/fastMemo.js → components/GridConfigurationContext.js} +4 -4
  83. package/node/components/GridHeaders.js +2 -5
  84. package/node/components/GridRow.js +6 -8
  85. package/node/components/GridScrollArea.js +1 -1
  86. package/node/components/GridSkeletonLoadingOverlay.js +1 -1
  87. package/node/components/cell/GridCell.js +1 -1
  88. package/node/components/cell/GridSkeletonCell.js +2 -2
  89. package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -1
  90. package/node/components/containers/GridRootStyles.js +9 -2
  91. package/node/components/virtualization/GridMainContainer.js +3 -2
  92. package/node/components/virtualization/GridVirtualScrollerFiller.js +1 -1
  93. package/node/context/GridContextProvider.js +12 -7
  94. package/node/hooks/core/useGridRefs.js +3 -1
  95. package/node/hooks/core/useGridStateInitialization.js +1 -3
  96. package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
  97. package/node/hooks/features/export/serializers/csvSerializer.js +4 -3
  98. package/node/hooks/features/filter/gridFilterSelector.js +35 -1
  99. package/node/hooks/features/filter/index.js +97 -15
  100. package/node/hooks/features/filter/useGridFilter.js +3 -0
  101. package/node/hooks/features/rowSelection/useGridRowSelection.js +6 -4
  102. package/node/hooks/features/rows/useGridRowAriaAttributes.js +28 -0
  103. package/node/hooks/utils/useGridAriaAttributes.js +4 -7
  104. package/node/hooks/utils/useGridConfiguration.js +18 -0
  105. package/node/hooks/utils/useGridSelector.js +1 -1
  106. package/node/index.js +1 -1
  107. package/node/internals/index.js +31 -12
  108. package/node/locales/viVN.js +4 -5
  109. package/node/models/configuration/gridConfiguration.js +5 -0
  110. package/node/models/configuration/gridRowConfiguration.js +5 -0
  111. package/package.json +12 -2
  112. package/modern/utils/fastMemo.js +0 -5
  113. package/modern/utils/fastObjectShallowCompare.js +0 -28
  114. package/modern/utils/throttle.js +0 -19
  115. package/node/utils/fastObjectShallowCompare.js +0 -34
  116. package/node/utils/throttle.js +0 -25
  117. package/utils/fastMemo.d.ts +0 -1
  118. package/utils/fastMemo.js +0 -5
  119. package/utils/fastObjectShallowCompare.d.ts +0 -1
  120. package/utils/fastObjectShallowCompare.js +0 -28
  121. package/utils/throttle.d.ts +0 -4
  122. package/utils/throttle.js +0 -19
@@ -1,28 +0,0 @@
1
- const is = Object.is;
2
- export function fastObjectShallowCompare(a, b) {
3
- if (a === b) {
4
- return true;
5
- }
6
- if (!(a instanceof Object) || !(b instanceof Object)) {
7
- return false;
8
- }
9
- let aLength = 0;
10
- let bLength = 0;
11
-
12
- /* eslint-disable guard-for-in */
13
- for (const key in a) {
14
- aLength += 1;
15
- if (!is(a[key], b[key])) {
16
- return false;
17
- }
18
- if (!(key in b)) {
19
- return false;
20
- }
21
- }
22
-
23
- /* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
24
- for (const _ in b) {
25
- bLength += 1;
26
- }
27
- return aLength === bLength;
28
- }
@@ -1,19 +0,0 @@
1
- export function throttle(func, wait = 166) {
2
- let timeout;
3
- let lastArgs;
4
- const later = () => {
5
- timeout = undefined;
6
- func(...lastArgs);
7
- };
8
- function throttled(...args) {
9
- lastArgs = args;
10
- if (timeout === undefined) {
11
- timeout = setTimeout(later, wait);
12
- }
13
- }
14
- throttled.clear = () => {
15
- clearTimeout(timeout);
16
- timeout = undefined;
17
- };
18
- return throttled;
19
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fastObjectShallowCompare = fastObjectShallowCompare;
7
- const is = Object.is;
8
- function fastObjectShallowCompare(a, b) {
9
- if (a === b) {
10
- return true;
11
- }
12
- if (!(a instanceof Object) || !(b instanceof Object)) {
13
- return false;
14
- }
15
- let aLength = 0;
16
- let bLength = 0;
17
-
18
- /* eslint-disable guard-for-in */
19
- for (const key in a) {
20
- aLength += 1;
21
- if (!is(a[key], b[key])) {
22
- return false;
23
- }
24
- if (!(key in b)) {
25
- return false;
26
- }
27
- }
28
-
29
- /* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
30
- for (const _ in b) {
31
- bLength += 1;
32
- }
33
- return aLength === bLength;
34
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.throttle = throttle;
7
- function throttle(func, wait = 166) {
8
- let timeout;
9
- let lastArgs;
10
- const later = () => {
11
- timeout = undefined;
12
- func(...lastArgs);
13
- };
14
- function throttled(...args) {
15
- lastArgs = args;
16
- if (timeout === undefined) {
17
- timeout = setTimeout(later, wait);
18
- }
19
- }
20
- throttled.clear = () => {
21
- clearTimeout(timeout);
22
- timeout = undefined;
23
- };
24
- return throttled;
25
- }
@@ -1 +0,0 @@
1
- export declare function fastMemo<T>(component: T): T;
package/utils/fastMemo.js DELETED
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- import { fastObjectShallowCompare } from './fastObjectShallowCompare';
3
- export function fastMemo(component) {
4
- return /*#__PURE__*/React.memo(component, fastObjectShallowCompare);
5
- }
@@ -1 +0,0 @@
1
- export declare function fastObjectShallowCompare<T extends Record<string, any> | null>(a: T, b: T): boolean;
@@ -1,28 +0,0 @@
1
- const is = Object.is;
2
- export function fastObjectShallowCompare(a, b) {
3
- if (a === b) {
4
- return true;
5
- }
6
- if (!(a instanceof Object) || !(b instanceof Object)) {
7
- return false;
8
- }
9
- let aLength = 0;
10
- let bLength = 0;
11
-
12
- /* eslint-disable guard-for-in */
13
- for (const key in a) {
14
- aLength += 1;
15
- if (!is(a[key], b[key])) {
16
- return false;
17
- }
18
- if (!(key in b)) {
19
- return false;
20
- }
21
- }
22
-
23
- /* eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars */
24
- for (const _ in b) {
25
- bLength += 1;
26
- }
27
- return aLength === bLength;
28
- }
@@ -1,4 +0,0 @@
1
- export interface Cancelable {
2
- clear(): void;
3
- }
4
- export declare function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable;
package/utils/throttle.js DELETED
@@ -1,19 +0,0 @@
1
- export function throttle(func, wait = 166) {
2
- let timeout;
3
- let lastArgs;
4
- const later = () => {
5
- timeout = undefined;
6
- func(...lastArgs);
7
- };
8
- function throttled(...args) {
9
- lastArgs = args;
10
- if (timeout === undefined) {
11
- timeout = setTimeout(later, wait);
12
- }
13
- }
14
- throttled.clear = () => {
15
- clearTimeout(timeout);
16
- timeout = undefined;
17
- };
18
- return throttled;
19
- }