@mui/x-data-grid 7.27.0 → 7.27.1

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 (65) hide show
  1. package/CHANGELOG.md +53 -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/dimensions/useGridDimensions.js +8 -9
  15. package/hooks/features/pagination/useGridPaginationModel.js +1 -1
  16. package/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  17. package/hooks/features/rows/useGridRows.js +2 -10
  18. package/hooks/features/sorting/gridSortingUtils.js +2 -1
  19. package/index.js +1 -1
  20. package/internals/index.d.ts +1 -0
  21. package/internals/index.js +1 -0
  22. package/locales/bnBD.d.ts +2 -0
  23. package/locales/bnBD.js +154 -0
  24. package/locales/index.d.ts +1 -0
  25. package/locales/index.js +1 -0
  26. package/models/api/gridRowApi.d.ts +0 -1
  27. package/models/gridStateCommunity.d.ts +8 -0
  28. package/models/props/DataGridProps.d.ts +2 -0
  29. package/modern/DataGrid/DataGrid.js +2 -0
  30. package/modern/DataGrid/useDataGridComponent.js +2 -0
  31. package/modern/colDef/gridCheckboxSelectionColDef.js +2 -1
  32. package/modern/colDef/gridDateColDef.js +3 -2
  33. package/modern/colDef/gridSingleSelectColDef.js +2 -2
  34. package/modern/hooks/core/gridPropsSelectors.js +14 -0
  35. package/modern/hooks/core/index.js +1 -1
  36. package/modern/hooks/core/useGridInitialization.js +2 -0
  37. package/modern/hooks/core/useGridProps.js +18 -0
  38. package/modern/hooks/features/dimensions/useGridDimensions.js +8 -9
  39. package/modern/hooks/features/pagination/useGridPaginationModel.js +1 -1
  40. package/modern/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  41. package/modern/hooks/features/rows/useGridRows.js +2 -10
  42. package/modern/hooks/features/sorting/gridSortingUtils.js +2 -1
  43. package/modern/index.js +1 -1
  44. package/modern/internals/index.js +1 -0
  45. package/modern/locales/bnBD.js +154 -0
  46. package/modern/locales/index.js +1 -0
  47. package/node/DataGrid/DataGrid.js +2 -0
  48. package/node/DataGrid/useDataGridComponent.js +2 -0
  49. package/node/colDef/gridCheckboxSelectionColDef.js +2 -1
  50. package/node/colDef/gridDateColDef.js +3 -2
  51. package/node/colDef/gridSingleSelectColDef.js +2 -2
  52. package/node/hooks/core/gridPropsSelectors.js +20 -0
  53. package/node/hooks/core/index.js +8 -1
  54. package/node/hooks/core/useGridInitialization.js +2 -0
  55. package/node/hooks/core/useGridProps.js +28 -0
  56. package/node/hooks/features/dimensions/useGridDimensions.js +8 -9
  57. package/node/hooks/features/pagination/useGridPaginationModel.js +1 -1
  58. package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
  59. package/node/hooks/features/rows/useGridRows.js +2 -10
  60. package/node/hooks/features/sorting/gridSortingUtils.js +2 -1
  61. package/node/index.js +1 -1
  62. package/node/internals/index.js +8 -0
  63. package/node/locales/bnBD.js +160 -0
  64. package/node/locales/index.js +11 -0
  65. package/package.json +1 -1
