@mui/x-data-grid 6.16.3 → 6.18.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 +127 -0
- package/DataGrid/DataGrid.js +13 -0
- package/DataGrid/useDataGridProps.js +3 -1
- package/colDef/gridStringOperators.js +1 -2
- package/components/containers/GridRootStyles.js +2 -1
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +6 -2
- package/hooks/core/useGridInitialization.d.ts +1 -1
- package/hooks/core/useGridInitialization.js +3 -0
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -25
- package/hooks/features/filter/gridFilterUtils.js +55 -24
- package/hooks/features/filter/useGridFilter.js +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +9 -1
- package/index.js +1 -1
- package/legacy/DataGrid/DataGrid.js +13 -0
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/colDef/gridStringOperators.js +1 -2
- package/legacy/components/containers/GridRootStyles.js +2 -1
- package/legacy/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +6 -2
- package/legacy/hooks/core/useGridInitialization.js +3 -0
- package/legacy/hooks/features/filter/gridFilterUtils.js +40 -17
- package/legacy/hooks/features/filter/useGridFilter.js +2 -2
- package/legacy/hooks/features/rows/useGridRowsMeta.js +2 -2
- package/legacy/hooks/features/virtualization/useGridVirtualScroller.js +9 -1
- package/legacy/index.js +1 -1
- package/legacy/locales/ptBR.js +13 -14
- package/legacy/utils/utils.js +1 -1
- package/locales/ptBR.js +13 -14
- package/models/api/gridApiCommon.d.ts +3 -2
- package/models/api/gridApiCommunity.d.ts +2 -1
- package/models/api/gridCoreApi.d.ts +7 -1
- package/models/api/gridEditingApi.d.ts +2 -2
- package/models/api/gridFilterApi.d.ts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +3 -2
- package/models/props/DataGridProps.d.ts +13 -0
- package/modern/DataGrid/DataGrid.js +13 -0
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/colDef/gridStringOperators.js +1 -2
- package/modern/components/containers/GridRootStyles.js +2 -1
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +6 -2
- package/modern/hooks/core/useGridInitialization.js +3 -0
- package/modern/hooks/features/filter/gridFilterUtils.js +55 -24
- package/modern/hooks/features/filter/useGridFilter.js +2 -2
- package/modern/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +9 -1
- package/modern/index.js +1 -1
- package/modern/locales/ptBR.js +13 -14
- package/modern/utils/utils.js +1 -1
- package/node/DataGrid/DataGrid.js +13 -0
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/colDef/gridStringOperators.js +1 -2
- package/node/components/containers/GridRootStyles.js +2 -1
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +6 -2
- package/node/hooks/core/useGridInitialization.js +3 -0
- package/node/hooks/features/filter/gridFilterUtils.js +56 -27
- package/node/hooks/features/filter/useGridFilter.js +2 -2
- package/node/hooks/features/rows/useGridRowsMeta.js +1 -1
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +9 -1
- package/node/index.js +1 -1
- package/node/locales/ptBR.js +13 -14
- package/node/utils/utils.js +1 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -1
- package/utils/utils.js +1 -1
|
@@ -475,6 +475,7 @@ const useGridVirtualScroller = props => {
|
|
|
475
475
|
rowStyleCache.current = Object.create(null);
|
|
476
476
|
}
|
|
477
477
|
const rows = [];
|
|
478
|
+
let isRowWithFocusedCellRendered = false;
|
|
478
479
|
for (let i = 0; i < renderedRows.length; i += 1) {
|
|
479
480
|
const {
|
|
480
481
|
id,
|
|
@@ -509,6 +510,13 @@ const useGridVirtualScroller = props => {
|
|
|
509
510
|
const style = (0, _extends2.default)({}, rowStyle, rootRowStyle);
|
|
510
511
|
rowStyleCache.current[id] = style;
|
|
511
512
|
}
|
|
513
|
+
let index = rowIndexOffset + (currentPage?.range?.firstRowIndex || 0) + firstRowToRender + i;
|
|
514
|
+
if (isRowWithFocusedCellNotInRange && cellFocus?.id === id) {
|
|
515
|
+
index = indexOfRowWithFocusedCell;
|
|
516
|
+
isRowWithFocusedCellRendered = true;
|
|
517
|
+
} else if (isRowWithFocusedCellRendered) {
|
|
518
|
+
index -= 1;
|
|
519
|
+
}
|
|
512
520
|
rows.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.row, (0, _extends2.default)({
|
|
513
521
|
row: model,
|
|
514
522
|
rowId: id,
|
|
@@ -522,7 +530,7 @@ const useGridVirtualScroller = props => {
|
|
|
522
530
|
firstColumnToRender: firstColumnToRender,
|
|
523
531
|
lastColumnToRender: lastColumnToRender,
|
|
524
532
|
selected: isSelected,
|
|
525
|
-
index:
|
|
533
|
+
index: index,
|
|
526
534
|
containerWidth: availableSpace,
|
|
527
535
|
isLastVisible: lastVisibleRowIndex,
|
|
528
536
|
position: position
|
package/node/index.js
CHANGED
package/node/locales/ptBR.js
CHANGED
|
@@ -66,13 +66,12 @@ const ptBRGrid = {
|
|
|
66
66
|
filterOperatorIsEmpty: 'está vazio',
|
|
67
67
|
filterOperatorIsNotEmpty: 'não está vazio',
|
|
68
68
|
filterOperatorIsAnyOf: 'é qualquer um dos',
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
'filterOperator=': 'igual à',
|
|
70
|
+
'filterOperator!=': 'diferente de',
|
|
71
|
+
'filterOperator>': 'maior que',
|
|
72
|
+
'filterOperator>=': 'maior ou igual que',
|
|
73
|
+
'filterOperator<': 'menor que',
|
|
74
|
+
'filterOperator<=': 'menor ou igual que',
|
|
76
75
|
// Header filter operators text
|
|
77
76
|
headerFilterOperatorContains: 'Contém',
|
|
78
77
|
headerFilterOperatorEquals: 'Igual',
|
|
@@ -80,13 +79,13 @@ const ptBRGrid = {
|
|
|
80
79
|
headerFilterOperatorEndsWith: 'Termina com',
|
|
81
80
|
headerFilterOperatorIs: 'É',
|
|
82
81
|
headerFilterOperatorNot: 'Não é',
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
headerFilterOperatorAfter: 'Depois de',
|
|
83
|
+
headerFilterOperatorOnOrAfter: 'Está entre ou depois de',
|
|
84
|
+
headerFilterOperatorBefore: 'Antes de',
|
|
85
|
+
headerFilterOperatorOnOrBefore: 'Está entre ou antes de',
|
|
86
|
+
headerFilterOperatorIsEmpty: 'É vazio',
|
|
87
|
+
headerFilterOperatorIsNotEmpty: 'Não é vazio',
|
|
88
|
+
headerFilterOperatorIsAnyOf: 'É algum',
|
|
90
89
|
'headerFilterOperator=': 'Igual',
|
|
91
90
|
'headerFilterOperator!=': 'Não igual',
|
|
92
91
|
'headerFilterOperator>': 'Maior que',
|
package/node/utils/utils.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.isObject = isObject;
|
|
|
13
13
|
exports.localStorageAvailable = localStorageAvailable;
|
|
14
14
|
exports.randomNumberBetween = randomNumberBetween;
|
|
15
15
|
function isNumber(value) {
|
|
16
|
-
return typeof value === 'number';
|
|
16
|
+
return typeof value === 'number' && !Number.isNaN(value);
|
|
17
17
|
}
|
|
18
18
|
function isFunction(value) {
|
|
19
19
|
return typeof value === 'function';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.23.2",
|
|
39
|
-
"@mui/utils": "^5.14.
|
|
39
|
+
"@mui/utils": "^5.14.16",
|
|
40
40
|
"clsx": "^2.0.0",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^4.1.8"
|
package/utils/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function isNumber(value:
|
|
1
|
+
export declare function isNumber(value: unknown): value is number;
|
|
2
2
|
export declare function isFunction(value: any): value is Function;
|
|
3
3
|
export declare function isObject<TObject = Record<PropertyKey, any>>(value: unknown): value is TObject;
|
|
4
4
|
export declare function localStorageAvailable(): boolean;
|
package/utils/utils.js
CHANGED