@mui/x-data-grid 8.27.3 → 9.0.0-alpha.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 (68) hide show
  1. package/CHANGELOG.md +264 -52
  2. package/components/GridPagination.js +5 -4
  3. package/components/panel/filterPanel/GridFilterInputMultipleValue.js +12 -9
  4. package/components/virtualization/GridVirtualScrollbar.js +1 -52
  5. package/constants/localeTextConstants.js +3 -2
  6. package/esm/components/GridPagination.js +5 -4
  7. package/esm/components/panel/filterPanel/GridFilterInputMultipleValue.js +11 -8
  8. package/esm/components/virtualization/GridVirtualScrollbar.js +1 -52
  9. package/esm/constants/localeTextConstants.js +3 -2
  10. package/esm/hooks/features/columns/gridColumnsSelector.js +5 -14
  11. package/esm/hooks/features/pagination/gridPaginationUtils.js +1 -1
  12. package/esm/hooks/features/pagination/useGridRowCount.js +19 -3
  13. package/esm/index.js +1 -1
  14. package/esm/internals/utils/propValidation.js +1 -1
  15. package/esm/locales/beBY.js +3 -2
  16. package/esm/locales/bgBG.js +3 -2
  17. package/esm/locales/bnBD.js +3 -2
  18. package/esm/locales/csCZ.js +2 -2
  19. package/esm/locales/daDK.js +3 -2
  20. package/esm/locales/elGR.js +3 -2
  21. package/esm/locales/faIR.js +3 -2
  22. package/esm/locales/fiFI.js +3 -2
  23. package/esm/locales/huHU.js +3 -2
  24. package/esm/locales/hyAM.js +3 -2
  25. package/esm/locales/isIS.js +3 -2
  26. package/esm/locales/nlNL.js +3 -2
  27. package/esm/locales/roRO.js +3 -2
  28. package/esm/locales/ruRU.js +3 -2
  29. package/esm/locales/svSE.js +3 -2
  30. package/esm/locales/thTH.d.ts +2 -0
  31. package/esm/locales/thTH.js +297 -0
  32. package/esm/locales/trTR.js +3 -2
  33. package/esm/locales/ukUA.js +13 -12
  34. package/esm/locales/urPK.js +3 -2
  35. package/esm/locales/viVN.js +3 -2
  36. package/esm/material/index.js +1 -1
  37. package/esm/utils/utils.d.ts +2 -2
  38. package/esm/utils/utils.js +2 -2
  39. package/hooks/features/columns/gridColumnsSelector.js +5 -14
  40. package/hooks/features/pagination/gridPaginationUtils.js +1 -1
  41. package/hooks/features/pagination/useGridRowCount.js +19 -3
  42. package/index.js +1 -1
  43. package/internals/utils/propValidation.js +1 -1
  44. package/locales/beBY.js +3 -2
  45. package/locales/bgBG.js +3 -2
  46. package/locales/bnBD.js +3 -2
  47. package/locales/csCZ.js +2 -2
  48. package/locales/daDK.js +3 -2
  49. package/locales/elGR.js +3 -2
  50. package/locales/faIR.js +3 -2
  51. package/locales/fiFI.js +3 -2
  52. package/locales/huHU.js +3 -2
  53. package/locales/hyAM.js +3 -2
  54. package/locales/isIS.js +3 -2
  55. package/locales/nlNL.js +3 -2
  56. package/locales/roRO.js +3 -2
  57. package/locales/ruRU.js +3 -2
  58. package/locales/svSE.js +3 -2
  59. package/locales/thTH.d.ts +2 -0
  60. package/locales/thTH.js +303 -0
  61. package/locales/trTR.js +3 -2
  62. package/locales/ukUA.js +13 -12
  63. package/locales/urPK.js +3 -2
  64. package/locales/viVN.js +3 -2
  65. package/material/index.js +1 -1
  66. package/package.json +16 -8
  67. package/utils/utils.d.ts +2 -2
  68. package/utils/utils.js +2 -2
@@ -2,11 +2,8 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { styled } from '@mui/material/styles';
5
- import useEventCallback from '@mui/utils/useEventCallback';
6
- import useForkRef from '@mui/utils/useForkRef';
7
5
  import composeClasses from '@mui/utils/composeClasses';
8
6
  import { forwardRef } from '@mui/x-internals/forwardRef';
