@mui/x-data-grid 7.27.0 → 7.27.2

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 (75) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/DataGrid/DataGrid.js +2 -0
  3. package/DataGrid/useDataGridComponent.js +2 -0
  4. package/colDef/gridCheckboxSelectionColDef.js +2 -1
  5. package/colDef/gridDateColDef.js +3 -2
  6. package/colDef/gridSingleSelectColDef.js +2 -2
  7. package/hooks/core/gridPropsSelectors.d.ts +9 -0
  8. package/hooks/core/gridPropsSelectors.js +14 -0
  9. package/hooks/core/index.d.ts +1 -0
  10. package/hooks/core/index.js +1 -1
  11. package/hooks/core/useGridInitialization.js +2 -0
  12. package/hooks/core/useGridProps.d.ts +8 -0
  13. package/hooks/core/useGridProps.js +18 -0
  14. package/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  15. package/hooks/features/dimensions/useGridDimensions.js +8 -9
  16. package/hooks/features/pagination/useGridPaginationModel.js +1 -1
  17. package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  18. package/hooks/features/rows/useGridRows.js +2 -10
  19. package/hooks/features/sorting/gridSortingUtils.js +2 -1
  20. package/index.js +1 -1
  21. package/internals/index.d.ts +1 -0
  22. package/internals/index.js +1 -0
  23. package/locales/bnBD.d.ts +2 -0
  24. package/locales/bnBD.js +154 -0
  25. package/locales/huHU.js +7 -8
  26. package/locales/index.d.ts +1 -0
  27. package/locales/index.js +1 -0
  28. package/locales/ruRU.js +5 -6
  29. package/models/api/gridRowApi.d.ts +0 -1
  30. package/models/gridSortModel.d.ts +1 -1
  31. package/models/gridStateCommunity.d.ts +8 -0
  32. package/models/props/DataGridProps.d.ts +2 -0
  33. package/modern/DataGrid/DataGrid.js +2 -0
  34. package/modern/DataGrid/useDataGridComponent.js +2 -0
  35. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
  36. package/modern/colDef/gridDateColDef.js +3 -2
  37. package/modern/colDef/gridSingleSelectColDef.js +2 -2
  38. package/modern/hooks/core/gridPropsSelectors.js +14 -0
  39. package/modern/hooks/core/index.js +1 -1
  40. package/modern/hooks/core/useGridInitialization.js +2 -0
  41. package/modern/hooks/core/useGridProps.js +18 -0
  42. package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  43. package/modern/hooks/features/dimensions/useGridDimensions.js +8 -9
  44. package/modern/hooks/features/pagination/useGridPaginationModel.js +1 -1
  45. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  46. package/modern/hooks/features/rows/useGridRows.js +2 -10
  47. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -1
  48. package/modern/index.js +1 -1
  49. package/modern/internals/index.js +1 -0
  50. package/modern/locales/bnBD.js +154 -0
  51. package/modern/locales/huHU.js +7 -8
  52. package/modern/locales/index.js +1 -0
  53. package/modern/locales/ruRU.js +5 -6
  54. package/node/DataGrid/DataGrid.js +2 -0
  55. package/node/DataGrid/useDataGridComponent.js +2 -0
  56. package/node/colDef/gridCheckboxSelectionColDef.js +2 -1
  57. package/node/colDef/gridDateColDef.js +3 -2
  58. package/node/colDef/gridSingleSelectColDef.js +2 -2
  59. package/node/hooks/core/gridPropsSelectors.js +20 -0
  60. package/node/hooks/core/index.js +8 -1
  61. package/node/hooks/core/useGridInitialization.js +2 -0
  62. package/node/hooks/core/useGridProps.js +28 -0
  63. package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +2 -2
  64. package/node/hooks/features/dimensions/useGridDimensions.js +8 -9
  65. package/node/hooks/features/pagination/useGridPaginationModel.js +1 -1
  66. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  67. package/node/hooks/features/rows/useGridRows.js +2 -10
  68. package/node/hooks/features/sorting/gridSortingUtils.js +2 -1
  69. package/node/index.js +1 -1
  70. package/node/internals/index.js +8 -0
  71. package/node/locales/bnBD.js +160 -0
  72. package/node/locales/huHU.js +7 -8
  73. package/node/locales/index.js +11 -0
  74. package/node/locales/ruRU.js +5 -6
  75. package/package.json +1 -1
package/locales/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  export * from "./arSD.js";
3
3
  export * from "./beBY.js";
4
4
  export * from "./bgBG.js";
5
+ export * from "./bnBD.js";
5
6
  export * from "./csCZ.js";
6
7
  export * from "./daDK.js";
7
8
  export * from "./deDE.js";
