@mui/x-data-grid-generator 5.15.2 → 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 +177 -2
- package/README.md +1 -1
- package/hooks/useDemoData.js +4 -5
- package/hooks/useQuery.d.ts +62 -3
- package/hooks/useQuery.js +2 -2
- package/index.js +1 -1
- package/legacy/hooks/useDemoData.js +4 -5
- package/legacy/hooks/useQuery.js +2 -2
- package/legacy/index.js +1 -1
- package/modern/hooks/useDemoData.js +4 -5
- package/modern/hooks/useQuery.js +2 -2
- package/modern/index.js +1 -1
- package/node/hooks/useDemoData.js +4 -5
- package/node/hooks/useQuery.js +3 -1
- package/node/index.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,181 @@
|
|
|
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
|
+
|
|
83
|
+
## 5.16.0
|
|
84
|
+
|
|
85
|
+
_Aug 25, 2022_
|
|
86
|
+
|
|
87
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
88
|
+
|
|
89
|
+
- 🎁 Introduce column grouping for data grid (#5133) @alexfauquette
|
|
90
|
+
|
|
91
|
+
You can now group columns using the `columnGroupingModel` prop. This lets you to display more structured data.
|
|
92
|
+
|
|
93
|
+
<img src="https://user-images.githubusercontent.com/45398769/186178366-4fba66b2-bf90-4c7a-9d83-940a7fc78704.png" width="800" />
|
|
94
|
+
|
|
95
|
+
To enable this feature, add `experimentalFeatures={{ columnGrouping: true }}`.
|
|
96
|
+
The grouping header can be fully customized.
|
|
97
|
+
See the [documentation](https://mui.com/x/react-data-grid/column-groups/) to explore everything it has to offer.
|
|
98
|
+
|
|
99
|
+
- 🐞 Bugfixes
|
|
100
|
+
- 🌏 New locales for pickers thanks to @tesseractjh and @drastus
|
|
101
|
+
|
|
102
|
+
### `@mui/x-data-grid@v5.16.0` / `@mui/x-data-grid-pro@v5.16.0` / `@mui/x-data-grid-premium@v5.16.0`
|
|
103
|
+
|
|
104
|
+
#### Changes
|
|
105
|
+
|
|
106
|
+
- [DataGrid] Implement column grouping (#5133) @alexfauquette
|
|
107
|
+
- [DataGrid] Handle `disableVirtualization` prop change (#5889) @cherniavskii
|
|
108
|
+
- [DataGrid] Improve `GridRowModel` typing (#5734) @cherniavskii
|
|
109
|
+
- [DataGrid] Update deprecation note for `GridColDef` `hide` property (#5886) @cherniavskii
|
|
110
|
+
|
|
111
|
+
### `@mui/x-date-pickers@v5.0.0-beta.7` / `@mui/x-date-pickers-pro@v5.0.0-beta.7`
|
|
112
|
+
|
|
113
|
+
#### Changes
|
|
114
|
+
|
|
115
|
+
- [DatePicker] Fix to pass down `className` prop provided on DatePicker to `renderInput` (#5471) @CruseCtrl
|
|
116
|
+
- [DatePicker] Improve `a11y` support (#5809) @LukasTy
|
|
117
|
+
- [pickers] Add `PaperContent` component slot (#5801) @LukasTy
|
|
118
|
+
- [pickers] Add a breaking change section in the migration guide (#5805) @alexfauquette
|
|
119
|
+
- [pickers] Add new translations to `localeText` (#5143) @alexfauquette
|
|
120
|
+
- [pickers] Document components slots (#4657) @flaviendelangle
|
|
121
|
+
- [pickers] Add new unstable field components (#5504) @flaviendelangle
|
|
122
|
+
- [pickers] Fallback to default `minDate` / `maxDate` when `null` value is passed (#5397) @flaviendelangle
|
|
123
|
+
- [l10n] Add Korean (ko-KR) locale (#5854) @tesseractjh
|
|
124
|
+
- [l10n] Add Polish (pl-PL) locale (#5833) @drastus
|
|
125
|
+
|
|
126
|
+
### Docs
|
|
127
|
+
|
|
128
|
+
- [docs] Fix typo in `migration from lab` (#5277) @chuckwired
|
|
129
|
+
- [docs] Use `dayjs` instead of `date-fns` in doc examples (#5481) @flaviendelangle
|
|
130
|
+
|
|
131
|
+
### Core
|
|
132
|
+
|
|
133
|
+
- [core] Clarify the scope of the license key used for tests and documentation (#5824) @oliviertassinari
|
|
134
|
+
- [core] Fix Typescript error on field hooks (#5892) @flaviendelangle
|
|
135
|
+
- [core] Memoize `columns` in `useDemoData` hook (#5848) @cherniavskii
|
|
136
|
+
- [core] Remove Firefox from the BrowserStack list (#5874) @DanailH
|
|
137
|
+
- [core] Small changes to the release script (#5840) @m4theushw
|
|
138
|
+
|
|
139
|
+
## 5.15.3
|
|
140
|
+
|
|
141
|
+
_Aug 18, 2022_
|
|
142
|
+
|
|
143
|
+
We'd like to offer a big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
|
|
144
|
+
|
|
145
|
+
- 📚 Documentation improvements
|
|
146
|
+
- 🐞 Bugfixes
|
|
147
|
+
|
|
148
|
+
### `@mui/x-data-grid@v5.15.3` / `@mui/x-data-grid-pro@v5.15.3` / `@mui/x-data-grid-premium@v5.15.3`
|
|
149
|
+
|
|
150
|
+
#### Changes
|
|
151
|
+
|
|
152
|
+
- [DataGrid] Fix <kbd>Enter</kbd> causing Select to re-open when commiting value (#5756) @m4theushw
|
|
153
|
+
- [DataGrid] Fix `GridOverlays` bypassing pointer events (#5674) @philjones88
|
|
154
|
+
|
|
155
|
+
### `@mui/x-date-pickers@v5.0.0-beta.6` / `@mui/x-date-picker-pro@v5.0.0-beta.6`
|
|
156
|
+
|
|
157
|
+
#### Changes
|
|
158
|
+
|
|
159
|
+
- [DatePicker] Support click on day outside of current month (#5768) @alexfauquette
|
|
160
|
+
- [pickers] Extend `PickersActionBarProps` with `DialogActionProps` (#5798) @LukasTy
|
|
161
|
+
|
|
162
|
+
### Docs
|
|
163
|
+
|
|
164
|
+
- [docs] Fix API anchor link scroll top (#5795) @oliviertassinari
|
|
165
|
+
- [docs] Fix contradiction in the free trial clause (#5732) @oliviertassinari
|
|
166
|
+
- [docs] Fix default value of the DataGrid `logLevel` prop to false (#5784) @HwangTaehyun
|
|
167
|
+
- [docs] Fix typo on the row height page (#5772) @flaviendelangle
|
|
168
|
+
- [docs] Improve "upgrading plans" documentation. (#5683) @joserodolfofreitas
|
|
169
|
+
- [docs] Link the license docs before pricing (#5726) @oliviertassinari
|
|
170
|
+
- [docs] Update packages README files (#5835) @cherniavskii
|
|
171
|
+
- [docs] Use `InputBase` for pickers inputs (#5597) @cherniavskii
|
|
172
|
+
|
|
173
|
+
### Core
|
|
174
|
+
|
|
175
|
+
- [core] Upgrade monorepo (#5771, #5797) @cherniavskii
|
|
176
|
+
- [core] Various TS improvements (#5556) @flaviendelangle
|
|
177
|
+
- [license] Give more context in the missing license (#5731) @oliviertassinari
|
|
178
|
+
- [license] Only log an error type once (#5730) @oliviertassinari
|
|
179
|
+
- [test] Increase timeout to take print screenshot (#5799) @m4theushw
|
|
180
|
+
|
|
6
181
|
## 5.15.2
|
|
7
182
|
|
|
8
183
|
_Aug 11, 2022_
|
|
@@ -13,7 +188,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
13
188
|
- 📚 Documentation improvements
|
|
14
189
|
- 🐞 Bugfixes
|
|
15
190
|
|
|
16
|
-
### `@mui/x-data-grid@
|
|
191
|
+
### `@mui/x-data-grid@v5.15.2` / `@mui/x-data-grid-pro@v5.15.2` / `@mui/x-data-grid-premium@v5.15.2`
|
|
17
192
|
|
|
18
193
|
#### Changes
|
|
19
194
|
|
|
@@ -487,7 +662,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
487
662
|
|
|
488
663
|
**MonthPicker**: The prop `onMonthChange` has been removed, you can use `onChange` instead since every change is a month change
|
|
489
664
|
|
|
490
|
-
**YearPicker**: The prop `
|
|
665
|
+
**YearPicker**: The prop `onYearChange` has been removed, you can use `onChange` instead since every change is a year change
|
|
491
666
|
|
|
492
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`)
|
|
493
668
|
|
package/README.md
CHANGED
package/hooks/useDemoData.js
CHANGED
|
@@ -113,7 +113,7 @@ export const useDemoData = options => {
|
|
|
113
113
|
const [rowLength, setRowLength] = React.useState(options.rowLength);
|
|
114
114
|
const [index, setIndex] = React.useState(0);
|
|
115
115
|
const [loading, setLoading] = React.useState(true);
|
|
116
|
-
const
|
|
116
|
+
const columns = React.useMemo(() => {
|
|
117
117
|
return getColumnsFromOptions({
|
|
118
118
|
dataSet: options.dataSet,
|
|
119
119
|
editable: options.editable,
|
|
@@ -122,7 +122,6 @@ export const useDemoData = options => {
|
|
|
122
122
|
});
|
|
123
123
|
}, [options.dataSet, options.editable, options.maxColumns, options.visibleFields]);
|
|
124
124
|
const [data, setData] = React.useState(() => {
|
|
125
|
-
const columns = getColumns();
|
|
126
125
|
return addTreeDataOptionsToDemoData({
|
|
127
126
|
columns,
|
|
128
127
|
rows: [],
|
|
@@ -149,10 +148,10 @@ export const useDemoData = options => {
|
|
|
149
148
|
let newData;
|
|
150
149
|
|
|
151
150
|
if (rowLength > 1000) {
|
|
152
|
-
newData = await getRealGridData(1000,
|
|
151
|
+
newData = await getRealGridData(1000, columns);
|
|
153
152
|
newData = await extrapolateSeed(rowLength, newData);
|
|
154
153
|
} else {
|
|
155
|
-
newData = await getRealGridData(rowLength,
|
|
154
|
+
newData = await getRealGridData(rowLength, columns);
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
if (!active) {
|
|
@@ -177,7 +176,7 @@ export const useDemoData = options => {
|
|
|
177
176
|
return () => {
|
|
178
177
|
active = false;
|
|
179
178
|
};
|
|
180
|
-
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index,
|
|
179
|
+
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index, columns]);
|
|
181
180
|
return {
|
|
182
181
|
data,
|
|
183
182
|
loading,
|
package/hooks/useQuery.d.ts
CHANGED
|
@@ -1,24 +1,83 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
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?:
|
|
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
|
@@ -166,7 +166,7 @@ export var useDemoData = function useDemoData(options) {
|
|
|
166
166
|
loading = _React$useState6[0],
|
|
167
167
|
setLoading = _React$useState6[1];
|
|
168
168
|
|
|
169
|
-
var
|
|
169
|
+
var columns = React.useMemo(function () {
|
|
170
170
|
return getColumnsFromOptions({
|
|
171
171
|
dataSet: options.dataSet,
|
|
172
172
|
editable: options.editable,
|
|
@@ -176,7 +176,6 @@ export var useDemoData = function useDemoData(options) {
|
|
|
176
176
|
}, [options.dataSet, options.editable, options.maxColumns, options.visibleFields]);
|
|
177
177
|
|
|
178
178
|
var _React$useState7 = React.useState(function () {
|
|
179
|
-
var columns = getColumns();
|
|
180
179
|
return addTreeDataOptionsToDemoData({
|
|
181
180
|
columns: columns,
|
|
182
181
|
rows: [],
|
|
@@ -216,7 +215,7 @@ export var useDemoData = function useDemoData(options) {
|
|
|
216
215
|
}
|
|
217
216
|
|
|
218
217
|
_context.next = 4;
|
|
219
|
-
return getRealGridData(1000,
|
|
218
|
+
return getRealGridData(1000, columns);
|
|
220
219
|
|
|
221
220
|
case 4:
|
|
222
221
|
newData = _context.sent;
|
|
@@ -230,7 +229,7 @@ export var useDemoData = function useDemoData(options) {
|
|
|
230
229
|
|
|
231
230
|
case 10:
|
|
232
231
|
_context.next = 12;
|
|
233
|
-
return getRealGridData(rowLength,
|
|
232
|
+
return getRealGridData(rowLength, columns);
|
|
234
233
|
|
|
235
234
|
case 12:
|
|
236
235
|
newData = _context.sent;
|
|
@@ -269,7 +268,7 @@ export var useDemoData = function useDemoData(options) {
|
|
|
269
268
|
return function () {
|
|
270
269
|
active = false;
|
|
271
270
|
};
|
|
272
|
-
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index,
|
|
271
|
+
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index, columns]);
|
|
273
272
|
return {
|
|
274
273
|
data: data,
|
|
275
274
|
loading: loading,
|
package/legacy/hooks/useQuery.js
CHANGED
|
@@ -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
|
@@ -105,7 +105,7 @@ export const useDemoData = options => {
|
|
|
105
105
|
const [rowLength, setRowLength] = React.useState(options.rowLength);
|
|
106
106
|
const [index, setIndex] = React.useState(0);
|
|
107
107
|
const [loading, setLoading] = React.useState(true);
|
|
108
|
-
const
|
|
108
|
+
const columns = React.useMemo(() => {
|
|
109
109
|
return getColumnsFromOptions({
|
|
110
110
|
dataSet: options.dataSet,
|
|
111
111
|
editable: options.editable,
|
|
@@ -114,7 +114,6 @@ export const useDemoData = options => {
|
|
|
114
114
|
});
|
|
115
115
|
}, [options.dataSet, options.editable, options.maxColumns, options.visibleFields]);
|
|
116
116
|
const [data, setData] = React.useState(() => {
|
|
117
|
-
const columns = getColumns();
|
|
118
117
|
return addTreeDataOptionsToDemoData({
|
|
119
118
|
columns,
|
|
120
119
|
rows: [],
|
|
@@ -139,10 +138,10 @@ export const useDemoData = options => {
|
|
|
139
138
|
let newData;
|
|
140
139
|
|
|
141
140
|
if (rowLength > 1000) {
|
|
142
|
-
newData = await getRealGridData(1000,
|
|
141
|
+
newData = await getRealGridData(1000, columns);
|
|
143
142
|
newData = await extrapolateSeed(rowLength, newData);
|
|
144
143
|
} else {
|
|
145
|
-
newData = await getRealGridData(rowLength,
|
|
144
|
+
newData = await getRealGridData(rowLength, columns);
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
if (!active) {
|
|
@@ -167,7 +166,7 @@ export const useDemoData = options => {
|
|
|
167
166
|
return () => {
|
|
168
167
|
active = false;
|
|
169
168
|
};
|
|
170
|
-
}, [rowLength, options.dataSet, options.maxColumns, options.treeData?.maxDepth, options.treeData?.groupingField, options.treeData?.averageChildren, index,
|
|
169
|
+
}, [rowLength, options.dataSet, options.maxColumns, options.treeData?.maxDepth, options.treeData?.groupingField, options.treeData?.averageChildren, index, columns]);
|
|
171
170
|
return {
|
|
172
171
|
data,
|
|
173
172
|
loading,
|
package/modern/hooks/useQuery.js
CHANGED
|
@@ -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
|
@@ -140,7 +140,7 @@ const useDemoData = options => {
|
|
|
140
140
|
const [rowLength, setRowLength] = React.useState(options.rowLength);
|
|
141
141
|
const [index, setIndex] = React.useState(0);
|
|
142
142
|
const [loading, setLoading] = React.useState(true);
|
|
143
|
-
const
|
|
143
|
+
const columns = React.useMemo(() => {
|
|
144
144
|
return getColumnsFromOptions({
|
|
145
145
|
dataSet: options.dataSet,
|
|
146
146
|
editable: options.editable,
|
|
@@ -149,7 +149,6 @@ const useDemoData = options => {
|
|
|
149
149
|
});
|
|
150
150
|
}, [options.dataSet, options.editable, options.maxColumns, options.visibleFields]);
|
|
151
151
|
const [data, setData] = React.useState(() => {
|
|
152
|
-
const columns = getColumns();
|
|
153
152
|
return (0, _treeDataGenerator.addTreeDataOptionsToDemoData)({
|
|
154
153
|
columns,
|
|
155
154
|
rows: [],
|
|
@@ -176,10 +175,10 @@ const useDemoData = options => {
|
|
|
176
175
|
let newData;
|
|
177
176
|
|
|
178
177
|
if (rowLength > 1000) {
|
|
179
|
-
newData = await (0, _realDataService.getRealGridData)(1000,
|
|
178
|
+
newData = await (0, _realDataService.getRealGridData)(1000, columns);
|
|
180
179
|
newData = await extrapolateSeed(rowLength, newData);
|
|
181
180
|
} else {
|
|
182
|
-
newData = await (0, _realDataService.getRealGridData)(rowLength,
|
|
181
|
+
newData = await (0, _realDataService.getRealGridData)(rowLength, columns);
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
if (!active) {
|
|
@@ -204,7 +203,7 @@ const useDemoData = options => {
|
|
|
204
203
|
return () => {
|
|
205
204
|
active = false;
|
|
206
205
|
};
|
|
207
|
-
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index,
|
|
206
|
+
}, [rowLength, options.dataSet, options.maxColumns, (_options$treeData5 = options.treeData) == null ? void 0 : _options$treeData5.maxDepth, (_options$treeData6 = options.treeData) == null ? void 0 : _options$treeData6.groupingField, (_options$treeData7 = options.treeData) == null ? void 0 : _options$treeData7.averageChildren, index, columns]);
|
|
208
207
|
return {
|
|
209
208
|
data,
|
|
210
209
|
loading,
|
package/node/hooks/useQuery.js
CHANGED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid-generator",
|
|
3
|
-
"version": "5.
|
|
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",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"directory": "packages/grid/x-data-grid-generator"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@babel/runtime": "^7.18.
|
|
23
|
-
"@mui/base": "^5.0.0-alpha.
|
|
24
|
-
"@mui/x-data-grid-premium": "5.
|
|
22
|
+
"@babel/runtime": "^7.18.9",
|
|
23
|
+
"@mui/base": "^5.0.0-alpha.94",
|
|
24
|
+
"@mui/x-data-grid-premium": "5.17.0",
|
|
25
25
|
"chance": "^1.1.8",
|
|
26
26
|
"clsx": "^1.2.1",
|
|
27
|
-
"lru-cache": "^7.
|
|
27
|
+
"lru-cache": "^7.14.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@mui/icons-material": "^5.4.1",
|