9
- import { useOnMount } from "../../hooks/utils/useOnMount.js";
10
7
  import { useGridPrivateApiContext } from "../../hooks/utils/useGridPrivateApiContext.js";
11
8
  import { gridDimensionsSelector, useGridSelector } from "../../hooks/index.js";
12
9
  import { useGridRootProps } from "../../hooks/utils/useGridRootProps.js";
@@ -84,64 +81,16 @@ export const ScrollbarCorner = styled(Scrollbar, {
84
81
  const GridVirtualScrollbar = forwardRef(function GridVirtualScrollbar(props, ref) {
85
82
  const apiRef = useGridPrivateApiContext();
86
83
  const rootProps = useGridRootProps();
87
- const isLocked = React.useRef(false);
88
- const lastPosition = React.useRef(0);
89
- const scrollbarRef = React.useRef(null);
90
84
  const classes = useUtilityClasses(rootProps, props.position);
91
85
  const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
92
86
  const propertyDimension = props.position === 'vertical' ? 'height' : 'width';
93
- const propertyScroll = props.position === 'vertical' ? 'scrollTop' : 'scrollLeft';
94
- const propertyScrollPosition = props.position === 'vertical' ? 'top' : 'left';
95
87
  const scrollbarInnerSize = props.position === 'horizontal' ? dimensions.minimumSize.width : dimensions.minimumSize.height - dimensions.headersTotalHeight;
96
- const onScrollerScroll = useEventCallback(() => {
97
- const scrollbar = scrollbarRef.current;
98
- const scrollPosition = props.scrollPosition.current;
99
- if (!scrollbar) {
100
- return;
101
- }
102
- if (scrollPosition[propertyScrollPosition] === lastPosition.current) {
103
- return;
104
- }
105
- lastPosition.current = scrollPosition[propertyScrollPosition];
106
- if (isLocked.current) {
107
- isLocked.current = false;
108
- return;
109
- }
110
- isLocked.current = true;
111
- scrollbar[propertyScroll] = props.scrollPosition.current[propertyScrollPosition];
112
- });
113
- const onScrollbarScroll = useEventCallback(() => {
114
- const scroller = apiRef.current.virtualScrollerRef.current;
115
- const scrollbar = scrollbarRef.current;
116
- if (!scrollbar) {
117
- return;
118
- }
119
- if (isLocked.current) {
120
- isLocked.current = false;
121
- return;
122
- }
123
- isLocked.current = true;
124
- scroller[propertyScroll] = scrollbar[propertyScroll];
125
- });
126
- useOnMount(() => {
127
- const scroller = apiRef.current.virtualScrollerRef.current;
128
- const scrollbar = scrollbarRef.current;
129
- const options = {
130
- passive: true
131
- };
132
- scroller.addEventListener('scroll', onScrollerScroll, options);
133
- scrollbar.addEventListener('scroll', onScrollbarScroll, options);
134
- return () => {
135
- scroller.removeEventListener('scroll', onScrollerScroll, options);
136
- scrollbar.removeEventListener('scroll', onScrollbarScroll, options);
137
- };
138
- });
139
88
  const Container = props.position === 'vertical' ? ScrollbarVertical : ScrollbarHorizontal;
140
89
  const scrollbarInnerStyle = React.useMemo(() => ({
141
90
  [propertyDimension]: `${scrollbarInnerSize}px`
142
91
  }), [propertyDimension, scrollbarInnerSize]);
143
92
  return /*#__PURE__*/_jsx(Container, {
144
- ref: useForkRef(ref, scrollbarRef),
93
+ ref: ref,
145
94
  className: classes.root,
146
95
  tabIndex: -1,
147
96
  "aria-hidden": "true"
@@ -165,11 +165,12 @@ export const GRID_DEFAULT_LOCALE_TEXT = {
165
165
  count,
166
166
  estimated
167
167
  }) => {
168
+ const unknownRowCount = count == null || count === -1;
168
169
  if (!estimated) {
169
- return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
170
+ return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
170
171
  }
171
172
  const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
172
- return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
173
+ return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
173
174
  },
174
175
  paginationItemAriaLabel: type => {
175
176
  if (type === 'first') {
@@ -1,6 +1,5 @@
1
1
  import { createSelector, createSelectorMemoized, createRootSelector } from "../../../utils/createSelector.js";
2
2
  import { EMPTY_PINNED_COLUMN_FIELDS } from "./gridColumnsInterfaces.js";
3
- import { gridIsRtlSelector } from "../../core/gridCoreSelector.js";
4
3
  import { gridListColumnSelector, gridListViewSelector } from "../listView/index.js";
5
4
 
6
5
  /**
@@ -65,24 +64,24 @@ export const gridPinnedColumnsSelector = createRootSelector(state => state.pinne
65
64
  * @category Pinned Columns
66
65
  * @ignore - Do not document
67
66
  */
68
- export const gridExistingPinnedColumnSelector = createSelectorMemoized(gridPinnedColumnsSelector, gridColumnFieldsSelector, gridIsRtlSelector, (model, orderedFields, isRtl) => filterMissingColumns(model, orderedFields, isRtl));
67
+ export const gridExistingPinnedColumnSelector = createSelectorMemoized(gridPinnedColumnsSelector, gridColumnFieldsSelector, (model, orderedFields) => filterMissingColumns(model, orderedFields));
69
68
 
70
69
  /**
71
70
  * Get the visible pinned columns.
72
71
  * @category Visible Columns
73
72
  */
74
- export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridIsRtlSelector, gridListViewSelector, (columnsState, model, visibleColumnFields, isRtl, listView) => {
73
+ export const gridVisiblePinnedColumnDefinitionsSelector = createSelectorMemoized(gridColumnsStateSelector, gridPinnedColumnsSelector, gridVisibleColumnFieldsSelector, gridListViewSelector, (columnsState, model, visibleColumnFields, listView) => {
75
74
  if (listView) {
76
75
  return EMPTY_PINNED_COLUMN_FIELDS;
77
76
  }
78
- const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields, isRtl);
77
+ const visiblePinnedFields = filterMissingColumns(model, visibleColumnFields);
79
78
  const visiblePinnedColumns = {
80
79
  left: visiblePinnedFields.left.map(field => columnsState.lookup[field]),
81
80
  right: visiblePinnedFields.right.map(field => columnsState.lookup[field])
82
81
  };
83
82
  return visiblePinnedColumns;
84
83
  });
85
- function filterMissingColumns(pinnedColumns, columns, invert) {
84
+ function filterMissingColumns(pinnedColumns, columns) {
86
85
  if (!Array.isArray(pinnedColumns.left) && !Array.isArray(pinnedColumns.right)) {
87
86
  return EMPTY_PINNED_COLUMN_FIELDS;
88
87
  }
@@ -96,16 +95,8 @@ function filterMissingColumns(pinnedColumns, columns, invert) {
96
95
  return newPinnedColumns.filter(field => remainingColumns.includes(field));
97
96
  };
98
97
  const leftPinnedColumns = filter(pinnedColumns.left, columns);
99
- const columnsWithoutLeftPinnedColumns = columns.filter(
100
- // Filter out from the remaining columns those columns already pinned to the left
101
- field => !leftPinnedColumns.includes(field));
98
+ const columnsWithoutLeftPinnedColumns = columns.filter(field => !leftPinnedColumns.includes(field));
102
99
  const rightPinnedColumns = filter(pinnedColumns.right, columnsWithoutLeftPinnedColumns);
103
- if (invert) {
104
- return {
105
- left: rightPinnedColumns,
106
- right: leftPinnedColumns
107
- };
108
- }
109
100
  return {
110
101
  left: leftPinnedColumns,
111
102
  right: rightPinnedColumns
@@ -5,7 +5,7 @@ export const getPageCount = (rowCount, pageSize, page) => {
5
5
  if (pageSize > 0 && rowCount > 0) {
6
6
  return Math.ceil(rowCount / pageSize);
7
7
  }
8
- if (rowCount === -1) {
8
+ if (rowCount === -1 || rowCount == null) {
9
9
  // With unknown row-count, we can assume a page after the current one
10
10
  return page + 2;
11
11
  }
@@ -11,10 +11,11 @@ import { gridPaginationRowCountSelector, gridPaginationMetaSelector, gridPaginat
11
11
  export const useGridRowCount = (apiRef, props) => {
12
12
  const logger = useGridLogger(apiRef, 'useGridRowCount');
13
13
  const previousPageSize = useLazyRef(() => gridPaginationModelSelector(apiRef).pageSize);
14
+ const onRowCountChangeProp = props.onRowCountChange;
14
15
  apiRef.current.registerControlState({
15
16
  stateId: 'paginationRowCount',
16
17
  propModel: props.rowCount,
17
- propOnChange: props.onRowCountChange,
18
+ propOnChange: onRowCountChangeProp,
18
19
  stateSelector: gridPaginationRowCountSelector,
19
20
  changeEvent: 'rowCountChange'
20
21
  });
@@ -28,12 +29,26 @@ export const useGridRowCount = (apiRef, props) => {
28
29
  return;
29
30
  }
30
31
  logger.debug("Setting 'rowCount' to", newRowCount);
32
+ if (rowCountState == null || rowCountState === -1) {
33
+ const newState = _extends({}, apiRef.current.state, {
34
+ pagination: _extends({}, apiRef.current.state.pagination, {
35
+ rowCount: newRowCount
36
+ })
37
+ });
38
+ apiRef.current.state = newState;
39
+ apiRef.current.store.update(newState);
40
+ apiRef.current.publishEvent('rowCountChange', newRowCount);
41
+ if (onRowCountChangeProp) {
42
+ onRowCountChangeProp(newRowCount);
43
+ }
44
+ return;
45
+ }
31
46
  apiRef.current.setState(state => _extends({}, state, {
32
47
  pagination: _extends({}, state.pagination, {
33
48
  rowCount: newRowCount
34
49
  })
35
50
  }));
36
- }, [apiRef, logger]);
51
+ }, [apiRef, logger, onRowCountChangeProp]);
37
52
  const paginationRowCountApi = {
38
53
  setRowCount
39
54
  };
@@ -110,7 +125,8 @@ export const useGridRowCount = (apiRef, props) => {
110
125
  }
111
126
  return undefined;
112
127
  }, (_, isLastPageOrRowCount) => {
113
- if (isLastPageOrRowCount === true && gridPaginationRowCountSelector(apiRef) !== -1) {
128
+ const rowCount = gridPaginationRowCountSelector(apiRef);
129
+ if (isLastPageOrRowCount === true && (rowCount == null || rowCount === -1)) {
114
130
  const visibleTopLevelRowCount = gridFilteredTopLevelRowCountSelector(apiRef);
115
131
  const paginationModel = gridPaginationModelSelector(apiRef);
116
132
  apiRef.current.setRowCount(paginationModel.pageSize * paginationModel.page + visibleTopLevelRowCount);
package/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid v8.27.3
2
+ * @mui/x-data-grid v9.0.0-alpha.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -1,7 +1,7 @@
1
1
  import { warnOnce } from '@mui/x-internals/warning';
2
2
  import { isNumber } from "../../utils/utils.js";
3
3
  import { GridSignature } from "../../constants/signature.js";
4
- export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.dataSource && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
4
+ export const propValidatorsDataGrid = [props => props.autoPageSize && props.autoHeight && ['MUI X: `<DataGrid autoPageSize={true} autoHeight={true} />` are not valid props.', 'You cannot use both the `autoPageSize` and `autoHeight` props at the same time because `autoHeight` scales the height of the Data Grid according to the `pageSize`.', '', 'Please remove one of these two props.'].join('\n') || undefined, props => props.paginationMode === 'client' && props.paginationMeta != null && ['MUI X: Usage of the `paginationMeta` prop with client-side pagination (`paginationMode="client"`) has no effect.', '`paginationMeta` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.signature === GridSignature.DataGrid && props.paginationMode === 'client' && isNumber(props.rowCount) && ['MUI X: Usage of the `rowCount` prop with client side pagination (`paginationMode="client"`) has no effect.', '`rowCount` is only meant to be used with `paginationMode="server"`.'].join('\n') || undefined, props => props.paginationMode === 'server' && props.rowCount == null && !props.dataSource && !props.paginationMeta && ["MUI X: The `rowCount` prop must be passed using `paginationMode='server'`", 'For more detail, see http://mui.com/components/data-grid/pagination/#index-based-pagination'].join('\n') || undefined];
5
5
  export function validateProps(props, validators) {
6
6
  validators.forEach(validator => {
7
7
  const message = validator(props);
@@ -196,11 +196,12 @@ const beBYGrid = {
196
196
  // count,
197
197
  // estimated
198
198
  // }) => {
199
+ // const unknownRowCount = count == null || count === -1;
199
200
  // if (!estimated) {
200
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
201
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
201
202
  // }
202
203
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
203
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
204
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
204
205
  // },
205
206
  paginationItemAriaLabel: type => {
206
207
  if (type === 'first') {
@@ -173,11 +173,12 @@ const bgBGGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -172,11 +172,12 @@ const bnBDGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -125,7 +125,7 @@ const csCZGrid = {
125
125
  columnMenuManageColumns: 'Spravovat sloupce',
126
126
  columnMenuFilter: 'Filtr',
127
127
  columnMenuHideColumn: 'Skrýt',
128
- columnMenuUnsort: 'Zrušit filtry',
128
+ columnMenuUnsort: 'Zrušit řazení',
129
129
  columnMenuSortAsc: 'Seřadit vzestupně',
130
130
  columnMenuSortDesc: 'Seřadit sestupně',
131
131
  // columnMenuManagePivot: 'Manage pivot',
@@ -142,7 +142,7 @@ const csCZGrid = {
142
142
  return `${count} ${pluralForm}`;
143
143
  },
144
144
  columnHeaderFiltersLabel: 'Zobrazit filtry',
145
- columnHeaderSortIconLabel: 'Filtrovat',
145
+ columnHeaderSortIconLabel: 'Řadit',
146
146
  // Rows selected footer text
147
147
  footerRowSelected: count => {
148
148
  let pluralForm = 'vybraných záznamů';
@@ -172,11 +172,12 @@ const daDKGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -173,11 +173,12 @@ const elGRGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -172,11 +172,12 @@ const faIRGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -173,11 +173,12 @@ const fiFIGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -171,11 +171,12 @@ const huHUGrid = {
171
171
  // count,
172
172
  // estimated
173
173
  // }) => {
174
+ // const unknownRowCount = count == null || count === -1;
174
175
  // if (!estimated) {
175
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
176
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
176
177
  // }
177
178
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
178
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
179
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
179
180
  // },
180
181
  paginationItemAriaLabel: type => {
181
182
  if (type === 'first') {
@@ -196,11 +196,12 @@ const hyAMGrid = {
196
196
  // count,
197
197
  // estimated
198
198
  // }) => {
199
+ // const unknownRowCount = count == null || count === -1;
199
200
  // if (!estimated) {
200
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
201
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
201
202
  // }
202
203
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
203
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
204
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
204
205
  // },
205
206
  // paginationItemAriaLabel: type => {
206
207
  // if (type === 'first') {
@@ -173,11 +173,12 @@ const isISGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -172,11 +172,12 @@ const nlNLGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -172,11 +172,12 @@ const roROGrid = {
172
172
  // count,
173
173
  // estimated
174
174
  // }) => {
175
+ // const unknownRowCount = count == null || count === -1;
175
176
  // if (!estimated) {
176
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
177
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
177
178
  // }
178
179
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
179
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
180
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
180
181
  // },
181
182
  paginationItemAriaLabel: type => {
182
183
  if (type === 'first') {
@@ -194,11 +194,12 @@ const ruRUGrid = {
194
194
  // count,
195
195
  // estimated
196
196
  // }) => {
197
+ // const unknownRowCount = count == null || count === -1;
197
198
  // if (!estimated) {
198
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
199
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
199
200
  // }
200
201
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
201
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
202
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
202
203
  // },
203
204
  paginationItemAriaLabel: type => {
204
205
  if (type === 'first') {
@@ -173,11 +173,12 @@ const svSEGrid = {
173
173
  // count,
174
174
  // estimated
175
175
  // }) => {
176
+ // const unknownRowCount = count == null || count === -1;
176
177
  // if (!estimated) {
177
- // return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
178
+ // return `${from}–${to} of ${!unknownRowCount ? count : `more than ${to}`}`;
178
179
  // }
179
180
  // const estimatedLabel = estimated && estimated > to ? `around ${estimated}` : `more than ${to}`;
180
- // return `${from}–${to} of ${count !== -1 ? count : estimatedLabel}`;
181
+ // return `${from}–${to} of ${!unknownRowCount ? count : estimatedLabel}`;
181
182
  // },
182
183
  paginationItemAriaLabel: type => {
183
184
  if (type === 'first') {
@@ -0,0 +1,2 @@
1
+ import { type Localization } from "../utils/getGridLocalization.js";
2
+ export declare const thTH: Localization;