@@ -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
+ };
@@ -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.1
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);
@@ -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";
@@ -289,6 +289,8 @@ DataGridRaw.propTypes = {
289
289
  getRowHeight: _propTypes.default.func,
290
290
  /**
291
291
  * Return the id of a given [[GridRowModel]].
292
+ * Ensure the reference of this prop is stable to avoid performance implications.
293
+ * It could be done by either defining the prop outside of the component or by memoizing it.
292
294
  */
293
295
  getRowId: _propTypes.default.func,
294
296
  /**
@@ -35,6 +35,7 @@ var _virtualization = require("../hooks/features/virtualization");
35
35
  var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
36
36
  var _useGridRowSpanning = require("../hooks/features/rows/useGridRowSpanning");
37
37
  var _useGridListView = require("../hooks/features/listView/useGridListView");
38
+ var _useGridProps = require("../hooks/core/useGridProps");
38
39
  const useDataGridComponent = (inputApiRef, props) => {
39
40
  const apiRef = (0, _useGridInitialization.useGridInitialization)(inputApiRef, props);
40
41
 
@@ -47,6 +48,7 @@ const useDataGridComponent = (inputApiRef, props) => {
47
48
  /**
48
49
  * Register all state initializers here.
49
50
  */
51
+ (0, _useGridInitializeState.useGridInitializeState)(_useGridProps.propsStateInitializer, apiRef, props);
50
52
  (0, _useGridInitializeState.useGridInitializeState)(_useGridRowSelection.rowSelectionStateInitializer, apiRef, props);
51
53
  (0, _useGridInitializeState.useGridInitializeState)(_useGridColumns.columnsStateInitializer, apiRef, props);
52
54
  (0, _useGridInitializeState.useGridInitializeState)(_useGridRows.rowsStateInitializer, apiRef, props);
@@ -12,6 +12,7 @@ var _GridCellCheckboxRenderer = require("../components/columnSelection/GridCellC
12
12
  var _GridHeaderCheckbox = require("../components/columnSelection/GridHeaderCheckbox");
13
13
  var _gridRowSelectionSelector = require("../hooks/features/rowSelection/gridRowSelectionSelector");
14
14
  var _gridBooleanColDef = require("./gridBooleanColDef");
15
+ var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
15
16
  var _jsxRuntime = require("react/jsx-runtime");
16
17
  const GRID_CHECKBOX_SELECTION_FIELD = exports.GRID_CHECKBOX_SELECTION_FIELD = '__check__';
17
18
  const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanColDef.GRID_BOOLEAN_COL_DEF, {
@@ -30,7 +31,7 @@ const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF
30
31
  display: 'flex',
31
32
  valueGetter: (value, row, column, apiRef) => {
32
33
  const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(apiRef);
33
- const rowId = apiRef.current.getRowId(row);
34
+ const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef.current.state, row);
34
35
  return selectionLookup[rowId] !== undefined;
35
36
  },
36
37
  renderHeader: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeaderCheckbox.GridHeaderCheckbox, (0, _extends2.default)({}, params)),
@@ -10,6 +10,7 @@ var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
10
10
  var _gridDateOperators = require("./gridDateOperators");
11
11
  var _gridStringColDef = require("./gridStringColDef");
12
12
  var _GridEditDateCell = require("../components/cell/GridEditDateCell");
13
+ var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
13
14
  function throwIfNotDateObject({
14
15
  value,
15
16
  columnType,
@@ -24,7 +25,7 @@ const gridDateFormatter = (value, row, column, apiRef) => {
24
25
  if (!value) {
25
26
  return '';
26
27
  }
27
- const rowId = apiRef.current.getRowId(row);
28
+ const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef.current.state, row);
28
29
  throwIfNotDateObject({
29
30
  value,
30
31
  columnType: 'date',
@@ -38,7 +39,7 @@ const gridDateTimeFormatter = (value, row, column, apiRef) => {
38
39
  if (!value) {
39
40
  return '';
40
41
  }
41
- const rowId = apiRef.current.getRowId(row);
42
+ const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef.current.state, row);
42
43
  throwIfNotDateObject({
43
44
  value,
44
45
  columnType: 'dateTime',
@@ -11,6 +11,7 @@ var _GridEditSingleSelectCell = require("../components/cell/GridEditSingleSelect
11
11
  var _gridSingleSelectOperators = require("./gridSingleSelectOperators");
12
12
  var _filterPanelUtils = require("../components/panel/filterPanel/filterPanelUtils");
13
13
  var _utils = require("../utils/utils");
14
+ var _gridPropsSelectors = require("../hooks/core/gridPropsSelectors");
14
15
  const isArrayOfObjects = options => {
15
16
  return typeof options[0] === 'object';
16
17
  };
@@ -25,8 +26,7 @@ const GRID_SINGLE_SELECT_COL_DEF = exports.GRID_SINGLE_SELECT_COL_DEF = (0, _ext
25
26
  getOptionLabel: defaultGetOptionLabel,
26
27
  getOptionValue: defaultGetOptionValue,
27
28
  valueFormatter(value, row, colDef, apiRef) {
28
- // const { id, field, value, api } = params;
29
- const rowId = apiRef.current.getRowId(row);
29
+ const rowId = (0, _gridPropsSelectors.gridRowIdSelector)(apiRef.current.state, row);
30
30
  if (!(0, _filterPanelUtils.isSingleSelectColDef)(colDef)) {
31
31
  return '';
32
32
  }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.gridRowIdSelector = void 0;
7
+ var _gridRowsUtils = require("../features/rows/gridRowsUtils");
8
+ /**
9
+ * Get the row id for a given row
10
+ * @param state - The grid state
11
+ * @param {GridRowModel} row - The row to get the id for
12
+ * @returns {GridRowId} The row id
13
+ */
14
+ const gridRowIdSelector = (state, row) => {
15
+ if (_gridRowsUtils.GRID_ID_AUTOGENERATED in row) {
16
+ return row[_gridRowsUtils.GRID_ID_AUTOGENERATED];
17
+ }
18
+ return state.props.getRowId ? state.props.getRowId(row) : row.id;
19
+ };
20
+ exports.gridRowIdSelector = gridRowIdSelector;
@@ -2,4 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
5
+ });
6
+ Object.defineProperty(exports, "gridRowIdSelector", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _gridPropsSelectors.gridRowIdSelector;
10
+ }
11
+ });
12
+ var _gridPropsSelectors = require("./gridPropsSelectors");
@@ -12,12 +12,14 @@ var _useGridLocaleText = require("./useGridLocaleText");
12
12
  var _pipeProcessing = require("./pipeProcessing");
13
13
  var _strategyProcessing = require("./strategyProcessing");
14
14
  var _useGridStateInitialization = require("./useGridStateInitialization");
15
+ var _useGridProps = require("./useGridProps");
15
16
  /**
16
17
  * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs
17
18
  */
18
19
  const useGridInitialization = (inputApiRef, props) => {
19
20
  const privateApiRef = (0, _useGridApiInitialization.useGridApiInitialization)(inputApiRef, props);
20
21
  (0, _useGridRefs.useGridRefs)(privateApiRef);
22
+ (0, _useGridProps.useGridProps)(privateApiRef, props);
21
23
  (0, _useGridIsRtl.useGridIsRtl)(privateApiRef);
22
24
  (0, _useGridLoggerFactory.useGridLoggerFactory)(privateApiRef, props);
23
25
  (0, _useGridStateInitialization.useGridStateInitialization)(privateApiRef);
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.useGridProps = exports.propsStateInitializer = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ const propsStateInitializer = (state, props) => {
12
+ return (0, _extends2.default)({}, state, {
13
+ props: {
14
+ getRowId: props.getRowId
15
+ }
16
+ });
17
+ };
18
+ exports.propsStateInitializer = propsStateInitializer;
19
+ const useGridProps = (apiRef, props) => {
20
+ React.useEffect(() => {
21
+ apiRef.current.setState(state => (0, _extends2.default)({}, state, {
22
+ props: {
23
+ getRowId: props.getRowId
24
+ }
25
+ }));
26
+ }, [apiRef, props.getRowId]);
27
+ };
28
+ exports.useGridProps = useGridProps;
@@ -135,8 +135,7 @@ function useGridDimensions(apiRef, props) {
135
135
  // All the floating point dimensions should be rounded to .1 decimal places to avoid subpixel rendering issues
136
136
  // https://github.com/mui/mui-x/issues/9550#issuecomment-1619020477
137
137
  // https://github.com/mui/mui-x/issues/15721
138
- const rootElement = apiRef.current.rootElementRef.current;
139
- const scrollbarSize = measureScrollbarSize(rootElement, props.scrollbarSize);
138
+ const scrollbarSize = measureScrollbarSize(apiRef.current.mainElementRef.current, props.scrollbarSize);
140
139
  const rowsMeta = (0, _gridRowsMetaSelector.gridRowsMetaSelector)(apiRef.current.state);
141
140
  const topContainerHeight = headersTotalHeight + rowsMeta.pinnedTopRowsTotalHeight;
142
141
  const bottomContainerHeight = rowsMeta.pinnedBottomRowsTotalHeight;
@@ -297,28 +296,28 @@ function getStaticDimensions(props, apiRef, density, pinnedColumnns) {
297
296
  };
298
297
  }
299
298
  const scrollbarSizeCache = new WeakMap();
300
- function measureScrollbarSize(rootElement, scrollbarSize) {
299
+ function measureScrollbarSize(element, scrollbarSize) {
301
300
  if (scrollbarSize !== undefined) {
302
301
  return scrollbarSize;
303
302
  }
304
- if (rootElement === null) {
303
+ if (element === null) {
305
304
  return 0;
306
305
  }
307
- const cachedSize = scrollbarSizeCache.get(rootElement);
306
+ const cachedSize = scrollbarSizeCache.get(element);
308
307
  if (cachedSize !== undefined) {
309
308
  return cachedSize;
310
309
  }
311
- const doc = (0, _utils.unstable_ownerDocument)(rootElement);
310
+ const doc = (0, _utils.unstable_ownerDocument)(element);
312
311
  const scrollDiv = doc.createElement('div');
313
312
  scrollDiv.style.width = '99px';
314
313
  scrollDiv.style.height = '99px';
315
314
  scrollDiv.style.position = 'absolute';
316
315
  scrollDiv.style.overflow = 'scroll';
317
316
  scrollDiv.className = 'scrollDiv';
318
- rootElement.appendChild(scrollDiv);
317
+ element.appendChild(scrollDiv);
319
318
  const size = scrollDiv.offsetWidth - scrollDiv.clientWidth;
320
- rootElement.removeChild(scrollDiv);
321
- scrollbarSizeCache.set(rootElement, size);
319
+ element.removeChild(scrollDiv);
320
+ scrollbarSizeCache.set(element, size);
322
321
  return size;
323
322
  }
324
323
  function areElementSizesEqual(a, b) {