@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/CHANGELOG.md
CHANGED
|
@@ -3,23 +3,151 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.9.2
|
|
7
|
+
|
|
8
|
+
_Jul 6, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 🚀 Auto-scroll when making range selection (#8661) @m4theushw
|
|
13
|
+
|
|
14
|
+
- 📚 New page: Components lifecycle (#8372) @flaviendelangle
|
|
15
|
+
|
|
16
|
+
Clarify pickers events and value updates in a [single docs page](https://mui.com/x/react-date-pickers/lifecycle/).
|
|
17
|
+
|
|
18
|
+
- 🥧 Add pie chart component
|
|
19
|
+
|
|
20
|
+
They are fresh from the code editor. You can visit [pie charts docs](https://mui.com/x/react-charts/pie/) or their [demo page](https://mui.com/x/react-charts/pie-demo/).
|
|
21
|
+
|
|
22
|
+
<img width="380" alt="pie-charts" src="https://github.com/mui/mui-x/assets/13808724/fe908c45-803c-4316-b913-dbd2f9f0551e">
|
|
23
|
+
|
|
24
|
+
- 🐞 Bugfixes
|
|
25
|
+
|
|
26
|
+
- 📚 Documentation improvements
|
|
27
|
+
|
|
28
|
+
### `@mui/x-data-grid@v6.9.2` / `@mui/x-data-grid-pro@v6.9.2` / `@mui/x-data-grid-premium@v6.9.2`
|
|
29
|
+
|
|
30
|
+
#### Changes
|
|
31
|
+
|
|
32
|
+
- [DataGrid] Fix `RangeError` when using flex columns (#9554) @cherniavskii
|
|
33
|
+
- [DataGrid] Fix React 17 editing bug (#9530) @romgrk
|
|
34
|
+
- [DataGrid] Use `getRowId` in filtering (#9564) @romgrk
|
|
35
|
+
- [DataGrid] Correctly reflect `TablePagination`'s `rowsPerPageOptions` shape to `pageSizeOptions` (#9438) @burakkgunduzz
|
|
36
|
+
- [DataGridPremium] Auto-scroll when making range selection (#8661) @m4theushw
|
|
37
|
+
- [l10n] Improve Spanish (es-ES) locale (#9500) @fufex
|
|
38
|
+
|
|
39
|
+
### `@mui/x-date-pickers@v6.9.2` / `@mui/x-date-pickers-pro@v6.9.2`
|
|
40
|
+
|
|
41
|
+
#### Changes
|
|
42
|
+
|
|
43
|
+
- [pickers] Forward digital clock classes (#9555) @YoonjiJang
|
|
44
|
+
- [pickers] Rename `internal` folder to `internals` on `@mui/x-date-picker-pro` (#9571) @flaviendelangle
|
|
45
|
+
|
|
46
|
+
### `@mui/x-charts@6.0.0-alpha.2`
|
|
47
|
+
|
|
48
|
+
#### Changes
|
|
49
|
+
|
|
50
|
+
- [charts] Add pie chart component (#9395) @alexfauquette
|
|
51
|
+
|
|
52
|
+
### Docs
|
|
53
|
+
|
|
54
|
+
- [docs] Add pickers playground (#9164) @LukasTy
|
|
55
|
+
- [docs] Fix API links for pickers (#9573) @alexfauquette
|
|
56
|
+
- [docs] Fix demos with `ToggleButtonGroup` (#9548) @flaviendelangle
|
|
57
|
+
- [docs] Fix typos in pagination documentation page (#9332) @RatherBeLunar
|
|
58
|
+
- [docs] Hide ads on paid content @oliviertassinari
|
|
59
|
+
- [docs] Move the charts in the sidebar (#9437) @flaviendelangle
|
|
60
|
+
- [docs] New page: Components lifecycle (#8372) @flaviendelangle
|
|
61
|
+
- [docs] Remove outdated header tag @oliviertassinari
|
|
62
|
+
|
|
63
|
+
### Core
|
|
64
|
+
|
|
65
|
+
- [core] Fix typo in priority support @oliviertassinari
|
|
66
|
+
- [core] Remove mention of Crowdin @oliviertassinari
|
|
67
|
+
|
|
68
|
+
## 6.9.1
|
|
69
|
+
|
|
70
|
+
_Jun 30, 2023_
|
|
71
|
+
|
|
72
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
73
|
+
|
|
74
|
+
- 🔎 Add experimental API for faster filtering performance
|
|
75
|
+
- 🌍 Add Chinese (Hong Kong) (zh-HK) locale on the pickers
|
|
76
|
+
- 🌍 Improve Romanian (ro-RO) and Hungarian (hu-HU) translations on the pickers and the data grid
|
|
77
|
+
- 🐞 Bugfixes
|
|
78
|
+
- 📚 Documentation improvements
|
|
79
|
+
|
|
80
|
+
### `@mui/x-data-grid@v6.9.1` / `@mui/x-data-grid-pro@v6.9.1` / `@mui/x-data-grid-premium@v6.9.1`
|
|
81
|
+
|
|
82
|
+
#### Changes
|
|
83
|
+
|
|
84
|
+
- [DataGrid] Add Joy UI `tooltip` and `loadingOverlay` slots (#9028) @cherniavskii
|
|
85
|
+
- [DataGrid] Add section about enabling pagination on Pro and Premium (#8759) @joserodolfofreitas
|
|
86
|
+
- [DataGrid] Don't forward `editCellState` prop to DOM element (#9501) @m4theushw
|
|
87
|
+
- [DataGrid] Add experimental API for faster filtering performance (#9254) @romgrk
|
|
88
|
+
- [DataGrid] Fix `nextFieldToFocus` to always be a visible column field when <kbd>Tab</kbd> key is pressed (#8314) @yaredtsy
|
|
89
|
+
- [DataGrid] Fix `Maximum call stack size exceeded` error when using fractional width (#9516) @cherniavskii
|
|
90
|
+
- [DataGridPro] Don't throw error in column pinning (#9507) @romgrk
|
|
91
|
+
- [DataGridPro] Fix bug with `checkboxSelection` and treeData/grouping (#9418) @romgrk
|
|
92
|
+
- [l10n] Improve Romanian (ro-RO) and Hungarian (hu-HU) translations (#9436) @noraleonte
|
|
93
|
+
|
|
94
|
+
### `@mui/x-date-pickers@v6.9.1` / `@mui/x-date-pickers-pro@v6.9.1`
|
|
95
|
+
|
|
96
|
+
#### Changes
|
|
97
|
+
|
|
98
|
+
- [DateTimePicker] Scroll to Digital Clock section only when selection changes (#9434) @LukasTy
|
|
99
|
+
- [pickers] Handle `keyDown` only when input is focused (#9481) @LukasTy
|
|
100
|
+
- [pickers] Add `referenceDate` prop on `TimeClock`, `DigitalClock` and `MultiSectionDigitalClock` (#9356) @flaviendelangle
|
|
101
|
+
- [l10n] Add Chinese (Hong Kong) (zh-HK) locale (#9468) @samchiu90
|
|
102
|
+
- [l10n] Improve Romanian (ro-RO) translations (#9436) @noraleonte
|
|
103
|
+
|
|
104
|
+
### `@mui/x-charts@6.0.0-alpha.1`
|
|
105
|
+
|
|
106
|
+
#### Changes
|
|
107
|
+
|
|
108
|
+
- [charts] Take responsive container from data grid (#9497) @alexfauquette
|
|
109
|
+
- [charts] Update README.md (#9426) @alexfauquette
|
|
110
|
+
- [charts] Fix typo and small refactor (#9526) @flaviendelangle
|
|
111
|
+
|
|
112
|
+
### Docs
|
|
113
|
+
|
|
114
|
+
- [docs] Add a recipe limiting to one expanded detail panel at a time (#9488) @cherniavskii
|
|
115
|
+
- [docs] Add missing upcoming flag without issue (#9449) @oliviertassinari
|
|
116
|
+
- [docs] Fix 301 when opening the charts @oliviertassinari
|
|
117
|
+
- [docs] Fix 404 link (#9435) @alexfauquette
|
|
118
|
+
- [docs] Fix `productId` logic (#9451) @oliviertassinari
|
|
119
|
+
- [docs] Update charts overview.md (#9429) @brentertz
|
|
120
|
+
- [docs] Avoid systematic usage of `"bg": "inline"` (#9499) @alexfauquette
|
|
121
|
+
- [docs] Display plan icon in ToC (#9490) @cherniavskii
|
|
122
|
+
- [docs] Remove "product" markdown header (#9517) @oliviertassinari
|
|
123
|
+
|
|
124
|
+
### Core
|
|
125
|
+
|
|
126
|
+
- [core] Add `edit-mode` to priority support action (#9483) @DanailH
|
|
127
|
+
- [core] Fix priority support prompt action (#9472) @DanailH
|
|
128
|
+
- [core] Update `uses` for priority support action (#9480) @DanailH
|
|
129
|
+
- [core] Bumb update monorepo (#9476) @alexfauquette
|
|
130
|
+
- [CHANGELOG] Fix media quality (#9439) @oliviertassinari
|
|
131
|
+
- [CHANGELOG] Remove height img attribute @oliviertassinari
|
|
132
|
+
- [test] Skip flaky row pinning tests in JSDOM (#9511) @cherniavskii
|
|
133
|
+
|
|
6
134
|
## 6.9.0
|
|
7
135
|
|
|
8
136
|
_Jun 22, 2023_
|
|
9
137
|
|
|
10
138
|
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
11
139
|
|
|
12
|
-
- 🎁 We
|
|
13
|
-
|
|
140
|
+
- 🎁 We released a new open-source package: `@mui/x-charts`. This package aims at simplifying the integration of charts into your dashboards. 📊
|
|
141
|
+
|
|
142
|
+
<img width="512" alt="charts" src="https://github.com/mui/mui-x/assets/3165635/41201d3c-16a4-442d-a230-68356e6b433d">
|
|
143
|
+
|
|
144
|
+
It already contains [line](https://mui.com/x/react-charts/lines/), [bar](https://mui.com/x/react-charts/bars/), and [scatter](https://mui.com/x/react-charts/scatter/) charts, with basic customization features. Check out the [documentation](https://mui.com/x/react-charts/) to see what it can do, and open issues to get the feature you need implemented.
|
|
14
145
|
|
|
15
|
-
|
|
146
|
+
- 🚀 Introducing UTC and timezone support for pickers.
|
|
16
147
|
|
|
17
|
-
|
|
18
|
-
Please, visit the new [documentation](https://mui.com/x/react-charts/) to know what it does, and open issues to get the feature you need to be implemented.
|
|
148
|
+
<img width="774" src="https://github.com/mui/mui-x/assets/3165635/ad95a404-ee67-4aff-b996-ad6cbb322348">
|
|
19
149
|
|
|
20
|
-
|
|
21
|
-

|
|
22
|
-
Please visit the [documentation](https://mui.com/x/react-date-pickers/timezone/) to learn how to use it.
|
|
150
|
+
Visit the [documentation](https://mui.com/x/react-date-pickers/timezone/) to learn how to use it.
|
|
23
151
|
|
|
24
152
|
- 🌍 Improve Brazilian Portuguese (pt-BR) on the data grid
|
|
25
153
|
- 🌍 Improve Czech (cs-CZ) locale on the pickers
|
package/DataGrid/DataGrid.js
CHANGED
|
@@ -513,7 +513,10 @@ DataGridRaw.propTypes = {
|
|
|
513
513
|
* Select the pageSize dynamically using the component UI.
|
|
514
514
|
* @default [25, 50, 100]
|
|
515
515
|
*/
|
|
516
|
-
pageSizeOptions: PropTypes.arrayOf(PropTypes.number
|
|
516
|
+
pageSizeOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
517
|
+
label: PropTypes.string.isRequired,
|
|
518
|
+
value: PropTypes.number.isRequired
|
|
519
|
+
})]).isRequired),
|
|
517
520
|
pagination: props => {
|
|
518
521
|
if (props.pagination === false) {
|
|
519
522
|
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'));
|
|
@@ -54,7 +54,7 @@ export const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
54
|
useGridRowSelection(privateApiRef, props);
|
|
55
55
|
useGridColumns(privateApiRef, props);
|
|
56
56
|
useGridRows(privateApiRef, props);
|
|
57
|
-
useGridParamsApi(privateApiRef);
|
|
57
|
+
useGridParamsApi(privateApiRef, props);
|
|
58
58
|
useGridColumnSpanning(privateApiRef);
|
|
59
59
|
useGridColumnGrouping(privateApiRef, props);
|
|
60
60
|
useGridEditing(privateApiRef, props);
|
package/README.md
CHANGED
|
@@ -14,5 +14,6 @@ export const GRID_ACTIONS_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
14
14
|
disableColumnMenu: true,
|
|
15
15
|
disableExport: true,
|
|
16
16
|
renderCell: renderActionsCell,
|
|
17
|
-
getApplyQuickFilterFn: undefined
|
|
17
|
+
getApplyQuickFilterFn: undefined,
|
|
18
|
+
getApplyQuickFilterFnV7: undefined
|
|
18
19
|
});
|
|
@@ -36,6 +36,7 @@ export const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
36
36
|
valueFormatter: gridBooleanFormatter,
|
|
37
37
|
filterOperators: getGridBooleanOperators(),
|
|
38
38
|
getApplyQuickFilterFn: undefined,
|
|
39
|
+
getApplyQuickFilterFnV7: undefined,
|
|
39
40
|
// @ts-ignore
|
|
40
41
|
aggregable: false,
|
|
41
42
|
// @ts-ignore
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { GridFilterInputBoolean } from '../components/panel/filterPanel/GridFilterInputBoolean';
|
|
2
|
-
|
|
2
|
+
import { convertLegacyOperators } from './utils';
|
|
3
|
+
export const getGridBooleanOperators = () => convertLegacyOperators([{
|
|
3
4
|
value: 'is',
|
|
4
|
-
|
|
5
|
+
getApplyFilterFnV7: filterItem => {
|
|
5
6
|
if (!filterItem.value) {
|
|
6
7
|
return null;
|
|
7
8
|
}
|
|
8
9
|
const valueAsBoolean = filterItem.value === 'true';
|
|
9
|
-
return
|
|
10
|
-
value
|
|
11
|
-
}) => {
|
|
10
|
+
return value => {
|
|
12
11
|
return Boolean(value) === valueAsBoolean;
|
|
13
12
|
};
|
|
14
13
|
},
|
|
15
14
|
InputComponent: GridFilterInputBoolean
|
|
16
|
-
}];
|
|
15
|
+
}]);
|
|
@@ -19,6 +19,7 @@ export const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF
|
|
|
19
19
|
disableReorder: true,
|
|
20
20
|
disableExport: true,
|
|
21
21
|
getApplyQuickFilterFn: undefined,
|
|
22
|
+
getApplyQuickFilterFnV7: undefined,
|
|
22
23
|
valueGetter: params => {
|
|
23
24
|
const selectionLookup = selectedIdsLookupSelector(params.api.state, params.api.instanceId);
|
|
24
25
|
return selectionLookup[params.id] !== undefined;
|
package/colDef/gridDateColDef.js
CHANGED
|
@@ -52,6 +52,7 @@ export const GRID_DATE_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
52
52
|
filterOperators: getGridDateOperators(),
|
|
53
53
|
renderEditCell: renderEditDateCell,
|
|
54
54
|
getApplyQuickFilterFn: undefined,
|
|
55
|
+
getApplyQuickFilterFnV7: undefined,
|
|
55
56
|
// @ts-ignore
|
|
56
57
|
pastedValueParser: value => new Date(value)
|
|
57
58
|
});
|
|
@@ -62,6 +63,7 @@ export const GRID_DATETIME_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
62
63
|
filterOperators: getGridDateOperators(true),
|
|
63
64
|
renderEditCell: renderEditDateCell,
|
|
64
65
|
getApplyQuickFilterFn: undefined,
|
|
66
|
+
getApplyQuickFilterFnV7: undefined,
|
|
65
67
|
// @ts-ignore
|
|
66
68
|
pastedValueParser: value => new Date(value)
|
|
67
69
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GridFilterInputDate } from '../components/panel/filterPanel/GridFilterInputDate';
|
|
2
|
+
import { convertLegacyOperators } from './utils';
|
|
2
3
|
const dateRegex = /(\d+)-(\d+)-(\d+)/;
|
|
3
4
|
const dateTimeRegex = /(\d+)-(\d+)-(\d+)T(\d+):(\d+)/;
|
|
4
5
|
function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
@@ -7,9 +8,7 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
|
7
8
|
}
|
|
8
9
|
const [year, month, day, hour, minute] = filterItem.value.match(showTime ? dateTimeRegex : dateRegex).slice(1).map(Number);
|
|
9
10
|
const time = new Date(year, month - 1, day, hour || 0, minute || 0).getTime();
|
|
10
|
-
return
|
|
11
|
-
value
|
|
12
|
-
}) => {
|
|
11
|
+
return value => {
|
|
13
12
|
if (!value) {
|
|
14
13
|
return false;
|
|
15
14
|
}
|
|
@@ -23,9 +22,9 @@ function buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {
|
|
|
23
22
|
return compareFn(timeToCompare, time);
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
|
-
export const getGridDateOperators = showTime => [{
|
|
25
|
+
export const getGridDateOperators = showTime => convertLegacyOperators([{
|
|
27
26
|
value: 'is',
|
|
28
|
-
|
|
27
|
+
getApplyFilterFnV7: filterItem => {
|
|
29
28
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 === value2, showTime);
|
|
30
29
|
},
|
|
31
30
|
InputComponent: GridFilterInputDate,
|
|
@@ -34,7 +33,7 @@ export const getGridDateOperators = showTime => [{
|
|
|
34
33
|
}
|
|
35
34
|
}, {
|
|
36
35
|
value: 'not',
|
|
37
|
-
|
|
36
|
+
getApplyFilterFnV7: filterItem => {
|
|
38
37
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 !== value2, showTime);
|
|
39
38
|
},
|
|
40
39
|
InputComponent: GridFilterInputDate,
|
|
@@ -43,7 +42,7 @@ export const getGridDateOperators = showTime => [{
|
|
|
43
42
|
}
|
|
44
43
|
}, {
|
|
45
44
|
value: 'after',
|
|
46
|
-
|
|
45
|
+
getApplyFilterFnV7: filterItem => {
|
|
47
46
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 > value2, showTime);
|
|
48
47
|
},
|
|
49
48
|
InputComponent: GridFilterInputDate,
|
|
@@ -52,7 +51,7 @@ export const getGridDateOperators = showTime => [{
|
|
|
52
51
|
}
|
|
53
52
|
}, {
|
|
54
53
|
value: 'onOrAfter',
|
|
55
|
-
|
|
54
|
+
getApplyFilterFnV7: filterItem => {
|
|
56
55
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 >= value2, showTime);
|
|
57
56
|
},
|
|
58
57
|
InputComponent: GridFilterInputDate,
|
|
@@ -61,7 +60,7 @@ export const getGridDateOperators = showTime => [{
|
|
|
61
60
|
}
|
|
62
61
|
}, {
|
|
63
62
|
value: 'before',
|
|
64
|
-
|
|
63
|
+
getApplyFilterFnV7: filterItem => {
|
|
65
64
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 < value2, showTime, !showTime);
|
|
66
65
|
},
|
|
67
66
|
InputComponent: GridFilterInputDate,
|
|
@@ -70,7 +69,7 @@ export const getGridDateOperators = showTime => [{
|
|
|
70
69
|
}
|
|
71
70
|
}, {
|
|
72
71
|
value: 'onOrBefore',
|
|
73
|
-
|
|
72
|
+
getApplyFilterFnV7: filterItem => {
|
|
74
73
|
return buildApplyFilterFn(filterItem, (value1, value2) => value1 <= value2, showTime);
|
|
75
74
|
},
|
|
76
75
|
InputComponent: GridFilterInputDate,
|
|
@@ -79,22 +78,18 @@ export const getGridDateOperators = showTime => [{
|
|
|
79
78
|
}
|
|
80
79
|
}, {
|
|
81
80
|
value: 'isEmpty',
|
|
82
|
-
|
|
83
|
-
return
|
|
84
|
-
value
|
|
85
|
-
}) => {
|
|
81
|
+
getApplyFilterFnV7: () => {
|
|
82
|
+
return value => {
|
|
86
83
|
return value == null;
|
|
87
84
|
};
|
|
88
85
|
},
|
|
89
86
|
requiresFilterValue: false
|
|
90
87
|
}, {
|
|
91
88
|
value: 'isNotEmpty',
|
|
92
|
-
|
|
93
|
-
return
|
|
94
|
-
value
|
|
95
|
-
}) => {
|
|
89
|
+
getApplyFilterFnV7: () => {
|
|
90
|
+
return value => {
|
|
96
91
|
return value != null;
|
|
97
92
|
};
|
|
98
93
|
},
|
|
99
94
|
requiresFilterValue: false
|
|
100
|
-
}];
|
|
95
|
+
}]);
|
|
@@ -3,6 +3,7 @@ import { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils
|
|
|
3
3
|
import { isNumber } from '../utils/utils';
|
|
4
4
|
import { getGridNumericOperators, getGridNumericQuickFilterFn } from './gridNumericOperators';
|
|
5
5
|
import { GRID_STRING_COL_DEF } from './gridStringColDef';
|
|
6
|
+
import { convertQuickFilterV7ToLegacy } from './utils';
|
|
6
7
|
export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
7
8
|
type: 'number',
|
|
8
9
|
align: 'right',
|
|
@@ -13,5 +14,6 @@ export const GRID_NUMERIC_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {
|
|
|
13
14
|
value
|
|
14
15
|
}) => isNumber(value) ? value.toLocaleString() : value || '',
|
|
15
16
|
filterOperators: getGridNumericOperators(),
|
|
16
|
-
getApplyQuickFilterFn: getGridNumericQuickFilterFn
|
|
17
|
+
getApplyQuickFilterFn: convertQuickFilterV7ToLegacy(getGridNumericQuickFilterFn),
|
|
18
|
+
getApplyQuickFilterFnV7: getGridNumericQuickFilterFn
|
|
17
19
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getGridNumericQuickFilterFn: (value: any) =>
|
|
2
|
+
import type { GridApplyQuickFilterV7 } from '../models/colDef/gridColDef';
|
|
3
|
+
export declare const getGridNumericQuickFilterFn: (value: any) => GridApplyQuickFilterV7 | null;
|
|
4
4
|
export declare const getGridNumericOperators: () => GridFilterOperator<any, number | string | null, any>[];
|
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';
|
|
2
2
|
import { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';
|
|
3
|
+
import { convertLegacyOperators, tagInternalFilter } from './utils';
|
|
3
4
|
const parseNumericValue = value => {
|
|
4
5
|
if (value == null) {
|
|
5
6
|
return null;
|
|
6
7
|
}
|
|
7
8
|
return Number(value);
|
|
8
9
|
};
|
|
9
|
-
export const getGridNumericQuickFilterFn = value => {
|
|
10
|
+
export const getGridNumericQuickFilterFn = tagInternalFilter(value => {
|
|
10
11
|
if (value == null || Number.isNaN(value) || value === '') {
|
|
11
12
|
return null;
|
|
12
13
|
}
|
|
13
|
-
return
|
|
14
|
-
value: columnValue
|
|
15
|
-
}) => {
|
|
14
|
+
return columnValue => {
|
|
16
15
|
return parseNumericValue(columnValue) === parseNumericValue(value);
|
|
17
16
|
};
|
|
18
|
-
};
|
|
19
|
-
export const getGridNumericOperators = () => [{
|
|
17
|
+
});
|
|
18
|
+
export const getGridNumericOperators = () => convertLegacyOperators([{
|
|
20
19
|
value: '=',
|
|
21
|
-
|
|
20
|
+
getApplyFilterFnV7: filterItem => {
|
|
22
21
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
23
22
|
return null;
|
|
24
23
|
}
|
|
25
|
-
return
|
|
26
|
-
value
|
|
27
|
-
}) => {
|
|
24
|
+
return value => {
|
|
28
25
|
return parseNumericValue(value) === filterItem.value;
|
|
29
26
|
};
|
|
30
27
|
},
|
|
@@ -34,13 +31,11 @@ export const getGridNumericOperators = () => [{
|
|
|
34
31
|
}
|
|
35
32
|
}, {
|
|
36
33
|
value: '!=',
|
|
37
|
-
|
|
34
|
+
getApplyFilterFnV7: filterItem => {
|
|
38
35
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
39
36
|
return null;
|
|
40
37
|
}
|
|
41
|
-
return
|
|
42
|
-
value
|
|
43
|
-
}) => {
|
|
38
|
+
return value => {
|
|
44
39
|
return parseNumericValue(value) !== filterItem.value;
|
|
45
40
|
};
|
|
46
41
|
},
|
|
@@ -50,13 +45,11 @@ export const getGridNumericOperators = () => [{
|
|
|
50
45
|
}
|
|
51
46
|
}, {
|
|
52
47
|
value: '>',
|
|
53
|
-
|
|
48
|
+
getApplyFilterFnV7: filterItem => {
|
|
54
49
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
55
50
|
return null;
|
|
56
51
|
}
|
|
57
|
-
return
|
|
58
|
-
value
|
|
59
|
-
}) => {
|
|
52
|
+
return value => {
|
|
60
53
|
if (value == null) {
|
|
61
54
|
return false;
|
|
62
55
|
}
|
|
@@ -69,13 +62,11 @@ export const getGridNumericOperators = () => [{
|
|
|
69
62
|
}
|
|
70
63
|
}, {
|
|
71
64
|
value: '>=',
|
|
72
|
-
|
|
65
|
+
getApplyFilterFnV7: filterItem => {
|
|
73
66
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
74
67
|
return null;
|
|
75
68
|
}
|
|
76
|
-
return
|
|
77
|
-
value
|
|
78
|
-
}) => {
|
|
69
|
+
return value => {
|
|
79
70
|
if (value == null) {
|
|
80
71
|
return false;
|
|
81
72
|
}
|
|
@@ -88,13 +79,11 @@ export const getGridNumericOperators = () => [{
|
|
|
88
79
|
}
|
|
89
80
|
}, {
|
|
90
81
|
value: '<',
|
|
91
|
-
|
|
82
|
+
getApplyFilterFnV7: filterItem => {
|
|
92
83
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
93
84
|
return null;
|
|
94
85
|
}
|
|
95
|
-
return
|
|
96
|
-
value
|
|
97
|
-
}) => {
|
|
86
|
+
return value => {
|
|
98
87
|
if (value == null) {
|
|
99
88
|
return false;
|
|
100
89
|
}
|
|
@@ -107,13 +96,11 @@ export const getGridNumericOperators = () => [{
|
|
|
107
96
|
}
|
|
108
97
|
}, {
|
|
109
98
|
value: '<=',
|
|
110
|
-
|
|
99
|
+
getApplyFilterFnV7: filterItem => {
|
|
111
100
|
if (filterItem.value == null || Number.isNaN(filterItem.value)) {
|
|
112
101
|
return null;
|
|
113
102
|
}
|
|
114
|
-
return
|
|
115
|
-
value
|
|
116
|
-
}) => {
|
|
103
|
+
return value => {
|
|
117
104
|
if (value == null) {
|
|
118
105
|
return false;
|
|
119
106
|
}
|
|
@@ -126,33 +113,27 @@ export const getGridNumericOperators = () => [{
|
|
|
126
113
|
}
|
|
127
114
|
}, {
|
|
128
115
|
value: 'isEmpty',
|
|
129
|
-
|
|
130
|
-
return
|
|
131
|
-
value
|
|
132
|
-
}) => {
|
|
116
|
+
getApplyFilterFnV7: () => {
|
|
117
|
+
return value => {
|
|
133
118
|
return value == null;
|
|
134
119
|
};
|
|
135
120
|
},
|
|
136
121
|
requiresFilterValue: false
|
|
137
122
|
}, {
|
|
138
123
|
value: 'isNotEmpty',
|
|
139
|
-
|
|
140
|
-
return
|
|
141
|
-
value
|
|
142
|
-
}) => {
|
|
124
|
+
getApplyFilterFnV7: () => {
|
|
125
|
+
return value => {
|
|
143
126
|
return value != null;
|
|
144
127
|
};
|
|
145
128
|
},
|
|
146
129
|
requiresFilterValue: false
|
|
147
130
|
}, {
|
|
148
131
|
value: 'isAnyOf',
|
|
149
|
-
|
|
132
|
+
getApplyFilterFnV7: filterItem => {
|
|
150
133
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
151
134
|
return null;
|
|
152
135
|
}
|
|
153
|
-
return
|
|
154
|
-
value
|
|
155
|
-
}) => {
|
|
136
|
+
return value => {
|
|
156
137
|
return value != null && filterItem.value.includes(Number(value));
|
|
157
138
|
};
|
|
158
139
|
},
|
|
@@ -160,4 +141,4 @@ export const getGridNumericOperators = () => [{
|
|
|
160
141
|
InputComponentProps: {
|
|
161
142
|
type: 'number'
|
|
162
143
|
}
|
|
163
|
-
}];
|
|
144
|
+
}]);
|
|
@@ -1,44 +1,39 @@
|
|
|
1
1
|
import { GridFilterInputSingleSelect } from '../components/panel/filterPanel/GridFilterInputSingleSelect';
|
|
2
2
|
import { GridFilterInputMultipleSingleSelect } from '../components/panel/filterPanel/GridFilterInputMultipleSingleSelect';
|
|
3
3
|
import { isObject } from '../utils/utils';
|
|
4
|
+
import { convertLegacyOperators } from './utils';
|
|
4
5
|
const parseObjectValue = value => {
|
|
5
6
|
if (value == null || !isObject(value)) {
|
|
6
7
|
return value;
|
|
7
8
|
}
|
|
8
9
|
return value.value;
|
|
9
10
|
};
|
|
10
|
-
export const getGridSingleSelectOperators = () => [{
|
|
11
|
+
export const getGridSingleSelectOperators = () => convertLegacyOperators([{
|
|
11
12
|
value: 'is',
|
|
12
|
-
|
|
13
|
+
getApplyFilterFnV7: filterItem => {
|
|
13
14
|
if (filterItem.value == null || filterItem.value === '') {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
|
-
return (
|
|
17
|
-
value
|
|
18
|
-
}) => parseObjectValue(value) === parseObjectValue(filterItem.value);
|
|
17
|
+
return value => parseObjectValue(value) === parseObjectValue(filterItem.value);
|
|
19
18
|
},
|
|
20
19
|
InputComponent: GridFilterInputSingleSelect
|
|
21
20
|
}, {
|
|
22
21
|
value: 'not',
|
|
23
|
-
|
|
22
|
+
getApplyFilterFnV7: filterItem => {
|
|
24
23
|
if (filterItem.value == null || filterItem.value === '') {
|
|
25
24
|
return null;
|
|
26
25
|
}
|
|
27
|
-
return (
|
|
28
|
-
value
|
|
29
|
-
}) => parseObjectValue(value) !== parseObjectValue(filterItem.value);
|
|
26
|
+
return value => parseObjectValue(value) !== parseObjectValue(filterItem.value);
|
|
30
27
|
},
|
|
31
28
|
InputComponent: GridFilterInputSingleSelect
|
|
32
29
|
}, {
|
|
33
30
|
value: 'isAnyOf',
|
|
34
|
-
|
|
31
|
+
getApplyFilterFnV7: filterItem => {
|
|
35
32
|
if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {
|
|
36
33
|
return null;
|
|
37
34
|
}
|
|
38
35
|
const filterItemValues = filterItem.value.map(parseObjectValue);
|
|
39
|
-
return (
|
|
40
|
-
value
|
|
41
|
-
}) => filterItemValues.includes(parseObjectValue(value));
|
|
36
|
+
return value => filterItemValues.includes(parseObjectValue(value));
|
|
42
37
|
},
|
|
43
38
|
InputComponent: GridFilterInputMultipleSingleSelect
|
|
44
|
-
}];
|
|
39
|
+
}]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { renderEditInputCell } from '../components/cell/GridEditInputCell';
|
|
2
2
|
import { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';
|
|
3
3
|
import { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';
|
|
4
|
+
import { convertQuickFilterV7ToLegacy } from './utils';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* TODO: Move pro and premium properties outside of this Community file
|
|
@@ -23,5 +24,6 @@ export const GRID_STRING_COL_DEF = {
|
|
|
23
24
|
align: 'left',
|
|
24
25
|
filterOperators: getGridStringOperators(),
|
|
25
26
|
renderEditCell: renderEditInputCell,
|
|
26
|
-
getApplyQuickFilterFn: getGridStringQuickFilterFn
|
|
27
|
+
getApplyQuickFilterFn: convertQuickFilterV7ToLegacy(getGridStringQuickFilterFn),
|
|
28
|
+
getApplyQuickFilterFnV7: getGridStringQuickFilterFn
|
|
27
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import type { GridApplyQuickFilterV7 } from '../models/colDef/gridColDef';
|
|
1
2
|
import { GridFilterOperator } from '../models/gridFilterOperator';
|
|
2
|
-
|
|
3
|
-
export declare const getGridStringQuickFilterFn: (value: any) => (({ formattedValue: columnValue }: GridCellParams) => boolean) | null;
|
|
3
|
+
export declare const getGridStringQuickFilterFn: (value: any) => GridApplyQuickFilterV7 | null;
|
|
4
4
|
export declare const getGridStringOperators: (disableTrim?: boolean) => GridFilterOperator<any, number | string | null, any>[];
|