@mui/x-data-grid 6.9.0 → 6.9.2
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 +136 -8
- package/DataGrid/DataGrid.js +4 -1
- package/DataGrid/useDataGridComponent.js +1 -1
- package/README.md +1 -1
- package/colDef/gridActionsColDef.js +2 -1
- package/colDef/gridBooleanColDef.js +1 -0
- package/colDef/gridBooleanOperators.js +5 -6
- package/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/colDef/gridDateColDef.js +2 -0
- package/colDef/gridDateOperators.js +14 -19
- package/colDef/gridNumericColDef.js +3 -1
- package/colDef/gridNumericOperators.d.ts +2 -2
- package/colDef/gridNumericOperators.js +24 -43
- package/colDef/gridSingleSelectOperators.js +9 -14
- package/colDef/gridStringColDef.js +3 -1
- package/colDef/gridStringOperators.d.ts +2 -2
- package/colDef/gridStringOperators.js +22 -36
- package/colDef/utils.d.ts +21 -0
- package/colDef/utils.js +51 -0
- package/components/GridPagination.js +16 -3
- package/components/cell/GridCell.js +1 -1
- package/components/cell/GridEditDateCell.js +1 -1
- package/components/cell/GridEditInputCell.js +3 -3
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/hooks/features/editing/useGridEditing.js +2 -1
- package/hooks/features/editing/useGridRowEditing.js +2 -2
- package/hooks/features/filter/gridFilterState.d.ts +6 -5
- package/hooks/features/filter/gridFilterUtils.d.ts +8 -6
- package/hooks/features/filter/gridFilterUtils.js +115 -57
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/filter/useGridFilter.js +34 -25
- package/hooks/features/pagination/gridPaginationSelector.js +10 -5
- package/hooks/features/rows/gridRowsUtils.d.ts +1 -0
- package/hooks/features/rows/gridRowsUtils.js +1 -0
- package/hooks/features/rows/useGridParamsApi.d.ts +2 -1
- package/hooks/features/rows/useGridParamsApi.js +31 -1
- package/hooks/features/rows/useGridRows.js +4 -3
- package/index.js +1 -1
- package/internals/index.d.ts +2 -1
- package/internals/index.js +1 -0
- package/joy/joySlots.js +29 -8
- package/legacy/DataGrid/DataGrid.js +4 -1
- package/legacy/DataGrid/useDataGridComponent.js +1 -1
- package/legacy/colDef/gridActionsColDef.js +2 -1
- package/legacy/colDef/gridBooleanColDef.js +1 -0
- package/legacy/colDef/gridBooleanOperators.js +5 -5
- package/legacy/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/legacy/colDef/gridDateColDef.js +2 -0
- package/legacy/colDef/gridDateOperators.js +14 -16
- package/legacy/colDef/gridNumericColDef.js +3 -1
- package/legacy/colDef/gridNumericOperators.js +24 -33
- package/legacy/colDef/gridSingleSelectOperators.js +9 -11
- package/legacy/colDef/gridStringColDef.js +3 -1
- package/legacy/colDef/gridStringOperators.js +22 -28
- package/legacy/colDef/utils.js +51 -0
- package/legacy/components/GridPagination.js +16 -3
- package/legacy/components/cell/GridCell.js +2 -1
- package/legacy/components/cell/GridEditDateCell.js +1 -1
- package/legacy/components/cell/GridEditInputCell.js +3 -3
- package/legacy/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/legacy/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/legacy/hooks/features/editing/useGridEditing.js +2 -1
- package/legacy/hooks/features/editing/useGridRowEditing.js +2 -2
- package/legacy/hooks/features/filter/gridFilterUtils.js +115 -65
- package/legacy/hooks/features/filter/useGridFilter.js +32 -24
- package/legacy/hooks/features/pagination/gridPaginationSelector.js +10 -5
- package/legacy/hooks/features/rows/gridRowsUtils.js +1 -0
- package/legacy/hooks/features/rows/useGridParamsApi.js +29 -1
- package/legacy/hooks/features/rows/useGridRows.js +15 -16
- package/legacy/index.js +1 -1
- package/legacy/internals/index.js +1 -0
- package/legacy/joy/joySlots.js +29 -8
- package/legacy/locales/esES.js +3 -3
- package/legacy/locales/huHU.js +23 -25
- package/legacy/locales/roRO.js +34 -38
- package/locales/esES.js +3 -3
- package/locales/huHU.js +23 -25
- package/locales/roRO.js +34 -38
- package/models/api/gridEditingApi.d.ts +1 -1
- package/models/api/gridParamsApi.d.ts +22 -1
- package/models/colDef/gridColDef.d.ts +13 -1
- package/models/gridFilterOperator.d.ts +17 -2
- package/models/gridRows.d.ts +1 -1
- package/models/props/DataGridProps.d.ts +4 -1
- package/modern/DataGrid/DataGrid.js +4 -1
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/colDef/gridActionsColDef.js +2 -1
- package/modern/colDef/gridBooleanColDef.js +1 -0
- package/modern/colDef/gridBooleanOperators.js +5 -6
- package/modern/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/modern/colDef/gridDateColDef.js +2 -0
- package/modern/colDef/gridDateOperators.js +14 -19
- package/modern/colDef/gridNumericColDef.js +3 -1
- package/modern/colDef/gridNumericOperators.js +24 -43
- package/modern/colDef/gridSingleSelectOperators.js +9 -14
- package/modern/colDef/gridStringColDef.js +3 -1
- package/modern/colDef/gridStringOperators.js +22 -36
- package/modern/colDef/utils.js +51 -0
- package/modern/components/GridPagination.js +16 -2
- package/modern/components/cell/GridCell.js +1 -1
- package/modern/components/cell/GridEditDateCell.js +1 -1
- package/modern/components/cell/GridEditInputCell.js +3 -3
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/modern/hooks/features/editing/useGridEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -2
- package/modern/hooks/features/filter/gridFilterUtils.js +110 -54
- package/modern/hooks/features/filter/useGridFilter.js +34 -25
- package/modern/hooks/features/pagination/gridPaginationSelector.js +9 -5
- package/modern/hooks/features/rows/gridRowsUtils.js +1 -0
- package/modern/hooks/features/rows/useGridParamsApi.js +29 -1
- package/modern/hooks/features/rows/useGridRows.js +4 -3
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -0
- package/modern/joy/joySlots.js +29 -7
- package/modern/locales/esES.js +3 -3
- package/modern/locales/huHU.js +23 -25
- package/modern/locales/roRO.js +34 -38
- package/node/DataGrid/DataGrid.js +4 -1
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/colDef/gridActionsColDef.js +2 -1
- package/node/colDef/gridBooleanColDef.js +1 -0
- package/node/colDef/gridBooleanOperators.js +5 -6
- package/node/colDef/gridCheckboxSelectionColDef.js +1 -0
- package/node/colDef/gridDateColDef.js +2 -0
- package/node/colDef/gridDateOperators.js +14 -19
- package/node/colDef/gridNumericColDef.js +3 -1
- package/node/colDef/gridNumericOperators.js +24 -43
- package/node/colDef/gridSingleSelectOperators.js +9 -14
- package/node/colDef/gridStringColDef.js +3 -1
- package/node/colDef/gridStringOperators.js +22 -36
- package/node/colDef/utils.js +64 -0
- package/node/components/GridPagination.js +16 -2
- package/node/components/cell/GridCell.js +1 -1
- package/node/components/cell/GridEditDateCell.js +1 -1
- package/node/components/cell/GridEditInputCell.js +3 -3
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +2 -2
- package/node/hooks/features/editing/useGridEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/filter/gridFilterUtils.js +110 -54
- package/node/hooks/features/filter/useGridFilter.js +33 -24
- package/node/hooks/features/pagination/gridPaginationSelector.js +9 -5
- package/node/hooks/features/rows/gridRowsUtils.js +3 -1
- package/node/hooks/features/rows/useGridParamsApi.js +29 -1
- package/node/hooks/features/rows/useGridRows.js +3 -2
- package/node/index.js +1 -1
- package/node/internals/index.js +13 -1
- package/node/joy/joySlots.js +29 -7
- package/node/locales/esES.js +3 -3
- package/node/locales/huHU.js +23 -25
- package/node/locales/roRO.js +34 -38
- package/package.json +2 -2
package/modern/locales/huHU.js
CHANGED
|
@@ -60,34 +60,32 @@ const huHUGrid = {
|
|
|
60
60
|
filterOperatorIsEmpty: 'üres',
|
|
61
61
|
filterOperatorIsNotEmpty: 'nem üres',
|
|
62
62
|
filterOperatorIsAnyOf: 'a következők egyike:',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
headerFilterOperatorContains: 'Tartalmazza:',
|
|
71
|
+
headerFilterOperatorEquals: 'Egyenlő ezzel:',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Ezzel kezdődik:',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Ezzel végződik:',
|
|
75
74
|
// headerFilterOperatorIs: 'Is',
|
|
76
75
|
// headerFilterOperatorNot: 'Is not',
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
headerFilterOperatorAfter: 'Ezutáni:',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'Ekkozori vagy ezutáni:',
|
|
78
|
+
headerFilterOperatorBefore: 'Ezelőtti:',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'Ekkori vagy ezelőtti:',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Üres',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Nem üres',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'A következők egyike:',
|
|
83
|
+
'headerFilterOperator=': 'Egyenlő',
|
|
84
|
+
'headerFilterOperator!=': 'Nem egyenlő',
|
|
85
|
+
'headerFilterOperator>': 'Nagyobb mint',
|
|
86
|
+
'headerFilterOperator>=': 'Nagyobb vagy egyenlő',
|
|
87
|
+
'headerFilterOperator<': 'Kissebb mint',
|
|
88
|
+
'headerFilterOperator<=': 'Kissebb vagy enygenlő',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'bármilyen',
|
|
93
91
|
filterValueTrue: 'igaz',
|
package/modern/locales/roRO.js
CHANGED
|
@@ -37,7 +37,7 @@ const roROGrid = {
|
|
|
37
37
|
columnsPanelHideAllButton: 'Ascunde tot',
|
|
38
38
|
// Filter panel text
|
|
39
39
|
filterPanelAddFilter: 'Adăugare filtru',
|
|
40
|
-
|
|
40
|
+
filterPanelRemoveAll: 'Șterge tot',
|
|
41
41
|
filterPanelDeleteIconLabel: 'Ștergere',
|
|
42
42
|
filterPanelLogicOperator: 'Operatori logici',
|
|
43
43
|
filterPanelOperator: 'Operatori',
|
|
@@ -60,34 +60,32 @@ const roROGrid = {
|
|
|
60
60
|
filterOperatorIsEmpty: 'este gol',
|
|
61
61
|
filterOperatorIsNotEmpty: 'nu este gol',
|
|
62
62
|
filterOperatorIsAnyOf: 'este una din valori',
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
'filterOperator=': '=',
|
|
64
|
+
'filterOperator!=': '!=',
|
|
65
|
+
'filterOperator>': '>',
|
|
66
|
+
'filterOperator>=': '>=',
|
|
67
|
+
'filterOperator<': '<',
|
|
68
|
+
'filterOperator<=': '<=',
|
|
70
69
|
// Header filter operators text
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
70
|
+
headerFilterOperatorContains: 'Conține',
|
|
71
|
+
headerFilterOperatorEquals: 'Egal cu',
|
|
72
|
+
headerFilterOperatorStartsWith: 'Începe cu',
|
|
73
|
+
headerFilterOperatorEndsWith: 'Se termină cu',
|
|
74
|
+
headerFilterOperatorIs: 'Este',
|
|
75
|
+
headerFilterOperatorNot: 'Nu este',
|
|
76
|
+
headerFilterOperatorAfter: 'Este după',
|
|
77
|
+
headerFilterOperatorOnOrAfter: 'Este la sau „după”',
|
|
78
|
+
headerFilterOperatorBefore: 'Este înainte de',
|
|
79
|
+
headerFilterOperatorOnOrBefore: 'este la sau înainte de',
|
|
80
|
+
headerFilterOperatorIsEmpty: 'Este gol',
|
|
81
|
+
headerFilterOperatorIsNotEmpty: 'Nu este gol',
|
|
82
|
+
headerFilterOperatorIsAnyOf: 'Este una din valori',
|
|
83
|
+
'headerFilterOperator=': 'Egal cu',
|
|
84
|
+
'headerFilterOperator!=': 'Nu este egal cu',
|
|
85
|
+
'headerFilterOperator>': 'Mai mare decât',
|
|
86
|
+
'headerFilterOperator>=': 'Mai mare sau egal cu',
|
|
87
|
+
'headerFilterOperator<': 'Mai mic decât',
|
|
88
|
+
'headerFilterOperator<=': 'Mai mic sau egal cu',
|
|
91
89
|
// Filter values text
|
|
92
90
|
filterValueAny: 'Aleatoriu',
|
|
93
91
|
filterValueTrue: 'Da',
|
|
@@ -95,7 +93,7 @@ const roROGrid = {
|
|
|
95
93
|
// Column menu text
|
|
96
94
|
columnMenuLabel: 'Meniu',
|
|
97
95
|
columnMenuShowColumns: 'Afișează toate coloanele',
|
|
98
|
-
|
|
96
|
+
columnMenuManageColumns: 'Gestionează coloane',
|
|
99
97
|
columnMenuFilter: 'Filtru',
|
|
100
98
|
columnMenuHideColumn: 'Ascunde',
|
|
101
99
|
columnMenuUnsort: 'Dezactivare sortare',
|
|
@@ -139,15 +137,13 @@ const roROGrid = {
|
|
|
139
137
|
expandDetailPanel: 'Extindere',
|
|
140
138
|
collapseDetailPanel: 'Restrângere',
|
|
141
139
|
// Row reordering text
|
|
142
|
-
rowReorderingHeaderName: 'Reordonare rânduri'
|
|
143
|
-
|
|
140
|
+
rowReorderingHeaderName: 'Reordonare rânduri',
|
|
144
141
|
// Aggregation
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
aggregationMenuItemHeader: 'Agregare',
|
|
143
|
+
aggregationFunctionLabelSum: 'Sumă',
|
|
144
|
+
aggregationFunctionLabelAvg: 'Medie',
|
|
145
|
+
aggregationFunctionLabelMin: 'Minim',
|
|
146
|
+
aggregationFunctionLabelMax: 'Maxim',
|
|
147
|
+
aggregationFunctionLabelSize: 'Numărul elementelor'
|
|
151
148
|
};
|
|
152
|
-
|
|
153
149
|
export const roRO = getGridLocalization(roROGrid, roROCore);
|
|
@@ -522,7 +522,10 @@ DataGridRaw.propTypes = {
|
|
|
522
522
|
* Select the pageSize dynamically using the component UI.
|
|
523
523
|
* @default [25, 50, 100]
|
|
524
524
|
*/
|
|
525
|
-
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.number
|
|
525
|
+
pageSizeOptions: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
|
|
526
|
+
label: _propTypes.default.string.isRequired,
|
|
527
|
+
value: _propTypes.default.number.isRequired
|
|
528
|
+
})]).isRequired),
|
|
526
529
|
pagination: props => {
|
|
527
530
|
if (props.pagination === false) {
|
|
528
531
|
return new Error(['MUI: `<DataGrid pagination={false} />` is not a valid prop.', 'Infinite scrolling is not available in the MIT version.', '', 'You need to upgrade to DataGridPro or DataGridPremium component to disable the pagination.'].join('\n'));
|
|
@@ -60,7 +60,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
60
60
|
(0, _useGridRowSelection.useGridRowSelection)(privateApiRef, props);
|
|
61
61
|
(0, _useGridColumns.useGridColumns)(privateApiRef, props);
|
|
62
62
|
(0, _useGridRows.useGridRows)(privateApiRef, props);
|
|
63
|
-
(0, _useGridParamsApi.useGridParamsApi)(privateApiRef);
|
|
63
|
+
(0, _useGridParamsApi.useGridParamsApi)(privateApiRef, props);
|
|
64
64
|
(0, _useGridColumnSpanning.useGridColumnSpanning)(privateApiRef);
|
|
65
65
|
(0, _useGridColumnGrouping.useGridColumnGrouping)(privateApiRef, props);
|
|
66
66
|
(0, _useGridEditing.useGridEditing)(privateApiRef, props);
|
|
@@ -22,6 +22,7 @@ const GRID_ACTIONS_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_S
|
|
|
22
22
|
disableColumnMenu: true,
|
|
23
23
|
disableExport: true,
|
|
24
24
|
renderCell: _GridActionsCell.renderActionsCell,
|
|
25
|
-
getApplyQuickFilterFn: undefined
|
|
25
|
+
getApplyQuickFilterFn: undefined,
|
|
26
|
+
getApplyQuickFilterFnV7: undefined
|
|
26
27
|
});
|
|
27
28
|
exports.GRID_ACTIONS_COL_DEF = GRID_ACTIONS_COL_DEF;
|
|
@@ -43,6 +43,7 @@ const GRID_BOOLEAN_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_S
|
|
|
43
43
|
valueFormatter: gridBooleanFormatter,
|
|
44
44
|
filterOperators: (0, _gridBooleanOperators.getGridBooleanOperators)(),
|
|
45
45
|
getApplyQuickFilterFn: undefined,
|
|
46
|
+
getApplyQuickFilterFnV7: undefined,
|
|
46
47
|
// @ts-ignore
|
|
47
48
|
aggregable: false,
|
|
48
49
|
// @ts-ignore
|
|
@@ -5,19 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGridBooleanOperators = void 0;
|
|
7
7
|
var _GridFilterInputBoolean = require("../components/panel/filterPanel/GridFilterInputBoolean");
|
|
8
|
-
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
const getGridBooleanOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
9
10
|
value: 'is',
|
|
10
|
-
|
|
11
|
+
getApplyFilterFnV7: filterItem => {
|
|
11
12
|
if (!filterItem.value) {
|
|
12
13
|
return null;
|
|
13
14
|
}
|
|
14
15
|
const valueAsBoolean = filterItem.value === 'true';
|
|
15
|
-
return
|
|
16
|
-
value
|
|
17
|
-
}) => {
|
|
16
|
+
return value => {
|
|
18
17
|
return Boolean(value) === valueAsBoolean;
|
|
19
18
|
};
|
|
20
19
|
},
|
|
21
20
|
InputComponent: _GridFilterInputBoolean.GridFilterInputBoolean
|
|
22
|
-
}];
|
|
21
|
+
}]);
|
|
23
22
|
exports.getGridBooleanOperators = getGridBooleanOperators;
|
|
@@ -29,6 +29,7 @@ const GRID_CHECKBOX_SELECTION_COL_DEF = (0, _extends2.default)({}, _gridBooleanC
|
|
|
29
29
|
disableReorder: true,
|
|
30
30
|
disableExport: true,
|
|
31
31
|
getApplyQuickFilterFn: undefined,
|
|
32
|
+
getApplyQuickFilterFnV7: undefined,
|
|
32
33
|
valueGetter: params => {
|
|
33
34
|
const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(params.api.state, params.api.instanceId);
|
|
34
35
|
return selectionLookup[params.id] !== undefined;
|
|
@@ -61,6 +61,7 @@ const GRID_DATE_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRI
|
|
|
61
61
|
filterOperators: (0, _gridDateOperators.getGridDateOperators)(),
|
|
62
62
|
renderEditCell: _GridEditDateCell.renderEditDateCell,
|
|
63
63
|
getApplyQuickFilterFn: undefined,
|
|
64
|
+
getApplyQuickFilterFnV7: undefined,
|
|
64
65
|
// @ts-ignore
|
|
65
66
|
pastedValueParser: value => new Date(value)
|
|
66
67
|
});
|
|
@@ -72,6 +73,7 @@ const GRID_DATETIME_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_
|
|
|
72
73
|
filterOperators: (0, _gridDateOperators.getGridDateOperators)(true),
|
|
73
74
|
renderEditCell: _GridEditDateCell.renderEditDateCell,
|
|
74
75
|
getApplyQuickFilterFn: undefined,
|
|
76
|
+
getApplyQuickFilterFnV7: undefined,
|
|
75
77
|
// @ts-ignore
|
|
76
78
|
pastedValueParser: value => new Date(value)
|
|
77
79
|
});
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getGridDateOperators = void 0;
|
|
7
7
|
var _GridFilterInputDate = require("../components/panel/filterPanel/GridFilterInputDate");
|
|
8
|
+
var _utils = require("./utils");
|
|
8
9
|
const dateRegex = /(\d+)-(\d+)-(\d+)/;
|
|
9
10
|
const dateTimeRegex = /(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;
|
|
10
11
|
function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
@@ -13,9 +14,7 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
|
13
14
|
}
|
|
14
15
|
const [year, month, day, hour, minute] = filterItem.value.match(showTime ? dateTimeRegex : dateRegex).slice(1).map(Number);
|
|
15
16
|
const time = new Date(year, month - 1, day, hour || 0, minute || 0).getTime();
|
|
16
|
-
return
|
|
17
|
-
value
|
|
18
|
-
}) => {
|
|
17
|
+
return value => {
|
|
19
18
|
if (!value) {
|
|
20
19
|
return false;
|
|
21
20
|
}
|
|
@@ -29,9 +28,9 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
|
29
28
|
return compareFn(timeToCompare, time);
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
|
-
const getGridDateOperators = showTime => [{
|
|
31
|
+
const getGridDateOperators = showTime => (0, _utils.convertLegacyOperators)([{
|
|
33
32
|
value: 'is',
|
|
34
|
-
|
|
33
|
+
getApplyFilterFnV7: filterItem => {
|
|
35
34
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);
|
|
36
35
|
},
|
|
37
36
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -40,7 +39,7 @@ const getGridDateOperators = showTime => [{
|
|
|
40
39
|
}
|
|
41
40
|
}, {
|
|
42
41
|
value: 'not',
|
|
43
|
-
|
|
42
|
+
getApplyFilterFnV7: filterItem => {
|
|
44
43
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);
|
|
45
44
|
},
|
|
46
45
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -49,7 +48,7 @@ const getGridDateOperators = showTime => [{
|
|
|
49
48
|
}
|
|
50
49
|
}, {
|
|
51
50
|
value: 'after',
|
|
52
|
-
|
|
51
|
+
getApplyFilterFnV7: filterItem => {
|
|
53
52
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime);
|
|
54
53
|
},
|
|
55
54
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -58,7 +57,7 @@ const getGridDateOperators = showTime => [{
|
|
|
58
57
|
}
|
|
59
58
|
}, {
|
|
60
59
|
value: 'onOrAfter',
|
|
61
|
-
|
|
60
|
+
getApplyFilterFnV7: filterItem => {
|
|
62
61
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime);
|
|
63
62
|
},
|
|
64
63
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -67,7 +66,7 @@ const getGridDateOperators = showTime => [{
|
|
|
67
66
|
}
|
|
68
67
|
}, {
|
|
69
68
|
value: 'before',
|
|
70
|
-
|
|
69
|
+
getApplyFilterFnV7: filterItem => {
|
|
71
70
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, !showTime);
|
|
72
71
|
},
|
|
73
72
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -76,7 +75,7 @@ const getGridDateOperators = showTime => [{
|
|
|
76
75
|
}
|
|
77
76
|
}, {
|
|
78
77
|
value: 'onOrBefore',
|
|
79
|
-
|
|
78
|
+
getApplyFilterFnV7: filterItem => {
|
|
80
79
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime);
|
|
81
80
|
},
|
|
82
81
|
InputComponent: _GridFilterInputDate.GridFilterInputDate,
|
|
@@ -85,23 +84,19 @@ const getGridDateOperators = showTime => [{
|
|
|
85
84
|
}
|
|
86
85
|
}, {
|
|
87
86
|
value: 'isEmpty',
|
|
88
|
-
|
|
89
|
-
return
|
|
90
|
-
value
|
|
91
|
-
}) => {
|
|
87
|
+
getApplyFilterFnV7: () => {
|
|
88
|
+
return value => {
|
|
92
89
|
return value == null;
|
|
93
90
|
};
|
|
94
91
|
},
|
|
95
92
|
requiresFilterValue: false
|
|
96
93
|
}, {
|
|
97
94
|
value: 'isNotEmpty',
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
value
|
|
101
|
-
}) => {
|
|
95
|
+
getApplyFilterFnV7: () => {
|
|
96
|
+
return value => {
|
|
102
97
|
return value != null;
|
|
103
98
|
};
|
|
104
99
|
},
|
|
105
100
|
requiresFilterValue: false
|
|
106
|
-
}];
|
|
101
|
+
}]);
|
|
107
102
|
exports.getGridDateOperators = getGridDateOperators;
|
|
@@ -10,6 +10,7 @@ var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
|
10
10
|
var _utils = require("../utils/utils");
|
|
11
11
|
var _gridNumericOperators = require("./gridNumericOperators");
|
|
12
12
|
var _gridStringColDef = require("./gridStringColDef");
|
|
13
|
+
var _utils2 = require("./utils");
|
|
13
14
|
const GRID_NUMERIC_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
|
|
14
15
|
type: 'number',
|
|
15
16
|
align: 'right',
|
|
@@ -20,6 +21,7 @@ const GRID_NUMERIC_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_S
|
|
|
20
21
|
value
|
|
21
22
|
}) => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
|
|
22
23
|
filterOperators: (0, _gridNumericOperators.getGridNumericOperators)(),
|
|
23
|
-
getApplyQuickFilterFn: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
24
|
+
getApplyQuickFilterFn: (0, _utils2.convertQuickFilterV7ToLegacy)(_gridNumericOperators.getGridNumericQuickFilterFn),
|
|
25
|
+
getApplyQuickFilterFnV7: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
24
26
|
});
|
|
25
27
|
exports.GRID_NUMERIC_COL_DEF = GRID_NUMERIC_COL_DEF;
|
|
@@ -6,32 +6,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getGridNumericQuickFilterFn = exports.getGridNumericOperators = void 0;
|
|
7
7
|
var _GridFilterInputValue = require("../components/panel/filterPanel/GridFilterInputValue");
|
|
8
8
|
var _GridFilterInputMultipleValue = require("../components/panel/filterPanel/GridFilterInputMultipleValue");
|
|
9
|
+
var _utils = require("./utils");
|
|
9
10
|
const parseNumericValue = value => {
|
|
10
11
|
if (value == null) {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
14
|
return Number(value);
|
|
14
15
|
};
|
|
15
|
-
const getGridNumericQuickFilterFn = value => {
|
|
16
|
+
const getGridNumericQuickFilterFn = (0, _utils.tagInternalFilter)(value => {
|
|
16
17
|
if (value == null || Number.isNaN(value) || value === '') {
|
|
17
18
|
return null;
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
-
value: columnValue
|
|
21
|
-
}) => {
|
|
20
|
+
return columnValue => {
|
|
22
21
|
return parseNumericValue(columnValue) === parseNumericValue(value);
|
|
23
22
|
};
|
|
24
|
-
};
|
|
23
|
+
});
|
|
25
24
|
exports.getGridNumericQuickFilterFn = getGridNumericQuickFilterFn;
|
|
26
|
-
const getGridNumericOperators = () => [{
|
|
25
|
+
const getGridNumericOperators = () => (0, _utils.convertLegacyOperators)([{
|
|
27
26
|
value: '=',
|
|
28
|
-
|
|
27
|
+
getApplyFilterFnV7: filterItem => {
|
|
29
28
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
32
|
-
return
|
|
33
|
-
value
|
|
34
|
-
}) => {
|
|
31
|
+
return value => {
|
|
35
32
|
return parseNumericValue(value) === filterItem.value;
|
|
36
33
|
};
|
|
37
34
|
},
|
|
@@ -41,13 +38,11 @@ const getGridNumericOperators = () => [{
|
|
|
41
38
|
}
|
|
42
39
|
}, {
|
|
43
40
|
value: '!=',
|
|
44
|
-
|
|
41
|
+
getApplyFilterFnV7: filterItem => {
|
|
45
42
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
46
43
|
return null;
|
|
47
44
|
}
|
|
48
|
-
return
|
|
49
|
-
value
|
|
50
|
-
}) => {
|
|
45
|
+
return value => {
|
|
51
46
|
return parseNumericValue(value) !== filterItem.value;
|
|
52
47
|
};
|
|
53
48
|
},
|
|
@@ -57,13 +52,11 @@ const getGridNumericOperators = () => [{
|
|
|
57
52
|
}
|
|
58
53
|
}, {
|
|
59
54
|
value: '>',
|
|
60
|
-
|
|
55
|
+
getApplyFilterFnV7: filterItem => {
|
|
61
56
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
62
57
|
return null;
|
|
63
58
|
}
|
|
64
|
-
return
|
|
65
|
-
value
|
|
66
|
-
}) => {
|
|
59
|
+
return value => {
|
|
67
60
|
if (value == null) {
|
|
68
61
|
return false;
|
|
69
62
|
}
|
|
@@ -76,13 +69,11 @@ const getGridNumericOperators = () => [{
|
|
|
76
69
|
}
|
|
77
70
|
}, {
|
|
78
71
|
value: '>=',
|
|
79
|
-
|
|
72
|
+
getApplyFilterFnV7: filterItem => {
|
|
80
73
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
81
74
|
return null;
|
|
82
75
|
}
|
|
83
|
-
return
|
|
84
|
-
value
|
|
85
|
-
}) => {
|
|
76
|
+
return value => {
|
|
86
77
|
if (value == null) {
|
|
87
78
|
return false;
|
|
88
79
|
}
|
|
@@ -95,13 +86,11 @@ const getGridNumericOperators = () => [{
|
|
|
95
86
|
}
|
|
96
87
|
}, {
|
|
97
88
|
value: '<',
|
|
98
|
-
|
|
89
|
+
getApplyFilterFnV7: filterItem => {
|
|
99
90
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
100
91
|
return null;
|
|
101
92
|
}
|
|
102
|
-
return
|
|
103
|
-
value
|
|
104
|
-
}) => {
|
|
93
|
+
return value => {
|
|
105
94
|
if (value == null) {
|
|
106
95
|
return false;
|
|
107
96
|
}
|
|
@@ -114,13 +103,11 @@ const getGridNumericOperators = () => [{
|
|
|
114
103
|
}
|
|
115
104
|
}, {
|
|
116
105
|
value: '<=',
|
|
117
|
-
|
|
106
|
+
getApplyFilterFnV7: filterItem => {
|
|
118
107
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
119
108
|
return null;
|
|
120
109
|
}
|
|
121
|
-
return
|
|
122
|
-
value
|
|
123
|
-
}) => {
|
|
110
|
+
return value => {
|
|
124
111
|
if (value == null) {
|
|
125
112
|
return false;
|
|
126
113
|
}
|
|
@@ -133,33 +120,27 @@ const getGridNumericOperators = () => [{
|
|
|
133
120
|
}
|
|
134
121
|
}, {
|
|
135
122
|
value: 'isEmpty',
|
|
136
|
-
|
|
137
|
-
return
|
|
138
|
-
value
|
|
139
|
-
}) => {
|
|
123
|
+
getApplyFilterFnV7: () => {
|
|
124
|
+
return value => {
|
|
140
125
|
return value == null;
|
|
141
126
|
};
|
|
142
127
|
},
|
|
143
128
|
requiresFilterValue: false
|
|
144
129
|
}, {
|
|
145
130
|
value: 'isNotEmpty',
|
|
146
|
-
|
|
147
|
-
return
|
|
148
|
-
value
|
|
149
|
-
}) => {
|
|
131
|
+
getApplyFilterFnV7: () => {
|
|
132
|
+
return value => {
|
|
150
133
|
return value != null;
|
|
151
134
|
};
|
|
152
135
|
},
|
|
153
136
|
requiresFilterValue: false
|
|
154
137
|
}, {
|
|
155
138
|
value: 'isAnyOf',
|
|
156
|
-
|
|
139
|
+
getApplyFilterFnV7: filterItem => {
|
|
157
140
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
158
141
|
return null;
|
|
159
142
|
}
|
|
160
|
-
return
|
|
161
|
-
value
|
|
162
|
-
}) => {
|
|
143
|
+
return value => {
|
|
163
144
|
return value != null && filterItem.value.includes(Number(value));
|
|
164
145
|
};
|
|
165
146
|
},
|
|
@@ -167,5 +148,5 @@ const getGridNumericOperators = () => [{
|
|
|
167
148
|
InputComponentProps: {
|
|
168
149
|
type: 'number'
|
|
169
150
|
}
|
|
170
|
-
}];
|
|
151
|
+
}]);
|
|
171
152
|
exports.getGridNumericOperators = getGridNumericOperators;
|
|
@@ -7,45 +7,40 @@ exports.getGridSingleSelectOperators = void 0;
|
|
|
7
7
|
var _GridFilterInputSingleSelect = require("../components/panel/filterPanel/GridFilterInputSingleSelect");
|
|
8
8
|
var _GridFilterInputMultipleSingleSelect = require("../components/panel/filterPanel/GridFilterInputMultipleSingleSelect");
|
|
9
9
|
var _utils = require("../utils/utils");
|
|
10
|
+
var _utils2 = require("./utils");
|
|
10
11
|
const parseObjectValue = value => {
|
|
11
12
|
if (value == null || !(0, _utils.isObject)(value)) {
|
|
12
13
|
return value;
|
|
13
14
|
}
|
|
14
15
|
return value.value;
|
|
15
16
|
};
|
|
16
|
-
const getGridSingleSelectOperators = () => [{
|
|
17
|
+
const getGridSingleSelectOperators = () => (0, _utils2.convertLegacyOperators)([{
|
|
17
18
|
value: 'is',
|
|
18
|
-
|
|
19
|
+
getApplyFilterFnV7: filterItem => {
|
|
19
20
|
if (filterItem.value == null || filterItem.value === '') {
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
|
-
return (
|
|
23
|
-
value
|
|
24
|
-
}) => parseObjectValue(value) === parseObjectValue(filterItem.value);
|
|
23
|
+
return value => parseObjectValue(value) === parseObjectValue(filterItem.value);
|
|
25
24
|
},
|
|
26
25
|
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
|
|
27
26
|
}, {
|
|
28
27
|
value: 'not',
|
|
29
|
-
|
|
28
|
+
getApplyFilterFnV7: filterItem => {
|
|
30
29
|
if (filterItem.value == null || filterItem.value === '') {
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
33
|
-
return (
|
|
34
|
-
value
|
|
35
|
-
}) => parseObjectValue(value) !== parseObjectValue(filterItem.value);
|
|
32
|
+
return value => parseObjectValue(value) !== parseObjectValue(filterItem.value);
|
|
36
33
|
},
|
|
37
34
|
InputComponent: _GridFilterInputSingleSelect.GridFilterInputSingleSelect
|
|
38
35
|
}, {
|
|
39
36
|
value: 'isAnyOf',
|
|
40
|
-
|
|
37
|
+
getApplyFilterFnV7: filterItem => {
|
|
41
38
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
42
39
|
return null;
|
|
43
40
|
}
|
|
44
41
|
const filterItemValues = filterItem.value.map(parseObjectValue);
|
|
45
|
-
return (
|
|
46
|
-
value
|
|
47
|
-
}) => filterItemValues.includes(parseObjectValue(value));
|
|
42
|
+
return value => filterItemValues.includes(parseObjectValue(value));
|
|
48
43
|
},
|
|
49
44
|
InputComponent: _GridFilterInputMultipleSingleSelect.GridFilterInputMultipleSingleSelect
|
|
50
|
-
}];
|
|
45
|
+
}]);
|
|
51
46
|
exports.getGridSingleSelectOperators = getGridSingleSelectOperators;
|
|
@@ -7,6 +7,7 @@ exports.GRID_STRING_COL_DEF = void 0;
|
|
|
7
7
|
var _GridEditInputCell = require("../components/cell/GridEditInputCell");
|
|
8
8
|
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
9
9
|
var _gridStringOperators = require("./gridStringOperators");
|
|
10
|
+
var _utils = require("./utils");
|
|
10
11
|
/**
|
|
11
12
|
* TODO: Move pro and premium properties outside of this Community file
|
|
12
13
|
*/
|
|
@@ -28,6 +29,7 @@ const GRID_STRING_COL_DEF = {
|
|
|
28
29
|
align: 'left',
|
|
29
30
|
filterOperators: (0, _gridStringOperators.getGridStringOperators)(),
|
|
30
31
|
renderEditCell: _GridEditInputCell.renderEditInputCell,
|
|
31
|
-
getApplyQuickFilterFn: _gridStringOperators.getGridStringQuickFilterFn
|
|
32
|
+
getApplyQuickFilterFn: (0, _utils.convertQuickFilterV7ToLegacy)(_gridStringOperators.getGridStringQuickFilterFn),
|
|
33
|
+
getApplyQuickFilterFnV7: _gridStringOperators.getGridStringQuickFilterFn
|
|
32
34
|
};
|
|
33
35
|
exports.GRID_STRING_COL_DEF = GRID_STRING_COL_DEF;
|