@mui/x-internals 8.0.0 → 8.3.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 +337 -5
- package/EventManager/index.d.ts +1 -1
- package/esm/EventManager/index.d.ts +1 -1
- package/esm/export/index.d.ts +1 -0
- package/esm/export/index.js +1 -0
- package/esm/export/loadStyleSheets.d.ts +7 -0
- package/esm/export/loadStyleSheets.js +42 -0
- package/esm/hash/index.d.ts +2 -1
- package/esm/hash/index.js +2 -1
- package/esm/hash/stringify.d.ts +6 -0
- package/esm/hash/stringify.js +17 -0
- package/esm/useAssertModelConsistency/index.d.ts +1 -0
- package/esm/useAssertModelConsistency/index.js +1 -0
- package/esm/useAssertModelConsistency/useAssertModelConsistency.d.ts +32 -0
- package/esm/useAssertModelConsistency/useAssertModelConsistency.js +36 -0
- package/export/index.d.ts +1 -0
- package/export/index.js +12 -0
- package/export/loadStyleSheets.d.ts +7 -0
- package/export/loadStyleSheets.js +48 -0
- package/hash/index.d.ts +2 -1
- package/hash/index.js +11 -0
- package/hash/stringify.d.ts +6 -0
- package/hash/stringify.js +23 -0
- package/package.json +3 -3
- package/useAssertModelConsistency/index.d.ts +1 -0
- package/useAssertModelConsistency/index.js +12 -0
- package/useAssertModelConsistency/useAssertModelConsistency.d.ts +32 -0
- package/useAssertModelConsistency/useAssertModelConsistency.js +41 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,334 @@
|
|
|
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.3.0
|
|
9
|
+
|
|
10
|
+
_May 8, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🎨 Added new styling options and shapes for `<FunnelChart />`, including `variant`, `borderRadius`, `pyramid`, and `step-pyramid` curves.
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
|
|
18
|
+
Special thanks go out to this community member for a valuable contribution:
|
|
19
|
+
@ptuukkan.
|
|
20
|
+
Team members who have contributed to this release:
|
|
21
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @MBilalShafi, @rita-codes, @romgrk.
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.3.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix cell editing of computed columns with data source (#17684) @ptuukkan
|
|
28
|
+
- [DataGrid] Fix lazy loading crash with `isRowSelectable` prop (#17629) @MBilalShafi
|
|
29
|
+
- [DataGrid] Fix: use CSS nonce (#17726) @romgrk
|
|
30
|
+
- [DataGrid] Ignore `preProcessEditCellProps` for non-editable columns when starting a row update (#17732) @arminmeh
|
|
31
|
+
- [DataGrid] Avoid applying row selection propagation on filtered rows (#17739) @MBilalShafi
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@8.3.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@8.3.0`.
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid-premium@8.3.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
38
|
+
|
|
39
|
+
Same changes as in `@mui/x-data-grid-pro@8.3.0`.
|
|
40
|
+
|
|
41
|
+
### Date and Time Pickers
|
|
42
|
+
|
|
43
|
+
#### `@mui/x-date-pickers@8.3.0`
|
|
44
|
+
|
|
45
|
+
- [DateTimePicker] Fix focus behavior on desktop variant (#17719) @LukasTy
|
|
46
|
+
- [pickers] Avoid `DigitalClock` stealing focus from a Picker open button on close (#17686) @LukasTy
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers-pro@8.3.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
49
|
+
|
|
50
|
+
Same changes as in `@mui/x-date-pickers@8.3.0`, plus:
|
|
51
|
+
|
|
52
|
+
- [DateRangePicker] Fix to reset range position after closing mobile Picker (#17631) @LukasTy
|
|
53
|
+
|
|
54
|
+
### Charts
|
|
55
|
+
|
|
56
|
+
- The `<FunnelChart />` series now accepts a `variant='outlined'` prop for a simpler style.
|
|
57
|
+
<img width="398" alt="Screenshot 2025-05-06 at 20 36 12" src="https://github.com/user-attachments/assets/00fef14f-9026-421e-a4b6-7e081adce1e8" />
|
|
58
|
+
|
|
59
|
+
- Add a `borderRadius` property to `<FunnelChart />`. All funnels have `8px` as a default value.
|
|
60
|
+
<img width="386" alt="Screenshot 2025-05-06 at 14 00 20" src="https://github.com/user-attachments/assets/4f4cc0e7-01ce-4ed6-a0e1-a387f78def23" />
|
|
61
|
+
|
|
62
|
+
- Add a `pyramid` curve to `<FunnelChart />`, which allows creation of a pyramid-shaped funnel.
|
|
63
|
+
<img width="344" alt="Screenshot 2025-05-06 at 14 32 59" src="https://github.com/user-attachments/assets/0b2896e0-0478-4766-bb1b-258a4977a751" />
|
|
64
|
+
|
|
65
|
+
- Add a `step-pyramid` curve to `<FunnelChart />`, which creates a stepped-pyramid like shape.
|
|
66
|
+
<img width="344" alt="Screenshot 2025-05-06 at 14 33 03" src="https://github.com/user-attachments/assets/894f0ab3-7898-40fe-b0df-560feea4085a" />
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-charts@8.3.0`
|
|
69
|
+
|
|
70
|
+
- [charts] Add charts toolbar with zoom options (#17615) @bernardobelchior
|
|
71
|
+
- [charts] Add zoom slider (#17496) @bernardobelchior
|
|
72
|
+
- [charts] Cleanup compiler warnings (#17360) @alexfauquette
|
|
73
|
+
- [charts] Fix `<PieArcLabel />` not taking `arcLabelRadius` into account (#17655) @bernardobelchior
|
|
74
|
+
- [charts] Fix spark line not having clip path (#17501) @bernardobelchior
|
|
75
|
+
- [charts] Fix type issue with ESM (#17624) @alexfauquette
|
|
76
|
+
- [charts] Improve `<MarkElement />` performance (#17546) @bernardobelchior
|
|
77
|
+
- [charts] Rename `materialSlots` internal constant (#17710) @bernardobelchior
|
|
78
|
+
- [charts] Update zoom slider design (#17682) @bernardobelchior
|
|
79
|
+
- [charts] Fix zoom being documented as available for heatmap (#17657) @bernardobelchior
|
|
80
|
+
|
|
81
|
+
#### `@mui/x-charts-pro@8.3.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
82
|
+
|
|
83
|
+
Same changes as in `@mui/x-charts@8.3.0`, plus:
|
|
84
|
+
|
|
85
|
+
- [charts-pro] Add `pyramid` curve to `<FunnelChart />` (#17665) @JCQuintas
|
|
86
|
+
- [charts-pro] Add `variant='outlined'` to `<FunnelChart />` series (#17661) @JCQuintas
|
|
87
|
+
- [charts-pro] Add a `borderRadius` property to `<FunnelChart />` (#17660) @JCQuintas
|
|
88
|
+
|
|
89
|
+
### Tree View
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-tree-view@8.3.0`
|
|
92
|
+
|
|
93
|
+
- [tree view] Bug fix - Escape does not cancel Drag n Drop (#17735) @rita-codes
|
|
94
|
+
- [tree view] Fix keyboard navigation error (#17685) @rita-codes
|
|
95
|
+
- [tree view] Continue cleaning the plugin system (#17386) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-tree-view-pro@8.3.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-tree-view@8.3.0`.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [charts] Add population pyramid demo (#17652) @bernardobelchior
|
|
104
|
+
- [charts] Fix randomised argos test (#17658) @JCQuintas
|
|
105
|
+
- [docs] Make preview messaging consistent in charts @bernardobelchior
|
|
106
|
+
|
|
107
|
+
### Core
|
|
108
|
+
|
|
109
|
+
- [code-infra] Avoid `node` types in the built packages (#17533) @LukasTy
|
|
110
|
+
- [code-infra] Add `pkg.pr.new` publishing (#17402) @Janpot
|
|
111
|
+
- [code-infra] Normalize author package in org @oliviertassinari
|
|
112
|
+
- [code-infra] Remove required checkout step (#17729) @JCQuintas
|
|
113
|
+
- [docs-infra] Normalize netlify.toml in org @oliviertassinari
|
|
114
|
+
|
|
115
|
+
## 8.2.0
|
|
116
|
+
|
|
117
|
+
_May 1, 2025_
|
|
118
|
+
|
|
119
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
120
|
+
|
|
121
|
+
- 📊 `<FunnelChart/>` now uses the `strawberrySky` sequential color palette by default.
|
|
122
|
+
<img width="481" alt="Screenshot 2025-04-29 at 13 55 21" src="https://github.com/user-attachments/assets/182085d1-a7ce-4e4d-9d8d-a4fe87f27167" />
|
|
123
|
+
- 📊 Add API to export a chart as an image: `apiRef.exportAsImage` — [Learn more](https://mui.com/x/react-charts/export/#export-as-image).
|
|
124
|
+
|
|
125
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
126
|
+
@federico-ntr, @nusr.
|
|
127
|
+
Following are all team members who have contributed to this release:
|
|
128
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @hasdfa, @Janpot, @JCQuintas, @KenanYusuf, @LukasTy, @MBilalShafi, @michelengelen, @oliviertassinari, @romgrk.
|
|
129
|
+
|
|
130
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
131
|
+
|
|
132
|
+
### Data Grid
|
|
133
|
+
|
|
134
|
+
#### `@mui/x-data-grid@8.2.0`
|
|
135
|
+
|
|
136
|
+
- [DataGrid] Fix panel alignment (#17625) @KenanYusuf
|
|
137
|
+
- [DataGrid] Fix theme `defaultProps` causing unwanted re-renders (#17490) @KenanYusuf
|
|
138
|
+
- [DataGrid] Fix circular reference error (#17591) @romgrk
|
|
139
|
+
- [DataGrid] Fix `<GridEditInputCell />` break input (#16773) @nusr
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-data-grid-pro@8.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-data-grid@8.2.0`, plus:
|
|
144
|
+
|
|
145
|
+
- [DataGridPro] Use intersection observer to trigger server-side infinite loading (#17369) @arminmeh
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-data-grid-premium@8.2.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
148
|
+
|
|
149
|
+
Same changes as in `@mui/x-data-grid-pro@8.2.0`.
|
|
150
|
+
|
|
151
|
+
### Date and Time Pickers
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-date-pickers@8.2.0`
|
|
154
|
+
|
|
155
|
+
- [l10n] Improve Italian (it-IT) locale (#17600) @federico-ntr
|
|
156
|
+
- [pickers] Refactor owner state typing (#17517) @LukasTy
|
|
157
|
+
|
|
158
|
+
#### `@mui/x-date-pickers-pro@8.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
159
|
+
|
|
160
|
+
Same changes as in `@mui/x-date-pickers@8.2.0`.
|
|
161
|
+
|
|
162
|
+
### Charts
|
|
163
|
+
|
|
164
|
+
#### `@mui/x-charts@8.2.0`
|
|
165
|
+
|
|
166
|
+
- [charts] Add library name to errors (#17547) @bernardobelchior
|
|
167
|
+
- [charts] Add monochrome palettes (#17610) @JCQuintas
|
|
168
|
+
- [charts] Add screenshot of the tooltip (#17395) @alexfauquette
|
|
169
|
+
- [charts] Default bar chart x-axis scale type to band (#17519) @bernardobelchior
|
|
170
|
+
- [charts] Document axis ID uniqueness constraints (#17630) @bernardobelchior
|
|
171
|
+
- [charts] Refactor axis types (#17632) @bernardobelchior
|
|
172
|
+
- [charts] Use `<circle />` for circular legend mark (#17590) @alexfauquette
|
|
173
|
+
|
|
174
|
+
#### `@mui/x-charts-pro@8.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
175
|
+
|
|
176
|
+
Same changes as in `@mui/x-charts@8.2.0`, plus:
|
|
177
|
+
|
|
178
|
+
- [charts-pro] Add `gap` option to `<FunnelChart />` (#17642) @JCQuintas
|
|
179
|
+
- [charts-pro] Export charts as image (#17353) @bernardobelchior
|
|
180
|
+
- [charts-pro] Simplify zoom testing (#17525) @JCQuintas
|
|
181
|
+
- [charts-pro] Use new sequential color palette in `<FunnelChart />` (#17606) @JCQuintas
|
|
182
|
+
|
|
183
|
+
### Tree View
|
|
184
|
+
|
|
185
|
+
#### `@mui/x-tree-view@8.2.0`
|
|
186
|
+
|
|
187
|
+
Internal changes.
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-tree-view-pro@8.2.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
190
|
+
|
|
191
|
+
Same changes as in `@mui/x-tree-view@8.2.0`.
|
|
192
|
+
|
|
193
|
+
### Docs
|
|
194
|
+
|
|
195
|
+
- [docs][charts] Add composition sections (#17377) @alexfauquette
|
|
196
|
+
- [docs][charts] Add docs on tooltip style (#17601) @bernardobelchior
|
|
197
|
+
- [docs][charts] Fix highlighting heading structure (#17581) @oliviertassinari
|
|
198
|
+
- [docs][charts] Improve export docs (#17538) @oliviertassinari
|
|
199
|
+
- [docs][charts] Similar introduction on most charts pages (#17374) @alexfauquette
|
|
200
|
+
- [docs][DataGrid] Clear component docs (#17540) @oliviertassinari
|
|
201
|
+
- [docs] Explicitly state that `groupingColDef` reference needs to be stable (#17544) @arminmeh
|
|
202
|
+
- [docs] Fix <kbd> a11y (#17536) @oliviertassinari
|
|
203
|
+
- [docs] Fix CodeSandbox spelling @oliviertassinari
|
|
204
|
+
- [docs] Fix coding style function @oliviertassinari
|
|
205
|
+
- [docs] Fix migration guide format (#17450) @oliviertassinari
|
|
206
|
+
- [docs] Improve data grid export docs (#17551) @MBilalShafi
|
|
207
|
+
- [docs] Remove leftover `@next` usages (#17542) @LukasTy
|
|
208
|
+
|
|
209
|
+
### Core
|
|
210
|
+
|
|
211
|
+
- [core] Add security label to dependabot PRs @oliviertassinari
|
|
212
|
+
- [core] Allow post-install vale @oliviertassinari
|
|
213
|
+
- [core] Component consistency @oliviertassinari
|
|
214
|
+
- [core] Fix all Vale errors @oliviertassinari
|
|
215
|
+
- [core] Move `loadStyleSheets` to internals and use it in data grid and charts (#17548) @bernardobelchior
|
|
216
|
+
- [core] Remove empty version (#17582) @oliviertassinari
|
|
217
|
+
- [core] Remove eslint from codemod spec files (#17443) @alexfauquette
|
|
218
|
+
- [core] Remove unnecessary versions (#17597) @oliviertassinari
|
|
219
|
+
- [code-infra] Allow postinstall scripts for packages requesting it (#17635) @LukasTy
|
|
220
|
+
- [code-infra] Data Grid `vitest` changes (#17619) @JCQuintas
|
|
221
|
+
- [code-infra] Fix date-time sensitive tests (#17644) @JCQuintas
|
|
222
|
+
- [code-infra] Fix extension handling for type imports (#17636) @Janpot
|
|
223
|
+
- [code-infra] Further remove `clock=fake` and add `async act` for datagrid (#17563) @JCQuintas
|
|
224
|
+
- [code-infra] Latest vitest picker changes (#17577) @JCQuintas
|
|
225
|
+
- [docs-infra] Fix Vale no longer working (#17602) @alexfauquette
|
|
226
|
+
- [docs-infra] Uniformize Vale between repositories @oliviertassinari
|
|
227
|
+
- [infra] Updates to `branch switch comments` (#17589) @michelengelen
|
|
228
|
+
- [x-telemetry] Fix issue with get machineid hash (#17614) @hasdfa
|
|
229
|
+
|
|
230
|
+
## 8.1.0
|
|
231
|
+
|
|
232
|
+
_Apr 24, 2025_
|
|
233
|
+
|
|
234
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
235
|
+
|
|
236
|
+
- 📊 Add API to print a chart or export it as PDF: `apiRef.exportAsPrint()`.
|
|
237
|
+
- 📚 Documentation improvements
|
|
238
|
+
- 🐞 Bugfixes
|
|
239
|
+
|
|
240
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
241
|
+
@lhilgert9, @ArturAghakaryan, @sai6855.
|
|
242
|
+
Following are all team members who have contributed to this release:
|
|
243
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @JCQuintas, @joserodolfofreitas, @KenanYusuf, @LukasTy, @mapache-salvaje, @oliviertassinari, @romgrk.
|
|
244
|
+
|
|
245
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
246
|
+
|
|
247
|
+
### Data Grid
|
|
248
|
+
|
|
249
|
+
#### `@mui/x-data-grid@8.1.0`
|
|
250
|
+
|
|
251
|
+
- [DataGrid] Allow row deselection with multiple rows selected (#17473) @arminmeh
|
|
252
|
+
- [DataGrid] Fix column title truncation on touch devices (#17375) @KenanYusuf
|
|
253
|
+
- [DataGrid] Remove internal usage of `material` prop (#17513) @KenanYusuf
|
|
254
|
+
- [DataGrid] Fix apiRef not being passed on onCellClick params (#17335) @sai6855
|
|
255
|
+
- [DataGrid] Add Armenian (hy-AM) locale (#17527) @ArturAghakaryan
|
|
256
|
+
|
|
257
|
+
#### `@mui/x-data-grid-pro@8.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
258
|
+
|
|
259
|
+
Same changes as in `@mui/x-data-grid@8.1.0`, plus:
|
|
260
|
+
|
|
261
|
+
- [DataGridPro] Fix locales.ts export (#17433) @lhilgert9
|
|
262
|
+
- [DataGridPro] Avoid proptypes warnings with header filters in React 17 (#17482) @cherniavskii
|
|
263
|
+
- [DataGridPro] Fix expandable rows detail content height updates (#17394) @arminmeh
|
|
264
|
+
|
|
265
|
+
#### `@mui/x-data-grid-premium@8.1.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
266
|
+
|
|
267
|
+
Same changes as in `@mui/x-data-grid-pro@8.1.0`.
|
|
268
|
+
|
|
269
|
+
### Date and Time Pickers
|
|
270
|
+
|
|
271
|
+
#### `@mui/x-date-pickers@8.1.0`
|
|
272
|
+
|
|
273
|
+
- [pickers] Improve `PickersInputBase` owner state typing (#17478) @LukasTy
|
|
274
|
+
|
|
275
|
+
#### `@mui/x-date-pickers-pro@8.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
276
|
+
|
|
277
|
+
Same changes as in `@mui/x-date-pickers@8.1.0`.
|
|
278
|
+
|
|
279
|
+
### Charts
|
|
280
|
+
|
|
281
|
+
- Add API to print a chart or export it as PDF: `apiRef.exportAsPrint()`.
|
|
282
|
+
|
|
283
|
+
#### `@mui/x-charts@8.1.0`
|
|
284
|
+
|
|
285
|
+
- [charts] Add a localization provider (#17325) @alexfauquette
|
|
286
|
+
- [charts] Add codemod for replacing legend's hidden slot prop (#17392) @bernardobelchior
|
|
287
|
+
- [charts] Fix chart visual tests flakiness (#17469) @bernardobelchior
|
|
288
|
+
- [charts] Fix tooltip position (#17440) @alexfauquette
|
|
289
|
+
- [charts] Improve axis tooltip performances (#17398) @alexfauquette
|
|
290
|
+
- [charts] Move radar from under development to preview (#17418) @alexfauquette
|
|
291
|
+
- [charts] Advance time in charts regression tests (#17420) @bernardobelchior
|
|
292
|
+
- [charts] Fix charts visuals flakiness (#17472) @bernardobelchior
|
|
293
|
+
- [charts] Move `rafThrottle` on event handlers instead of setter (#17489) @bernardobelchior
|
|
294
|
+
|
|
295
|
+
#### `@mui/x-charts-pro@8.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
296
|
+
|
|
297
|
+
Same changes as in `@mui/x-charts@8.1.0`, plus:
|
|
298
|
+
|
|
299
|
+
- [charts-pro] Add export as PDF/print functionality (#17285) @bernardobelchior
|
|
300
|
+
- [charts-pro] Fix axis zoom being disabled when not specified in `initialZoom` (#17500) @bernardobelchior
|
|
301
|
+
|
|
302
|
+
### Tree View
|
|
303
|
+
|
|
304
|
+
#### `@mui/x-tree-view@8.1.0`
|
|
305
|
+
|
|
306
|
+
Internal changes.
|
|
307
|
+
|
|
308
|
+
#### `@mui/x-tree-view-pro@8.1.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
309
|
+
|
|
310
|
+
Same changes as in `@mui/x-tree-view@8.1.0`.
|
|
311
|
+
|
|
312
|
+
### Docs
|
|
313
|
+
|
|
314
|
+
- [docs] Fix AI Assistant Panel Trigger demo (#17426) @KenanYusuf
|
|
315
|
+
- [docs] Fix DataGrid's master-detail demo for one expanded detail panel at a time (#17471) @arminmeh
|
|
316
|
+
- [docs] Improve StackOverflow links (#17483) @oliviertassinari
|
|
317
|
+
- [docs] Refine charts demos (#17417) @alexfauquette
|
|
318
|
+
- [docs] Remove ad on paid docs pages (#17373) @oliviertassinari
|
|
319
|
+
- [docs] Serve migration guides in raw markdown format (#17210) @cherniavskii
|
|
320
|
+
- [docs] Fix heading structure (#17495) @oliviertassinari
|
|
321
|
+
- [docs] Revise the Row Grouping doc (#16217) @mapache-salvaje
|
|
322
|
+
- [docs] Fix ellipsis in the demo (#17476) @oliviertassinari
|
|
323
|
+
- [docs] Add docs information for Legend HTML (#17502) @alexfauquette
|
|
324
|
+
- [docs] Refine charts demos (#17417) @alexfauquette
|
|
325
|
+
- [tree view][docs] Copyedit the Tree View Overview page (#17498) @mapache-salvaje
|
|
326
|
+
|
|
327
|
+
### Core
|
|
328
|
+
|
|
329
|
+
- [core] Bump `@types/node` (#17444) @LukasTy
|
|
330
|
+
- [core] Remove `react-is` dependency (#17470) @LukasTy
|
|
331
|
+
- [core] Remove redundant `overridesResolver` in `styled` components (#17466) @romgrk
|
|
332
|
+
- [core] Update support table (#17425) @joserodolfofreitas
|
|
333
|
+
- [code-infra] Ditch `@babel/node` (#17446) @LukasTy
|
|
334
|
+
- [code-infra] Further remove `clock=fake` from pickers (#17253) @JCQuintas
|
|
335
|
+
|
|
8
336
|
## 8.0.0
|
|
9
337
|
|
|
10
338
|
_Apr 17, 2025_
|
|
@@ -1715,7 +2043,7 @@ Same changes as in `@mui/x-tree-view@8.0.0-alpha.8`.
|
|
|
1715
2043
|
- [docs] Add example for custom legend (#16169) @alexfauquette
|
|
1716
2044
|
- [docs] Add full custom field creation example (#15194) @flaviendelangle
|
|
1717
2045
|
- [docs] Copyedit the Data Grid cell selection page (#16099) @samuelsycamore
|
|
1718
|
-
- [docs] Fix demo rendering issue on
|
|
2046
|
+
- [docs] Fix demo rendering issue on CodeSandbox (#16118) @arminmeh
|
|
1719
2047
|
- [docs] Remove broken links (#16167) @alexfauquette
|
|
1720
2048
|
- [docs] Split the Data Grid editing page (#14931) @MBilalShafi
|
|
1721
2049
|
- [docs] Fix wrong props warnings (#16119) @JCQuintas
|
|
@@ -2162,7 +2490,7 @@ Releasing to benefit from license package fix (#15814).
|
|
|
2162
2490
|
|
|
2163
2491
|
- [code-infra] Add Charts sandbox generation (#15830) @JCQuintas
|
|
2164
2492
|
- [code-infra] Remove redundant `@type/react-test-renderer` dep (#15766) @LukasTy
|
|
2165
|
-
- [license] Use `console.log` for the error message on
|
|
2493
|
+
- [license] Use `console.log` for the error message on CodeSandbox to avoid rendering error (#15814) @arminmeh
|
|
2166
2494
|
|
|
2167
2495
|
## 8.0.0-alpha.3
|
|
2168
2496
|
|
|
@@ -2378,6 +2706,8 @@ Same changes as in `@mui/x-tree-view@v8.0.0-alpha.2`.
|
|
|
2378
2706
|
|
|
2379
2707
|
### Docs
|
|
2380
2708
|
|
|
2709
|
+
<!-- vale MUI.CorrectRererenceCased = NO -->
|
|
2710
|
+
|
|
2381
2711
|
- [docs] Fix 404 links (#15575) @oliviertassinari
|
|
2382
2712
|
- [docs] Fix bash comments (#15571) @oliviertassinari
|
|
2383
2713
|
- [docs] Fix Pickers theme augmentation example (#15672) @LukasTy
|
|
@@ -2387,6 +2717,8 @@ Same changes as in `@mui/x-tree-view@v8.0.0-alpha.2`.
|
|
|
2387
2717
|
- [docs] Fix `anchorEl` API page for charts (#15625) @oliviertassinari
|
|
2388
2718
|
- [docs] Add documentation for the list view feature (#15344) @KenanYusuf
|
|
2389
2719
|
|
|
2720
|
+
<!-- vale MUI.CorrectRererenceCased = YES -->
|
|
2721
|
+
|
|
2390
2722
|
### Core
|
|
2391
2723
|
|
|
2392
2724
|
- [core] Follow `()` function convention for docs @oliviertassinari
|
|
@@ -3295,7 +3627,7 @@ Same changes as in `@mui/x-tree-view@7.24.0`.
|
|
|
3295
3627
|
### Docs
|
|
3296
3628
|
|
|
3297
3629
|
- [docs] Copyedit the Data Grid cell selection page (#16213) @samuelsycamore
|
|
3298
|
-
- [docs] Fix demo rendering issue on
|
|
3630
|
+
- [docs] Fix demo rendering issue on CodeSandbox (#16129) @arminmeh
|
|
3299
3631
|
|
|
3300
3632
|
### Core
|
|
3301
3633
|
|
|
@@ -3573,7 +3905,7 @@ Releasing to benefit from license package fix (#15818).
|
|
|
3573
3905
|
### Core
|
|
3574
3906
|
|
|
3575
3907
|
- [core] Add `@mui/x-tree-view-pro` to `releaseChangelog` (#15747) @flaviendelangle
|
|
3576
|
-
- [license] Use `console.log` for the error message on
|
|
3908
|
+
- [license] Use `console.log` for the error message on CodeSandbox to avoid rendering error (#15818) @arminmeh
|
|
3577
3909
|
|
|
3578
3910
|
## 7.23.1
|
|
3579
3911
|
|
|
@@ -6914,7 +7246,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.4`.
|
|
|
6914
7246
|
/>
|
|
6915
7247
|
```
|
|
6916
7248
|
|
|
6917
|
-
- The headless field hooks (
|
|
7249
|
+
- The headless field hooks (for example `useDateField()`) now returns a new prop called `enableAccessibleFieldDOMStructure`.
|
|
6918
7250
|
This property is utilized to determine whether the anticipated UI is constructed using an accessible DOM structure.
|
|
6919
7251
|
Learn more about this new accessible DOM structure in the [v8 migration guide](https://v7.mui.com/x/migration/migration-pickers-v7/#new-dom-structure-for-the-field).
|
|
6920
7252
|
|
package/EventManager/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { EventManager } from "./EventManager.js";
|
|
2
|
-
export type { EventListenerOptions } from
|
|
2
|
+
export type { EventListenerOptions } from "./EventManager.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { EventManager } from "./EventManager.js";
|
|
2
|
-
export type { EventListenerOptions } from
|
|
2
|
+
export type { EventListenerOptions } from "./EventManager.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadStyleSheets } from "./loadStyleSheets.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadStyleSheets } from "./loadStyleSheets.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads all stylesheets from the given root element into the document.
|
|
3
|
+
* @returns an array of promises that resolve when each stylesheet is loaded
|
|
4
|
+
* @param document Document to load stylesheets into
|
|
5
|
+
* @param root Document or ShadowRoot to load stylesheets from
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot): Promise<void>[];
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads all stylesheets from the given root element into the document.
|
|
3
|
+
* @returns an array of promises that resolve when each stylesheet is loaded
|
|
4
|
+
* @param document Document to load stylesheets into
|
|
5
|
+
* @param root Document or ShadowRoot to load stylesheets from
|
|
6
|
+
*/
|
|
7
|
+
export function loadStyleSheets(document, root) {
|
|
8
|
+
const stylesheetLoadPromises = [];
|
|
9
|
+
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
|
|
10
|
+
for (let i = 0; i < headStyleElements.length; i += 1) {
|
|
11
|
+
const node = headStyleElements[i];
|
|
12
|
+
if (node.tagName === 'STYLE') {
|
|
13
|
+
const newHeadStyleElements = document.createElement(node.tagName);
|
|
14
|
+
const sheet = node.sheet;
|
|
15
|
+
if (sheet) {
|
|
16
|
+
let styleCSS = '';
|
|
17
|
+
for (let j = 0; j < sheet.cssRules.length; j += 1) {
|
|
18
|
+
if (typeof sheet.cssRules[j].cssText === 'string') {
|
|
19
|
+
styleCSS += `${sheet.cssRules[j].cssText}\r\n`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
newHeadStyleElements.appendChild(document.createTextNode(styleCSS));
|
|
23
|
+
document.head.appendChild(newHeadStyleElements);
|
|
24
|
+
}
|
|
25
|
+
} else if (node.getAttribute('href')) {
|
|
26
|
+
// If `href` tag is empty, avoid loading these links
|
|
27
|
+
|
|
28
|
+
const newHeadStyleElements = document.createElement(node.tagName);
|
|
29
|
+
for (let j = 0; j < node.attributes.length; j += 1) {
|
|
30
|
+
const attr = node.attributes[j];
|
|
31
|
+
if (attr) {
|
|
32
|
+
newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
stylesheetLoadPromises.push(new Promise(resolve => {
|
|
36
|
+
newHeadStyleElements.addEventListener('load', () => resolve());
|
|
37
|
+
}));
|
|
38
|
+
document.head.appendChild(newHeadStyleElements);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return stylesheetLoadPromises;
|
|
42
|
+
}
|
package/esm/hash/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./hash.js";
|
|
1
|
+
export * from "./hash.js";
|
|
2
|
+
export * from "./stringify.js";
|
package/esm/hash/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./hash.js";
|
|
1
|
+
export * from "./hash.js";
|
|
2
|
+
export * from "./stringify.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A JSON.stringify that handles circular references safely.
|
|
3
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
4
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
5
|
+
*/
|
|
6
|
+
export declare function stringify(input: object | string | number | null): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A JSON.stringify that handles circular references safely.
|
|
3
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
4
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
5
|
+
*/
|
|
6
|
+
export function stringify(input) {
|
|
7
|
+
const seen = new WeakSet();
|
|
8
|
+
return JSON.stringify(input, (_, v) => {
|
|
9
|
+
if (v !== null && typeof v === 'object') {
|
|
10
|
+
if (seen.has(v)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
seen.add(v);
|
|
14
|
+
}
|
|
15
|
+
return v;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAssertModelConsistency } from "./useAssertModelConsistency.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAssertModelConsistency } from "./useAssertModelConsistency.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make sure a controlled prop is used correctly.
|
|
3
|
+
* Logs errors if the prop either:
|
|
4
|
+
*
|
|
5
|
+
* - switch between controlled and uncontrolled
|
|
6
|
+
* - modify it's default value
|
|
7
|
+
* @param parameters
|
|
8
|
+
*/
|
|
9
|
+
declare function useAssertModelConsistencyOutsideOfProduction<T>(parameters: {
|
|
10
|
+
/**
|
|
11
|
+
* The warning prefix indicating from which package the warning comes from.
|
|
12
|
+
*/
|
|
13
|
+
warningPrefix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The name of the component used in the warning message.
|
|
16
|
+
*/
|
|
17
|
+
componentName: string;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the controlled state.
|
|
20
|
+
*/
|
|
21
|
+
propName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The value of the controlled prop.
|
|
24
|
+
*/
|
|
25
|
+
controlled: T | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The default value of the controlled prop.
|
|
28
|
+
*/
|
|
29
|
+
defaultValue: T;
|
|
30
|
+
}): void;
|
|
31
|
+
export declare const useAssertModelConsistency: typeof useAssertModelConsistencyOutsideOfProduction;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { warnOnce } from "../warning/index.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Make sure a controlled prop is used correctly.
|
|
8
|
+
* Logs errors if the prop either:
|
|
9
|
+
*
|
|
10
|
+
* - switch between controlled and uncontrolled
|
|
11
|
+
* - modify it's default value
|
|
12
|
+
* @param parameters
|
|
13
|
+
*/
|
|
14
|
+
function useAssertModelConsistencyOutsideOfProduction(parameters) {
|
|
15
|
+
const {
|
|
16
|
+
componentName,
|
|
17
|
+
propName,
|
|
18
|
+
controlled,
|
|
19
|
+
defaultValue,
|
|
20
|
+
warningPrefix = 'MUI X'
|
|
21
|
+
} = parameters;
|
|
22
|
+
const [{
|
|
23
|
+
initialDefaultValue,
|
|
24
|
+
isControlled
|
|
25
|
+
}] = React.useState({
|
|
26
|
+
initialDefaultValue: defaultValue,
|
|
27
|
+
isControlled: controlled !== undefined
|
|
28
|
+
});
|
|
29
|
+
if (isControlled !== (controlled !== undefined)) {
|
|
30
|
+
warnOnce([`${warningPrefix}: A component is changing the ${isControlled ? '' : 'un'}controlled ${propName} state of ${componentName} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${propName} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'], 'error');
|
|
31
|
+
}
|
|
32
|
+
if (JSON.stringify(initialDefaultValue) !== JSON.stringify(defaultValue)) {
|
|
33
|
+
warnOnce([`${warningPrefix}: A component is changing the default ${propName} state of an uncontrolled ${componentName} after being initialized. ` + `To suppress this warning opt to use a controlled ${componentName}.`], 'error');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export const useAssertModelConsistency = process.env.NODE_ENV === 'production' ? () => {} : useAssertModelConsistencyOutsideOfProduction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadStyleSheets } from "./loadStyleSheets.js";
|
package/export/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "loadStyleSheets", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _loadStyleSheets.loadStyleSheets;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _loadStyleSheets = require("./loadStyleSheets");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads all stylesheets from the given root element into the document.
|
|
3
|
+
* @returns an array of promises that resolve when each stylesheet is loaded
|
|
4
|
+
* @param document Document to load stylesheets into
|
|
5
|
+
* @param root Document or ShadowRoot to load stylesheets from
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadStyleSheets(document: Document, root: Document | ShadowRoot): Promise<void>[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.loadStyleSheets = loadStyleSheets;
|
|
7
|
+
/**
|
|
8
|
+
* Loads all stylesheets from the given root element into the document.
|
|
9
|
+
* @returns an array of promises that resolve when each stylesheet is loaded
|
|
10
|
+
* @param document Document to load stylesheets into
|
|
11
|
+
* @param root Document or ShadowRoot to load stylesheets from
|
|
12
|
+
*/
|
|
13
|
+
function loadStyleSheets(document, root) {
|
|
14
|
+
const stylesheetLoadPromises = [];
|
|
15
|
+
const headStyleElements = root.querySelectorAll("style, link[rel='stylesheet']");
|
|
16
|
+
for (let i = 0; i < headStyleElements.length; i += 1) {
|
|
17
|
+
const node = headStyleElements[i];
|
|
18
|
+
if (node.tagName === 'STYLE') {
|
|
19
|
+
const newHeadStyleElements = document.createElement(node.tagName);
|
|
20
|
+
const sheet = node.sheet;
|
|
21
|
+
if (sheet) {
|
|
22
|
+
let styleCSS = '';
|
|
23
|
+
for (let j = 0; j < sheet.cssRules.length; j += 1) {
|
|
24
|
+
if (typeof sheet.cssRules[j].cssText === 'string') {
|
|
25
|
+
styleCSS += `${sheet.cssRules[j].cssText}\r\n`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
newHeadStyleElements.appendChild(document.createTextNode(styleCSS));
|
|
29
|
+
document.head.appendChild(newHeadStyleElements);
|
|
30
|
+
}
|
|
31
|
+
} else if (node.getAttribute('href')) {
|
|
32
|
+
// If `href` tag is empty, avoid loading these links
|
|
33
|
+
|
|
34
|
+
const newHeadStyleElements = document.createElement(node.tagName);
|
|
35
|
+
for (let j = 0; j < node.attributes.length; j += 1) {
|
|
36
|
+
const attr = node.attributes[j];
|
|
37
|
+
if (attr) {
|
|
38
|
+
newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
stylesheetLoadPromises.push(new Promise(resolve => {
|
|
42
|
+
newHeadStyleElements.addEventListener('load', () => resolve());
|
|
43
|
+
}));
|
|
44
|
+
document.head.appendChild(newHeadStyleElements);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return stylesheetLoadPromises;
|
|
48
|
+
}
|
package/hash/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from "./hash.js";
|
|
1
|
+
export * from "./hash.js";
|
|
2
|
+
export * from "./stringify.js";
|
package/hash/index.js
CHANGED
|
@@ -13,4 +13,15 @@ Object.keys(_hash).forEach(function (key) {
|
|
|
13
13
|
return _hash[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _stringify = require("./stringify");
|
|
18
|
+
Object.keys(_stringify).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _stringify[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _stringify[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A JSON.stringify that handles circular references safely.
|
|
3
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
4
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
5
|
+
*/
|
|
6
|
+
export declare function stringify(input: object | string | number | null): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.stringify = stringify;
|
|
7
|
+
/**
|
|
8
|
+
* A JSON.stringify that handles circular references safely.
|
|
9
|
+
* Fixes: https://github.com/mui/mui-x/issues/17521
|
|
10
|
+
* Source: https://www.30secondsofcode.org/js/s/stringify-circular-json/
|
|
11
|
+
*/
|
|
12
|
+
function stringify(input) {
|
|
13
|
+
const seen = new WeakSet();
|
|
14
|
+
return JSON.stringify(input, (_, v) => {
|
|
15
|
+
if (v !== null && typeof v === 'object') {
|
|
16
|
+
if (seen.has(v)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
seen.add(v);
|
|
20
|
+
}
|
|
21
|
+
return v;
|
|
22
|
+
});
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-internals",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "Utility functions for the MUI X packages (internal use only).",
|
|
3
|
+
"version": "8.3.0",
|
|
5
4
|
"author": "MUI Team",
|
|
5
|
+
"description": "Utility functions for the MUI X packages (internal use only).",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/mui/mui-x/issues"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"directory": "packages/x-internals"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@babel/runtime": "^7.27.
|
|
34
|
+
"@babel/runtime": "^7.27.1",
|
|
35
35
|
"@mui/utils": "^7.0.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAssertModelConsistency } from "./useAssertModelConsistency.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useAssertModelConsistency", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useAssertModelConsistency.useAssertModelConsistency;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useAssertModelConsistency = require("./useAssertModelConsistency");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make sure a controlled prop is used correctly.
|
|
3
|
+
* Logs errors if the prop either:
|
|
4
|
+
*
|
|
5
|
+
* - switch between controlled and uncontrolled
|
|
6
|
+
* - modify it's default value
|
|
7
|
+
* @param parameters
|
|
8
|
+
*/
|
|
9
|
+
declare function useAssertModelConsistencyOutsideOfProduction<T>(parameters: {
|
|
10
|
+
/**
|
|
11
|
+
* The warning prefix indicating from which package the warning comes from.
|
|
12
|
+
*/
|
|
13
|
+
warningPrefix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The name of the component used in the warning message.
|
|
16
|
+
*/
|
|
17
|
+
componentName: string;
|
|
18
|
+
/**
|
|
19
|
+
* The name of the controlled state.
|
|
20
|
+
*/
|
|
21
|
+
propName: string;
|
|
22
|
+
/**
|
|
23
|
+
* The value of the controlled prop.
|
|
24
|
+
*/
|
|
25
|
+
controlled: T | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The default value of the controlled prop.
|
|
28
|
+
*/
|
|
29
|
+
defaultValue: T;
|
|
30
|
+
}): void;
|
|
31
|
+
export declare const useAssertModelConsistency: typeof useAssertModelConsistencyOutsideOfProduction;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useAssertModelConsistency = void 0;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _warning = require("../warning");
|
|
11
|
+
/**
|
|
12
|
+
* Make sure a controlled prop is used correctly.
|
|
13
|
+
* Logs errors if the prop either:
|
|
14
|
+
*
|
|
15
|
+
* - switch between controlled and uncontrolled
|
|
16
|
+
* - modify it's default value
|
|
17
|
+
* @param parameters
|
|
18
|
+
*/
|
|
19
|
+
function useAssertModelConsistencyOutsideOfProduction(parameters) {
|
|
20
|
+
const {
|
|
21
|
+
componentName,
|
|
22
|
+
propName,
|
|
23
|
+
controlled,
|
|
24
|
+
defaultValue,
|
|
25
|
+
warningPrefix = 'MUI X'
|
|
26
|
+
} = parameters;
|
|
27
|
+
const [{
|
|
28
|
+
initialDefaultValue,
|
|
29
|
+
isControlled
|
|
30
|
+
}] = React.useState({
|
|
31
|
+
initialDefaultValue: defaultValue,
|
|
32
|
+
isControlled: controlled !== undefined
|
|
33
|
+
});
|
|
34
|
+
if (isControlled !== (controlled !== undefined)) {
|
|
35
|
+
(0, _warning.warnOnce)([`${warningPrefix}: A component is changing the ${isControlled ? '' : 'un'}controlled ${propName} state of ${componentName} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${propName} ` + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'], 'error');
|
|
36
|
+
}
|
|
37
|
+
if (JSON.stringify(initialDefaultValue) !== JSON.stringify(defaultValue)) {
|
|
38
|
+
(0, _warning.warnOnce)([`${warningPrefix}: A component is changing the default ${propName} state of an uncontrolled ${componentName} after being initialized. ` + `To suppress this warning opt to use a controlled ${componentName}.`], 'error');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const useAssertModelConsistency = exports.useAssertModelConsistency = process.env.NODE_ENV === 'production' ? () => {} : useAssertModelConsistencyOutsideOfProduction;
|