@mui/x-data-grid-generator 5.16.0 → 5.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,83 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.17.0
7
+
8
+ _Sep 2, 2022_
9
+
10
+ 🎉 We are excited to finally introduce a stable release (v5.0.0) for the `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` packages!
11
+
12
+ If you are still using picker components from the `lab`, take a look at the [migration guide](https://mui.com/x/react-date-pickers/migration-lab/).
13
+
14
+ We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
15
+
16
+ - 🎁 Implement Lazy loading (#5214) @DanailH
17
+
18
+ Pro users now can try the experimental lazy loading feature.
19
+ In a few steps, you can load your data on demand, as the rows are displayed.
20
+
21
+ To enable this feature, add `experimentalFeatures={{ lazyLoading: true }}`.
22
+ Lazy Loading requires a few other settings.
23
+ See the [documentation](https://mui.com/x/react-data-grid/row-updates/#lazy-loading) to explore the example in detail.
24
+
25
+ - 🚀 Improve `pickers` focus management (#5820) @alexfauquette
26
+ - 🎉 Enable disabling `day` on date range picker depending on `position` (#5773) @alexfauquette
27
+ - ✨ Various improvements
28
+ - 📚 Documentation improvements
29
+ - 🐞 Bugfixes
30
+
31
+ ### `@mui/x-data-grid@v5.17.0` / `@mui/x-data-grid-pro@v5.17.0` / `@mui/x-data-grid-premium@v5.17.0`
32
+
33
+ #### Changes
34
+
35
+ - [DataGrid] Add `sort` prop to columns panel slot (#5888) @gavbrennan
36
+ - [DataGrid] Do not throw if `fieldToFocus` cannot be found (#5871) @cherniavskii
37
+ - [DataGrid] Support `getRowId` in the `replaceRows` method (#5988) @flaviendelangle
38
+ - [DataGridPro] Add class name to row with open detail panel (#5924) @m4theushw
39
+ - [DataGridPro] Fix crash when using `pinnedRows` + `getRowClassName` props and `rows=[]` (#5851) @cherniavskii
40
+ - [DataGridPro] Fix filtering with inactive filter items (#5993) @alexfauquette
41
+ - [DataGridPro] Implement Lazy loading (#5214) @DanailH
42
+ - [DataGridPro] Support pinned columns and dynamic row height (#5782) @m4theushw
43
+ - [DataGridPremium] Add state initializer for column groups (#5963) @alexfauquette
44
+ - [DataGridPremium] Update grouping when `groupingValueGetter` changes (#5919) @flaviendelangle
45
+ - [DataGridPremium] Use the aggregated value on tree data real groups (#5953) @flaviendelangle
46
+
47
+ ### `@mui/x-date-pickers@v5.0.0` / `@mui/x-date-pickers-pro@v5.0.0`
48
+
49
+ #### Changes
50
+
51
+ - [DatePicker] Improve focus management (#5820) @alexfauquette
52
+ - [DateRangePicker] Enable disabling `day` depending on `position` (#5773) @alexfauquette
53
+ - [DateTimePicker] Create a new `tabs` component slot (#5972) @LukasTy
54
+ - [pickers] Do not forward validation props to the DOM on field components (#5971) @flaviendelangle
55
+ - [pickers] Do not hardcode `date-fns` elements in field components (#5975) @flaviendelangle
56
+ - [pickers] Do not require `date-fns` in `@mui/x-date-pickers-pro` (#5941) @flaviendelangle
57
+ - [pickers] Fix mobile picker not opening on label click (#5651) @LukasTy
58
+ - [pickers] Improve DOM event management on `useField` (#5901) @flaviendelangle
59
+ - [pickers] Include `community` package `themeAugmentation` in `pro` package types (#5969) @LukasTy
60
+ - [pickers] Rename `DateRangeField` into `SingleInputDateRangeField` (#5961) @flaviendelangle
61
+ - [pickers] Support `isSameError` on field components (#5984) @flaviendelangle
62
+
63
+ ### Docs
64
+
65
+ - [docs] Add `description` and `default` to pickers slots (#5893) @alexfauquette
66
+ - [docs] Fix typo (#5945) @wettopa
67
+ - [docs] Fix typo `onYearPicker` to `onYearChange` (#5954) @alexfauquette
68
+ - [docs] Update `GridCellParams`'s `value` description (#5849) @cherniavskii
69
+ - [docs] Update `README.md` to match Introduction section of the docs (#5754) @samuelsycamore
70
+
71
+ ### Core
72
+
73
+ - [core] Fix typo (#5990) @flaviendelangle
74
+ - [core] Remove old babel resolve rule (#5939) @oliviertassinari
75
+ - [core] Remove outdated TODO (#5956) @flaviendelangle
76
+ - [core] Upgrade monorepo (#5960) @cherniavskii
77
+ - [core] Fix statics (#5986) @DanailH
78
+ - [core] Remove unused dependencies (#5937) @oliviertassinari
79
+ - [license] Remove CLI (#5757) @flaviendelangle
80
+ - [test] Fix time zone sensitive test (#5955) @LukasTy
81
+ - [test] Use `userEvent.mousePress` instead of `fireClickEvent` (#5920) @cherniavskii
82
+
6
83
  ## 5.16.0
7
84
 
8
85
  _Aug 25, 2022_
@@ -585,7 +662,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
585
662
 
586
663
  **MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
587
664
 
588
- **YearPicker**: The prop `onYearPicker` has been removed, you can use `onChange` instead since every change is a year change
665
+ **YearPicker**: The prop `onYearChange` has been removed, you can use `onChange` instead since every change is a year change
589
666
 
590
667
  **DayPicker**: The prop `isDateDisabled` has been removed, you can now use the same validation props as for the other components (`maxDate`, `minDate`, `shouldDisableDate`, `disableFuture` and `disablePast`)
591
668
 
@@ -1,24 +1,83 @@
1
- import { GridRowModel, GridFilterModel, GridSortModel, GridRowId } from '@mui/x-data-grid-pro';
1
+ import * as React from 'react';
2
+ import { GridRowModel, GridFilterModel, GridSortModel, GridRowId, GridFilterOperator, GridColDef } from '@mui/x-data-grid-pro';
2
3
  import { UseDemoDataOptions } from './useDemoData';
4
+ /**
5
+ * Simulates server data loading
6
+ */
7
+ export declare const loadServerRows: (rows: GridRowModel[], queryOptions: QueryOptions, serverOptions: ServerOptions, columnsWithDefaultColDef: GridColDef[]) => Promise<FakeServerResponse>;
8
+ interface FakeServerResponse {
9
+ returnedRows: GridRowModel[];
10
+ nextCursor?: string;
11
+ totalRowCount: number;
12
+ }
3
13
  interface PageInfo {
4
14
  totalRowCount?: number;
5
15
  nextCursor?: string;
6
16
  pageSize?: number;
7
17
  }
8
- export interface ServerOptions {
18
+ interface DefaultServerOptions {
9
19
  minDelay: number;
10
20
  maxDelay: number;
11
21
  useCursorPagination?: boolean;
12
22
  }
23
+ declare type ServerOptions = Partial<DefaultServerOptions>;
13
24
  export interface QueryOptions {
14
25
  cursor?: GridRowId;
15
26
  page?: number;
16
27
  pageSize?: number;
17
28
  filterModel?: GridFilterModel;
18
29
  sortModel?: GridSortModel;
30
+ firstRowToRender?: number;
31
+ lastRowToRender?: number;
19
32
  }
20
- export declare const createFakeServer: (dataSetOptions?: Partial<UseDemoDataOptions>, serverOptions?: Partial<ServerOptions>) => {
33
+ export declare const createFakeServer: (dataSetOptions?: Partial<UseDemoDataOptions>, serverOptions?: ServerOptions) => {
21
34
  columns: import("..").GridColDefGenerator[];
35
+ columnsWithDefaultColDef: {
36
+ generateData?: ((row: any, context: import("..").GridDataGeneratorContext) => any) | undefined;
37
+ dataGeneratorUniquenessEnabled?: boolean | undefined;
38
+ field: string;
39
+ headerName?: string | undefined;
40
+ description?: string | undefined;
41
+ width?: number | undefined;
42
+ flex?: number | undefined;
43
+ minWidth?: number | undefined;
44
+ maxWidth?: number | undefined;
45
+ hide?: boolean | undefined;
46
+ hideable?: boolean | undefined;
47
+ sortable?: boolean | undefined;
48
+ sortingOrder?: import("@mui/x-data-grid-pro").GridSortDirection[] | undefined;
49
+ resizable?: boolean | undefined;
50
+ editable?: boolean | undefined;
51
+ groupable?: boolean | undefined;
52
+ pinnable?: boolean | undefined;
53
+ sortComparator?: import("@mui/x-data-grid-pro").GridComparatorFn<any> | undefined;
54
+ type?: string | undefined;
55
+ valueOptions?: import("@mui/x-data-grid-pro").ValueOptions[] | ((params: import("@mui/x-data-grid-pro").GridValueOptionsParams<any>) => import("@mui/x-data-grid-pro").ValueOptions[]) | undefined;
56
+ align?: import("@mui/x-data-grid-pro").GridAlignment | undefined;
57
+ valueGetter?: ((params: import("@mui/x-data-grid-pro").GridValueGetterParams<any, any>) => any) | undefined;
58
+ valueSetter?: ((params: import("@mui/x-data-grid-pro").GridValueSetterParams<any, any>) => any) | undefined;
59
+ valueFormatter?: ((params: import("@mui/x-data-grid-pro").GridValueFormatterParams<any>) => any) | undefined;
60
+ valueParser?: ((value: any, params?: import("@mui/x-data-grid-pro").GridCellParams<any, any, any> | undefined) => any) | undefined;
61
+ cellClassName?: import("@mui/x-data-grid-pro").GridCellClassNamePropType | undefined;
62
+ renderCell?: ((params: import("@mui/x-data-grid-pro").GridRenderCellParams<any, any, any>) => React.ReactNode) | undefined;
63
+ renderEditCell?: ((params: import("@mui/x-data-grid-pro").GridRenderEditCellParams<any, any, any>) => React.ReactNode) | undefined;
64
+ preProcessEditCellProps?: ((params: import("@mui/x-data-grid-pro").GridPreProcessEditCellProps<any, any>) => import("@mui/x-data-grid-pro").GridEditCellProps<any> | Promise<import("@mui/x-data-grid-pro").GridEditCellProps<any>>) | undefined;
65
+ headerClassName?: import("@mui/x-data-grid-pro").GridColumnHeaderClassNamePropType | undefined;
66
+ renderHeader?: ((params: import("@mui/x-data-grid-pro").GridColumnHeaderParams<any, any, any>) => React.ReactNode) | undefined;
67
+ headerAlign?: import("@mui/x-data-grid-pro").GridAlignment | undefined;
68
+ hideSortIcons?: boolean | undefined;
69
+ disableColumnMenu?: boolean | undefined;
70
+ filterable?: boolean | undefined;
71
+ filterOperators?: GridFilterOperator<any, any, any>[] | undefined;
72
+ getApplyQuickFilterFn?: ((value: any, colDef: import("@mui/x-data-grid-pro").GridStateColDef<any, any, any>, apiRef: React.MutableRefObject<import("@mui/x-data-grid/internals").GridApiCommunity>) => ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any>) => boolean) | null) | undefined;
73
+ disableReorder?: boolean | undefined;
74
+ disableExport?: boolean | undefined;
75
+ colSpan?: number | ((params: import("@mui/x-data-grid-pro").GridCellParams<any, any, any>) => number | undefined) | undefined;
76
+ aggregable?: boolean | undefined;
77
+ availableAggregationFunctions?: string[] | undefined;
78
+ groupingValueGetter?: ((params: import("@mui/x-data-grid-premium").GridGroupingValueGetterParams<any, any>) => import("@mui/x-data-grid-pro").GridKeyValue | null | undefined) | undefined;
79
+ extendType?: import("@mui/x-data-grid-pro").GridNativeColTypes | undefined;
80
+ }[];
22
81
  initialState: {
23
82
  columns: {
24
83
  columnVisibilityModel: import("@mui/x-data-grid-pro").GridColumnVisibilityModel;
package/hooks/useQuery.js CHANGED
@@ -109,7 +109,7 @@ const getFilteredRows = (rows, filterModel, columnsWithDefaultColDef) => {
109
109
  */
110
110
 
111
111
 
112
- const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
112
+ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
113
113
  const {
114
114
  minDelay = 100,
115
115
  maxDelay = 300,
@@ -161,7 +161,6 @@ const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultCol
161
161
  }, delay); // simulate network latency
162
162
  });
163
163
  };
164
-
165
164
  const DEFAULT_DATASET_OPTIONS = {
166
165
  dataSet: 'Commodity',
167
166
  rowLength: 100,
@@ -245,6 +244,7 @@ export const createFakeServer = (dataSetOptions, serverOptions) => {
245
244
 
246
245
  return {
247
246
  columns,
247
+ columnsWithDefaultColDef,
248
248
  initialState,
249
249
  useQuery
250
250
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.16.0
1
+ /** @license MUI v5.17.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -128,7 +128,7 @@ var getFilteredRows = function getFilteredRows(rows, filterModel, columnsWithDef
128
128
  */
129
129
 
130
130
 
131
- var loadServerRows = function loadServerRows(rows, queryOptions, serverOptions, columnsWithDefaultColDef) {
131
+ export var loadServerRows = function loadServerRows(rows, queryOptions, serverOptions, columnsWithDefaultColDef) {
132
132
  var _serverOptions$minDel = serverOptions.minDelay,
133
133
  minDelay = _serverOptions$minDel === void 0 ? 100 : _serverOptions$minDel,
134
134
  _serverOptions$maxDel = serverOptions.maxDelay,
@@ -180,7 +180,6 @@ var loadServerRows = function loadServerRows(rows, queryOptions, serverOptions,
180
180
  }, delay); // simulate network latency
181
181
  });
182
182
  };
183
-
184
183
  var DEFAULT_DATASET_OPTIONS = {
185
184
  dataSet: 'Commodity',
186
185
  rowLength: 100,
@@ -303,6 +302,7 @@ export var createFakeServer = function createFakeServer(dataSetOptions, serverOp
303
302
 
304
303
  return {
305
304
  columns: columns,
305
+ columnsWithDefaultColDef: columnsWithDefaultColDef,
306
306
  initialState: initialState,
307
307
  useQuery: useQuery
308
308
  };
package/legacy/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.16.0
1
+ /** @license MUI v5.17.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -105,7 +105,7 @@ const getFilteredRows = (rows, filterModel, columnsWithDefaultColDef) => {
105
105
  */
106
106
 
107
107
 
108
- const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
108
+ export const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultColDef) => {
109
109
  const {
110
110
  minDelay = 100,
111
111
  maxDelay = 300,
@@ -157,7 +157,6 @@ const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultCol
157
157
  }, delay); // simulate network latency
158
158
  });
159
159
  };
160
-
161
160
  const DEFAULT_DATASET_OPTIONS = {
162
161
  dataSet: 'Commodity',
163
162
  rowLength: 100,
@@ -241,6 +240,7 @@ export const createFakeServer = (dataSetOptions, serverOptions) => {
241
240
 
242
241
  return {
243
242
  columns,
243
+ columnsWithDefaultColDef,
244
244
  initialState,
245
245
  useQuery
246
246
  };
package/modern/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.16.0
1
+ /** @license MUI v5.17.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.createFakeServer = void 0;
8
+ exports.loadServerRows = exports.createFakeServer = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -179,6 +179,7 @@ const loadServerRows = (rows, queryOptions, serverOptions, columnsWithDefaultCol
179
179
  });
180
180
  };
181
181
 
182
+ exports.loadServerRows = loadServerRows;
182
183
  const DEFAULT_DATASET_OPTIONS = {
183
184
  dataSet: 'Commodity',
184
185
  rowLength: 100,
@@ -261,6 +262,7 @@ const createFakeServer = (dataSetOptions, serverOptions) => {
261
262
 
262
263
  return {
263
264
  columns,
265
+ columnsWithDefaultColDef,
264
266
  initialState,
265
267
  useQuery
266
268
  };
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license MUI v5.16.0
1
+ /** @license MUI v5.17.0
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-data-grid-generator",
3
- "version": "5.16.0",
3
+ "version": "5.17.0",
4
4
  "description": "Generate fake data for demo purposes only.",
5
5
  "author": "MUI Team",
6
6
  "main": "./node/index.js",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@babel/runtime": "^7.18.9",
23
23
  "@mui/base": "^5.0.0-alpha.94",
24
- "@mui/x-data-grid-premium": "5.16.0",
24
+ "@mui/x-data-grid-premium": "5.17.0",
25
25
  "chance": "^1.1.8",
26
26
  "clsx": "^1.2.1",
27
27
  "lru-cache": "^7.14.0"