@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/modern/joy/joySlots.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
3
|
const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size", "checked", "sx", "value", "inputRef"],
|
|
4
|
-
_excluded2 = ["
|
|
5
|
-
_excluded3 = ["color", "size", "sx"],
|
|
6
|
-
_excluded4 = ["
|
|
4
|
+
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
5
|
+
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
6
|
+
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
7
|
+
_excluded5 = ["name", "checkedIcon", "color", "disableRipple", "disableFocusRipple", "disableTouchRipple", "edge", "icon", "inputProps", "inputRef", "size", "sx", "onChange", "onClick"],
|
|
8
|
+
_excluded6 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
9
|
+
_excluded7 = ["native"],
|
|
10
|
+
_excluded8 = ["shrink", "variant", "sx"];
|
|
7
11
|
import * as React from 'react';
|
|
8
12
|
import JoyCheckbox from '@mui/joy/Checkbox';
|
|
9
13
|
import JoyInput from '@mui/joy/Input';
|
|
@@ -12,6 +16,15 @@ import JoyFormLabel from '@mui/joy/FormLabel';
|
|
|
12
16
|
import JoyButton from '@mui/joy/Button';
|
|
13
17
|
import JoyIconButton from '@mui/joy/IconButton';
|
|
14
18
|
import JoySwitch from '@mui/joy/Switch';
|
|
19
|
+
import JoySelect from '@mui/joy/Select';
|
|
20
|
+
import JoyOption from '@mui/joy/Option';
|
|
21
|
+
import JoyBox from '@mui/joy/Box';
|
|
22
|
+
import JoyTypography from '@mui/joy/Typography';
|
|
23
|
+
import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
|
24
|
+
import joyIconSlots, { GridKeyboardArrowRight, GridKeyboardArrowLeft } from './icons';
|
|
25
|
+
import { useGridApiContext } from '../hooks/utils/useGridApiContext';
|
|
26
|
+
import { useGridRootProps } from '../hooks/utils/useGridRootProps';
|
|
27
|
+
import { gridFilteredTopLevelRowCountSelector, gridPaginationModelSelector } from '../hooks';
|
|
15
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
30
|
function convertColor(color) {
|
|
@@ -33,14 +46,17 @@ function convertSize(size) {
|
|
|
33
46
|
large: 'lg'
|
|
34
47
|
}[size] : size;
|
|
35
48
|
}
|
|
36
|
-
function convertVariant(variant) {
|
|
37
|
-
|
|
49
|
+
function convertVariant(variant, defaultVariant = 'plain') {
|
|
50
|
+
if (!variant) {
|
|
51
|
+
return defaultVariant;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
standard: 'outlined',
|
|
38
55
|
outlined: 'outlined',
|
|
39
56
|
contained: 'solid',
|
|
40
57
|
text: 'plain',
|
|
41
|
-
standard: 'plain',
|
|
42
58
|
filled: 'soft'
|
|
43
|
-
}[variant]
|
|
59
|
+
}[variant] || defaultVariant;
|
|
44
60
|
}
|
|
45
61
|
const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
46
62
|
let {
|
|
@@ -61,36 +77,46 @@ const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
61
77
|
onChange: onChange
|
|
62
78
|
}));
|
|
63
79
|
});
|
|
64
|
-
const TextField = /*#__PURE__*/React.forwardRef(({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
const TextField = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
81
|
+
let {
|
|
82
|
+
onChange,
|
|
83
|
+
label,
|
|
84
|
+
placeholder,
|
|
85
|
+
value,
|
|
86
|
+
inputRef,
|
|
87
|
+
type,
|
|
88
|
+
size,
|
|
89
|
+
variant
|
|
90
|
+
} = _ref2,
|
|
91
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
92
|
+
const rootRef = useForkRef(ref, props.InputProps?.ref);
|
|
93
|
+
const inputForkRef = useForkRef(inputRef, props?.inputProps?.ref);
|
|
94
|
+
const {
|
|
95
|
+
startAdornment,
|
|
96
|
+
endAdornment
|
|
97
|
+
} = props.InputProps || {};
|
|
72
98
|
return /*#__PURE__*/_jsxs(JoyFormControl, {
|
|
73
|
-
ref:
|
|
99
|
+
ref: rootRef,
|
|
74
100
|
children: [/*#__PURE__*/_jsx(JoyFormLabel, {
|
|
75
|
-
sx: {
|
|
76
|
-
fontSize: 12
|
|
77
|
-
},
|
|
78
101
|
children: label
|
|
79
102
|
}), /*#__PURE__*/_jsx(JoyInput, {
|
|
80
103
|
type: type,
|
|
81
104
|
value: value,
|
|
82
105
|
onChange: onChange,
|
|
83
106
|
placeholder: placeholder,
|
|
84
|
-
|
|
107
|
+
variant: convertVariant(variant, 'outlined'),
|
|
108
|
+
size: convertSize(size),
|
|
85
109
|
slotProps: {
|
|
86
|
-
input: {
|
|
87
|
-
ref:
|
|
88
|
-
}
|
|
89
|
-
}
|
|
110
|
+
input: _extends({}, props?.inputProps, {
|
|
111
|
+
ref: inputForkRef
|
|
112
|
+
})
|
|
113
|
+
},
|
|
114
|
+
startDecorator: startAdornment,
|
|
115
|
+
endDecorator: endAdornment
|
|
90
116
|
})]
|
|
91
117
|
});
|
|
92
118
|
});
|
|
93
|
-
const Button = /*#__PURE__*/React.forwardRef(function Button(
|
|
119
|
+
const Button = /*#__PURE__*/React.forwardRef(function Button(_ref3, ref) {
|
|
94
120
|
let {
|
|
95
121
|
startIcon,
|
|
96
122
|
color,
|
|
@@ -98,25 +124,25 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref2, ref) {
|
|
|
98
124
|
size,
|
|
99
125
|
sx,
|
|
100
126
|
variant
|
|
101
|
-
} =
|
|
102
|
-
props = _objectWithoutPropertiesLoose(
|
|
127
|
+
} = _ref3,
|
|
128
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
103
129
|
return /*#__PURE__*/_jsx(JoyButton, _extends({}, props, {
|
|
104
130
|
size: convertSize(size),
|
|
105
131
|
color: convertColor(color),
|
|
106
|
-
variant: convertVariant(variant)
|
|
132
|
+
variant: convertVariant(variant),
|
|
107
133
|
ref: ref,
|
|
108
134
|
startDecorator: startIcon,
|
|
109
135
|
endDecorator: endIcon,
|
|
110
136
|
sx: sx
|
|
111
137
|
}));
|
|
112
138
|
});
|
|
113
|
-
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(
|
|
139
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref) {
|
|
114
140
|
let {
|
|
115
141
|
color,
|
|
116
142
|
size,
|
|
117
143
|
sx
|
|
118
|
-
} =
|
|
119
|
-
props = _objectWithoutPropertiesLoose(
|
|
144
|
+
} = _ref4,
|
|
145
|
+
props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
|
|
120
146
|
return /*#__PURE__*/_jsx(JoyIconButton, _extends({}, props, {
|
|
121
147
|
size: convertSize(size),
|
|
122
148
|
color: convertColor(color) ?? 'neutral',
|
|
@@ -125,7 +151,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref3, ref)
|
|
|
125
151
|
sx: sx
|
|
126
152
|
}));
|
|
127
153
|
});
|
|
128
|
-
const Switch = /*#__PURE__*/React.forwardRef(function Switch(
|
|
154
|
+
const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref5, ref) {
|
|
129
155
|
let {
|
|
130
156
|
name,
|
|
131
157
|
color: colorProp,
|
|
@@ -137,8 +163,8 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
|
|
|
137
163
|
sx,
|
|
138
164
|
onChange,
|
|
139
165
|
onClick
|
|
140
|
-
} =
|
|
141
|
-
props = _objectWithoutPropertiesLoose(
|
|
166
|
+
} = _ref5,
|
|
167
|
+
props = _objectWithoutPropertiesLoose(_ref5, _excluded5);
|
|
142
168
|
return /*#__PURE__*/_jsx(JoySwitch, _extends({}, props, {
|
|
143
169
|
onChange: onChange,
|
|
144
170
|
size: convertSize(size),
|
|
@@ -161,17 +187,198 @@ const Switch = /*#__PURE__*/React.forwardRef(function Switch(_ref4, ref) {
|
|
|
161
187
|
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
162
188
|
}));
|
|
163
189
|
});
|
|
164
|
-
const
|
|
190
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
191
|
+
let {
|
|
192
|
+
open,
|
|
193
|
+
onOpen,
|
|
194
|
+
value,
|
|
195
|
+
onChange,
|
|
196
|
+
size,
|
|
197
|
+
color,
|
|
198
|
+
variant,
|
|
199
|
+
MenuProps,
|
|
200
|
+
inputRef,
|
|
201
|
+
labelId
|
|
202
|
+
} = _ref6,
|
|
203
|
+
props = _objectWithoutPropertiesLoose(_ref6, _excluded6);
|
|
204
|
+
const handleChange = (event, newValue) => {
|
|
205
|
+
if (event && onChange) {
|
|
206
|
+
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
207
|
+
|
|
208
|
+
// Redefine target to allow name and value to be read.
|
|
209
|
+
// This allows seamless integration with the most popular form libraries.
|
|
210
|
+
// https://github.com/mui/material-ui/issues/13485#issuecomment-676048492
|
|
211
|
+
// Clone the event to not override `target` of the original event.
|
|
212
|
+
const nativeEvent = event.nativeEvent || event;
|
|
213
|
+
// @ts-ignore The nativeEvent is function, not object
|
|
214
|
+
const clonedEvent = new nativeEvent.constructor(nativeEvent.type, nativeEvent);
|
|
215
|
+
Object.defineProperty(clonedEvent, 'target', {
|
|
216
|
+
writable: true,
|
|
217
|
+
value: {
|
|
218
|
+
value: newValue,
|
|
219
|
+
name: props.name
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
onChange(clonedEvent, null);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
return /*#__PURE__*/_jsx(JoySelect, _extends({}, props, {
|
|
226
|
+
listboxOpen: open,
|
|
227
|
+
onListboxOpenChange: isOpen => {
|
|
228
|
+
if (isOpen) {
|
|
229
|
+
onOpen?.({});
|
|
230
|
+
} else {
|
|
231
|
+
MenuProps?.onClose?.({}, undefined);
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
size: convertSize(size),
|
|
235
|
+
color: convertColor(color),
|
|
236
|
+
variant: convertVariant(variant, 'outlined'),
|
|
237
|
+
ref: ref,
|
|
238
|
+
value: value,
|
|
239
|
+
onChange: handleChange,
|
|
240
|
+
slotProps: {
|
|
241
|
+
button: {
|
|
242
|
+
'aria-labelledby': labelId,
|
|
243
|
+
ref: inputRef
|
|
244
|
+
},
|
|
245
|
+
listbox: {
|
|
246
|
+
disablePortal: false,
|
|
247
|
+
sx: {
|
|
248
|
+
zIndex: 1350
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
});
|
|
254
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
255
|
+
let props = _objectWithoutPropertiesLoose(_ref7, _excluded7);
|
|
256
|
+
return /*#__PURE__*/_jsx(JoyOption, _extends({}, props, {
|
|
257
|
+
ref: ref
|
|
258
|
+
}));
|
|
259
|
+
});
|
|
260
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
261
|
+
let {
|
|
262
|
+
sx
|
|
263
|
+
} = _ref8,
|
|
264
|
+
props = _objectWithoutPropertiesLoose(_ref8, _excluded8);
|
|
265
|
+
return /*#__PURE__*/_jsx(JoyFormLabel, _extends({}, props, {
|
|
266
|
+
ref: ref,
|
|
267
|
+
sx: sx
|
|
268
|
+
}));
|
|
269
|
+
});
|
|
270
|
+
function labelDisplayedRows({
|
|
271
|
+
from,
|
|
272
|
+
to,
|
|
273
|
+
count
|
|
274
|
+
}) {
|
|
275
|
+
return `${from}–${to} of ${count !== -1 ? count : `more than ${to}`}`;
|
|
276
|
+
}
|
|
277
|
+
const getLabelDisplayedRowsTo = ({
|
|
278
|
+
page,
|
|
279
|
+
pageSize,
|
|
280
|
+
rowCount
|
|
281
|
+
}) => {
|
|
282
|
+
if (rowCount === -1) {
|
|
283
|
+
return (page + 1) * pageSize;
|
|
284
|
+
}
|
|
285
|
+
return pageSize === -1 ? rowCount : Math.min(rowCount, (page + 1) * pageSize);
|
|
286
|
+
};
|
|
287
|
+
const Pagination = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
288
|
+
const apiRef = useGridApiContext();
|
|
289
|
+
const rootProps = useGridRootProps();
|
|
290
|
+
const paginationModel = gridPaginationModelSelector(apiRef);
|
|
291
|
+
const visibleTopLevelRowCount = gridFilteredTopLevelRowCountSelector(apiRef);
|
|
292
|
+
const rowCount = React.useMemo(() => rootProps.rowCount ?? visibleTopLevelRowCount ?? 0, [rootProps.rowCount, visibleTopLevelRowCount]);
|
|
293
|
+
const lastPage = React.useMemo(() => Math.floor(rowCount / (paginationModel.pageSize || 1)), [rowCount, paginationModel.pageSize]);
|
|
294
|
+
const handlePageChange = React.useCallback(page => {
|
|
295
|
+
apiRef.current.setPage(page);
|
|
296
|
+
}, [apiRef]);
|
|
297
|
+
const page = paginationModel.page <= lastPage ? paginationModel.page : lastPage;
|
|
298
|
+
const pageSize = paginationModel.pageSize;
|
|
299
|
+
const pageSizeOptions = rootProps.pageSizeOptions?.includes(pageSize) ? rootProps.pageSizeOptions : [];
|
|
300
|
+
const handleChangeRowsPerPage = (event, newValue) => {
|
|
301
|
+
const newPageSize = Number(newValue);
|
|
302
|
+
apiRef.current.setPageSize(newPageSize);
|
|
303
|
+
};
|
|
304
|
+
return /*#__PURE__*/_jsxs(JoyBox, {
|
|
305
|
+
sx: {
|
|
306
|
+
display: 'flex',
|
|
307
|
+
alignItems: 'center',
|
|
308
|
+
gap: 2,
|
|
309
|
+
justifyContent: 'flex-end',
|
|
310
|
+
px: 2
|
|
311
|
+
},
|
|
312
|
+
ref: ref,
|
|
313
|
+
children: [/*#__PURE__*/_jsxs(JoyFormControl, {
|
|
314
|
+
orientation: "horizontal",
|
|
315
|
+
size: "sm",
|
|
316
|
+
children: [/*#__PURE__*/_jsx(JoyFormLabel, {
|
|
317
|
+
children: "Rows per page:"
|
|
318
|
+
}), /*#__PURE__*/_jsx(JoySelect, {
|
|
319
|
+
onChange: handleChangeRowsPerPage,
|
|
320
|
+
value: pageSize,
|
|
321
|
+
children: pageSizeOptions.map(option => {
|
|
322
|
+
return /*#__PURE__*/_jsx(Option, {
|
|
323
|
+
value: option,
|
|
324
|
+
children: option
|
|
325
|
+
}, option);
|
|
326
|
+
})
|
|
327
|
+
})]
|
|
328
|
+
}), /*#__PURE__*/_jsx(JoyTypography, {
|
|
329
|
+
textAlign: "center",
|
|
330
|
+
fontSize: "xs",
|
|
331
|
+
fontWeight: "md",
|
|
332
|
+
children: labelDisplayedRows({
|
|
333
|
+
from: rowCount === 0 ? 0 : page * pageSize + 1,
|
|
334
|
+
to: getLabelDisplayedRowsTo({
|
|
335
|
+
page,
|
|
336
|
+
pageSize,
|
|
337
|
+
rowCount
|
|
338
|
+
}),
|
|
339
|
+
count: rowCount === -1 ? -1 : rowCount
|
|
340
|
+
})
|
|
341
|
+
}), /*#__PURE__*/_jsxs(JoyBox, {
|
|
342
|
+
sx: {
|
|
343
|
+
display: 'flex',
|
|
344
|
+
gap: 0.5
|
|
345
|
+
},
|
|
346
|
+
children: [/*#__PURE__*/_jsx(JoyIconButton, {
|
|
347
|
+
size: "sm",
|
|
348
|
+
color: "neutral",
|
|
349
|
+
variant: "outlined",
|
|
350
|
+
disabled: page === 0,
|
|
351
|
+
onClick: () => handlePageChange(page - 1),
|
|
352
|
+
sx: {
|
|
353
|
+
bgcolor: 'background.surface'
|
|
354
|
+
},
|
|
355
|
+
children: /*#__PURE__*/_jsx(GridKeyboardArrowLeft, {})
|
|
356
|
+
}), /*#__PURE__*/_jsx(JoyIconButton, {
|
|
357
|
+
size: "sm",
|
|
358
|
+
color: "neutral",
|
|
359
|
+
variant: "outlined",
|
|
360
|
+
disabled: rowCount !== -1 ? page >= Math.ceil(rowCount / pageSize) - 1 : false,
|
|
361
|
+
onClick: () => handlePageChange(page + 1),
|
|
362
|
+
sx: {
|
|
363
|
+
bgcolor: 'background.surface'
|
|
364
|
+
},
|
|
365
|
+
children: /*#__PURE__*/_jsx(GridKeyboardArrowRight, {})
|
|
366
|
+
})]
|
|
367
|
+
})]
|
|
368
|
+
});
|
|
369
|
+
});
|
|
370
|
+
const joySlots = _extends({}, joyIconSlots, {
|
|
165
371
|
baseCheckbox: Checkbox,
|
|
166
372
|
baseTextField: TextField,
|
|
167
373
|
baseButton: Button,
|
|
168
374
|
baseIconButton: IconButton,
|
|
169
|
-
baseSwitch: Switch
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
375
|
+
baseSwitch: Switch,
|
|
376
|
+
baseSelect: Select,
|
|
377
|
+
baseSelectOption: Option,
|
|
378
|
+
baseInputLabel: InputLabel,
|
|
379
|
+
baseFormControl: JoyFormControl,
|
|
173
380
|
// BaseTooltip: MUITooltip,
|
|
174
381
|
// BasePopper: MUIPopper,
|
|
175
|
-
|
|
176
|
-
|
|
382
|
+
pagination: Pagination
|
|
383
|
+
});
|
|
177
384
|
export default joySlots;
|
package/modern/locales/deDE.js
CHANGED
|
@@ -37,7 +37,7 @@ const deDEGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Verberge alle',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Filter hinzufügen',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Alle entfernen',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Löschen',
|
|
42
42
|
filterPanelLogicOperator: 'Logische Operatoren',
|
|
43
43
|
filterPanelOperator: 'Operatoren',
|
|
@@ -67,7 +67,7 @@ const deDEGrid = {
|
|
|
67
67
|
// Column menu text
|
|
68
68
|
columnMenuLabel: 'Menü',
|
|
69
69
|
columnMenuShowColumns: 'Zeige alle Spalten',
|
|
70
|
-
|
|
70
|
+
columnMenuManageColumns: 'Spalten verwalten',
|
|
71
71
|
columnMenuFilter: 'Filter',
|
|
72
72
|
columnMenuHideColumn: 'Verbergen',
|
|
73
73
|
columnMenuUnsort: 'Sortierung deaktivieren',
|
package/modern/locales/frFR.js
CHANGED
|
@@ -7,7 +7,7 @@ const frFRGrid = {
|
|
|
7
7
|
// Density selector toolbar button text
|
|
8
8
|
toolbarDensity: 'Densité',
|
|
9
9
|
toolbarDensityLabel: 'Densité',
|
|
10
|
-
toolbarDensityCompact: '
|
|
10
|
+
toolbarDensityCompact: 'Compacte',
|
|
11
11
|
toolbarDensityStandard: 'Standard',
|
|
12
12
|
toolbarDensityComfortable: 'Confortable',
|
|
13
13
|
// Columns selector toolbar button text
|
|
@@ -20,7 +20,7 @@ const frFRGrid = {
|
|
|
20
20
|
toolbarFiltersTooltipShow: 'Afficher les filtres',
|
|
21
21
|
toolbarFiltersTooltipActive: count => count > 1 ? `${count} filtres actifs` : `${count} filtre actif`,
|
|
22
22
|
// Quick filter toolbar field
|
|
23
|
-
toolbarQuickFilterPlaceholder: '
|
|
23
|
+
toolbarQuickFilterPlaceholder: 'Rechercher…',
|
|
24
24
|
toolbarQuickFilterLabel: 'Recherche',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: 'Supprimer',
|
|
26
26
|
// Export selector toolbar button text
|
|
@@ -30,7 +30,7 @@ const frFRGrid = {
|
|
|
30
30
|
toolbarExportPrint: 'Imprimer',
|
|
31
31
|
toolbarExportExcel: 'Télécharger pour Excel',
|
|
32
32
|
// Columns panel text
|
|
33
|
-
columnsPanelTextFieldLabel: 'Chercher colonne',
|
|
33
|
+
columnsPanelTextFieldLabel: 'Chercher une colonne',
|
|
34
34
|
columnsPanelTextFieldPlaceholder: 'Titre de la colonne',
|
|
35
35
|
columnsPanelDragIconLabel: 'Réorganiser la colonne',
|
|
36
36
|
columnsPanelShowAllButton: 'Tout afficher',
|
|
@@ -43,12 +43,12 @@ const frFRGrid = {
|
|
|
43
43
|
filterPanelOperator: 'Opérateur',
|
|
44
44
|
filterPanelOperatorAnd: 'Et',
|
|
45
45
|
filterPanelOperatorOr: 'Ou',
|
|
46
|
-
filterPanelColumns: '
|
|
46
|
+
filterPanelColumns: 'Colonne',
|
|
47
47
|
filterPanelInputLabel: 'Valeur',
|
|
48
48
|
filterPanelInputPlaceholder: 'Filtrer la valeur',
|
|
49
49
|
// Filter operators text
|
|
50
50
|
filterOperatorContains: 'contient',
|
|
51
|
-
filterOperatorEquals: 'égal à',
|
|
51
|
+
filterOperatorEquals: 'est égal à',
|
|
52
52
|
filterOperatorStartsWith: 'commence par',
|
|
53
53
|
filterOperatorEndsWith: 'se termine par',
|
|
54
54
|
filterOperatorIs: 'est',
|
|
@@ -80,7 +80,7 @@ const frFRGrid = {
|
|
|
80
80
|
// Rows selected footer text
|
|
81
81
|
footerRowSelected: count => count > 1 ? `${count.toLocaleString()} lignes sélectionnées` : `${count.toLocaleString()} ligne sélectionnée`,
|
|
82
82
|
// Total row amount footer text
|
|
83
|
-
footerTotalRows: '
|
|
83
|
+
footerTotalRows: 'Total de lignes :',
|
|
84
84
|
// Total visible row amount footer text
|
|
85
85
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} sur ${totalCount.toLocaleString()}`,
|
|
86
86
|
// Checkbox selection text
|
package/modern/locales/ptBR.js
CHANGED
|
@@ -37,7 +37,7 @@ const ptBRGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Ocultar todas',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Adicionar filtro',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Remover todos',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Excluir',
|
|
42
42
|
filterPanelLogicOperator: 'Operador lógico',
|
|
43
43
|
filterPanelOperator: 'Operador',
|
package/modern/locales/ukUA.js
CHANGED
|
@@ -51,7 +51,7 @@ const ukUAGrid = {
|
|
|
51
51
|
columnsPanelHideAllButton: 'Приховати всі',
|
|
52
52
|
// Filter panel text
|
|
53
53
|
filterPanelAddFilter: 'Додати фільтр',
|
|
54
|
-
|
|
54
|
+
filterPanelRemoveAll: 'Видалити всі',
|
|
55
55
|
filterPanelDeleteIconLabel: 'Видалити',
|
|
56
56
|
filterPanelLogicOperator: 'Логічна функція',
|
|
57
57
|
filterPanelOperator: 'Оператори',
|
|
@@ -81,7 +81,7 @@ const ukUAGrid = {
|
|
|
81
81
|
// Column menu text
|
|
82
82
|
columnMenuLabel: 'Меню',
|
|
83
83
|
columnMenuShowColumns: 'Показати стовпці',
|
|
84
|
-
|
|
84
|
+
columnMenuManageColumns: 'Керування стовпцями',
|
|
85
85
|
columnMenuFilter: 'Фільтр',
|
|
86
86
|
columnMenuHideColumn: 'Приховати',
|
|
87
87
|
columnMenuUnsort: 'Скасувати сортування',
|
|
@@ -135,12 +135,11 @@ const ukUAGrid = {
|
|
|
135
135
|
// Row reordering text
|
|
136
136
|
rowReorderingHeaderName: 'Порядок рядків',
|
|
137
137
|
// Aggregation
|
|
138
|
-
aggregationMenuItemHeader: 'Агрегація'
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
aggregationMenuItemHeader: 'Агрегація',
|
|
139
|
+
aggregationFunctionLabelSum: 'сума',
|
|
140
|
+
aggregationFunctionLabelAvg: 'сер',
|
|
141
|
+
aggregationFunctionLabelMin: 'мін',
|
|
142
|
+
aggregationFunctionLabelMax: 'макс',
|
|
143
|
+
aggregationFunctionLabelSize: 'кількість'
|
|
144
144
|
};
|
|
145
|
-
|
|
146
145
|
export const ukUA = getGridLocalization(ukUAGrid, ukUACore);
|
package/modern/material/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import MUIIconButton from '@mui/material/IconButton';
|
|
|
9
9
|
import MUITooltip from '@mui/material/Tooltip';
|
|
10
10
|
import MUIPopper from '@mui/material/Popper';
|
|
11
11
|
import MUIInputLabel from '@mui/material/InputLabel';
|
|
12
|
+
import MUIChip from '@mui/material/Chip';
|
|
12
13
|
import { GridColumnUnsortedIcon } from './icons/GridColumnUnsortedIcon';
|
|
13
14
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from './icons';
|
|
14
15
|
import MUISelectOption from './components/MUISelectOption';
|
|
@@ -60,6 +61,7 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
60
61
|
BaseTooltip: MUITooltip,
|
|
61
62
|
BasePopper: MUIPopper,
|
|
62
63
|
BaseInputLabel: MUIInputLabel,
|
|
63
|
-
BaseSelectOption: MUISelectOption
|
|
64
|
+
BaseSelectOption: MUISelectOption,
|
|
65
|
+
BaseChip: MUIChip
|
|
64
66
|
});
|
|
65
67
|
export default materialSlots;
|
|
@@ -11,7 +11,6 @@ export * from './gridColumnMenuApi';
|
|
|
11
11
|
export * from './gridPreferencesPanelApi';
|
|
12
12
|
export * from './gridPrintExportApi';
|
|
13
13
|
export * from './gridDisableVirtualizationApi';
|
|
14
|
-
export * from './gridClipboardApi';
|
|
15
14
|
export * from './gridCallbackDetails';
|
|
16
15
|
export * from './gridScrollApi';
|
|
17
16
|
export * from './gridVirtualScrollerApi';
|
package/modern/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
|
+
};
|
|
@@ -77,6 +77,11 @@ DataGridRaw.propTypes = {
|
|
|
77
77
|
* Override or extend the styles applied to the component.
|
|
78
78
|
*/
|
|
79
79
|
classes: _propTypes.default.object,
|
|
80
|
+
/**
|
|
81
|
+
* The character used to separate cell values when copying to the clipboard.
|
|
82
|
+
* @default '\t'
|
|
83
|
+
*/
|
|
84
|
+
clipboardCopyCellDelimiter: _propTypes.default.string,
|
|
80
85
|
/**
|
|
81
86
|
* Number of extra columns to be rendered before/after the visible slice.
|
|
82
87
|
* @default 3
|
|
@@ -335,6 +340,11 @@ DataGridRaw.propTypes = {
|
|
|
335
340
|
* @param {GridCallbackDetails} details Additional details for this callback.
|
|
336
341
|
*/
|
|
337
342
|
onCellModesModelChange: _propTypes.default.func,
|
|
343
|
+
/**
|
|
344
|
+
* Callback called when the data is copied to the clipboard.
|
|
345
|
+
* @param {string} data The data copied to the clipboard.
|
|
346
|
+
*/
|
|
347
|
+
onClipboardCopy: _propTypes.default.func,
|
|
338
348
|
/**
|
|
339
349
|
* Callback fired when a click event comes from a column header element.
|
|
340
350
|
* @param {GridColumnHeaderParams} params With all properties from [[GridColumnHeaderParams]].
|
|
@@ -620,5 +630,14 @@ DataGridRaw.propTypes = {
|
|
|
620
630
|
/**
|
|
621
631
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
622
632
|
*/
|
|
623
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
633
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
634
|
+
/**
|
|
635
|
+
* If `true`, the grid will not use `valueFormatter` when exporting to CSV or copying to clipboard.
|
|
636
|
+
* If an object is provided, you can choose to ignore the `valueFormatter` for CSV export or clipboard export.
|
|
637
|
+
* @default: false
|
|
638
|
+
*/
|
|
639
|
+
unstable_ignoreValueFormatterDuringExport: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
640
|
+
clipboardExport: _propTypes.default.bool,
|
|
641
|
+
csvExport: _propTypes.default.bool
|
|
642
|
+
}), _propTypes.default.bool])
|
|
624
643
|
};
|
|
@@ -73,9 +73,9 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
73
73
|
(0, _useGridRowsMeta.useGridRowsMeta)(privateApiRef, props);
|
|
74
74
|
(0, _useGridScroll.useGridScroll)(privateApiRef, props);
|
|
75
75
|
(0, _useGridColumnMenu.useGridColumnMenu)(privateApiRef);
|
|
76
|
-
(0, _useGridCsvExport.useGridCsvExport)(privateApiRef);
|
|
76
|
+
(0, _useGridCsvExport.useGridCsvExport)(privateApiRef, props);
|
|
77
77
|
(0, _useGridPrintExport.useGridPrintExport)(privateApiRef, props);
|
|
78
|
-
(0, _useGridClipboard.useGridClipboard)(privateApiRef);
|
|
78
|
+
(0, _useGridClipboard.useGridClipboard)(privateApiRef, props);
|
|
79
79
|
(0, _useGridDimensions.useGridDimensions)(privateApiRef, props);
|
|
80
80
|
(0, _useGridEvents.useGridEvents)(privateApiRef, props);
|
|
81
81
|
(0, _useGridStatePersistence.useGridStatePersistence)(privateApiRef);
|
|
@@ -75,7 +75,9 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = {
|
|
|
75
75
|
disableColumnReorder: false,
|
|
76
76
|
disableColumnResize: false,
|
|
77
77
|
keepNonExistentRowsSelected: false,
|
|
78
|
-
keepColumnPositionIfDraggedOutside: false
|
|
78
|
+
keepColumnPositionIfDraggedOutside: false,
|
|
79
|
+
unstable_ignoreValueFormatterDuringExport: false,
|
|
80
|
+
clipboardCopyCellDelimiter: '\t'
|
|
79
81
|
};
|
|
80
82
|
exports.DATA_GRID_PROPS_DEFAULT_VALUES = DATA_GRID_PROPS_DEFAULT_VALUES;
|
|
81
83
|
const defaultSlots = (0, _utils.uncapitalizeObjectKeys)(_defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS);
|
|
@@ -17,6 +17,22 @@ function gridBooleanFormatter({
|
|
|
17
17
|
}) {
|
|
18
18
|
return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');
|
|
19
19
|
}
|
|
20
|
+
const stringToBoolean = value => {
|
|
21
|
+
switch (value.toLowerCase().trim()) {
|
|
22
|
+
case 'true':
|
|
23
|
+
case 'yes':
|
|
24
|
+
case '1':
|
|
25
|
+
return true;
|
|
26
|
+
case 'false':
|
|
27
|
+
case 'no':
|
|
28
|
+
case '0':
|
|
29
|
+
case 'null':
|
|
30
|
+
case 'undefined':
|
|
31
|
+
return false;
|
|
32
|
+
default:
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
20
36
|
const GRID_BOOLEAN_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
|
|
21
37
|
type: 'boolean',
|
|
22
38
|
align: 'center',
|
|
@@ -28,6 +44,8 @@ const GRID_BOOLEAN_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_S
|
|
|
28
44
|
filterOperators: (0, _gridBooleanOperators.getGridBooleanOperators)(),
|
|
29
45
|
getApplyQuickFilterFn: undefined,
|
|
30
46
|
// @ts-ignore
|
|
31
|
-
aggregable: false
|
|
47
|
+
aggregable: false,
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
pastedValueParser: value => stringToBoolean(value)
|
|
32
50
|
});
|
|
33
51
|
exports.GRID_BOOLEAN_COL_DEF = GRID_BOOLEAN_COL_DEF;
|
|
@@ -60,7 +60,9 @@ const GRID_DATE_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRI
|
|
|
60
60
|
valueFormatter: gridDateFormatter,
|
|
61
61
|
filterOperators: (0, _gridDateOperators.getGridDateOperators)(),
|
|
62
62
|
renderEditCell: _GridEditDateCell.renderEditDateCell,
|
|
63
|
-
getApplyQuickFilterFn: undefined
|
|
63
|
+
getApplyQuickFilterFn: undefined,
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
pastedValueParser: value => new Date(value)
|
|
64
66
|
});
|
|
65
67
|
exports.GRID_DATE_COL_DEF = GRID_DATE_COL_DEF;
|
|
66
68
|
const GRID_DATETIME_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
|
|
@@ -69,6 +71,8 @@ const GRID_DATETIME_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_
|
|
|
69
71
|
valueFormatter: gridDateTimeFormatter,
|
|
70
72
|
filterOperators: (0, _gridDateOperators.getGridDateOperators)(true),
|
|
71
73
|
renderEditCell: _GridEditDateCell.renderEditDateCell,
|
|
72
|
-
getApplyQuickFilterFn: undefined
|
|
74
|
+
getApplyQuickFilterFn: undefined,
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
pastedValueParser: value => new Date(value)
|
|
73
77
|
});
|
|
74
78
|
exports.GRID_DATETIME_COL_DEF = GRID_DATETIME_COL_DEF;
|