@mui/x-data-grid-generator 8.0.0-alpha.2 → 8.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,108 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.0.0-alpha.3
9
+
10
+ _Dec 5, 2024_
11
+
12
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
13
+
14
+ - 💫 Support [Server-side lazy loading](https://mui.com/x/react-data-grid/server-side-data/lazy-loading/) on the Data Grid. Use [data source](https://mui.com/x/react-data-grid/server-side-data/#data-source) to fetch a range of rows on demand and update the rows in the same way as described in [Infinite loading](https://mui.com/x/react-data-grid/row-updates/#infinite-loading) and [Lazy loading](https://mui.com/x/react-data-grid/row-updates/#lazy-loading) without the need to use any additional event listeners and callbacks.
15
+ - 🎯 Improved [data caching](https://mui.com/x/react-data-grid/server-side-data/#data-caching). Check out our [recommendations](https://mui.com/x/react-data-grid/server-side-data/#improving-the-cache-hit-rate) for improving the cache hit rate.
16
+
17
+ Special thanks go out to the community contributors who have helped make this release possible:
18
+ @ihsanberkozcan, @k-rajat19, @perezShaked.
19
+ Following are all team members who have contributed to this release:
20
+ @arminmeh, @cherniavskii, @flaviendelangle, @JCQuintas, @MBilalShafi, @noraleonte.
21
+
22
+ <!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
23
+
24
+ ### Data Grid
25
+
26
+ #### Breaking changes
27
+
28
+ - The "Select all" checkbox is now checked when all the selectable rows are selected, ignoring rows that are not selectable because of the `isRowSelectable` prop.
29
+ - The `rowPositionsDebounceMs` prop was removed.
30
+ - The `gridRowsDataRowIdToIdLookupSelector` selector was removed. Use the `gridRowsLookupSelector` selector in combination with the `getRowId()` API method instead.
31
+ ```diff
32
+ -const idToIdLookup = gridRowsDataRowIdToIdLookupSelector(apiRef);
33
+ -const rowId = idToIdLookup[id]
34
+ +const rowsLookup = gridRowsLookupSelector(apiRef);
35
+ +const rowId = apiRef.current.getRowId(rowsLookup[id])
36
+ ```
37
+ - The Grid is now more aligned with the WAI-ARIA authoring practices and sets the `role` attribute to `treegrid` if the Data Grid is used with row grouping feature.
38
+
39
+ #### `@mui/x-data-grid@8.0.0-alpha.3`
40
+
41
+ - [DataGrid] Fix deselection not working with `isRowSelectable` (#15692) @MBilalShafi
42
+ - [DataGrid] Make column autosizing work with flex columns (#15465) @cherniavskii
43
+ - [DataGrid] Remove `gridRowsDataRowIdToIdLookupSelector` selector (#15698) @arminmeh
44
+ - [DataGrid] Remove `rowPositionsDebounceMs` prop (#15482) @k-rajat19
45
+ - [l10n] Improve Hebrew (he-IL) locale (#15699) @perezShaked
46
+ - [l10n] Improve Turkish (tr-TR) locale (#15734) @ihsanberkozcan
47
+
48
+ #### `@mui/x-data-grid-pro@8.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
49
+
50
+ Same changes as in `@mui/x-data-grid@8.0.0-alpha.3`, plus:
51
+
52
+ - [DataGridPro] Cleanup pinned rows on removal (#15697) @cherniavskii
53
+ - [DataGridPro] Server-side lazy loading (#13878) @arminmeh
54
+
55
+ #### `@mui/x-data-grid-premium@8.0.0-alpha.3` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
56
+
57
+ Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.3`, plus:
58
+
59
+ - [DataGridPremium] Remove the `ariaV8` experimental flag (#15694) @arminmeh
60
+
61
+ ### Date and Time Pickers
62
+
63
+ #### Breaking changes
64
+
65
+ - The `onOpen()` and `onClose()` methods of the `usePickerContext()` hook have been replaced with a single `setOpen` method — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#usepickercontext).
66
+
67
+ #### `@mui/x-date-pickers@8.0.0-alpha.3`
68
+
69
+ - [pickers] Replace the `onOpen()` and `onClose()` methods of `usePickerContext()` with a single `setOpen()` method. (#15701) @flaviendelangle
70
+
71
+ #### `@mui/x-date-pickers-pro@8.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
72
+
73
+ Same changes as in `@mui/x-date-pickers@8.0.0-alpha.3`.
74
+
75
+ ### Charts
76
+
77
+ #### `@mui/x-charts@8.0.0-alpha.3`
78
+
79
+ - [charts] Improve SVG `pattern` and `gradient` support (#15720) @JCQuintas
80
+
81
+ #### `@mui/x-charts-pro@8.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
82
+
83
+ Same changes as in `@mui/x-charts@8.0.0-alpha.3`.
84
+
85
+ ### Tree View
86
+
87
+ #### `@mui/x-tree-view@8.0.0-alpha.3`
88
+
89
+ No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.2`.
90
+
91
+ #### `@mui/x-tree-view-pro@8.0.0-alpha.3` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
92
+
93
+ Same changes as in `@mui/x-tree-view@8.0.0-alpha.3`.
94
+
95
+ ### Docs
96
+
97
+ - [docs] Add a customization demo for the Date and Time Pickers overview page (#15118) @noraleonte
98
+ - [docs] Fix typo in charts axis documentation (#15743) @JCQuintas
99
+ - [docs] Improve SEO titles for the Data Grid (#15695) @MBilalShafi
100
+
101
+ ### Core
102
+
103
+ - [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15316) @flaviendelangle
104
+ - [code-infra] Lock file maintenance (#11894)
105
+ - [code-infra] Check if `preset-safe` folder exists in codemod test (#15703) @JCQuintas
106
+ - [code-infra] Import Pickers `preset-safe` into global codemod config (#15659) @JCQuintas
107
+ - [code-infra] Playwright 1.49 (#15493) @JCQuintas
108
+ - [test] Force hover in headless Chrome (#15710) @cherniavskii
109
+
8
110
  ## v8.0.0-alpha.2
9
111
 
10
112
  _Nov 29, 2024_
@@ -23,8 +23,8 @@ export interface QueryOptions {
23
23
  pageSize?: number;
24
24
  filterModel?: GridFilterModel;
25
25
  sortModel?: GridSortModel;
26
- firstRowToRender?: number;
27
- lastRowToRender?: number;
26
+ start?: number;
27
+ end?: number;
28
28
  }
29
29
  export interface ServerSideQueryOptions {
30
30
  cursor?: GridRowId;
@@ -32,8 +32,8 @@ export interface ServerSideQueryOptions {
32
32
  groupKeys?: string[];
33
33
  filterModel?: GridFilterModel;
34
34
  sortModel?: GridSortModel;
35
- firstRowToRender?: number;
36
- lastRowToRender?: number;
35
+ start?: number;
36
+ end?: number;
37
37
  groupFields?: string[];
38
38
  }
39
39
  export declare const disableDelay: any;
@@ -172,7 +172,9 @@ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDef
172
172
  const {
173
173
  cursor,
174
174
  page = 0,
175
- pageSize
175
+ pageSize,
176
+ start,
177
+ end
176
178
  } = queryOptions;
177
179
  let nextCursor;
178
180
  let firstRowIndex;
@@ -181,23 +183,26 @@ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDef
181
183
  const rowComparator = getRowComparator(queryOptions.sortModel, columnsWithDefaultColDef);
182
184
  filteredRows = [...filteredRows].sort(rowComparator);
183
185
  const totalRowCount = filteredRows.length;
184
- if (!pageSize) {
186
+ if (start !== undefined && end !== undefined) {
187
+ firstRowIndex = start;
188
+ lastRowIndex = end;
189
+ } else if (!pageSize) {
185
190
  firstRowIndex = 0;
186
- lastRowIndex = filteredRows.length;
191
+ lastRowIndex = filteredRows.length - 1;
187
192
  } else if (useCursorPagination) {
188
193
  firstRowIndex = cursor ? filteredRows.findIndex(({
189
194
  id
190
195
  }) => id === cursor) : 0;
191
196
  firstRowIndex = Math.max(firstRowIndex, 0); // if cursor not found return 0
192
- lastRowIndex = firstRowIndex + pageSize;
193
- nextCursor = lastRowIndex >= filteredRows.length ? undefined : filteredRows[lastRowIndex].id;
197
+ lastRowIndex = firstRowIndex + pageSize - 1;
198
+ nextCursor = filteredRows[lastRowIndex + 1]?.id;
194
199
  } else {
195
200
  firstRowIndex = page * pageSize;
196
- lastRowIndex = (page + 1) * pageSize;
201
+ lastRowIndex = (page + 1) * pageSize - 1;
197
202
  }
198
203
  const hasNextPage = lastRowIndex < filteredRows.length - 1;
199
204
  const response = {
200
- returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex),
205
+ returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex + 1),
201
206
  hasNextPage,
202
207
  nextCursor,
203
208
  totalRowCount
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-generator v8.0.0-alpha.2
2
+ * @mui/x-data-grid-generator v8.0.0-alpha.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -172,7 +172,9 @@ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDef
172
172
  const {
173
173
  cursor,
174
174
  page = 0,
175
- pageSize
175
+ pageSize,
176
+ start,
177
+ end
176
178
  } = queryOptions;
177
179
  let nextCursor;
178
180
  let firstRowIndex;
@@ -181,23 +183,26 @@ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDef
181
183
  const rowComparator = getRowComparator(queryOptions.sortModel, columnsWithDefaultColDef);
182
184
  filteredRows = [...filteredRows].sort(rowComparator);
183
185
  const totalRowCount = filteredRows.length;
184
- if (!pageSize) {
186
+ if (start !== undefined && end !== undefined) {
187
+ firstRowIndex = start;
188
+ lastRowIndex = end;
189
+ } else if (!pageSize) {
185
190
  firstRowIndex = 0;
186
- lastRowIndex = filteredRows.length;
191
+ lastRowIndex = filteredRows.length - 1;
187
192
  } else if (useCursorPagination) {
188
193
  firstRowIndex = cursor ? filteredRows.findIndex(({
189
194
  id
190
195
  }) => id === cursor) : 0;
191
196
  firstRowIndex = Math.max(firstRowIndex, 0); // if cursor not found return 0
192
- lastRowIndex = firstRowIndex + pageSize;
193
- nextCursor = lastRowIndex >= filteredRows.length ? undefined : filteredRows[lastRowIndex].id;
197
+ lastRowIndex = firstRowIndex + pageSize - 1;
198
+ nextCursor = filteredRows[lastRowIndex + 1]?.id;
194
199
  } else {
195
200
  firstRowIndex = page * pageSize;
196
- lastRowIndex = (page + 1) * pageSize;
201
+ lastRowIndex = (page + 1) * pageSize - 1;
197
202
  }
198
203
  const hasNextPage = lastRowIndex < filteredRows.length - 1;
199
204
  const response = {
200
- returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex),
205
+ returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex + 1),
201
206
  hasNextPage,
202
207
  nextCursor,
203
208
  totalRowCount
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-generator v8.0.0-alpha.2
2
+ * @mui/x-data-grid-generator v8.0.0-alpha.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
@@ -179,7 +179,9 @@ const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultCol
179
179
  const {
180
180
  cursor,
181
181
  page = 0,
182
- pageSize
182
+ pageSize,
183
+ start,
184
+ end
183
185
  } = queryOptions;
184
186
  let nextCursor;
185
187
  let firstRowIndex;
@@ -188,23 +190,26 @@ const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultCol
188
190
  const rowComparator = getRowComparator(queryOptions.sortModel, columnsWithDefaultColDef);
189
191
  filteredRows = [...filteredRows].sort(rowComparator);
190
192
  const totalRowCount = filteredRows.length;
191
- if (!pageSize) {
193
+ if (start !== undefined && end !== undefined) {
194
+ firstRowIndex = start;
195
+ lastRowIndex = end;
196
+ } else if (!pageSize) {
192
197
  firstRowIndex = 0;
193
- lastRowIndex = filteredRows.length;
198
+ lastRowIndex = filteredRows.length - 1;
194
199
  } else if (useCursorPagination) {
195
200
  firstRowIndex = cursor ? filteredRows.findIndex(({
196
201
  id
197
202
  }) => id === cursor) : 0;
198
203
  firstRowIndex = Math.max(firstRowIndex, 0); // if cursor not found return 0
199
- lastRowIndex = firstRowIndex + pageSize;
200
- nextCursor = lastRowIndex >= filteredRows.length ? undefined : filteredRows[lastRowIndex].id;
204
+ lastRowIndex = firstRowIndex + pageSize - 1;
205
+ nextCursor = filteredRows[lastRowIndex + 1]?.id;
201
206
  } else {
202
207
  firstRowIndex = page * pageSize;
203
- lastRowIndex = (page + 1) * pageSize;
208
+ lastRowIndex = (page + 1) * pageSize - 1;
204
209
  }
205
210
  const hasNextPage = lastRowIndex < filteredRows.length - 1;
206
211
  const response = {
207
- returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex),
212
+ returnedRows: filteredRows.slice(firstRowIndex, lastRowIndex + 1),
208
213
  hasNextPage,
209
214
  nextCursor,
210
215
  totalRowCount
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-data-grid-generator v8.0.0-alpha.2
2
+ * @mui/x-data-grid-generator v8.0.0-alpha.3
3
3
  *
4
4
  * @license MUI X Commercial
5
5
  * This source code is licensed under the commercial license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-generator",
3
- "version": "8.0.0-alpha.2",
3
+ "version": "8.0.0-alpha.3",
4
4
  "description": "Generate fake data for demo purposes only.",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -27,7 +27,7 @@
27
27
  "chance": "^1.1.12",
28
28
  "clsx": "^2.1.1",
29
29
  "lru-cache": "^11.0.2",
30
- "@mui/x-data-grid-premium": "8.0.0-alpha.2"
30
+ "@mui/x-data-grid-premium": "8.0.0-alpha.3"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@emotion/react": "^11.9.0",