@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.
- package/CHANGELOG.md +151 -2
- package/DataGrid/DataGrid.js +10 -1
- package/components/GridColumnHeaders.js +1 -1
- package/components/GridConfigurationContext.d.ts +2 -0
- package/components/GridConfigurationContext.js +5 -0
- package/components/GridHeaders.js +2 -5
- package/components/GridRow.js +6 -8
- package/components/GridScrollArea.js +1 -1
- package/components/GridSkeletonLoadingOverlay.js +1 -1
- package/components/cell/GridCell.js +1 -1
- package/components/cell/GridSkeletonCell.js +2 -2
- package/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/components/containers/GridRootStyles.js +9 -2
- package/components/virtualization/GridMainContainer.js +3 -2
- package/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/context/GridContextProvider.d.ts +3 -1
- package/context/GridContextProvider.js +12 -7
- package/hooks/core/useGridRefs.js +3 -1
- package/hooks/core/useGridStateInitialization.js +1 -3
- package/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/hooks/features/filter/gridFilterSelector.d.ts +20 -7
- package/hooks/features/filter/gridFilterSelector.js +34 -0
- package/hooks/features/filter/gridFilterState.d.ts +6 -0
- package/hooks/features/filter/index.d.ts +2 -1
- package/hooks/features/filter/index.js +1 -1
- package/hooks/features/filter/useGridFilter.js +3 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +6 -4
- package/hooks/features/rows/useGridRowAriaAttributes.d.ts +2 -0
- package/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
- package/hooks/utils/useGridAriaAttributes.d.ts +2 -6
- package/hooks/utils/useGridAriaAttributes.js +5 -8
- package/hooks/utils/useGridConfiguration.d.ts +2 -0
- package/hooks/utils/useGridConfiguration.js +9 -0
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/hooks/utils/useGridSelector.js +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +3 -1
- package/internals/index.js +3 -1
- package/locales/viVN.js +4 -5
- package/models/api/gridCoreApi.d.ts +1 -1
- package/models/configuration/gridConfiguration.d.ts +10 -0
- package/models/configuration/gridConfiguration.js +1 -0
- package/models/configuration/gridRowConfiguration.d.ts +12 -0
- package/models/configuration/gridRowConfiguration.js +1 -0
- package/models/gridDataSource.d.ts +2 -1
- package/models/gridRows.d.ts +2 -2
- package/models/props/DataGridProps.d.ts +1 -1
- package/modern/DataGrid/DataGrid.js +10 -1
- package/modern/components/GridColumnHeaders.js +1 -1
- package/modern/components/GridConfigurationContext.js +5 -0
- package/modern/components/GridHeaders.js +2 -5
- package/modern/components/GridRow.js +6 -8
- package/modern/components/GridScrollArea.js +1 -1
- package/modern/components/GridSkeletonLoadingOverlay.js +1 -1
- package/modern/components/cell/GridCell.js +1 -1
- package/modern/components/cell/GridSkeletonCell.js +2 -2
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/modern/components/containers/GridRootStyles.js +9 -2
- package/modern/components/virtualization/GridMainContainer.js +3 -2
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/modern/context/GridContextProvider.js +12 -7
- package/modern/hooks/core/useGridRefs.js +3 -1
- package/modern/hooks/core/useGridStateInitialization.js +1 -3
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/modern/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/modern/hooks/features/filter/gridFilterSelector.js +34 -0
- package/modern/hooks/features/filter/index.js +1 -1
- package/modern/hooks/features/filter/useGridFilter.js +3 -0
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +6 -4
- package/modern/hooks/features/rows/useGridRowAriaAttributes.js +19 -0
- package/modern/hooks/utils/useGridAriaAttributes.js +5 -8
- package/modern/hooks/utils/useGridConfiguration.js +9 -0
- package/modern/hooks/utils/useGridSelector.js +1 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -1
- package/modern/locales/viVN.js +4 -5
- package/modern/models/configuration/gridConfiguration.js +1 -0
- package/modern/models/configuration/gridRowConfiguration.js +1 -0
- package/node/DataGrid/DataGrid.js +10 -1
- package/node/components/GridColumnHeaders.js +1 -1
- package/node/{utils/fastMemo.js → components/GridConfigurationContext.js} +4 -4
- package/node/components/GridHeaders.js +2 -5
- package/node/components/GridRow.js +6 -8
- package/node/components/GridScrollArea.js +1 -1
- package/node/components/GridSkeletonLoadingOverlay.js +1 -1
- package/node/components/cell/GridCell.js +1 -1
- package/node/components/cell/GridSkeletonCell.js +2 -2
- package/node/components/columnHeaders/GridColumnHeaderItem.js +1 -1
- package/node/components/containers/GridRootStyles.js +9 -2
- package/node/components/virtualization/GridMainContainer.js +3 -2
- package/node/components/virtualization/GridVirtualScrollerFiller.js +1 -1
- package/node/context/GridContextProvider.js +12 -7
- package/node/hooks/core/useGridRefs.js +3 -1
- package/node/hooks/core/useGridStateInitialization.js +1 -3
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -1
- package/node/hooks/features/export/serializers/csvSerializer.js +4 -3
- package/node/hooks/features/filter/gridFilterSelector.js +35 -1
- package/node/hooks/features/filter/index.js +97 -15
- package/node/hooks/features/filter/useGridFilter.js +3 -0
- package/node/hooks/features/rowSelection/useGridRowSelection.js +6 -4
- package/node/hooks/features/rows/useGridRowAriaAttributes.js +28 -0
- package/node/hooks/utils/useGridAriaAttributes.js +4 -7
- package/node/hooks/utils/useGridConfiguration.js +18 -0
- package/node/hooks/utils/useGridSelector.js +1 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +31 -12
- package/node/locales/viVN.js +4 -5
- package/node/models/configuration/gridConfiguration.js +5 -0
- package/node/models/configuration/gridRowConfiguration.js +5 -0
- package/package.json +12 -2
- package/modern/utils/fastMemo.js +0 -5
- package/modern/utils/fastObjectShallowCompare.js +0 -28
- package/modern/utils/throttle.js +0 -19
- package/node/utils/fastObjectShallowCompare.js +0 -34
- package/node/utils/throttle.js +0 -25
- package/utils/fastMemo.d.ts +0 -1
- package/utils/fastMemo.js +0 -5
- package/utils/fastObjectShallowCompare.d.ts +0 -1
- package/utils/fastObjectShallowCompare.js +0 -28
- package/utils/throttle.d.ts +0 -4
- 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
|
-
}
|
package/modern/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
|
-
}
|
|
@@ -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
|
-
}
|
package/node/utils/throttle.js
DELETED
|
@@ -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
|
-
}
|
package/utils/fastMemo.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function fastMemo<T>(component: T): T;
|
package/utils/fastMemo.js
DELETED
|
@@ -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
|
-
}
|
package/utils/throttle.d.ts
DELETED
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
|
-
}
|