package/locales/ruRU.js CHANGED
@@ -49,8 +49,7 @@ const ruRUGrid = {
49
49
  columnsManagementNoColumns: 'Нет столбцов',
50
50
  columnsManagementShowHideAllText: 'Показать/Скрыть Всё',
51
51
  columnsManagementReset: 'Сбросить',
52
- // columnsManagementDeleteIconLabel: 'Clear',
53
-
52
+ columnsManagementDeleteIconLabel: 'Очистить',
54
53
  // Filter panel text
55
54
  filterPanelAddFilter: 'Добавить фильтр',
56
55
  filterPanelRemoveAll: 'Очистить фильтр',
@@ -64,9 +63,9 @@ const ruRUGrid = {
64
63
  filterPanelInputPlaceholder: 'Значение фильтра',
65
64
  // Filter operators text
66
65
  filterOperatorContains: 'содержит',
67
- // filterOperatorDoesNotContain: 'does not contain',
66
+ filterOperatorDoesNotContain: 'не содержит',
68
67
  filterOperatorEquals: 'равен',
69
- // filterOperatorDoesNotEqual: 'does not equal',
68
+ filterOperatorDoesNotEqual: 'не равен',
70
69
  filterOperatorStartsWith: 'начинается с',
71
70
  filterOperatorEndsWith: 'заканчивается на',
72
71
  filterOperatorIs: 'равен',
@@ -86,9 +85,9 @@ const ruRUGrid = {
86
85
  'filterOperator<=': '<=',
87
86
  // Header filter operators text
88
87
  headerFilterOperatorContains: 'содержит',
89
- // headerFilterOperatorDoesNotContain: 'Does not contain',
88
+ headerFilterOperatorDoesNotContain: 'не содержит',
90
89
  headerFilterOperatorEquals: 'равен',
91
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
90
+ headerFilterOperatorDoesNotEqual: 'не равен',
92
91
  headerFilterOperatorStartsWith: 'начинается с',
93
92
  headerFilterOperatorEndsWith: 'заканчивается на',
94
93
  headerFilterOperatorIs: 'равен',
@@ -69,7 +69,6 @@ export interface GridRowApi {
69
69
  getRowId: <R extends GridValidRowModel = any>(row: R) => GridRowId;
70
70
  /**
71
71
  * Gets the row node from the internal tree structure.
72
- * TODO rows v6: Rename `getTreeNode`
73
72
  * @param {GridRowId} id The id of the row.
74
73
  * @returns {GridTreeNode} The tree node.
75
74
  */
@@ -27,4 +27,4 @@ export interface GridSortItem {
27
27
  /**
28
28
  * The model used for sorting the grid.
29
29
  */
30
- export type GridSortModel = GridSortItem[];
30
+ export type GridSortModel = readonly GridSortItem[];
@@ -1,4 +1,5 @@
1
1
  import type { GridColumnMenuState, GridColumnsInitialState, GridColumnsState, GridColumnsGroupingState, GridColumnPinningState, GridDensityState, GridDimensionsState, GridFilterInitialState, GridFilterState, GridFocusState, GridPaginationInitialState, GridPaginationState, GridPreferencePanelInitialState, GridPreferencePanelState, GridRowsState, GridSortingInitialState, GridSortingState, GridTabIndexState, GridVirtualizationState } from '../hooks';
2
+ import type { DataGridProps } from './props/DataGridProps';
2
3
  import type { GridRowsMetaState } from '../hooks/features/rows/gridRowsMetaState';
3
4
  import type { GridEditingState } from './gridEditRowModel';
4
5
  import { GridHeaderFilteringState } from './gridHeaderFilteringModel';
@@ -7,11 +8,17 @@ import type { GridVisibleRowsLookupState } from '../hooks/features/filter/gridFi
7
8
  import type { GridColumnResizeState } from '../hooks/features/columnResize';
8
9
  import type { GridRowSpanningState } from '../hooks/features/rows/useGridRowSpanning';
9
10
  import type { GridListViewState } from '../hooks/features/listView/useGridListView';
11
+ /**
12
+ * Some props are passed on the state to enable grid selectors to select
13
+ * and react to them.
14
+ */
15
+ type GridStateProps = Pick<DataGridProps, 'getRowId'>;
10
16
  /**
11
17
  * The state of Data Grid.
12
18
  */
13
19
  export interface GridStateCommunity {
14
20
  isRtl: boolean;
21
+ props: GridStateProps;
15
22
  dimensions: GridDimensionsState;
16
23
  rows: GridRowsState;
17
24
  visibleRowsLookup: GridVisibleRowsLookupState;
@@ -50,3 +57,4 @@ export interface GridInitialStateCommunity {
50
57
  left: number;
51
58
  };
52
59
  }
60
+ export {};
@@ -743,6 +743,8 @@ export interface DataGridPropsWithoutDefaultValue<R extends GridValidRowModel =
743
743
  columns: readonly GridColDef<R>[];
744
744
  /**
745
745
  * Return the id of a given [[GridRowModel]].
746
+ * Ensure the reference of this prop is stable to avoid performance implications.
747
+ * It could be done by either defining the prop outside of the component or by memoizing it.
746
748
  */
747
749
  getRowId?: GridRowIdGetter<R>;
748
750
  /**
@@ -282,6 +282,8 @@ DataGridRaw.propTypes = {
282
282
  getRowHeight: PropTypes.func,
283
283
  /**
284
284
  * Return the id of a given [[GridRowModel]].
285
+ * Ensure the reference of this prop is stable to avoid performance implications.
286
+ * It could be done by either defining the prop outside of the component or by memoizing it.
285
287
  */
286
288
  getRowId: PropTypes.func,
287
289
  /**
@@ -29,6 +29,7 @@ import { useGridVirtualization, virtualizationStateInitializer } from "../hooks/
29
29
  import { columnResizeStateInitializer, useGridColumnResize } from "../hooks/features/columnResize/useGridColumnResize.js";
30
30
  import { rowSpanningStateInitializer, useGridRowSpanning } from "../hooks/features/rows/useGridRowSpanning.js";
31
31
  import { listViewStateInitializer, useGridListView } from "../hooks/features/listView/useGridListView.js";
32
+ import { propsStateInitializer } from "../hooks/core/useGridProps.js";
32
33
  export const useDataGridComponent = (inputApiRef, props) => {
33
34
  const apiRef = useGridInitialization(inputApiRef, props);
34
35
 
@@ -41,6 +42,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
41
42
  /**
42
43
  * Register all state initializers here.
43
44
  */
45
+ useGridInitializeState(propsStateInitializer, apiRef, props);
44
46
  useGridInitializeState(rowSelectionStateInitializer, apiRef, props);
45
47
  useGridInitializeState(columnsStateInitializer, apiRef, props);
46
48
  useGridInitializeState(rowsStateInitializer, apiRef, props);
@@ -4,6 +4,7 @@ import { GridCellCheckboxRenderer } from "../components/columnSelection/GridCell
4
4
  import { GridHeaderCheckbox } from "../components/columnSelection/GridHeaderCheckbox.js";
5
5
  import { selectedIdsLookupSelector } from "../hooks/features/rowSelection/gridRowSelectionSelector.js";
6
6
  import { GRID_BOOLEAN_COL_DEF } from "./gridBooleanColDef.js";
7
+ import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.js";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  export const GRID_CHECKBOX_SELECTION_FIELD = '__check__';
9
10
  export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {
@@ -22,7 +23,7 @@ export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF
22
23
  display: 'flex',
23
24
  valueGetter: (value, row, column, apiRef) => {
24
25
  const selectionLookup = selectedIdsLookupSelector(apiRef);
25
- const rowId = apiRef.current.getRowId(row);
26
+ const rowId = gridRowIdSelector(apiRef.current.state, row);
26
27
  return selectionLookup[rowId] !== undefined;
27
28
  },
28
29
  renderHeader: params => /*#__PURE__*/_jsx(GridHeaderCheckbox, _extends({}, params)),
@@ -3,6 +3,7 @@ import { gridDateComparator } from "../hooks/features/sorting/gridSortingUtils.j
3
3
  import { getGridDateOperators } from "./gridDateOperators.js";
4
4
  import { GRID_STRING_COL_DEF } from "./gridStringColDef.js";
5
5
  import { renderEditDateCell } from "../components/cell/GridEditDateCell.js";
6
+ import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.js";
6
7
  function throwIfNotDateObject({
7
8
  value,
8
9
  columnType,
@@ -17,7 +18,7 @@ export const gridDateFormatter = (value, row, column, apiRef) => {
17
18
  if (!value) {
18
19
  return '';
19
20
  }
20
- const rowId = apiRef.current.getRowId(row);
21
+ const rowId = gridRowIdSelector(apiRef.current.state, row);
21
22
  throwIfNotDateObject({
22
23
  value,
23
24
  columnType: 'date',
@@ -30,7 +31,7 @@ export const gridDateTimeFormatter = (value, row, column, apiRef) => {
30
31
  if (!value) {
31
32
  return '';
32
33
  }
33
- const rowId = apiRef.current.getRowId(row);
34
+ const rowId = gridRowIdSelector(apiRef.current.state, row);
34
35
  throwIfNotDateObject({
35
36
  value,
36
37
  columnType: 'dateTime',
@@ -4,6 +4,7 @@ import { renderEditSingleSelectCell } from "../components/cell/GridEditSingleSel
4
4
  import { getGridSingleSelectOperators } from "./gridSingleSelectOperators.js";
5
5
  import { getValueOptions, isSingleSelectColDef } from "../components/panel/filterPanel/filterPanelUtils.js";
6
6
  import { isObject } from "../utils/utils.js";
7
+ import { gridRowIdSelector } from "../hooks/core/gridPropsSelectors.js";
7
8
  const isArrayOfObjects = options => {
8
9
  return typeof options[0] === 'object';
9
10
  };
@@ -18,8 +19,7 @@ export const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
18
19
  getOptionLabel: defaultGetOptionLabel,
19
20
  getOptionValue: defaultGetOptionValue,
20
21
  valueFormatter(value, row, colDef, apiRef) {
21
- // const { id, field, value, api } = params;
22
- const rowId = apiRef.current.getRowId(row);
22
+ const rowId = gridRowIdSelector(apiRef.current.state, row);
23
23
  if (!isSingleSelectColDef(colDef)) {
24
24
  return '';
25
25
  }
@@ -0,0 +1,14 @@
1
+ import { GRID_ID_AUTOGENERATED } from "../features/rows/gridRowsUtils.js";
2
+
3
+ /**
4
+ * Get the row id for a given row
5
+ * @param state - The grid state
6
+ * @param {GridRowModel} row - The row to get the id for
7
+ * @returns {GridRowId} The row id
8
+ */
9
+ export const gridRowIdSelector = (state, row) => {
10
+ if (GRID_ID_AUTOGENERATED in row) {
11
+ return row[GRID_ID_AUTOGENERATED];
12
+ }
13
+ return state.props.getRowId ? state.props.getRowId(row) : row.id;
14
+ };
@@ -1 +1 @@
1
- export {};
1
+ export { gridRowIdSelector } from "./gridPropsSelectors.js";
@@ -6,6 +6,7 @@ import { useGridLocaleText } from "./useGridLocaleText.js";
6
6
  import { useGridPipeProcessing } from "./pipeProcessing/index.js";
7
7
  import { useGridStrategyProcessing } from "./strategyProcessing/index.js";
8
8
  import { useGridStateInitialization } from "./useGridStateInitialization.js";
9
+ import { useGridProps } from "./useGridProps.js";
9
10
 
10
11
  /**
11
12
  * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs
@@ -13,6 +14,7 @@ import { useGridStateInitialization } from "./useGridStateInitialization.js";
13
14
  export const useGridInitialization = (inputApiRef, props) => {
14
15
  const privateApiRef = useGridApiInitialization(inputApiRef, props);
15
16
  useGridRefs(privateApiRef);
17
+ useGridProps(privateApiRef, props);
16
18
  useGridIsRtl(privateApiRef);
17
19
  useGridLoggerFactory(privateApiRef, props);
18
20
  useGridStateInitialization(privateApiRef);
@@ -0,0 +1,18 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
3
+ export const propsStateInitializer = (state, props) => {
4
+ return _extends({}, state, {
5
+ props: {
6
+ getRowId: props.getRowId
7
+ }
8
+ });
9
+ };
10
+ export const useGridProps = (apiRef, props) => {
11
+ React.useEffect(() => {
12
+ apiRef.current.setState(state => _extends({}, state, {
13
+ props: {
14
+ getRowId: props.getRowId
15
+ }
16
+ }));
17
+ }, [apiRef, props.getRowId]);
18
+ };
@@ -135,7 +135,7 @@ export const useGridColumnHeaders = props => {
135
135
  const indexInSection = i;
136
136
  const sectionLength = renderedColumns.length;
137
137
  const showLeftBorder = shouldCellShowLeftBorder(pinnedPosition, indexInSection);
138
- const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
138
+ const showRightBorder = shouldCellShowRightBorder(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
139
139
  columns.push(/*#__PURE__*/_jsx(GridColumnHeaderItem, _extends({}, sortColumnLookup[colDef.field], {
140
140
  columnMenuOpen: open,
141
141
  filterItemsCounter: filterColumnLookup[colDef.field] && filterColumnLookup[colDef.field].length,
@@ -252,7 +252,7 @@ export const useGridColumnHeaders = props => {
252
252
  pinnedPosition: pinnedPosition,
253
253
  pinnedOffset: pinnedOffset,
254
254
  showLeftBorder: shouldCellShowLeftBorder(pinnedPosition, indexInSection),
255
- showRightBorder: shouldCellShowRightBorder(pinnedPosition, indexInSection, visibleColumnGroupHeader.length, rootProps.showCellVerticalBorder, gridHasFiller)
255
+ showRightBorder: shouldCellShowRightBorder(pinnedPosition, indexInSection, visibleColumnGroupHeader.length, rootProps.showColumnVerticalBorder, gridHasFiller)
256
256
  }, index);
257
257
  });
258
258
  return getFillers(params, children, leftOverflow);
@@ -125,8 +125,7 @@ export function useGridDimensions(apiRef, props) {
125
125
  // All the floating point dimensions should be rounded to .1 decimal places to avoid subpixel rendering issues
126
126
  // https://github.com/mui/mui-x/issues/9550#issuecomment-1619020477
127
127
  // https://github.com/mui/mui-x/issues/15721
128
- const rootElement = apiRef.current.rootElementRef.current;
129
- const scrollbarSize = measureScrollbarSize(rootElement, props.scrollbarSize);
128
+ const scrollbarSize = measureScrollbarSize(apiRef.current.mainElementRef.current, props.scrollbarSize);
130
129
  const rowsMeta = gridRowsMetaSelector(apiRef.current.state);
131
130
  const topContainerHeight = headersTotalHeight + rowsMeta.pinnedTopRowsTotalHeight;
132
131
  const bottomContainerHeight = rowsMeta.pinnedBottomRowsTotalHeight;
@@ -287,28 +286,28 @@ function getStaticDimensions(props, apiRef, density, pinnedColumnns) {
287
286
  };
288
287
  }
289
288
  const scrollbarSizeCache = new WeakMap();
290
- function measureScrollbarSize(rootElement, scrollbarSize) {
289
+ function measureScrollbarSize(element, scrollbarSize) {
291
290
  if (scrollbarSize !== undefined) {
292
291
  return scrollbarSize;
293
292
  }
294
- if (rootElement === null) {
293
+ if (element === null) {
295
294
  return 0;
296
295
  }
297
- const cachedSize = scrollbarSizeCache.get(rootElement);
296
+ const cachedSize = scrollbarSizeCache.get(element);
298
297
  if (cachedSize !== undefined) {
299
298
  return cachedSize;
300
299
  }
301
- const doc = ownerDocument(rootElement);
300
+ const doc = ownerDocument(element);
302
301
  const scrollDiv = doc.createElement('div');
303
302
  scrollDiv.style.width = '99px';
304
303
  scrollDiv.style.height = '99px';
305
304
  scrollDiv.style.position = 'absolute';
306
305
  scrollDiv.style.overflow = 'scroll';
307
306
  scrollDiv.className = 'scrollDiv';
308
- rootElement.appendChild(scrollDiv);
307
+ element.appendChild(scrollDiv);
309
308
  const size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
310
- rootElement.removeChild(scrollDiv);
311
- scrollbarSizeCache.set(rootElement, size);
309
+ element.removeChild(scrollDiv);
310
+ scrollbarSizeCache.set(element, size);
312
311
  return size;
313
312
  }
314
313
  function areElementSizesEqual(a, b) {
@@ -16,7 +16,7 @@ export const getDerivedPaginationModel = (paginationState, signature, pagination
16
16
  if (paginationModelProp && (paginationModelProp?.page !== paginationModel.page || paginationModelProp?.pageSize !== paginationModel.pageSize)) {
17
17
  paginationModel = paginationModelProp;
18
18
  }
19
- const validPage = getValidPage(paginationModel.page, pageCount);
19
+ const validPage = pageSize === -1 ? 0 : getValidPage(paginationModel.page, pageCount);
20
20
  if (validPage !== paginationModel.page) {
21
21
  paginationModel = _extends({}, paginationModel, {
22
22
  page: validPage
@@ -114,7 +114,7 @@ export const useGridRowSelection = (apiRef, props) => {
114
114
  if (propIsRowSelectable && !propIsRowSelectable(apiRef.current.getRowParams(id))) {
115
115
  return false;
116
116
  }
117
- const rowNode = apiRef.current.getRowNode(id);
117
+ const rowNode = gridRowTreeSelector(apiRef)[id];
118
118
  if (rowNode?.type === 'footer' || rowNode?.type === 'pinnedRow') {
119
119
  return false;
120
120
  }
@@ -338,7 +338,7 @@ export const useGridRowSelection = (apiRef, props) => {
338
338
  return;
339
339
  }
340
340
  }
341
- const rowNode = apiRef.current.getRowNode(params.id);
341
+ const rowNode = gridRowTreeSelector(apiRef)[params.id];
342
342
  if (rowNode.type === 'pinnedRow') {
343
343
  return;
344
344
  }
@@ -4,6 +4,7 @@ import useLazyRef from '@mui/utils/useLazyRef';
4
4
  import { useGridApiMethod } from "../../utils/useGridApiMethod.js";
5
5
  import { useGridLogger } from "../../utils/useGridLogger.js";
6
6
  import { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowGroupingNameSelector, gridRowTreeDepthsSelector, gridDataRowIdsSelector, gridRowsDataRowIdToIdLookupSelector, gridRowMaximumTreeDepthSelector, gridRowGroupsToFetchSelector } from "./gridRowsSelector.js";
7
+ import { gridRowIdSelector } from "../../core/gridPropsSelectors.js";
7
8
  import { useTimeout } from "../../utils/useTimeout.js";
8
9
  import { GridSignature, useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
9
10
  import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
@@ -55,16 +56,7 @@ export const useGridRows = (apiRef, props) => {
55
56
  }
56
57
  return null;
57
58
  }, [apiRef]);
58
- const getRowIdProp = props.getRowId;
59
- const getRowId = React.useCallback(row => {
60
- if (GRID_ID_AUTOGENERATED in row) {
61
- return row[GRID_ID_AUTOGENERATED];
62
- }
63
- if (getRowIdProp) {
64
- return getRowIdProp(row);
65
- }
66
- return row.id;
67
- }, [getRowIdProp]);
59
+ const getRowId = React.useCallback(row => gridRowIdSelector(apiRef.current.state, row), [apiRef]);
68
60
  const throttledRowsChange = React.useCallback(({
69
61
  cache,
70
62
  throttle
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { warnOnce } from '@mui/x-internals/warning';
3
+ import { gridRowTreeSelector } from "../rows/gridRowsSelector.js";
3
4
  export const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {
4
5
  if (disableMultipleColumnsSorting && model.length > 1) {
5
6
  if (process.env.NODE_ENV !== 'production') {
@@ -39,7 +40,7 @@ const parseSortItem = (sortItem, apiRef) => {
39
40
  const getSortCellParams = id => ({
40
41
  id,
41
42
  field: column.field,
42
- rowNode: apiRef.current.getRowNode(id),
43
+ rowNode: gridRowTreeSelector(apiRef)[id],
43
44
  value: apiRef.current.getCellValue(id, column.field),
44
45
  api: apiRef.current
45
46
  });
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v7.27.0
2
+ * @mui/x-data-grid v7.27.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -4,6 +4,7 @@ export { GridVirtualScrollerRenderZone } from "../components/virtualization/Grid
4
4
  export { GridHeaders } from "../components/GridHeaders.js";
5
5
  export { GridBaseColumnHeaders } from "../components/columnHeaders/GridBaseColumnHeaders.js";
6
6
  export { DATA_GRID_DEFAULT_SLOTS_COMPONENTS } from "../constants/defaultGridSlotsComponents.js";
7
+ export { propsStateInitializer } from "../hooks/core/useGridProps.js";
7
8
  export { getGridFilter } from "../components/panel/filterPanel/GridFilterPanel.js";
8
9
  export { useGridRegisterPipeProcessor } from "../hooks/core/pipeProcessing/index.js";
9
10
  export { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from "../hooks/core/strategyProcessing/index.js";
@@ -0,0 +1,154 @@
1
+ import { bnBD as bnBDCore } from '@mui/material/locale';
2
+ import { getGridLocalization } from "../utils/getGridLocalization.js";
3
+ const bnBDGrid = {
4
+ // Root
5
+ noRowsLabel: 'কোনো সারি নেই',
6
+ noResultsOverlayLabel: 'কোনো ফলাফল পাওয়া যায়নি।',
7
+ // Density selector toolbar button text
8
+ toolbarDensity: 'ঘনত্ব',
9
+ toolbarDensityLabel: 'ঘনত্ব',
10
+ toolbarDensityCompact: 'সংকুচিত',
11
+ toolbarDensityStandard: 'মানক',
12
+ toolbarDensityComfortable: 'স্বাচ্ছন্দ্যদায়ক',
13
+ // Columns selector toolbar button text
14
+ toolbarColumns: 'কলাম',
15
+ toolbarColumnsLabel: 'কলাম নির্বাচন করুন',
16
+ // Filters toolbar button text
17
+ toolbarFilters: 'ফিল্টার',
18
+ toolbarFiltersLabel: 'ফিল্টার দেখান',
19
+ toolbarFiltersTooltipHide: 'ফিল্টার লুকান',
20
+ toolbarFiltersTooltipShow: 'ফিল্টার দেখান',
21
+ toolbarFiltersTooltipActive: count => count !== 1 ? `${count} টি সক্রিয় ফিল্টার` : `${count} টি সক্রিয় ফিল্টার`,
22
+ // Quick filter toolbar field
23
+ toolbarQuickFilterPlaceholder: 'অনুসন্ধান করুন…',
24
+ toolbarQuickFilterLabel: 'অনুসন্ধান',
25
+ toolbarQuickFilterDeleteIconLabel: 'পরিষ্কার করুন',
26
+ // Export selector toolbar button text
27
+ toolbarExport: 'এক্সপোর্ট',
28
+ toolbarExportLabel: 'এক্সপোর্ট',
29
+ toolbarExportCSV: 'CSV হিসাবে ডাউনলোড করুন',
30
+ toolbarExportPrint: 'প্রিন্ট করুন',
31
+ toolbarExportExcel: 'Excel হিসাবে ডাউনলোড করুন',
32
+ // Columns management text
33
+ columnsManagementSearchTitle: 'অনুসন্ধান',
34
+ columnsManagementNoColumns: 'কোনো কলাম নেই',
35
+ columnsManagementShowHideAllText: 'সব দেখান/লুকান',
36
+ columnsManagementReset: 'রিসেট',
37
+ columnsManagementDeleteIconLabel: 'পরিষ্কার',
38
+ // Filter panel text
39
+ filterPanelAddFilter: 'ফিল্টার যোগ করুন',
40
+ filterPanelRemoveAll: 'সব সরান',
41
+ filterPanelDeleteIconLabel: 'মুছুন',
42
+ filterPanelLogicOperator: 'লজিক অপারেটর',
43
+ filterPanelOperator: 'অপারেটর',
44
+ filterPanelOperatorAnd: 'এবং',
45
+ filterPanelOperatorOr: 'অথবা',
46
+ filterPanelColumns: 'কলাম',
47
+ filterPanelInputLabel: 'মান',
48
+ filterPanelInputPlaceholder: 'ফিল্টার মান',
49
+ // Filter operators text
50
+ filterOperatorContains: 'অন্তর্ভুক্ত',
51
+ filterOperatorDoesNotContain: 'অন্তর্ভুক্ত নয়',
52
+ filterOperatorEquals: 'সমান',
53
+ filterOperatorDoesNotEqual: 'সমান নয়',
54
+ filterOperatorStartsWith: 'দিয়ে শুরু হয়',
55
+ filterOperatorEndsWith: 'দিয়ে শেষ হয়',
56
+ filterOperatorIs: 'হচ্ছে',
57
+ filterOperatorNot: 'হচ্ছে না',
58
+ filterOperatorAfter: 'পরবর্তী',
59
+ filterOperatorOnOrAfter: 'এই তারিখ বা পরবর্তী',
60
+ filterOperatorBefore: 'পূর্ববর্তী',
61
+ filterOperatorOnOrBefore: 'এই তারিখ বা পূর্ববর্তী',
62
+ filterOperatorIsEmpty: 'খালি',
63
+ filterOperatorIsNotEmpty: 'খালি নয়',
64
+ filterOperatorIsAnyOf: 'এর যেকোনো একটি',
65
+ 'filterOperator=': '=',
66
+ 'filterOperator!=': '!=',
67
+ 'filterOperator>': '>',
68
+ 'filterOperator>=': '>=',
69
+ 'filterOperator<': '<',
70
+ 'filterOperator<=': '<=',
71
+ // Header filter operators text
72
+ headerFilterOperatorContains: 'অন্তর্ভুক্ত',
73
+ headerFilterOperatorDoesNotContain: 'অন্তর্ভুক্ত নয়',
74
+ headerFilterOperatorEquals: 'সমান',
75
+ headerFilterOperatorDoesNotEqual: 'সমান নয়',
76
+ headerFilterOperatorStartsWith: 'দিয়ে শুরু হয়',
77
+ headerFilterOperatorEndsWith: 'দিয়ে শেষ হয়',
78
+ headerFilterOperatorIs: 'হচ্ছে',
79
+ headerFilterOperatorNot: 'হচ্ছে না',
80
+ headerFilterOperatorAfter: 'পরবর্তী',
81
+ headerFilterOperatorOnOrAfter: 'এই তারিখ বা পরবর্তী',
82
+ headerFilterOperatorBefore: 'পূর্ববর্তী',
83
+ headerFilterOperatorOnOrBefore: 'এই তারিখ বা পূর্ববর্তী',
84
+ headerFilterOperatorIsEmpty: 'খালি',
85
+ headerFilterOperatorIsNotEmpty: 'খালি নয়',
86
+ headerFilterOperatorIsAnyOf: 'এর যেকোনো একটি',
87
+ 'headerFilterOperator=': 'সমান',
88
+ 'headerFilterOperator!=': 'সমান নয়',
89
+ 'headerFilterOperator>': 'বড়',
90
+ 'headerFilterOperator>=': 'বড় বা সমান',
91
+ 'headerFilterOperator<': 'ছোট',
92
+ 'headerFilterOperator<=': 'ছোট বা সমান',
93
+ // Filter values text
94
+ filterValueAny: 'যেকোনো',
95
+ filterValueTrue: 'সত্য',
96
+ filterValueFalse: 'মিথ্যা',
97
+ // Column menu text
98
+ columnMenuLabel: 'মেনু',
99
+ columnMenuShowColumns: 'কলাম দেখান',
100
+ columnMenuManageColumns: 'কলাম পরিচালনা করুন',
101
+ columnMenuFilter: 'ফিল্টার',
102
+ columnMenuHideColumn: 'কলাম লুকান',
103
+ columnMenuUnsort: 'সাজানো বাতিল করুন',
104
+ columnMenuSortAsc: 'ASC অনুযায়ী সাজান',
105
+ columnMenuSortDesc: 'DESC অনুযায়ী সাজান',
106
+ // Column header text
107
+ columnHeaderFiltersTooltipActive: count => count !== 1 ? `${count} টি সক্রিয় ফিল্টার` : `${count} টি সক্রিয় ফিল্টার`,
108
+ columnHeaderFiltersLabel: 'ফিল্টার দেখান',
109
+ columnHeaderSortIconLabel: 'সাজান',
110
+ // Rows selected footer text
111
+ footerRowSelected: count => count !== 1 ? `${count.toLocaleString()} টি সারি নির্বাচিত` : `${count.toLocaleString()} টি সারি নির্বাচিত`,
112
+ // Total row amount footer text
113
+ footerTotalRows: 'মোট সারি:',
114
+ // Total visible row amount footer text
115
+ footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} of ${totalCount.toLocaleString()}`,
116
+ // Checkbox selection text
117
+ checkboxSelectionHeaderName: 'চেকবক্স নির্বাচন',
118
+ checkboxSelectionSelectAllRows: 'সব সারি নির্বাচন করুন',
119
+ checkboxSelectionUnselectAllRows: 'সব সারি নির্বাচন বাতিল করুন',
120
+ checkboxSelectionSelectRow: 'সারি নির্বাচন করুন',
121
+ checkboxSelectionUnselectRow: 'সারি নির্বাচন বাতিল করুন',
122
+ // Boolean cell text
123
+ booleanCellTrueLabel: 'হ্যাঁ',
124
+ booleanCellFalseLabel: 'না',
125
+ // Actions cell more text
126
+ actionsCellMore: 'আরও',
127
+ // Column pinning text
128
+ pinToLeft: 'বাঁ দিকে পিন করুন',
129
+ pinToRight: 'ডান দিকে পিন করুন',
130
+ unpin: 'আনপিন করুন',
131
+ // Tree Data
132
+ treeDataGroupingHeaderName: 'গ্রুপ',
133
+ // treeDataExpand: 'see children',
134
+ // treeDataCollapse: 'hide children',
135
+
136
+ // Grouping columns
137
+ groupingColumnHeaderName: 'গ্রুপ',
138
+ groupColumn: name => `${name} অনুসারে গ্রুপ করুন`,
139
+ unGroupColumn: name => `${name} অনুসারে গ্রুপ বন্ধ করুন`,
140
+ // Master/detail
141
+ detailPanelToggle: 'বিস্তারিত প্যানেল টগল করুন',
142
+ expandDetailPanel: 'সম্প্রসারিত করুন',
143
+ collapseDetailPanel: 'সংকুচিত করুন',
144
+ // Row reordering text
145
+ rowReorderingHeaderName: 'সারি পুনর্বিন্যাস',
146
+ // Aggregation
147
+ aggregationMenuItemHeader: 'সংকলন',
148
+ aggregationFunctionLabelSum: 'যোগফল',
149
+ aggregationFunctionLabelAvg: 'গড়',
150
+ aggregationFunctionLabelMin: 'সর্বনিম্ন',
151
+ aggregationFunctionLabelMax: 'সর্বোচ্চ',
152
+ aggregationFunctionLabelSize: 'মাপ'
153
+ };
154
+ export const bnBD = getGridLocalization(bnBDGrid, bnBDCore);
@@ -34,8 +34,7 @@ const huHUGrid = {
34
34
  columnsManagementNoColumns: 'Nincsenek oszlopok',
35
35
  columnsManagementShowHideAllText: 'Összes',
36
36
  columnsManagementReset: 'Visszavon',
37
- // columnsManagementDeleteIconLabel: 'Clear',
38
-
37
+ columnsManagementDeleteIconLabel: 'Törlés',
39
38
  // Filter panel text
40
39
  filterPanelAddFilter: 'Szűrő hozzáadása',
41
40
  filterPanelRemoveAll: 'Összes törlése',
@@ -49,9 +48,9 @@ const huHUGrid = {
49
48
  filterPanelInputPlaceholder: 'Érték szűrése',
50
49
  // Filter operators text
51
50
  filterOperatorContains: 'tartalmazza:',
52
- // filterOperatorDoesNotContain: 'does not contain',
51
+ filterOperatorDoesNotContain: 'nem tartalmazza',
53
52
  filterOperatorEquals: 'egyenlő ezzel:',
54
- // filterOperatorDoesNotEqual: 'does not equal',
53
+ filterOperatorDoesNotEqual: 'nem egyenlő',
55
54
  filterOperatorStartsWith: 'ezzel kezdődik:',
56
55
  filterOperatorEndsWith: 'ezzel végződik:',
57
56
  filterOperatorIs: 'a következő:',
@@ -71,13 +70,13 @@ const huHUGrid = {
71
70
  'filterOperator<=': '<=',
72
71
  // Header filter operators text
73
72
  headerFilterOperatorContains: 'Tartalmazza:',
74
- // headerFilterOperatorDoesNotContain: 'Does not contain',
73
+ headerFilterOperatorDoesNotContain: 'Nem tartalmazza',
75
74
  headerFilterOperatorEquals: 'Egyenlő ezzel:',
76
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
75
+ headerFilterOperatorDoesNotEqual: 'Nem egyenlő',
77
76
  headerFilterOperatorStartsWith: 'Ezzel kezdődik:',
78
77
  headerFilterOperatorEndsWith: 'Ezzel végződik:',
79
- // headerFilterOperatorIs: 'Is',
80
- // headerFilterOperatorNot: 'Is not',
78
+ headerFilterOperatorIs: 'Megegyezik',
79
+ headerFilterOperatorNot: 'Nem egyezik meg',
81
80
  headerFilterOperatorAfter: 'Ezutáni:',
82
81
  headerFilterOperatorOnOrAfter: 'Ekkori vagy ezutáni:',
83
82
  headerFilterOperatorBefore: 'Ezelőtti:',
@@ -2,6 +2,7 @@
2
2
  export * from "./arSD.js";
3
3
  export * from "./beBY.js";
4
4
  export * from "./bgBG.js";
5
+ export * from "./bnBD.js";
5
6
  export * from "./csCZ.js";
6
7
  export * from "./daDK.js";
7
8
  export * from "./deDE.js";
@@ -49,8 +49,7 @@ const ruRUGrid = {
49
49
  columnsManagementNoColumns: 'Нет столбцов',
50
50
  columnsManagementShowHideAllText: 'Показать/Скрыть Всё',
51
51
  columnsManagementReset: 'Сбросить',
52
- // columnsManagementDeleteIconLabel: 'Clear',
53
-
52
+ columnsManagementDeleteIconLabel: 'Очистить',
54
53
  // Filter panel text
55
54
  filterPanelAddFilter: 'Добавить фильтр',
56
55
  filterPanelRemoveAll: 'Очистить фильтр',
@@ -64,9 +63,9 @@ const ruRUGrid = {
64
63
  filterPanelInputPlaceholder: 'Значение фильтра',
65
64
  // Filter operators text
66
65
  filterOperatorContains: 'содержит',
67
- // filterOperatorDoesNotContain: 'does not contain',
66
+ filterOperatorDoesNotContain: 'не содержит',
68
67
  filterOperatorEquals: 'равен',
69
- // filterOperatorDoesNotEqual: 'does not equal',
68
+ filterOperatorDoesNotEqual: 'не равен',
70
69
  filterOperatorStartsWith: 'начинается с',
71
70
  filterOperatorEndsWith: 'заканчивается на',
72
71
  filterOperatorIs: 'равен',
@@ -86,9 +85,9 @@ const ruRUGrid = {
86
85
  'filterOperator<=': '<=',
87
86
  // Header filter operators text
88
87
  headerFilterOperatorContains: 'содержит',
89
- // headerFilterOperatorDoesNotContain: 'Does not contain',
88
+ headerFilterOperatorDoesNotContain: 'не содержит',
90
89
  headerFilterOperatorEquals: 'равен',
91
- // headerFilterOperatorDoesNotEqual: 'Does not equal',
90
+ headerFilterOperatorDoesNotEqual: 'не равен',
92
91
  headerFilterOperatorStartsWith: 'начинается с',
93
92
  headerFilterOperatorEndsWith: 'заканчивается на',
94
93
  headerFilterOperatorIs: 'равен',