@mui/x-data-grid 6.3.0 → 6.4.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 +105 -2
- package/DataGrid/DataGrid.js +20 -1
- package/DataGrid/useDataGridComponent.js +2 -2
- package/DataGrid/useDataGridProps.js +3 -1
- package/colDef/gridBooleanColDef.js +19 -1
- package/colDef/gridDateColDef.js +6 -2
- package/colDef/gridSingleSelectColDef.js +21 -1
- package/components/GridPagination.js +3 -1
- package/components/base/GridBody.d.ts +1 -0
- package/components/base/GridBody.js +6 -3
- package/components/containers/GridRootStyles.js +1 -0
- package/components/panel/GridPanel.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +12 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +2 -1
- package/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/hooks/features/dimensions/useGridDimensions.js +2 -4
- package/hooks/features/editing/useGridCellEditing.js +7 -3
- package/hooks/features/editing/useGridRowEditing.js +7 -3
- package/hooks/features/export/serializers/csvSerializer.d.ts +5 -0
- package/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/hooks/features/export/useGridCsvExport.d.ts +2 -1
- package/hooks/features/export/useGridCsvExport.js +7 -5
- package/hooks/features/focus/useGridFocus.js +2 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/index.js +1 -1
- package/internals/index.d.ts +3 -2
- package/internals/index.js +3 -2
- package/joy/icons.d.ts +33 -0
- package/joy/icons.js +433 -0
- package/joy/joySlots.js +254 -42
- package/legacy/DataGrid/DataGrid.js +20 -1
- package/legacy/DataGrid/useDataGridComponent.js +2 -2
- package/legacy/DataGrid/useDataGridProps.js +3 -1
- package/legacy/colDef/gridBooleanColDef.js +21 -1
- package/legacy/colDef/gridDateColDef.js +10 -2
- package/legacy/colDef/gridSingleSelectColDef.js +21 -1
- package/legacy/components/GridPagination.js +3 -1
- package/legacy/components/base/GridBody.js +6 -3
- package/legacy/components/containers/GridRootStyles.js +1 -0
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/legacy/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/legacy/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/legacy/hooks/features/clipboard/useGridClipboard.js +44 -26
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -4
- package/legacy/hooks/features/editing/useGridCellEditing.js +7 -3
- package/legacy/hooks/features/editing/useGridRowEditing.js +7 -3
- package/legacy/hooks/features/export/serializers/csvSerializer.js +43 -6
- package/legacy/hooks/features/export/useGridCsvExport.js +8 -5
- package/legacy/hooks/features/focus/useGridFocus.js +2 -2
- package/legacy/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +3 -2
- package/legacy/joy/icons.js +432 -0
- package/legacy/joy/joySlots.js +273 -54
- package/legacy/locales/deDE.js +2 -2
- package/legacy/locales/frFR.js +6 -6
- package/legacy/locales/ptBR.js +1 -1
- package/legacy/locales/ukUA.js +8 -9
- package/legacy/material/index.js +3 -1
- package/legacy/models/api/index.js +0 -1
- package/legacy/utils/domUtils.js +14 -1
- package/locales/deDE.js +2 -2
- package/locales/frFR.js +6 -6
- package/locales/ptBR.js +1 -1
- package/locales/ukUA.js +8 -9
- package/material/index.d.ts +3 -1
- package/material/index.js +3 -1
- package/models/api/gridApiCommon.d.ts +1 -2
- package/models/api/gridCoreApi.d.ts +4 -0
- package/models/api/index.d.ts +0 -1
- package/models/api/index.js +0 -1
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/models/props/DataGridProps.d.ts +19 -0
- package/modern/DataGrid/DataGrid.js +20 -1
- package/modern/DataGrid/useDataGridComponent.js +2 -2
- package/modern/DataGrid/useDataGridProps.js +3 -1
- package/modern/colDef/gridBooleanColDef.js +19 -1
- package/modern/colDef/gridDateColDef.js +6 -2
- package/modern/colDef/gridSingleSelectColDef.js +21 -1
- package/modern/components/GridPagination.js +2 -1
- package/modern/components/base/GridBody.js +6 -3
- package/modern/components/containers/GridRootStyles.js +1 -0
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/modern/hooks/features/clipboard/useGridClipboard.js +43 -26
- package/modern/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/modern/hooks/features/editing/useGridCellEditing.js +7 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -3
- package/modern/hooks/features/export/serializers/csvSerializer.js +44 -6
- package/modern/hooks/features/export/useGridCsvExport.js +7 -5
- package/modern/hooks/features/focus/useGridFocus.js +2 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/modern/index.js +1 -1
- package/modern/internals/index.js +3 -2
- package/modern/joy/icons.js +433 -0
- package/modern/joy/joySlots.js +248 -41
- package/modern/locales/deDE.js +2 -2
- package/modern/locales/frFR.js +6 -6
- package/modern/locales/ptBR.js +1 -1
- package/modern/locales/ukUA.js +8 -9
- package/modern/material/index.js +3 -1
- package/modern/models/api/index.js +0 -1
- package/modern/utils/domUtils.js +13 -1
- package/node/DataGrid/DataGrid.js +20 -1
- package/node/DataGrid/useDataGridComponent.js +2 -2
- package/node/DataGrid/useDataGridProps.js +3 -1
- package/node/colDef/gridBooleanColDef.js +19 -1
- package/node/colDef/gridDateColDef.js +6 -2
- package/node/colDef/gridSingleSelectColDef.js +21 -1
- package/node/components/GridPagination.js +2 -1
- package/node/components/base/GridBody.js +6 -3
- package/node/components/containers/GridRootStyles.js +1 -0
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -2
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +3 -1
- package/node/hooks/features/clipboard/useGridClipboard.js +42 -25
- package/node/hooks/features/dimensions/useGridDimensions.js +1 -3
- package/node/hooks/features/editing/useGridCellEditing.js +7 -3
- package/node/hooks/features/editing/useGridRowEditing.js +7 -3
- package/node/hooks/features/export/serializers/csvSerializer.js +46 -6
- package/node/hooks/features/export/useGridCsvExport.js +6 -3
- package/node/hooks/features/focus/useGridFocus.js +2 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +11 -0
- package/node/index.js +1 -1
- package/node/internals/index.js +23 -1
- package/node/joy/icons.js +471 -0
- package/node/joy/joySlots.js +248 -40
- package/node/locales/deDE.js +2 -2
- package/node/locales/frFR.js +6 -6
- package/node/locales/ptBR.js +1 -1
- package/node/locales/ukUA.js +8 -9
- package/node/material/index.js +3 -1
- package/node/models/api/index.js +0 -11
- package/node/utils/domUtils.js +15 -1
- package/package.json +2 -2
- package/utils/domUtils.d.ts +1 -0
- package/utils/domUtils.js +13 -1
- package/legacy/models/api/gridClipboardApi.js +0 -1
- package/models/api/gridClipboardApi.d.ts +0 -11
- package/models/api/gridClipboardApi.js +0 -1
- package/modern/models/api/gridClipboardApi.js +0 -1
- package/node/models/api/gridClipboardApi.js +0 -5
package/node/joy/joySlots.js
CHANGED
|
@@ -15,11 +15,24 @@ var _FormLabel = _interopRequireDefault(require("@mui/joy/FormLabel"));
|
|
|
15
15
|
var _Button = _interopRequireDefault(require("@mui/joy/Button"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("@mui/joy/IconButton"));
|
|
17
17
|
var _Switch = _interopRequireDefault(require("@mui/joy/Switch"));
|
|
18
|
+
var _Select = _interopRequireDefault(require("@mui/joy/Select"));
|
|
19
|
+
var _Option = _interopRequireDefault(require("@mui/joy/Option"));
|
|
20
|
+
var _Box = _interopRequireDefault(require("@mui/joy/Box"));
|
|
21
|
+
var _Typography = _interopRequireDefault(require("@mui/joy/Typography"));
|
|
22
|
+
var _utils = require("@mui/utils");
|
|
23
|
+
var _icons = _interopRequireWildcard(require("./icons"));
|
|
24
|
+
var _useGridApiContext = require("../hooks/utils/useGridApiContext");
|
|
25
|
+
var _useGridRootProps = require("../hooks/utils/useGridRootProps");
|
|
26
|
+
var _hooks = require("../hooks");
|
|
18
27
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
28
|
const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"],
|
|
20
|
-
_excluded2 = ["
|
|
21
|
-
_excluded3 = ["color", "size", "sx"],
|
|
22
|
-
_excluded4 = ["
|
|
29
|
+
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
30
|
+
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
31
|
+
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
32
|
+
_excluded5 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"],
|
|
33
|
+
_excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
34
|
+
_excluded7 = ["native"],
|
|
35
|
+
_excluded8 = ["shrink", "variant", "sx"];
|
|
23
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
37
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
38
|
function convertColor(color) {
|
|
@@ -41,14 +54,17 @@ function convertSize(size) {
|
|
|
41
54
|
large: 'lg'
|
|
42
55
|
}[size] : size;
|
|
43
56
|
}
|
|
44
|
-
function convertVariant(variant) {
|
|
45
|
-
|
|
57
|
+
function convertVariant(variant, defaultVariant = 'plain') {
|
|
58
|
+
if (!variant) {
|
|
59
|
+
return defaultVariant;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
standard: 'outlined',
|
|
46
63
|
outlined: 'outlined',
|
|
47
64
|
contained: 'solid',
|
|
48
65
|
text: 'plain',
|
|
49
|
-
standard: 'plain',
|
|
50
66
|
filled: 'soft'
|
|
51
|
-
}[variant]
|
|
67
|
+
}[variant] || defaultVariant;
|
|
52
68
|
}
|
|
53
69
|
const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
54
70
|
let {
|
|
@@ -69,36 +85,46 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
69
85
|
onChange: onChange
|
|
70
86
|
}));
|
|
71
87
|
});
|
|
72
|
-
const TextField = /*#__PURE__*/React.forwardRef(({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
89
|
+
let {
|
|
90
|
+
onChange,
|
|
91
|
+
label,
|
|
92
|
+
placeholder,
|
|
93
|
+
value,
|
|
94
|
+
inputRef,
|
|
95
|
+
type,
|
|
96
|
+
size,
|
|
97
|
+
variant
|
|
98
|
+
} = _ref2,
|
|
99
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref2, _excluded2);
|
|
100
|
+
const rootRef = (0, _utils.unstable_useForkRef)(ref, props.InputProps?.ref);
|
|
101
|
+
const inputForkRef = (0, _utils.unstable_useForkRef)(inputRef, props?.inputProps?.ref);
|
|
102
|
+
const {
|
|
103
|
+
startAdornment,
|
|
104
|
+
endAdornment
|
|
105
|
+
} = props.InputProps || {};
|
|
80
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_FormControl.default, {
|
|
81
|
-
ref:
|
|
107
|
+
ref: rootRef,
|
|
82
108
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, {
|
|
83
|
-
sx: {
|
|
84
|
-
fontSize: 12
|
|
85
|
-
},
|
|
86
109
|
children: label
|
|
87
110
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Input.default, {
|
|
88
111
|
type: type,
|
|
89
112
|
value: value,
|
|
90
113
|
onChange: onChange,
|
|
91
114
|
placeholder: placeholder,
|
|
92
|
-
|
|
115
|
+
variant: convertVariant(variant, 'outlined'),
|
|
116
|
+
size: convertSize(size),
|
|
93
117
|
slotProps: {
|
|
94
|
-
input: {
|
|
95
|
-
ref:
|
|
96
|
-
}
|
|
97
|
-
}
|
|
118
|
+
input: (0, _extends2.default)({}, props?.inputProps, {
|
|
119
|
+
ref: inputForkRef
|
|
120
|
+
})
|
|
121
|
+
},
|
|
122
|
+
startDecorator: startAdornment,
|
|
123
|
+
endDecorator: endAdornment
|
|
98
124
|
})]
|
|
99
125
|
});
|
|
100
126
|
});
|
|
101
|
-
const Button = /*#__PURE__*/React.forwardRef(function Button(
|
|
127
|
+
const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
|
|
102
128
|
let {
|
|
103
129
|
startIcon,
|
|
104
130
|
color,
|
|
@@ -106,25 +132,25 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref2, ref) {
|
|
|
106
132
|
size,
|
|
107
133
|
sx,
|
|
108
134
|
variant
|
|
109
|
-
} =
|
|
110
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
135
|
+
} = _ref3,
|
|
136
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded3);
|
|
111
137
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, (0, _extends2.default)({}, props, {
|
|
112
138
|
size: convertSize(size),
|
|
113
139
|
color: convertColor(color),
|
|
114
|
-
variant: convertVariant(variant)
|
|
140
|
+
variant: convertVariant(variant),
|
|
115
141
|
ref: ref,
|
|
116
142
|
startDecorator: startIcon,
|
|
117
143
|
endDecorator: endIcon,
|
|
118
144
|
sx: sx
|
|
119
145
|
}));
|
|
120
146
|
});
|
|
121
|
-
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(
|
|
147
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
|
|
122
148
|
let {
|
|
123
149
|
color,
|
|
124
150
|
size,
|
|
125
151
|
sx
|
|
126
|
-
} =
|
|
127
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
152
|
+
} = _ref4,
|
|
153
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref4, _excluded4);
|
|
128
154
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, (0, _extends2.default)({}, props, {
|
|
129
155
|
size: convertSize(size),
|
|
130
156
|
color: convertColor(color) ?? 'neutral',
|
|
@@ -133,7 +159,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref3, ref)
|
|
|
133
159
|
sx: sx
|
|
134
160
|
}));
|
|
135
161
|
});
|
|
136
|
-
const Switch = /*#__PURE__*/React.forwardRef(function Switch(
|
|
162
|
+
const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
|
|
137
163
|
let {
|
|
138
164
|
name,
|
|
139
165
|
color: colorProp,
|
|
@@ -145,8 +171,8 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
|
|
|
145
171
|
sx,
|
|
146
172
|
onChange,
|
|
147
173
|
onClick
|
|
148
|
-
} =
|
|
149
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
174
|
+
} = _ref5,
|
|
175
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
|
|
150
176
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, (0, _extends2.default)({}, props, {
|
|
151
177
|
onChange: onChange,
|
|
152
178
|
size: convertSize(size),
|
|
@@ -169,17 +195,199 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
|
|
|
169
195
|
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
170
196
|
}));
|
|
171
197
|
});
|
|
172
|
-
const
|
|
198
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
199
|
+
let {
|
|
200
|
+
open,
|
|
201
|
+
onOpen,
|
|
202
|
+
value,
|
|
203
|
+
onChange,
|
|
204
|
+
size,
|
|
205
|
+
color,
|
|
206
|
+
variant,
|
|
207
|
+
MenuProps,
|
|
208
|
+
inputRef,
|
|
209
|
+
labelId
|
|
210
|
+
} = _ref6,
|
|
211
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref6, _excluded6);
|
|
212
|
+
const handleChange = (event, newValue) => {
|
|
213
|
+
if (event && onChange) {
|
|
214
|
+
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
215
|
+
|
|
216
|
+
// Redefine target to allow name and value to be read.
|
|
217
|
+
// This allows seamless integration with the most popular form libraries.
|
|
218
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
219
|
+
// Clone the event to not override `target` of the original event.
|
|
220
|
+
const nativeEvent = event.nativeEvent || event;
|
|
221
|
+
// @ts-ignore The nativeEvent is function, not object
|
|
222
|
+
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
223
|
+
Object.defineProperty(clonedEvent, 'target', {
|
|
224
|
+
writable: true,
|
|
225
|
+
value: {
|
|
226
|
+
value: newValue,
|
|
227
|
+
name: props.name
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
onChange(clonedEvent, null);
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, (0, _extends2.default)({}, props, {
|
|
234
|
+
listboxOpen: open,
|
|
235
|
+
onListboxOpenChange: isOpen => {
|
|
236
|
+
if (isOpen) {
|
|
237
|
+
onOpen?.({});
|
|
238
|
+
} else {
|
|
239
|
+
MenuProps?.onClose?.({}, undefined);
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
size: convertSize(size),
|
|
243
|
+
color: convertColor(color),
|
|
244
|
+
variant: convertVariant(variant, 'outlined'),
|
|
245
|
+
ref: ref,
|
|
246
|
+
value: value,
|
|
247
|
+
onChange: handleChange,
|
|
248
|
+
slotProps: {
|
|
249
|
+
button: {
|
|
250
|
+
'aria-labelledby': labelId,
|
|
251
|
+
ref: inputRef
|
|
252
|
+
},
|
|
253
|
+
listbox: {
|
|
254
|
+
disablePortal: false,
|
|
255
|
+
sx: {
|
|
256
|
+
zIndex: 1350
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}));
|
|
261
|
+
});
|
|
262
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
263
|
+
let props = (0, _objectWithoutPropertiesLoose2.default)(_ref7, _excluded7);
|
|
264
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, (0, _extends2.default)({}, props, {
|
|
265
|
+
ref: ref
|
|
266
|
+
}));
|
|
267
|
+
});
|
|
268
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
269
|
+
let {
|
|
270
|
+
sx
|
|
271
|
+
} = _ref8,
|
|
272
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref8, _excluded8);
|
|
273
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, (0, _extends2.default)({}, props, {
|
|
274
|
+
ref: ref,
|
|
275
|
+
sx: sx
|
|
276
|
+
}));
|
|
277
|
+
});
|
|
278
|
+
function labelDisplayedRows({
|
|
279
|
+
from,
|
|
280
|
+
to,
|
|
281
|
+
count
|
|
282
|
+
}) {
|
|
283
|
+
return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
|
|
284
|
+
}
|
|
285
|
+
const getLabelDisplayedRowsTo = ({
|
|
286
|
+
page,
|
|
287
|
+
pageSize,
|
|
288
|
+
rowCount
|
|
289
|
+
}) => {
|
|
290
|
+
if (rowCount === -1) {
|
|
291
|
+
return (page + 1) * pageSize;
|
|
292
|
+
}
|
|
293
|
+
return pageSize === -1 ? rowCount : Math.min(rowCount, (page + 1) * pageSize);
|
|
294
|
+
};
|
|
295
|
+
const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
296
|
+
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
297
|
+
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
298
|
+
const paginationModel = (0, _hooks.gridPaginationModelSelector)(apiRef);
|
|
299
|
+
const visibleTopLevelRowCount = (0, _hooks.gridFilteredTopLevelRowCountSelector)(apiRef);
|
|
300
|
+
const rowCount = React.useMemo(() => rootProps.rowCount ?? visibleTopLevelRowCount ?? 0, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
301
|
+
const lastPage = React.useMemo(() => Math.floor(rowCount / (paginationModel.pageSize || 1)), [rowCount, paginationModel.pageSize]);
|
|
302
|
+
const handlePageChange = React.useCallback(page => {
|
|
303
|
+
apiRef.current.setPage(page);
|
|
304
|
+
}, [apiRef]);
|
|
305
|
+
const page = paginationModel.page <= lastPage ? paginationModel.page : lastPage;
|
|
306
|
+
const pageSize = paginationModel.pageSize;
|
|
307
|
+
const pageSizeOptions = rootProps.pageSizeOptions?.includes(pageSize) ? rootProps.pageSizeOptions : [];
|
|
308
|
+
const handleChangeRowsPerPage = (event, newValue) => {
|
|
309
|
+
const newPageSize = Number(newValue);
|
|
310
|
+
apiRef.current.setPageSize(newPageSize);
|
|
311
|
+
};
|
|
312
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
313
|
+
sx: {
|
|
314
|
+
display: 'flex',
|
|
315
|
+
alignItems: 'center',
|
|
316
|
+
gap: 2,
|
|
317
|
+
justifyContent: 'flex-end',
|
|
318
|
+
px: 2
|
|
319
|
+
},
|
|
320
|
+
ref: ref,
|
|
321
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_FormControl.default, {
|
|
322
|
+
orientation: "horizontal",
|
|
323
|
+
size: "sm",
|
|
324
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, {
|
|
325
|
+
children: "Rows per page:"
|
|
326
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Select.default, {
|
|
327
|
+
onChange: handleChangeRowsPerPage,
|
|
328
|
+
value: pageSize,
|
|
329
|
+
children: pageSizeOptions.map(option => {
|
|
330
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Option, {
|
|
331
|
+
value: option,
|
|
332
|
+
children: option
|
|
333
|
+
}, option);
|
|
334
|
+
})
|
|
335
|
+
})]
|
|
336
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
337
|
+
textAlign: "center",
|
|
338
|
+
fontSize: "xs",
|
|
339
|
+
fontWeight: "md",
|
|
340
|
+
children: labelDisplayedRows({
|
|
341
|
+
from: rowCount === 0 ? 0 : page * pageSize + 1,
|
|
342
|
+
to: getLabelDisplayedRowsTo({
|
|
343
|
+
page,
|
|
344
|
+
pageSize,
|
|
345
|
+
rowCount
|
|
346
|
+
}),
|
|
347
|
+
count: rowCount === -1 ? -1 : rowCount
|
|
348
|
+
})
|
|
349
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
350
|
+
sx: {
|
|
351
|
+
display: 'flex',
|
|
352
|
+
gap: 0.5
|
|
353
|
+
},
|
|
354
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
355
|
+
size: "sm",
|
|
356
|
+
color: "neutral",
|
|
357
|
+
variant: "outlined",
|
|
358
|
+
disabled: page === 0,
|
|
359
|
+
onClick: () => handlePageChange(page - 1),
|
|
360
|
+
sx: {
|
|
361
|
+
bgcolor: 'background.surface'
|
|
362
|
+
},
|
|
363
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridKeyboardArrowLeft, {})
|
|
364
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
365
|
+
size: "sm",
|
|
366
|
+
color: "neutral",
|
|
367
|
+
variant: "outlined",
|
|
368
|
+
disabled: rowCount !== -1 ? page >= Math.ceil(rowCount / pageSize) - 1 : false,
|
|
369
|
+
onClick: () => handlePageChange(page + 1),
|
|
370
|
+
sx: {
|
|
371
|
+
bgcolor: 'background.surface'
|
|
372
|
+
},
|
|
373
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.GridKeyboardArrowRight, {})
|
|
374
|
+
})]
|
|
375
|
+
})]
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
const joySlots = (0, _extends2.default)({}, _icons.default, {
|
|
173
379
|
baseCheckbox: Checkbox,
|
|
174
380
|
baseTextField: TextField,
|
|
175
381
|
baseButton: Button,
|
|
176
382
|
baseIconButton: IconButton,
|
|
177
|
-
baseSwitch: Switch
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
383
|
+
baseSwitch: Switch,
|
|
384
|
+
baseSelect: Select,
|
|
385
|
+
baseSelectOption: Option,
|
|
386
|
+
baseInputLabel: InputLabel,
|
|
387
|
+
baseFormControl: _FormControl.default,
|
|
181
388
|
// BaseTooltip: MUITooltip,
|
|
182
389
|
// BasePopper: MUIPopper,
|
|
183
|
-
|
|
390
|
+
pagination: Pagination
|
|
391
|
+
});
|
|
184
392
|
var _default = joySlots;
|
|
185
393
|
exports.default = _default;
|
package/node/locales/deDE.js
CHANGED
|
@@ -43,7 +43,7 @@ const deDEGrid = {
|
|
|
43
43
|
columnsPanelHideAllButton: 'Verberge alle',
|
|
44
44
|
// Filter panel text
|
|
45
45
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
46
|
-
|
|
46
|
+
filterPanelRemoveAll: 'Alle entfernen',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Löschen',
|
|
48
48
|
filterPanelLogicOperator: 'Logische Operatoren',
|
|
49
49
|
filterPanelOperator: 'Operatoren',
|
|
@@ -73,7 +73,7 @@ const deDEGrid = {
|
|
|
73
73
|
// Column menu text
|
|
74
74
|
columnMenuLabel: 'Menü',
|
|
75
75
|
columnMenuShowColumns: 'Zeige alle Spalten',
|
|
76
|
-
|
|
76
|
+
columnMenuManageColumns: 'Spalten verwalten',
|
|
77
77
|
columnMenuFilter: 'Filter',
|
|
78
78
|
columnMenuHideColumn: 'Verbergen',
|
|
79
79
|
columnMenuUnsort: 'Sortierung deaktivieren',
|
package/node/locales/frFR.js
CHANGED
|
@@ -13,7 +13,7 @@ const frFRGrid = {
|
|
|
13
13
|
// Density selector toolbar button text
|
|
14
14
|
toolbarDensity: 'Densité',
|
|
15
15
|
toolbarDensityLabel: 'Densité',
|
|
16
|
-
toolbarDensityCompact: '
|
|
16
|
+
toolbarDensityCompact: 'Compacte',
|
|
17
17
|
toolbarDensityStandard: 'Standard',
|
|
18
18
|
toolbarDensityComfortable: 'Confortable',
|
|
19
19
|
// Columns selector toolbar button text
|
|
@@ -26,7 +26,7 @@ const frFRGrid = {
|
|
|
26
26
|
toolbarFiltersTooltipShow: 'Afficher les filtres',
|
|
27
27
|
toolbarFiltersTooltipActive: count => count > 1 ? `${count} filtres actifs` : `${count} filtre actif`,
|
|
28
28
|
// Quick filter toolbar field
|
|
29
|
-
toolbarQuickFilterPlaceholder: '
|
|
29
|
+
toolbarQuickFilterPlaceholder: 'Rechercher…',
|
|
30
30
|
toolbarQuickFilterLabel: 'Recherche',
|
|
31
31
|
toolbarQuickFilterDeleteIconLabel: 'Supprimer',
|
|
32
32
|
// Export selector toolbar button text
|
|
@@ -36,7 +36,7 @@ const frFRGrid = {
|
|
|
36
36
|
toolbarExportPrint: 'Imprimer',
|
|
37
37
|
toolbarExportExcel: 'Télécharger pour Excel',
|
|
38
38
|
// Columns panel text
|
|
39
|
-
columnsPanelTextFieldLabel: 'Chercher colonne',
|
|
39
|
+
columnsPanelTextFieldLabel: 'Chercher une colonne',
|
|
40
40
|
columnsPanelTextFieldPlaceholder: 'Titre de la colonne',
|
|
41
41
|
columnsPanelDragIconLabel: 'Réorganiser la colonne',
|
|
42
42
|
columnsPanelShowAllButton: 'Tout afficher',
|
|
@@ -49,12 +49,12 @@ const frFRGrid = {
|
|
|
49
49
|
filterPanelOperator: 'Opérateur',
|
|
50
50
|
filterPanelOperatorAnd: 'Et',
|
|
51
51
|
filterPanelOperatorOr: 'Ou',
|
|
52
|
-
filterPanelColumns: '
|
|
52
|
+
filterPanelColumns: 'Colonne',
|
|
53
53
|
filterPanelInputLabel: 'Valeur',
|
|
54
54
|
filterPanelInputPlaceholder: 'Filtrer la valeur',
|
|
55
55
|
// Filter operators text
|
|
56
56
|
filterOperatorContains: 'contient',
|
|
57
|
-
filterOperatorEquals: 'égal à',
|
|
57
|
+
filterOperatorEquals: 'est égal à',
|
|
58
58
|
filterOperatorStartsWith: 'commence par',
|
|
59
59
|
filterOperatorEndsWith: 'se termine par',
|
|
60
60
|
filterOperatorIs: 'est',
|
|
@@ -86,7 +86,7 @@ const frFRGrid = {
|
|
|
86
86
|
// Rows selected footer text
|
|
87
87
|
footerRowSelected: count => count > 1 ? `${count.toLocaleString()} lignes sélectionnées` : `${count.toLocaleString()} ligne sélectionnée`,
|
|
88
88
|
// Total row amount footer text
|
|
89
|
-
footerTotalRows: '
|
|
89
|
+
footerTotalRows: 'Total de lignes :',
|
|
90
90
|
// Total visible row amount footer text
|
|
91
91
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} sur ${totalCount.toLocaleString()}`,
|
|
92
92
|
// Checkbox selection text
|
package/node/locales/ptBR.js
CHANGED
|
@@ -43,7 +43,7 @@ const ptBRGrid = {
|
|
|
43
43
|
columnsPanelHideAllButton: 'Ocultar todas',
|
|
44
44
|
// Filter panel text
|
|
45
45
|
filterPanelAddFilter: 'Adicionar filtro',
|
|
46
|
-
|
|
46
|
+
filterPanelRemoveAll: 'Remover todos',
|
|
47
47
|
filterPanelDeleteIconLabel: 'Excluir',
|
|
48
48
|
filterPanelLogicOperator: 'Operador lógico',
|
|
49
49
|
filterPanelOperator: 'Operador',
|
package/node/locales/ukUA.js
CHANGED
|
@@ -57,7 +57,7 @@ const ukUAGrid = {
|
|
|
57
57
|
columnsPanelHideAllButton: 'Приховати всі',
|
|
58
58
|
// Filter panel text
|
|
59
59
|
filterPanelAddFilter: 'Додати фільтр',
|
|
60
|
-
|
|
60
|
+
filterPanelRemoveAll: 'Видалити всі',
|
|
61
61
|
filterPanelDeleteIconLabel: 'Видалити',
|
|
62
62
|
filterPanelLogicOperator: 'Логічна функція',
|
|
63
63
|
filterPanelOperator: 'Оператори',
|
|
@@ -87,7 +87,7 @@ const ukUAGrid = {
|
|
|
87
87
|
// Column menu text
|
|
88
88
|
columnMenuLabel: 'Меню',
|
|
89
89
|
columnMenuShowColumns: 'Показати стовпці',
|
|
90
|
-
|
|
90
|
+
columnMenuManageColumns: 'Керування стовпцями',
|
|
91
91
|
columnMenuFilter: 'Фільтр',
|
|
92
92
|
columnMenuHideColumn: 'Приховати',
|
|
93
93
|
columnMenuUnsort: 'Скасувати сортування',
|
|
@@ -141,13 +141,12 @@ const ukUAGrid = {
|
|
|
141
141
|
// Row reordering text
|
|
142
142
|
rowReorderingHeaderName: 'Порядок рядків',
|
|
143
143
|
// Aggregation
|
|
144
|
-
aggregationMenuItemHeader: 'Агрегація'
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
aggregationMenuItemHeader: 'Агрегація',
|
|
145
|
+
aggregationFunctionLabelSum: 'сума',
|
|
146
|
+
aggregationFunctionLabelAvg: 'сер',
|
|
147
|
+
aggregationFunctionLabelMin: 'мін',
|
|
148
|
+
aggregationFunctionLabelMax: 'макс',
|
|
149
|
+
aggregationFunctionLabelSize: 'кількість'
|
|
150
150
|
};
|
|
151
|
-
|
|
152
151
|
const ukUA = (0, _getGridLocalization.getGridLocalization)(ukUAGrid, _locale.ukUA);
|
|
153
152
|
exports.ukUA = ukUA;
|
package/node/material/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
|
16
16
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
17
17
|
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
|
18
18
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
19
|
+
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
19
20
|
var _GridColumnUnsortedIcon = require("./icons/GridColumnUnsortedIcon");
|
|
20
21
|
var _icons = require("./icons");
|
|
21
22
|
var _MUISelectOption = _interopRequireDefault(require("./components/MUISelectOption"));
|
|
@@ -67,7 +68,8 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
|
67
68
|
BaseTooltip: _Tooltip.default,
|
|
68
69
|
BasePopper: _Popper.default,
|
|
69
70
|
BaseInputLabel: _InputLabel.default,
|
|
70
|
-
BaseSelectOption: _MUISelectOption.default
|
|
71
|
+
BaseSelectOption: _MUISelectOption.default,
|
|
72
|
+
BaseChip: _Chip.default
|
|
71
73
|
});
|
|
72
74
|
var _default = materialSlots;
|
|
73
75
|
exports.default = _default;
|
package/node/models/api/index.js
CHANGED
|
@@ -146,17 +146,6 @@ Object.keys(_gridDisableVirtualizationApi).forEach(function (key) {
|
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
});
|
|
149
|
-
var _gridClipboardApi = require("./gridClipboardApi");
|
|
150
|
-
Object.keys(_gridClipboardApi).forEach(function (key) {
|
|
151
|
-
if (key === "default" || key === "__esModule") return;
|
|
152
|
-
if (key in exports && exports[key] === _gridClipboardApi[key]) return;
|
|
153
|
-
Object.defineProperty(exports, key, {
|
|
154
|
-
enumerable: true,
|
|
155
|
-
get: function () {
|
|
156
|
-
return _gridClipboardApi[key];
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
149
|
var _gridCallbackDetails = require("./gridCallbackDetails");
|
|
161
150
|
Object.keys(_gridCallbackDetails).forEach(function (key) {
|
|
162
151
|
if (key === "default" || key === "__esModule") return;
|
package/node/utils/domUtils.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.findParentElementFromClassName = findParentElementFromClassName;
|
|
7
|
+
exports.getActiveElement = void 0;
|
|
7
8
|
exports.getGridCellElement = getGridCellElement;
|
|
8
9
|
exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
|
|
9
10
|
exports.getGridRowElement = getGridRowElement;
|
|
@@ -52,4 +53,17 @@ function getGridCellElement(root, {
|
|
|
52
53
|
const cellSelector = `.${_gridClasses.gridClasses.cell}[data-field="${escapeOperandAttributeSelector(field)}"]`;
|
|
53
54
|
const selector = `${rowSelector} ${cellSelector}`;
|
|
54
55
|
return root.querySelector(selector);
|
|
55
|
-
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/
|
|
59
|
+
const getActiveElement = (root = document) => {
|
|
60
|
+
const activeEl = root.activeElement;
|
|
61
|
+
if (!activeEl) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (activeEl.shadowRoot) {
|
|
65
|
+
return getActiveElement(activeEl.shadowRoot);
|
|
66
|
+
}
|
|
67
|
+
return activeEl;
|
|
68
|
+
};
|
|
69
|
+
exports.getActiveElement = getActiveElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "The community edition of the data grid component (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@babel/runtime": "^7.21.0",
|
|
39
|
-
"@mui/utils": "^5.12.
|
|
39
|
+
"@mui/utils": "^5.12.3",
|
|
40
40
|
"clsx": "^1.2.1",
|
|
41
41
|
"prop-types": "^15.8.1",
|
|
42
42
|
"reselect": "^4.1.8"
|
package/utils/domUtils.d.ts
CHANGED
package/utils/domUtils.js
CHANGED
|
@@ -39,4 +39,16 @@ export function getGridCellElement(root, {
|
|
|
39
39
|
const cellSelector = `.${gridClasses.cell}[data-field="${escapeOperandAttributeSelector(field)}"]`;
|
|
40
40
|
const selector = `${rowSelector} ${cellSelector}`;
|
|
41
41
|
return root.querySelector(selector);
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// https://www.abeautifulsite.net/posts/finding-the-active-element-in-a-shadow-root/
|
|
45
|
+
export const getActiveElement = (root = document) => {
|
|
46
|
+
const activeEl = root.activeElement;
|
|
47
|
+
if (!activeEl) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if (activeEl.shadowRoot) {
|
|
51
|
+
return getActiveElement(activeEl.shadowRoot);
|
|
52
|
+
}
|
|
53
|
+
return activeEl;
|
|
54
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Clipboard API interface that is available in the grid [[apiRef]].
|
|
3
|
-
*/
|
|
4
|
-
export interface GridClipboardApi {
|
|
5
|
-
/**
|
|
6
|
-
* Copies the selected rows to the clipboard.
|
|
7
|
-
* The fields will be separated by the TAB character.
|
|
8
|
-
* @ignore - do not document.
|
|
9
|
-
*/
|
|
10
|
-
unstable_copySelectedRowsToClipboard: () => void;
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|