@mui/x-data-grid 9.0.0-beta.0 → 9.0.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 +267 -1
- package/DataGrid/DataGrid.js +1 -0
- package/DataGrid/DataGrid.mjs +1 -0
- package/components/GridColumnUnsortedIcon.d.mts +5 -2
- package/components/GridColumnUnsortedIcon.d.ts +5 -2
- package/components/GridColumnUnsortedIcon.js +20 -6
- package/components/GridColumnUnsortedIcon.mjs +20 -5
- package/components/GridDetailPanels.d.mts +1 -4
- package/components/GridDetailPanels.d.ts +1 -4
- package/components/GridPinnedRows.d.mts +0 -2
- package/components/GridPinnedRows.d.ts +0 -2
- package/components/GridRowDragAndDropOverlay.js +1 -1
- package/components/GridRowDragAndDropOverlay.mjs +2 -2
- package/components/GridScrollbarFillerCell.js +9 -1
- package/components/GridScrollbarFillerCell.mjs +9 -1
- package/components/cell/GridCell.js +4 -2
- package/components/cell/GridCell.mjs +4 -2
- package/components/columnHeaders/GridColumnGroupHeader.js +5 -3
- package/components/columnHeaders/GridColumnGroupHeader.mjs +5 -3
- package/components/columnHeaders/GridColumnHeaderItem.js +3 -1
- package/components/columnHeaders/GridColumnHeaderItem.mjs +3 -1
- package/components/containers/GridRootStyles.js +86 -5
- package/components/containers/GridRootStyles.mjs +86 -5
- package/components/index.d.mts +3 -1
- package/components/index.d.ts +3 -1
- package/components/index.js +10 -2
- package/components/index.mjs +2 -1
- package/components/panel/filterPanel/GridFilterForm.js +1 -1
- package/components/panel/filterPanel/GridFilterForm.mjs +1 -1
- package/components/virtualization/GridBottomContainer.js +4 -1
- package/components/virtualization/GridBottomContainer.mjs +4 -1
- package/components/virtualization/GridVirtualScroller.js +55 -30
- package/components/virtualization/GridVirtualScroller.mjs +56 -31
- package/components/virtualization/GridVirtualScrollerContent.js +5 -1
- package/components/virtualization/GridVirtualScrollerContent.mjs +5 -1
- package/constants/gridClasses.d.mts +40 -1
- package/constants/gridClasses.d.ts +40 -1
- package/constants/gridClasses.js +2 -2
- package/constants/gridClasses.mjs +2 -2
- package/constants/localeTextConstants.js +1 -1
- package/constants/localeTextConstants.mjs +1 -1
- package/hooks/core/useGridVirtualizer.js +1 -0
- package/hooks/core/useGridVirtualizer.mjs +1 -0
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +8 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.mjs +8 -4
- package/hooks/features/dimensions/useGridDimensions.js +1 -0
- package/hooks/features/dimensions/useGridDimensions.mjs +1 -0
- package/hooks/features/export/useGridPrintExport.js +5 -1
- package/hooks/features/export/useGridPrintExport.mjs +5 -1
- package/hooks/features/focus/useGridFocus.js +4 -0
- package/hooks/features/focus/useGridFocus.mjs +4 -0
- package/hooks/features/rowSelection/useGridRowSelection.js +17 -1
- package/hooks/features/rowSelection/useGridRowSelection.mjs +17 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.mts +8 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +8 -0
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +8 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.mjs +7 -0
- package/hooks/features/virtualization/index.d.mts +1 -1
- package/hooks/features/virtualization/index.d.ts +1 -1
- package/hooks/features/virtualization/index.js +44 -13
- package/hooks/features/virtualization/index.mjs +1 -1
- package/hooks/utils/usePinnedScrollOffset.d.mts +3 -0
- package/hooks/utils/usePinnedScrollOffset.d.ts +3 -0
- package/hooks/utils/usePinnedScrollOffset.js +27 -0
- package/hooks/utils/usePinnedScrollOffset.mjs +21 -0
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/index.d.mts +3 -2
- package/internals/index.d.ts +3 -2
- package/internals/index.js +29 -0
- package/internals/index.mjs +3 -2
- package/locales/arSD.js +1 -1
- package/locales/arSD.mjs +1 -1
- package/locales/beBY.js +1 -1
- package/locales/beBY.mjs +1 -1
- package/locales/bgBG.js +1 -1
- package/locales/bgBG.mjs +1 -1
- package/locales/bnBD.js +1 -1
- package/locales/bnBD.mjs +1 -1
- package/locales/caES.js +1 -1
- package/locales/caES.mjs +1 -1
- package/locales/csCZ.js +1 -1
- package/locales/csCZ.mjs +1 -1
- package/locales/daDK.js +1 -1
- package/locales/daDK.mjs +1 -1
- package/locales/deDE.js +1 -1
- package/locales/deDE.mjs +1 -1
- package/locales/elGR.js +1 -1
- package/locales/elGR.mjs +1 -1
- package/locales/esES.js +1 -1
- package/locales/esES.mjs +1 -1
- package/locales/faIR.js +1 -1
- package/locales/faIR.mjs +1 -1
- package/locales/fiFI.js +1 -1
- package/locales/fiFI.mjs +1 -1
- package/locales/frFR.js +1 -1
- package/locales/frFR.mjs +1 -1
- package/locales/heIL.js +1 -1
- package/locales/heIL.mjs +1 -1
- package/locales/hrHR.js +1 -1
- package/locales/hrHR.mjs +1 -1
- package/locales/huHU.js +1 -1
- package/locales/huHU.mjs +1 -1
- package/locales/hyAM.js +1 -1
- package/locales/hyAM.mjs +1 -1
- package/locales/idID.js +1 -1
- package/locales/idID.mjs +1 -1
- package/locales/isIS.js +1 -1
- package/locales/isIS.mjs +1 -1
- package/locales/itIT.js +1 -1
- package/locales/itIT.mjs +1 -1
- package/locales/jaJP.js +1 -1
- package/locales/jaJP.mjs +1 -1
- package/locales/koKR.js +1 -1
- package/locales/koKR.mjs +1 -1
- package/locales/nbNO.js +1 -1
- package/locales/nbNO.mjs +1 -1
- package/locales/nlNL.js +1 -1
- package/locales/nlNL.mjs +1 -1
- package/locales/nnNO.js +1 -1
- package/locales/nnNO.mjs +1 -1
- package/locales/plPL.js +1 -1
- package/locales/plPL.mjs +1 -1
- package/locales/ptBR.js +1 -1
- package/locales/ptBR.mjs +1 -1
- package/locales/ptPT.js +1 -1
- package/locales/ptPT.mjs +1 -1
- package/locales/roRO.js +1 -1
- package/locales/roRO.mjs +1 -1
- package/locales/ruRU.js +1 -1
- package/locales/ruRU.mjs +1 -1
- package/locales/skSK.js +1 -1
- package/locales/skSK.mjs +1 -1
- package/locales/svSE.js +1 -1
- package/locales/svSE.mjs +1 -1
- package/locales/thTH.js +1 -1
- package/locales/thTH.mjs +1 -1
- package/locales/trTR.js +1 -1
- package/locales/trTR.mjs +1 -1
- package/locales/ukUA.js +1 -1
- package/locales/ukUA.mjs +1 -1
- package/locales/urPK.js +1 -1
- package/locales/urPK.mjs +1 -1
- package/locales/viVN.js +1 -1
- package/locales/viVN.mjs +1 -1
- package/locales/zhCN.js +1 -1
- package/locales/zhCN.mjs +1 -1
- package/locales/zhHK.js +1 -1
- package/locales/zhHK.mjs +1 -1
- package/locales/zhTW.js +1 -1
- package/locales/zhTW.mjs +1 -1
- package/material/index.js +26 -21
- package/material/index.mjs +26 -21
- package/material/variables.js +4 -4
- package/material/variables.mjs +4 -5
- package/models/api/gridLocaleTextApi.d.mts +1 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -1
- package/models/gridBaseSlots.d.mts +4 -2
- package/models/gridBaseSlots.d.ts +4 -2
- package/models/props/DataGridProps.d.mts +9 -0
- package/models/props/DataGridProps.d.ts +9 -0
- package/package.json +6 -6
- package/utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking.mjs +2 -2
- package/utils/cleanupTracking/TimerBasedCleanupTracking.mjs +2 -2
- package/utils/domUtils.js +3 -2
- package/utils/domUtils.mjs +3 -2
- package/utils/keyboardUtils.d.mts +2 -0
- package/utils/keyboardUtils.d.ts +2 -0
- package/utils/keyboardUtils.js +8 -0
- package/utils/keyboardUtils.mjs +6 -0
package/locales/zhTW.mjs
CHANGED
|
@@ -59,7 +59,7 @@ const zhTWGrid = {
|
|
|
59
59
|
filterPanelOperator: '運算子',
|
|
60
60
|
filterPanelOperatorAnd: '且',
|
|
61
61
|
filterPanelOperatorOr: '或',
|
|
62
|
-
|
|
62
|
+
filterPanelColumn: '欄位',
|
|
63
63
|
filterPanelInputLabel: '值',
|
|
64
64
|
filterPanelInputPlaceholder: '篩選值',
|
|
65
65
|
// Filter operators text
|
package/material/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var _variables = require("./variables");
|
|
|
64
64
|
const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
|
|
65
65
|
_excluded2 = ["onRowsPerPageChange", "material", "disabled"],
|
|
66
66
|
_excluded3 = ["material"],
|
|
67
|
-
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material"],
|
|
67
|
+
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
|
|
68
68
|
_excluded5 = ["material"],
|
|
69
69
|
_excluded6 = ["material"],
|
|
70
70
|
_excluded7 = ["material"],
|
|
@@ -80,7 +80,7 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
|
|
|
80
80
|
_excluded15 = ["slotProps", "material"],
|
|
81
81
|
_excluded16 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
|
|
82
82
|
_excluded17 = ["key"],
|
|
83
|
-
_excluded18 = ["
|
|
83
|
+
_excluded18 = ["slotProps"],
|
|
84
84
|
_excluded19 = ["slotProps"],
|
|
85
85
|
_excluded20 = ["slotProps"],
|
|
86
86
|
_excluded21 = ["slotProps", "material"],
|
|
@@ -237,11 +237,15 @@ const BasePagination = (0, _forwardRef.forwardRef)(function BasePagination(props
|
|
|
237
237
|
return undefined;
|
|
238
238
|
}
|
|
239
239
|
return {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
slotProps: {
|
|
241
|
+
actions: {
|
|
242
|
+
previousButton: {
|
|
243
|
+
disabled: true
|
|
244
|
+
},
|
|
245
|
+
nextButton: {
|
|
246
|
+
disabled: true
|
|
247
|
+
}
|
|
248
|
+
}
|
|
245
249
|
}
|
|
246
250
|
};
|
|
247
251
|
}, [disabled]);
|
|
@@ -282,12 +286,14 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
|
|
|
282
286
|
fullWidth,
|
|
283
287
|
slotProps,
|
|
284
288
|
className,
|
|
285
|
-
material
|
|
289
|
+
material,
|
|
290
|
+
inputRef
|
|
286
291
|
} = props,
|
|
287
292
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded4);
|
|
288
293
|
const elementRef = React.useRef(null);
|
|
289
294
|
const handleRef = (0, _useForkRef.default)(elementRef, ref);
|
|
290
295
|
const rippleRef = React.useRef(null);
|
|
296
|
+
const combinedInputRef = (0, _useForkRef.default)(inputRef, slotProps?.htmlInput?.ref, material?.slotProps?.input?.ref);
|
|
291
297
|
React.useEffect(() => {
|
|
292
298
|
if (autoFocus) {
|
|
293
299
|
const input = elementRef.current?.querySelector('input');
|
|
@@ -300,12 +306,15 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
|
|
|
300
306
|
rippleRef.current.stop({});
|
|
301
307
|
}
|
|
302
308
|
}, [autoFocus]);
|
|
309
|
+
const checkboxSlotProps = React.useMemo(() => (0, _extends2.default)({}, material?.slotProps, {
|
|
310
|
+
input: (0, _extends2.default)({}, material?.slotProps?.input, slotProps?.htmlInput, {
|
|
311
|
+
ref: combinedInputRef
|
|
312
|
+
})
|
|
313
|
+
}), [material?.slotProps, slotProps?.htmlInput, combinedInputRef]);
|
|
303
314
|
if (!label) {
|
|
304
315
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Checkbox, (0, _extends2.default)({}, other, material, {
|
|
305
316
|
className: (0, _clsx.default)(className, material?.className),
|
|
306
|
-
slotProps:
|
|
307
|
-
input: slotProps?.htmlInput
|
|
308
|
-
},
|
|
317
|
+
slotProps: checkboxSlotProps,
|
|
309
318
|
ref: handleRef,
|
|
310
319
|
touchRippleRef: rippleRef
|
|
311
320
|
}));
|
|
@@ -313,9 +322,7 @@ const BaseCheckbox = (0, _forwardRef.forwardRef)(function BaseCheckbox(props, re
|
|
|
313
322
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FormControlLabel, {
|
|
314
323
|
className: className,
|
|
315
324
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(Checkbox, (0, _extends2.default)({}, other, material, {
|
|
316
|
-
slotProps:
|
|
317
|
-
input: slotProps?.htmlInput
|
|
318
|
-
},
|
|
325
|
+
slotProps: checkboxSlotProps,
|
|
319
326
|
ref: handleRef,
|
|
320
327
|
touchRippleRef: rippleRef
|
|
321
328
|
})),
|
|
@@ -542,9 +549,7 @@ function BaseAutocomplete(props) {
|
|
|
542
549
|
}),
|
|
543
550
|
renderInput: params => {
|
|
544
551
|
const {
|
|
545
|
-
|
|
546
|
-
InputProps,
|
|
547
|
-
InputLabelProps
|
|
552
|
+
slotProps: autocompleteSlotProps
|
|
548
553
|
} = params,
|
|
549
554
|
inputRest = (0, _objectWithoutPropertiesLoose2.default)(params, _excluded18);
|
|
550
555
|
const _ref = slotProps?.textField ?? {},
|
|
@@ -562,11 +567,11 @@ function BaseAutocomplete(props) {
|
|
|
562
567
|
placeholder: placeholder
|
|
563
568
|
}, textFieldRest, baseTextFieldRest, {
|
|
564
569
|
slotProps: {
|
|
565
|
-
htmlInput: (0, _extends2.default)({},
|
|
566
|
-
input: (0, _extends2.default)({}, transformInputProps(
|
|
570
|
+
htmlInput: (0, _extends2.default)({}, autocompleteSlotProps.htmlInput, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
|
|
571
|
+
input: (0, _extends2.default)({}, transformInputProps(autocompleteSlotProps.input, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
|
|
567
572
|
inputLabel: (0, _extends2.default)({
|
|
568
573
|
shrink: true
|
|
569
|
-
},
|
|
574
|
+
}, autocompleteSlotProps.inputLabel, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
|
|
570
575
|
}
|
|
571
576
|
}));
|
|
572
577
|
}
|
|
@@ -749,7 +754,7 @@ const StyledTabs = (0, _styles.styled)(_Tabs.default, {
|
|
|
749
754
|
})(({
|
|
750
755
|
theme
|
|
751
756
|
}) => ({
|
|
752
|
-
borderBottom: `1px solid ${theme.palette.divider}`
|
|
757
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
753
758
|
}));
|
|
754
759
|
const StyledTab = (0, _styles.styled)(_Tab.default, {
|
|
755
760
|
name: 'MuiDataGrid',
|
package/material/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
3
3
|
const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps", "onChange", "onKeyDown", "onOpen", "onClose", "size", "style", "fullWidth"],
|
|
4
4
|
_excluded2 = ["onRowsPerPageChange", "material", "disabled"],
|
|
5
5
|
_excluded3 = ["material"],
|
|
6
|
-
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material"],
|
|
6
|
+
_excluded4 = ["autoFocus", "label", "fullWidth", "slotProps", "className", "material", "inputRef"],
|
|
7
7
|
_excluded5 = ["material"],
|
|
8
8
|
_excluded6 = ["material"],
|
|
9
9
|
_excluded7 = ["material"],
|
|
@@ -19,7 +19,7 @@ const _excluded = ["id", "label", "labelId", "material", "disabled", "slotProps"
|
|
|
19
19
|
_excluded15 = ["slotProps", "material"],
|
|
20
20
|
_excluded16 = ["id", "multiple", "freeSolo", "options", "getOptionLabel", "isOptionEqualToValue", "value", "onChange", "label", "placeholder", "slotProps", "material"],
|
|
21
21
|
_excluded17 = ["key"],
|
|
22
|
-
_excluded18 = ["
|
|
22
|
+
_excluded18 = ["slotProps"],
|
|
23
23
|
_excluded19 = ["slotProps"],
|
|
24
24
|
_excluded20 = ["slotProps"],
|
|
25
25
|
_excluded21 = ["slotProps", "material"],
|
|
@@ -224,11 +224,15 @@ const BasePagination = forwardRef(function BasePagination(props, ref) {
|
|
|
224
224
|
return undefined;
|
|
225
225
|
}
|
|
226
226
|
return {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
slotProps: {
|
|
228
|
+
actions: {
|
|
229
|
+
previousButton: {
|
|
230
|
+
disabled: true
|
|
231
|
+
},
|
|
232
|
+
nextButton: {
|
|
233
|
+
disabled: true
|
|
234
|
+
}
|
|
235
|
+
}
|
|
232
236
|
}
|
|
233
237
|
};
|
|
234
238
|
}, [disabled]);
|
|
@@ -269,12 +273,14 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
|
|
|
269
273
|
fullWidth,
|
|
270
274
|
slotProps,
|
|
271
275
|
className,
|
|
272
|
-
material
|
|
276
|
+
material,
|
|
277
|
+
inputRef
|
|
273
278
|
} = props,
|
|
274
279
|
other = _objectWithoutPropertiesLoose(props, _excluded4);
|
|
275
280
|
const elementRef = React.useRef(null);
|
|
276
281
|
const handleRef = useForkRef(elementRef, ref);
|
|
277
282
|
const rippleRef = React.useRef(null);
|
|
283
|
+
const combinedInputRef = useForkRef(inputRef, slotProps?.htmlInput?.ref, material?.slotProps?.input?.ref);
|
|
278
284
|
React.useEffect(() => {
|
|
279
285
|
if (autoFocus) {
|
|
280
286
|
const input = elementRef.current?.querySelector('input');
|
|
@@ -287,12 +293,15 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
|
|
|
287
293
|
rippleRef.current.stop({});
|
|
288
294
|
}
|
|
289
295
|
}, [autoFocus]);
|
|
296
|
+
const checkboxSlotProps = React.useMemo(() => _extends({}, material?.slotProps, {
|
|
297
|
+
input: _extends({}, material?.slotProps?.input, slotProps?.htmlInput, {
|
|
298
|
+
ref: combinedInputRef
|
|
299
|
+
})
|
|
300
|
+
}), [material?.slotProps, slotProps?.htmlInput, combinedInputRef]);
|
|
290
301
|
if (!label) {
|
|
291
302
|
return /*#__PURE__*/_jsx(Checkbox, _extends({}, other, material, {
|
|
292
303
|
className: clsx(className, material?.className),
|
|
293
|
-
slotProps:
|
|
294
|
-
input: slotProps?.htmlInput
|
|
295
|
-
},
|
|
304
|
+
slotProps: checkboxSlotProps,
|
|
296
305
|
ref: handleRef,
|
|
297
306
|
touchRippleRef: rippleRef
|
|
298
307
|
}));
|
|
@@ -300,9 +309,7 @@ const BaseCheckbox = forwardRef(function BaseCheckbox(props, ref) {
|
|
|
300
309
|
return /*#__PURE__*/_jsx(FormControlLabel, {
|
|
301
310
|
className: className,
|
|
302
311
|
control: /*#__PURE__*/_jsx(Checkbox, _extends({}, other, material, {
|
|
303
|
-
slotProps:
|
|
304
|
-
input: slotProps?.htmlInput
|
|
305
|
-
},
|
|
312
|
+
slotProps: checkboxSlotProps,
|
|
306
313
|
ref: handleRef,
|
|
307
314
|
touchRippleRef: rippleRef
|
|
308
315
|
})),
|
|
@@ -529,9 +536,7 @@ function BaseAutocomplete(props) {
|
|
|
529
536
|
}),
|
|
530
537
|
renderInput: params => {
|
|
531
538
|
const {
|
|
532
|
-
|
|
533
|
-
InputProps,
|
|
534
|
-
InputLabelProps
|
|
539
|
+
slotProps: autocompleteSlotProps
|
|
535
540
|
} = params,
|
|
536
541
|
inputRest = _objectWithoutPropertiesLoose(params, _excluded18);
|
|
537
542
|
const _ref = slotProps?.textField ?? {},
|
|
@@ -549,11 +554,11 @@ function BaseAutocomplete(props) {
|
|
|
549
554
|
placeholder: placeholder
|
|
550
555
|
}, textFieldRest, baseTextFieldRest, {
|
|
551
556
|
slotProps: {
|
|
552
|
-
htmlInput: _extends({},
|
|
553
|
-
input: _extends({}, transformInputProps(
|
|
557
|
+
htmlInput: _extends({}, autocompleteSlotProps.htmlInput, textFieldSlotProps?.htmlInput, baseTextFieldSlotProps?.htmlInput),
|
|
558
|
+
input: _extends({}, transformInputProps(autocompleteSlotProps.input, false), textFieldSlotProps?.input, baseTextFieldSlotProps?.input),
|
|
554
559
|
inputLabel: _extends({
|
|
555
560
|
shrink: true
|
|
556
|
-
},
|
|
561
|
+
}, autocompleteSlotProps.inputLabel, textFieldSlotProps?.inputLabel, baseTextFieldSlotProps?.inputLabel)
|
|
557
562
|
}
|
|
558
563
|
}));
|
|
559
564
|
}
|
|
@@ -736,7 +741,7 @@ const StyledTabs = styled(MUITabs, {
|
|
|
736
741
|
})(({
|
|
737
742
|
theme
|
|
738
743
|
}) => ({
|
|
739
|
-
borderBottom: `1px solid ${theme.palette.divider}`
|
|
744
|
+
borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`
|
|
740
745
|
}));
|
|
741
746
|
const StyledTab = styled(MUITab, {
|
|
742
747
|
name: 'MuiDataGrid',
|
package/material/variables.js
CHANGED
|
@@ -28,9 +28,9 @@ function transformTheme(t) {
|
|
|
28
28
|
const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
|
|
29
29
|
const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
|
|
30
30
|
const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
|
|
31
|
-
const backgroundBackdrop = t.
|
|
31
|
+
const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
|
|
32
32
|
const backgroundOverlay = t.palette.mode === 'dark' ? (0, _GridRootStyles.colorMixIfSupported)(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
|
|
33
|
-
const selectedColor = t.vars
|
|
33
|
+
const selectedColor = (t.vars || t).palette.primary.main;
|
|
34
34
|
const radius = getRadius(t);
|
|
35
35
|
const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
|
|
36
36
|
const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
|
|
@@ -89,9 +89,9 @@ function getBorderColor(theme) {
|
|
|
89
89
|
return theme.vars.palette.TableCell.border;
|
|
90
90
|
}
|
|
91
91
|
if (theme.palette.mode === 'light') {
|
|
92
|
-
return
|
|
92
|
+
return theme.lighten(theme.alpha(theme.palette.divider, 1), 0.88);
|
|
93
93
|
}
|
|
94
|
-
return
|
|
94
|
+
return theme.darken(theme.alpha(theme.palette.divider, 1), 0.68);
|
|
95
95
|
}
|
|
96
96
|
function setOpacity(color, opacity) {
|
|
97
97
|
return `rgba(from ${color} r g b / ${opacity})`;
|
package/material/variables.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { alpha, darken, lighten } from '@mui/material/styles';
|
|
3
2
|
import { useTheme } from '@mui/material/styles';
|
|
4
3
|
import { hash } from '@mui/x-internals/hash';
|
|
5
4
|
import { vars } from "../constants/cssVariables.mjs";
|
|
@@ -22,9 +21,9 @@ function transformTheme(t) {
|
|
|
22
21
|
const backgroundBase = dataGridPalette?.bg ?? (t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 95%, #fff)`, paperColor) : paperColor);
|
|
23
22
|
const backgroundHeader = dataGridPalette?.headerBg ?? backgroundBase;
|
|
24
23
|
const backgroundPinned = dataGridPalette?.pinnedBg ?? backgroundBase;
|
|
25
|
-
const backgroundBackdrop = t.
|
|
24
|
+
const backgroundBackdrop = t.alpha((t.vars || t).palette.background.default, (t.vars || t).palette.action.disabledOpacity);
|
|
26
25
|
const backgroundOverlay = t.palette.mode === 'dark' ? colorMixIfSupported(`color-mix(in srgb, ${paperColor} 90%, #fff)`, paperColor) : paperColor;
|
|
27
|
-
const selectedColor = t.vars
|
|
26
|
+
const selectedColor = (t.vars || t).palette.primary.main;
|
|
28
27
|
const radius = getRadius(t);
|
|
29
28
|
const fontBody = t.vars?.font?.body2 ?? formatFont(t.typography.body2);
|
|
30
29
|
const fontSmall = t.vars?.font?.caption ?? formatFont(t.typography.caption);
|
|
@@ -83,9 +82,9 @@ function getBorderColor(theme) {
|
|
|
83
82
|
return theme.vars.palette.TableCell.border;
|
|
84
83
|
}
|
|
85
84
|
if (theme.palette.mode === 'light') {
|
|
86
|
-
return lighten(alpha(theme.palette.divider, 1), 0.88);
|
|
85
|
+
return theme.lighten(theme.alpha(theme.palette.divider, 1), 0.88);
|
|
87
86
|
}
|
|
88
|
-
return darken(alpha(theme.palette.divider, 1), 0.68);
|
|
87
|
+
return theme.darken(theme.alpha(theme.palette.divider, 1), 0.68);
|
|
89
88
|
}
|
|
90
89
|
function setOpacity(color, opacity) {
|
|
91
90
|
return `rgba(from ${color} r g b / ${opacity})`;
|
|
@@ -46,7 +46,7 @@ export interface GridLocaleText {
|
|
|
46
46
|
filterPanelOperator: React.ReactNode;
|
|
47
47
|
filterPanelOperatorAnd: React.ReactNode;
|
|
48
48
|
filterPanelOperatorOr: React.ReactNode;
|
|
49
|
-
|
|
49
|
+
filterPanelColumn: React.ReactNode;
|
|
50
50
|
filterPanelInputLabel: string;
|
|
51
51
|
filterPanelInputPlaceholder: string;
|
|
52
52
|
filterOperatorContains: string;
|
|
@@ -46,7 +46,7 @@ export interface GridLocaleText {
|
|
|
46
46
|
filterPanelOperator: React.ReactNode;
|
|
47
47
|
filterPanelOperatorAnd: React.ReactNode;
|
|
48
48
|
filterPanelOperatorOr: React.ReactNode;
|
|
49
|
-
|
|
49
|
+
filterPanelColumn: React.ReactNode;
|
|
50
50
|
filterPanelInputLabel: string;
|
|
51
51
|
filterPanelInputPlaceholder: string;
|
|
52
52
|
filterOperatorContains: string;
|
|
@@ -96,7 +96,9 @@ export type CheckboxProps = CommonProps & {
|
|
|
96
96
|
size?: 'small' | 'medium';
|
|
97
97
|
density?: 'standard' | 'compact';
|
|
98
98
|
slotProps?: {
|
|
99
|
-
htmlInput?: React.InputHTMLAttributes<HTMLInputElement
|
|
99
|
+
htmlInput?: React.InputHTMLAttributes<HTMLInputElement> & {
|
|
100
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
101
|
+
};
|
|
100
102
|
};
|
|
101
103
|
style?: React.CSSProperties;
|
|
102
104
|
tabIndex?: number;
|
|
@@ -116,7 +118,7 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
|
|
|
116
118
|
color?: 'default' | 'inherit' | 'primary';
|
|
117
119
|
edge?: 'start' | 'end' | false;
|
|
118
120
|
};
|
|
119
|
-
export type ToggleButtonProps = CommonProps & {
|
|
121
|
+
export type ToggleButtonProps = Omit<CommonProps, 'onChange'> & {
|
|
120
122
|
selected?: boolean;
|
|
121
123
|
value: string;
|
|
122
124
|
};
|
|
@@ -96,7 +96,9 @@ export type CheckboxProps = CommonProps & {
|
|
|
96
96
|
size?: 'small' | 'medium';
|
|
97
97
|
density?: 'standard' | 'compact';
|
|
98
98
|
slotProps?: {
|
|
99
|
-
htmlInput?: React.InputHTMLAttributes<HTMLInputElement
|
|
99
|
+
htmlInput?: React.InputHTMLAttributes<HTMLInputElement> & {
|
|
100
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
101
|
+
};
|
|
100
102
|
};
|
|
101
103
|
style?: React.CSSProperties;
|
|
102
104
|
tabIndex?: number;
|
|
@@ -116,7 +118,7 @@ export type IconButtonProps = Omit<ButtonProps, 'startIcon'> & {
|
|
|
116
118
|
color?: 'default' | 'inherit' | 'primary';
|
|
117
119
|
edge?: 'start' | 'end' | false;
|
|
118
120
|
};
|
|
119
|
-
export type ToggleButtonProps = CommonProps & {
|
|
121
|
+
export type ToggleButtonProps = Omit<CommonProps, 'onChange'> & {
|
|
120
122
|
selected?: boolean;
|
|
121
123
|
value: string;
|
|
122
124
|
};
|
|
@@ -37,6 +37,15 @@ export interface GridExperimentalFeatures {
|
|
|
37
37
|
* Only works if NODE_ENV=test.
|
|
38
38
|
*/
|
|
39
39
|
warnIfFocusStateIsNotSynced: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the layout mode of the virtualizer.
|
|
42
|
+
* - `'uncontrolled'` (default): the browser controls scrolling and the virtualizer
|
|
43
|
+
* positions rows using a filler element.
|
|
44
|
+
* - `'controlled'`: the virtualizer controls scrolling by translating the viewport,
|
|
45
|
+
* enabling features such as sticky pinned rows and columns without extra DOM cost.
|
|
46
|
+
* @default 'uncontrolled'
|
|
47
|
+
*/
|
|
48
|
+
virtualizerLayoutMode: 'controlled' | 'uncontrolled';
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* The props users can give to the Data Grid component.
|
|
@@ -37,6 +37,15 @@ export interface GridExperimentalFeatures {
|
|
|
37
37
|
* Only works if NODE_ENV=test.
|
|
38
38
|
*/
|
|
39
39
|
warnIfFocusStateIsNotSynced: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the layout mode of the virtualizer.
|
|
42
|
+
* - `'uncontrolled'` (default): the browser controls scrolling and the virtualizer
|
|
43
|
+
* positions rows using a filler element.
|
|
44
|
+
* - `'controlled'`: the virtualizer controls scrolling by translating the viewport,
|
|
45
|
+
* enabling features such as sticky pinned rows and columns without extra DOM cost.
|
|
46
|
+
* @default 'uncontrolled'
|
|
47
|
+
*/
|
|
48
|
+
virtualizerLayoutMode: 'controlled' | 'uncontrolled';
|
|
40
49
|
}
|
|
41
50
|
/**
|
|
42
51
|
* The props users can give to the Data Grid component.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Community plan edition of the MUI X Data Grid components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.28.6",
|
|
41
|
-
"@mui/utils": "
|
|
41
|
+
"@mui/utils": "9.0.0",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"use-sync-external-store": "^1.6.0",
|
|
45
|
-
"@mui/x-virtualizer": "
|
|
46
|
-
"@mui/x-internals": "9.0.0
|
|
45
|
+
"@mui/x-virtualizer": "9.0.0-alpha.0",
|
|
46
|
+
"@mui/x-internals": "^9.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@emotion/react": "^11.9.0",
|
|
50
50
|
"@emotion/styled": "^11.8.1",
|
|
51
|
-
"@mui/material": "^
|
|
52
|
-
"@mui/system": "^
|
|
51
|
+
"@mui/material": "^7.3.0 || ^9.0.0",
|
|
52
|
+
"@mui/system": "^7.3.0 || ^9.0.0",
|
|
53
53
|
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
54
54
|
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
55
55
|
},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export class FinalizationRegistryBasedCleanupTracking {
|
|
2
|
-
registry =
|
|
2
|
+
registry = new FinalizationRegistry(unsubscribe => {
|
|
3
3
|
if (typeof unsubscribe === 'function') {
|
|
4
4
|
unsubscribe();
|
|
5
5
|
}
|
|
6
|
-
})
|
|
6
|
+
});
|
|
7
7
|
register(object, unsubscribe, unregisterToken) {
|
|
8
8
|
this.registry.register(object, unsubscribe, unregisterToken);
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// If no effect ran after this amount of time, we assume that the render was not committed by React
|
|
2
2
|
const CLEANUP_TIMER_LOOP_MILLIS = 1000;
|
|
3
3
|
export class TimerBasedCleanupTracking {
|
|
4
|
-
timeouts =
|
|
5
|
-
cleanupTimeout =
|
|
4
|
+
timeouts = new Map();
|
|
5
|
+
cleanupTimeout = CLEANUP_TIMER_LOOP_MILLIS;
|
|
6
6
|
constructor(timeout = CLEANUP_TIMER_LOOP_MILLIS) {
|
|
7
7
|
this.cleanupTimeout = timeout;
|
|
8
8
|
}
|
package/utils/domUtils.js
CHANGED
|
@@ -221,12 +221,13 @@ function findGridHeaderFilter(api, field) {
|
|
|
221
221
|
}
|
|
222
222
|
function findGridCells(api, field) {
|
|
223
223
|
const container = api.virtualScrollerRef.current;
|
|
224
|
-
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
|
|
224
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
|
|
225
225
|
}
|
|
226
226
|
function queryRows(api) {
|
|
227
227
|
return api.virtualScrollerRef.current.querySelectorAll(
|
|
228
228
|
// Use > to ignore rows from nested Data Grids (for example in detail panel)
|
|
229
|
-
`:scope > div > div > .${_gridClasses.gridClasses.row}
|
|
229
|
+
`:scope > div > div > div > .${_gridClasses.gridClasses.row},
|
|
230
|
+
:scope > div > div > div > div > .${_gridClasses.gridClasses.row}`);
|
|
230
231
|
}
|
|
231
232
|
function parseCellColIndex(col) {
|
|
232
233
|
const ariaColIndex = col.getAttribute('aria-colindex');
|
package/utils/domUtils.mjs
CHANGED
|
@@ -193,12 +193,13 @@ export function findGridHeaderFilter(api, field) {
|
|
|
193
193
|
}
|
|
194
194
|
export function findGridCells(api, field) {
|
|
195
195
|
const container = api.virtualScrollerRef.current;
|
|
196
|
-
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
|
|
196
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > div > [data-field="${escapeOperandAttributeSelector(field)}"][role="gridcell"]`));
|
|
197
197
|
}
|
|
198
198
|
function queryRows(api) {
|
|
199
199
|
return api.virtualScrollerRef.current.querySelectorAll(
|
|
200
200
|
// Use > to ignore rows from nested Data Grids (for example in detail panel)
|
|
201
|
-
`:scope > div > div > .${gridClasses.row}
|
|
201
|
+
`:scope > div > div > div > .${gridClasses.row},
|
|
202
|
+
:scope > div > div > div > div > .${gridClasses.row}`);
|
|
202
203
|
}
|
|
203
204
|
function parseCellColIndex(col) {
|
|
204
205
|
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
@@ -6,4 +6,6 @@ export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is
|
|
|
6
6
|
export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
|
|
7
7
|
export declare function isCopyShortcut(event: KeyboardEvent): boolean;
|
|
8
8
|
export declare function isUndoShortcut(event: React.KeyboardEvent): boolean;
|
|
9
|
+
export declare function isFillDownShortcut(event: React.KeyboardEvent): boolean;
|
|
10
|
+
export declare function isFillRightShortcut(event: React.KeyboardEvent): boolean;
|
|
9
11
|
export declare function isRedoShortcut(event: React.KeyboardEvent): boolean;
|
package/utils/keyboardUtils.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ export declare const isHideMenuKey: (key: React.KeyboardEvent["key"]) => key is
|
|
|
6
6
|
export declare function isPasteShortcut(event: React.KeyboardEvent): boolean;
|
|
7
7
|
export declare function isCopyShortcut(event: KeyboardEvent): boolean;
|
|
8
8
|
export declare function isUndoShortcut(event: React.KeyboardEvent): boolean;
|
|
9
|
+
export declare function isFillDownShortcut(event: React.KeyboardEvent): boolean;
|
|
10
|
+
export declare function isFillRightShortcut(event: React.KeyboardEvent): boolean;
|
|
9
11
|
export declare function isRedoShortcut(event: React.KeyboardEvent): boolean;
|
package/utils/keyboardUtils.js
CHANGED
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.isCopyShortcut = isCopyShortcut;
|
|
7
|
+
exports.isFillDownShortcut = isFillDownShortcut;
|
|
8
|
+
exports.isFillRightShortcut = isFillRightShortcut;
|
|
7
9
|
exports.isNavigationKey = exports.isKeyboardEvent = exports.isHideMenuKey = void 0;
|
|
8
10
|
exports.isPasteShortcut = isPasteShortcut;
|
|
9
11
|
exports.isPrintableKey = isPrintableKey;
|
|
@@ -45,6 +47,12 @@ function isCopyShortcut(event) {
|
|
|
45
47
|
function isUndoShortcut(event) {
|
|
46
48
|
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'Z' && !event.shiftKey && !event.altKey;
|
|
47
49
|
}
|
|
50
|
+
function isFillDownShortcut(event) {
|
|
51
|
+
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'D' && !event.shiftKey && !event.altKey;
|
|
52
|
+
}
|
|
53
|
+
function isFillRightShortcut(event) {
|
|
54
|
+
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'R' && !event.shiftKey && !event.altKey;
|
|
55
|
+
}
|
|
48
56
|
function isRedoShortcut(event) {
|
|
49
57
|
return (event.ctrlKey || event.metaKey) && (String.fromCharCode(event.keyCode) === 'Z' && event.shiftKey || String.fromCharCode(event.keyCode) === 'Y' && !event.shiftKey) && !event.altKey;
|
|
50
58
|
}
|
package/utils/keyboardUtils.mjs
CHANGED
|
@@ -31,6 +31,12 @@ export function isCopyShortcut(event) {
|
|
|
31
31
|
export function isUndoShortcut(event) {
|
|
32
32
|
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'Z' && !event.shiftKey && !event.altKey;
|
|
33
33
|
}
|
|
34
|
+
export function isFillDownShortcut(event) {
|
|
35
|
+
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'D' && !event.shiftKey && !event.altKey;
|
|
36
|
+
}
|
|
37
|
+
export function isFillRightShortcut(event) {
|
|
38
|
+
return (event.ctrlKey || event.metaKey) && String.fromCharCode(event.keyCode) === 'R' && !event.shiftKey && !event.altKey;
|
|
39
|
+
}
|
|
34
40
|
export function isRedoShortcut(event) {
|
|
35
41
|
return (event.ctrlKey || event.metaKey) && (String.fromCharCode(event.keyCode) === 'Z' && event.shiftKey || String.fromCharCode(event.keyCode) === 'Y' && !event.shiftKey) && !event.altKey;
|
|
36
42
|
}
|