@mui/x-data-grid 7.0.0-alpha.9 → 7.0.0-beta.1
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 +386 -38
- package/DataGrid/useDataGridComponent.js +1 -1
- package/README.md +2 -2
- package/colDef/gridBooleanColDef.js +3 -6
- package/colDef/gridCheckboxSelectionColDef.js +4 -3
- package/colDef/gridDateColDef.d.ts +3 -4
- package/colDef/gridDateColDef.js +10 -16
- package/colDef/gridNumericColDef.js +1 -3
- package/colDef/gridSingleSelectColDef.js +7 -12
- package/components/GridRow.js +1 -100
- package/components/cell/GridEditInputCell.js +1 -1
- package/components/columnsManagement/GridColumnsManagement.d.ts +43 -0
- package/components/columnsManagement/GridColumnsManagement.js +265 -0
- package/components/columnsManagement/index.d.ts +1 -0
- package/components/columnsManagement/index.js +1 -0
- package/components/columnsManagement/utils.d.ts +4 -0
- package/components/columnsManagement/utils.js +16 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/components/panel/GridColumnsPanel.d.ts +0 -28
- package/components/panel/GridColumnsPanel.js +5 -213
- package/constants/defaultGridSlotsComponents.js +2 -1
- package/constants/gridClasses.d.ts +12 -4
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +4 -6
- package/hooks/core/useGridApiInitialization.js +4 -0
- package/hooks/features/columns/useGridColumnSpanning.js +3 -1
- package/hooks/features/editing/useGridCellEditing.js +2 -5
- package/hooks/features/editing/useGridRowEditing.js +2 -5
- package/hooks/features/filter/gridFilterUtils.js +1 -1
- package/hooks/features/rows/gridRowsUtils.js +4 -1
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -2
- package/hooks/features/rows/useGridParamsApi.js +14 -49
- package/index.js +1 -1
- package/legacy/DataGrid/useDataGridComponent.js +1 -1
- package/legacy/colDef/gridBooleanColDef.js +3 -5
- package/legacy/colDef/gridCheckboxSelectionColDef.js +4 -3
- package/legacy/colDef/gridDateColDef.js +10 -14
- package/legacy/colDef/gridNumericColDef.js +1 -2
- package/legacy/colDef/gridSingleSelectColDef.js +7 -10
- package/legacy/components/GridRow.js +1 -100
- package/legacy/components/cell/GridEditInputCell.js +1 -1
- package/legacy/components/columnsManagement/GridColumnsManagement.js +307 -0
- package/legacy/components/columnsManagement/index.js +1 -0
- package/legacy/components/columnsManagement/utils.js +22 -0
- package/legacy/components/index.js +1 -0
- package/legacy/components/panel/GridColumnsPanel.js +5 -233
- package/legacy/constants/defaultGridSlotsComponents.js +2 -1
- package/legacy/constants/gridClasses.js +1 -1
- package/legacy/constants/localeTextConstants.js +4 -6
- package/legacy/hooks/core/useGridApiInitialization.js +4 -0
- package/legacy/hooks/features/columns/useGridColumnSpanning.js +3 -1
- package/legacy/hooks/features/editing/useGridCellEditing.js +2 -5
- package/legacy/hooks/features/editing/useGridRowEditing.js +2 -5
- package/legacy/hooks/features/filter/gridFilterUtils.js +2 -2
- package/legacy/hooks/features/rows/gridRowsUtils.js +4 -1
- package/legacy/hooks/features/rows/useGridParamsApi.js +14 -47
- package/legacy/index.js +1 -1
- package/legacy/locales/arSD.js +5 -6
- package/legacy/locales/beBY.js +5 -6
- package/legacy/locales/bgBG.js +5 -6
- package/legacy/locales/csCZ.js +5 -6
- package/legacy/locales/daDK.js +5 -6
- package/legacy/locales/deDE.js +5 -6
- package/legacy/locales/elGR.js +5 -6
- package/legacy/locales/esES.js +5 -6
- package/legacy/locales/faIR.js +5 -6
- package/legacy/locales/fiFI.js +5 -6
- package/legacy/locales/frFR.js +5 -6
- package/legacy/locales/heIL.js +12 -14
- package/legacy/locales/hrHR.js +5 -6
- package/legacy/locales/huHU.js +5 -6
- package/legacy/locales/itIT.js +5 -6
- package/legacy/locales/jaJP.js +5 -6
- package/legacy/locales/koKR.js +5 -6
- package/legacy/locales/nbNO.js +5 -6
- package/legacy/locales/nlNL.js +5 -6
- package/legacy/locales/plPL.js +5 -6
- package/legacy/locales/ptBR.js +5 -6
- package/legacy/locales/ptPT.js +5 -6
- package/legacy/locales/roRO.js +5 -6
- package/legacy/locales/ruRU.js +5 -6
- package/legacy/locales/skSK.js +5 -6
- package/legacy/locales/svSE.js +5 -6
- package/legacy/locales/trTR.js +5 -6
- package/legacy/locales/ukUA.js +5 -6
- package/legacy/locales/urPK.js +5 -6
- package/legacy/locales/viVN.js +5 -6
- package/legacy/locales/zhCN.js +5 -6
- package/legacy/locales/zhHK.js +5 -6
- package/legacy/locales/zhTW.js +5 -6
- package/locales/arSD.js +5 -6
- package/locales/beBY.js +5 -6
- package/locales/bgBG.js +5 -6
- package/locales/csCZ.js +5 -6
- package/locales/daDK.js +5 -6
- package/locales/deDE.js +5 -6
- package/locales/elGR.js +5 -6
- package/locales/esES.js +5 -6
- package/locales/faIR.js +5 -6
- package/locales/fiFI.js +5 -6
- package/locales/frFR.js +5 -6
- package/locales/heIL.js +12 -14
- package/locales/hrHR.js +5 -6
- package/locales/huHU.js +5 -6
- package/locales/itIT.js +5 -6
- package/locales/jaJP.js +5 -6
- package/locales/koKR.js +5 -6
- package/locales/nbNO.js +5 -6
- package/locales/nlNL.js +5 -6
- package/locales/plPL.js +5 -6
- package/locales/ptBR.js +5 -6
- package/locales/ptPT.js +5 -6
- package/locales/roRO.js +5 -6
- package/locales/ruRU.js +5 -6
- package/locales/skSK.js +5 -6
- package/locales/svSE.js +5 -6
- package/locales/trTR.js +5 -6
- package/locales/ukUA.js +5 -6
- package/locales/urPK.js +5 -6
- package/locales/viVN.js +5 -6
- package/locales/zhCN.js +5 -6
- package/locales/zhHK.js +5 -6
- package/locales/zhTW.js +5 -6
- package/models/api/gridLocaleTextApi.d.ts +3 -5
- package/models/colDef/gridColDef.d.ts +11 -17
- package/models/colDef/gridColType.d.ts +11 -2
- package/models/colDef/index.d.ts +1 -1
- package/models/gridSlotsComponent.d.ts +5 -0
- package/models/gridSlotsComponentsProps.d.ts +4 -0
- package/models/params/gridCellParams.d.ts +0 -26
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/colDef/gridBooleanColDef.js +3 -6
- package/modern/colDef/gridCheckboxSelectionColDef.js +4 -3
- package/modern/colDef/gridDateColDef.js +10 -16
- package/modern/colDef/gridNumericColDef.js +1 -3
- package/modern/colDef/gridSingleSelectColDef.js +7 -12
- package/modern/components/GridRow.js +1 -100
- package/modern/components/cell/GridEditInputCell.js +1 -1
- package/modern/components/columnsManagement/GridColumnsManagement.js +261 -0
- package/modern/components/columnsManagement/index.js +1 -0
- package/modern/components/columnsManagement/utils.js +16 -0
- package/modern/components/index.js +1 -0
- package/modern/components/panel/GridColumnsPanel.js +4 -209
- package/modern/constants/defaultGridSlotsComponents.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +4 -6
- package/modern/hooks/core/useGridApiInitialization.js +3 -0
- package/modern/hooks/features/columns/useGridColumnSpanning.js +3 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +2 -5
- package/modern/hooks/features/editing/useGridRowEditing.js +2 -5
- package/modern/hooks/features/filter/gridFilterUtils.js +1 -1
- package/modern/hooks/features/rows/gridRowsUtils.js +4 -1
- package/modern/hooks/features/rows/useGridParamsApi.js +14 -47
- package/modern/index.js +1 -1
- package/modern/locales/arSD.js +5 -6
- package/modern/locales/beBY.js +5 -6
- package/modern/locales/bgBG.js +5 -6
- package/modern/locales/csCZ.js +5 -6
- package/modern/locales/daDK.js +5 -6
- package/modern/locales/deDE.js +5 -6
- package/modern/locales/elGR.js +5 -6
- package/modern/locales/esES.js +5 -6
- package/modern/locales/faIR.js +5 -6
- package/modern/locales/fiFI.js +5 -6
- package/modern/locales/frFR.js +5 -6
- package/modern/locales/heIL.js +12 -14
- package/modern/locales/hrHR.js +5 -6
- package/modern/locales/huHU.js +5 -6
- package/modern/locales/itIT.js +5 -6
- package/modern/locales/jaJP.js +5 -6
- package/modern/locales/koKR.js +5 -6
- package/modern/locales/nbNO.js +5 -6
- package/modern/locales/nlNL.js +5 -6
- package/modern/locales/plPL.js +5 -6
- package/modern/locales/ptBR.js +5 -6
- package/modern/locales/ptPT.js +5 -6
- package/modern/locales/roRO.js +5 -6
- package/modern/locales/ruRU.js +5 -6
- package/modern/locales/skSK.js +5 -6
- package/modern/locales/svSE.js +5 -6
- package/modern/locales/trTR.js +5 -6
- package/modern/locales/ukUA.js +5 -6
- package/modern/locales/urPK.js +5 -6
- package/modern/locales/viVN.js +5 -6
- package/modern/locales/zhCN.js +5 -6
- package/modern/locales/zhHK.js +5 -6
- package/modern/locales/zhTW.js +5 -6
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/colDef/gridBooleanColDef.js +3 -6
- package/node/colDef/gridCheckboxSelectionColDef.js +4 -3
- package/node/colDef/gridDateColDef.js +13 -19
- package/node/colDef/gridNumericColDef.js +1 -3
- package/node/colDef/gridSingleSelectColDef.js +7 -12
- package/node/components/GridRow.js +1 -100
- package/node/components/cell/GridEditInputCell.js +1 -1
- package/node/components/columnsManagement/GridColumnsManagement.js +269 -0
- package/node/components/columnsManagement/index.js +16 -0
- package/node/components/columnsManagement/utils.js +24 -0
- package/node/components/index.js +11 -0
- package/node/components/panel/GridColumnsPanel.js +4 -208
- package/node/constants/defaultGridSlotsComponents.js +1 -0
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +4 -6
- package/node/hooks/core/useGridApiInitialization.js +3 -0
- package/node/hooks/features/columns/useGridColumnSpanning.js +3 -1
- package/node/hooks/features/editing/useGridCellEditing.js +2 -5
- package/node/hooks/features/editing/useGridRowEditing.js +2 -5
- package/node/hooks/features/filter/gridFilterUtils.js +1 -1
- package/node/hooks/features/rows/gridRowsUtils.js +4 -1
- package/node/hooks/features/rows/useGridParamsApi.js +14 -47
- package/node/index.js +1 -1
- package/node/locales/arSD.js +5 -6
- package/node/locales/beBY.js +5 -6
- package/node/locales/bgBG.js +5 -6
- package/node/locales/csCZ.js +5 -6
- package/node/locales/daDK.js +5 -6
- package/node/locales/deDE.js +5 -6
- package/node/locales/elGR.js +5 -6
- package/node/locales/esES.js +5 -6
- package/node/locales/faIR.js +5 -6
- package/node/locales/fiFI.js +5 -6
- package/node/locales/frFR.js +5 -6
- package/node/locales/heIL.js +12 -14
- package/node/locales/hrHR.js +5 -6
- package/node/locales/huHU.js +5 -6
- package/node/locales/itIT.js +5 -6
- package/node/locales/jaJP.js +5 -6
- package/node/locales/koKR.js +5 -6
- package/node/locales/nbNO.js +5 -6
- package/node/locales/nlNL.js +5 -6
- package/node/locales/plPL.js +5 -6
- package/node/locales/ptBR.js +5 -6
- package/node/locales/ptPT.js +5 -6
- package/node/locales/roRO.js +5 -6
- package/node/locales/ruRU.js +5 -6
- package/node/locales/skSK.js +5 -6
- package/node/locales/svSE.js +5 -6
- package/node/locales/trTR.js +5 -6
- package/node/locales/ukUA.js +5 -6
- package/node/locales/urPK.js +5 -6
- package/node/locales/viVN.js +5 -6
- package/node/locales/zhCN.js +5 -6
- package/node/locales/zhHK.js +5 -6
- package/node/locales/zhTW.js +5 -6
- package/package.json +4 -4
package/modern/locales/skSK.js
CHANGED
|
@@ -37,12 +37,11 @@ const skSKGrid = {
|
|
|
37
37
|
toolbarExportCSV: 'Stiahnuť ako CSV',
|
|
38
38
|
toolbarExportPrint: 'Vytlačiť',
|
|
39
39
|
toolbarExportExcel: 'Stiahnuť ako Excel',
|
|
40
|
-
// Columns
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
columnsPanelHideAllButton: 'Skryť všetko',
|
|
40
|
+
// Columns management text
|
|
41
|
+
// columnsManagementSearchTitle: 'Search',
|
|
42
|
+
// columnsManagementNoColumns: 'No columns',
|
|
43
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
44
|
+
|
|
46
45
|
// Filter panel text
|
|
47
46
|
filterPanelAddFilter: 'Pridať filter',
|
|
48
47
|
filterPanelRemoveAll: 'Odstrániť všetky',
|
package/modern/locales/svSE.js
CHANGED
|
@@ -29,12 +29,11 @@ const svSEGrid = {
|
|
|
29
29
|
toolbarExportCSV: 'Ladda ner som CSV',
|
|
30
30
|
toolbarExportPrint: 'Skriv ut',
|
|
31
31
|
toolbarExportExcel: 'Ladda ner som Excel',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: 'Dölj alla',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Lägg till filter',
|
|
40
39
|
filterPanelRemoveAll: 'Ta bort alla',
|
package/modern/locales/trTR.js
CHANGED
|
@@ -29,12 +29,11 @@ const trTRGrid = {
|
|
|
29
29
|
toolbarExportCSV: 'CSV olarak aktar',
|
|
30
30
|
toolbarExportPrint: 'Yazdır',
|
|
31
31
|
toolbarExportExcel: 'Excel olarak aktar',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: 'Hepsini gizle',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Filtre Ekle',
|
|
40
39
|
filterPanelRemoveAll: 'Hepsini kaldır',
|
package/modern/locales/ukUA.js
CHANGED
|
@@ -43,12 +43,11 @@ const ukUAGrid = {
|
|
|
43
43
|
toolbarExportCSV: 'Завантажити у форматі CSV',
|
|
44
44
|
toolbarExportPrint: 'Друк',
|
|
45
45
|
toolbarExportExcel: 'Завантажити у форматі Excel',
|
|
46
|
-
// Columns
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
columnsPanelHideAllButton: 'Приховати всі',
|
|
46
|
+
// Columns management text
|
|
47
|
+
// columnsManagementSearchTitle: 'Search',
|
|
48
|
+
// columnsManagementNoColumns: 'No columns',
|
|
49
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
50
|
+
|
|
52
51
|
// Filter panel text
|
|
53
52
|
filterPanelAddFilter: 'Додати фільтр',
|
|
54
53
|
filterPanelRemoveAll: 'Видалити всі',
|
package/modern/locales/urPK.js
CHANGED
|
@@ -29,12 +29,11 @@ const urPKGrid = {
|
|
|
29
29
|
toolbarExportCSV: 'CSV کے طور پر ڈاوٴنلوڈ کریں',
|
|
30
30
|
toolbarExportPrint: 'پرنٹ کریں',
|
|
31
31
|
toolbarExportExcel: 'ایکسل کے طور پر ڈاوٴنلوڈ کریں',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: 'سارے چھپائیں',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'نیا فلٹر',
|
|
40
39
|
filterPanelRemoveAll: 'سارے ختم کریں',
|
package/modern/locales/viVN.js
CHANGED
|
@@ -29,12 +29,11 @@ const viVNGrid = {
|
|
|
29
29
|
toolbarExportCSV: 'Xuất CSV',
|
|
30
30
|
toolbarExportPrint: 'In',
|
|
31
31
|
toolbarExportExcel: 'Xuất Excel',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: 'Ẩn tất cả',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'Thêm bộ lọc',
|
|
40
39
|
filterPanelRemoveAll: 'Xóa tất cả',
|
package/modern/locales/zhCN.js
CHANGED
|
@@ -29,12 +29,11 @@ const zhCNGrid = {
|
|
|
29
29
|
toolbarExportCSV: '导出至CSV',
|
|
30
30
|
toolbarExportPrint: '打印',
|
|
31
31
|
toolbarExportExcel: '导出至Excel',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: '隐藏所有',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: '添加筛选器',
|
|
40
39
|
filterPanelRemoveAll: '清除全部',
|
package/modern/locales/zhHK.js
CHANGED
|
@@ -29,12 +29,11 @@ const zhHKGrid = {
|
|
|
29
29
|
toolbarExportCSV: '下載為 CSV',
|
|
30
30
|
toolbarExportPrint: '列印',
|
|
31
31
|
toolbarExportExcel: '下載為 Excel',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: '全部藏起來',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: '新增過濾器',
|
|
40
39
|
filterPanelRemoveAll: '移除所有',
|
package/modern/locales/zhTW.js
CHANGED
|
@@ -29,12 +29,11 @@ const zhTWGrid = {
|
|
|
29
29
|
toolbarExportCSV: '匯出 CSV',
|
|
30
30
|
toolbarExportPrint: '列印',
|
|
31
31
|
toolbarExportExcel: '匯出 Excel',
|
|
32
|
-
// Columns
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
columnsPanelHideAllButton: '隱藏所有',
|
|
32
|
+
// Columns management text
|
|
33
|
+
// columnsManagementSearchTitle: 'Search',
|
|
34
|
+
// columnsManagementNoColumns: 'No columns',
|
|
35
|
+
// columnsManagementShowHideAllText: 'Show/Hide All',
|
|
36
|
+
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: '增加篩選器',
|
|
40
39
|
filterPanelRemoveAll: '清除所有',
|
|
@@ -63,7 +63,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
63
63
|
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
|
|
64
64
|
(0, _useGridColumns.useGridColumns)(apiRef, props);
|
|
65
65
|
(0, _useGridRows.useGridRows)(apiRef, props);
|
|
66
|
-
(0, _useGridParamsApi.useGridParamsApi)(apiRef
|
|
66
|
+
(0, _useGridParamsApi.useGridParamsApi)(apiRef);
|
|
67
67
|
(0, _useGridColumnSpanning.useGridColumnSpanning)(apiRef);
|
|
68
68
|
(0, _useGridColumnGrouping.useGridColumnGrouping)(apiRef, props);
|
|
69
69
|
(0, _useGridEditing.useGridEditing)(apiRef, props);
|
|
@@ -11,12 +11,9 @@ var _GridBooleanCell = require("../components/cell/GridBooleanCell");
|
|
|
11
11
|
var _GridEditBooleanCell = require("../components/cell/GridEditBooleanCell");
|
|
12
12
|
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
13
13
|
var _gridBooleanOperators = require("./gridBooleanOperators");
|
|
14
|
-
|
|
15
|
-
value
|
|
16
|
-
|
|
17
|
-
}) {
|
|
18
|
-
return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');
|
|
19
|
-
}
|
|
14
|
+
const gridBooleanFormatter = (value, row, column, apiRef) => {
|
|
15
|
+
return value ? apiRef.current.getLocaleText('booleanCellTrueLabel') : apiRef.current.getLocaleText('booleanCellFalseLabel');
|
|
16
|
+
};
|
|
20
17
|
const stringToBoolean = value => {
|
|
21
18
|
switch (value.toLowerCase().trim()) {
|
|
22
19
|
case 'true':
|
|
@@ -28,9 +28,10 @@ const GRID_CHECKBOX_SELECTION_COL_DEF = exports.GRID_CHECKBOX_SELECTION_COL_DEF
|
|
|
28
28
|
disableReorder: true,
|
|
29
29
|
disableExport: true,
|
|
30
30
|
getApplyQuickFilterFn: undefined,
|
|
31
|
-
valueGetter:
|
|
32
|
-
const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(
|
|
33
|
-
|
|
31
|
+
valueGetter: (value, row, column, apiRef) => {
|
|
32
|
+
const selectionLookup = (0, _gridRowSelectionSelector.selectedIdsLookupSelector)(apiRef);
|
|
33
|
+
const rowId = apiRef.current.getRowId(row);
|
|
34
|
+
return selectionLookup[rowId] !== undefined;
|
|
34
35
|
},
|
|
35
36
|
renderHeader: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeaderCheckbox.GridHeaderCheckbox, (0, _extends2.default)({}, params)),
|
|
36
37
|
renderCell: params => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridCellCheckboxRenderer.GridCellCheckboxRenderer, (0, _extends2.default)({}, params))
|
|
@@ -4,9 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.GRID_DATE_COL_DEF = exports.GRID_DATETIME_COL_DEF = void 0;
|
|
8
|
-
exports.gridDateFormatter = gridDateFormatter;
|
|
9
|
-
exports.gridDateTimeFormatter = gridDateTimeFormatter;
|
|
7
|
+
exports.gridDateTimeFormatter = exports.gridDateFormatter = exports.GRID_DATE_COL_DEF = exports.GRID_DATETIME_COL_DEF = void 0;
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
9
|
var _gridSortingUtils = require("../hooks/features/sorting/gridSortingUtils");
|
|
12
10
|
var _gridDateOperators = require("./gridDateOperators");
|
|
@@ -22,38 +20,34 @@ function throwIfNotDateObject({
|
|
|
22
20
|
throw new Error([`MUI X: \`${columnType}\` column type only accepts \`Date\` objects as values.`, 'Use `valueGetter` to transform the value into a `Date` object.', `Row ID: ${rowId}, field: "${field}".`].join('\n'));
|
|
23
21
|
}
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
value,
|
|
27
|
-
field,
|
|
28
|
-
id
|
|
29
|
-
}) {
|
|
23
|
+
const gridDateFormatter = (value, row, column, apiRef) => {
|
|
30
24
|
if (!value) {
|
|
31
25
|
return '';
|
|
32
26
|
}
|
|
27
|
+
const rowId = apiRef.current.getRowId(row);
|
|
33
28
|
throwIfNotDateObject({
|
|
34
29
|
value,
|
|
35
30
|
columnType: 'date',
|
|
36
|
-
rowId
|
|
37
|
-
field
|
|
31
|
+
rowId,
|
|
32
|
+
field: column.field
|
|
38
33
|
});
|
|
39
34
|
return value.toLocaleDateString();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
field,
|
|
44
|
-
id
|
|
45
|
-
}) {
|
|
35
|
+
};
|
|
36
|
+
exports.gridDateFormatter = gridDateFormatter;
|
|
37
|
+
const gridDateTimeFormatter = (value, row, column, apiRef) => {
|
|
46
38
|
if (!value) {
|
|
47
39
|
return '';
|
|
48
40
|
}
|
|
41
|
+
const rowId = apiRef.current.getRowId(row);
|
|
49
42
|
throwIfNotDateObject({
|
|
50
43
|
value,
|
|
51
44
|
columnType: 'dateTime',
|
|
52
|
-
rowId
|
|
53
|
-
field
|
|
45
|
+
rowId,
|
|
46
|
+
field: column.field
|
|
54
47
|
});
|
|
55
48
|
return value.toLocaleString();
|
|
56
|
-
}
|
|
49
|
+
};
|
|
50
|
+
exports.gridDateTimeFormatter = gridDateTimeFormatter;
|
|
57
51
|
const GRID_DATE_COL_DEF = exports.GRID_DATE_COL_DEF = (0, _extends2.default)({}, _gridStringColDef.GRID_STRING_COL_DEF, {
|
|
58
52
|
type: 'date',
|
|
59
53
|
sortComparator: _gridSortingUtils.gridDateComparator,
|
|
@@ -16,9 +16,7 @@ const GRID_NUMERIC_COL_DEF = exports.GRID_NUMERIC_COL_DEF = (0, _extends2.defaul
|
|
|
16
16
|
headerAlign: 'right',
|
|
17
17
|
sortComparator: _gridSortingUtils.gridNumberComparator,
|
|
18
18
|
valueParser: value => value === '' ? null : Number(value),
|
|
19
|
-
valueFormatter: (
|
|
20
|
-
value
|
|
21
|
-
}) => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
|
|
19
|
+
valueFormatter: value => (0, _utils.isNumber)(value) ? value.toLocaleString() : value || '',
|
|
22
20
|
filterOperators: (0, _gridNumericOperators.getGridNumericOperators)(),
|
|
23
21
|
getApplyQuickFilterFn: _gridNumericOperators.getGridNumericQuickFilterFn
|
|
24
22
|
});
|
|
@@ -24,20 +24,15 @@ const GRID_SINGLE_SELECT_COL_DEF = exports.GRID_SINGLE_SELECT_COL_DEF = (0, _ext
|
|
|
24
24
|
type: 'singleSelect',
|
|
25
25
|
getOptionLabel: defaultGetOptionLabel,
|
|
26
26
|
getOptionValue: defaultGetOptionValue,
|
|
27
|
-
valueFormatter(
|
|
28
|
-
const {
|
|
29
|
-
|
|
30
|
-
field,
|
|
31
|
-
value,
|
|
32
|
-
api
|
|
33
|
-
} = params;
|
|
34
|
-
const colDef = params.api.getColumn(field);
|
|
27
|
+
valueFormatter(value, row, colDef, apiRef) {
|
|
28
|
+
// const { id, field, value, api } = params;
|
|
29
|
+
const rowId = apiRef.current.getRowId(row);
|
|
35
30
|
if (!(0, _filterPanelUtils.isSingleSelectColDef)(colDef)) {
|
|
36
31
|
return '';
|
|
37
32
|
}
|
|
38
33
|
const valueOptions = (0, _filterPanelUtils.getValueOptions)(colDef, {
|
|
39
|
-
id,
|
|
40
|
-
row
|
|
34
|
+
id: rowId,
|
|
35
|
+
row
|
|
41
36
|
});
|
|
42
37
|
if (value == null) {
|
|
43
38
|
return '';
|
|
@@ -54,8 +49,8 @@ const GRID_SINGLE_SELECT_COL_DEF = exports.GRID_SINGLE_SELECT_COL_DEF = (0, _ext
|
|
|
54
49
|
renderEditCell: _GridEditSingleSelectCell.renderEditSingleSelectCell,
|
|
55
50
|
filterOperators: (0, _gridSingleSelectOperators.getGridSingleSelectOperators)(),
|
|
56
51
|
// @ts-ignore
|
|
57
|
-
pastedValueParser: (value,
|
|
58
|
-
const colDef =
|
|
52
|
+
pastedValueParser: (value, row, column) => {
|
|
53
|
+
const colDef = column;
|
|
59
54
|
const valueOptions = (0, _filterPanelUtils.getValueOptions)(colDef) || [];
|
|
60
55
|
const getOptionValue = colDef.getOptionValue;
|
|
61
56
|
const valueOption = valueOptions.find(option => {
|
|
@@ -441,106 +441,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
441
441
|
onDoubleClick: _propTypes.default.func,
|
|
442
442
|
onMouseEnter: _propTypes.default.func,
|
|
443
443
|
onMouseLeave: _propTypes.default.func,
|
|
444
|
-
pinnedColumns: _propTypes.default.
|
|
445
|
-
left: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
446
|
-
align: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
447
|
-
cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
448
|
-
colSpan: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number]),
|
|
449
|
-
computedWidth: _propTypes.default.number.isRequired,
|
|
450
|
-
description: _propTypes.default.string,
|
|
451
|
-
disableColumnMenu: _propTypes.default.bool,
|
|
452
|
-
disableExport: _propTypes.default.bool,
|
|
453
|
-
disableReorder: _propTypes.default.bool,
|
|
454
|
-
editable: _propTypes.default.bool,
|
|
455
|
-
field: _propTypes.default.string.isRequired,
|
|
456
|
-
filterable: _propTypes.default.bool,
|
|
457
|
-
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
458
|
-
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
459
|
-
getValueAsString: _propTypes.default.func,
|
|
460
|
-
headerLabel: _propTypes.default.string,
|
|
461
|
-
InputComponent: _propTypes.default.elementType,
|
|
462
|
-
InputComponentProps: _propTypes.default.object,
|
|
463
|
-
label: _propTypes.default.string,
|
|
464
|
-
requiresFilterValue: _propTypes.default.bool,
|
|
465
|
-
value: _propTypes.default.string.isRequired
|
|
466
|
-
})),
|
|
467
|
-
flex: _propTypes.default.number,
|
|
468
|
-
getApplyQuickFilterFn: _propTypes.default.func,
|
|
469
|
-
groupable: _propTypes.default.bool,
|
|
470
|
-
hasBeenResized: _propTypes.default.bool,
|
|
471
|
-
headerAlign: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
472
|
-
headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
473
|
-
headerName: _propTypes.default.string,
|
|
474
|
-
hideable: _propTypes.default.bool,
|
|
475
|
-
hideSortIcons: _propTypes.default.bool,
|
|
476
|
-
maxWidth: _propTypes.default.number,
|
|
477
|
-
minWidth: _propTypes.default.number,
|
|
478
|
-
pinnable: _propTypes.default.bool,
|
|
479
|
-
preProcessEditCellProps: _propTypes.default.func,
|
|
480
|
-
renderCell: _propTypes.default.func,
|
|
481
|
-
renderEditCell: _propTypes.default.func,
|
|
482
|
-
renderHeader: _propTypes.default.func,
|
|
483
|
-
resizable: _propTypes.default.bool,
|
|
484
|
-
sortable: _propTypes.default.bool,
|
|
485
|
-
sortComparator: _propTypes.default.func,
|
|
486
|
-
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
|
|
487
|
-
type: _propTypes.default.oneOf(['actions', 'boolean', 'custom', 'date', 'dateTime', 'number', 'singleSelect', 'string']),
|
|
488
|
-
valueFormatter: _propTypes.default.func,
|
|
489
|
-
valueGetter: _propTypes.default.func,
|
|
490
|
-
valueParser: _propTypes.default.func,
|
|
491
|
-
valueSetter: _propTypes.default.func,
|
|
492
|
-
width: _propTypes.default.number
|
|
493
|
-
})).isRequired,
|
|
494
|
-
right: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
495
|
-
align: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
496
|
-
cellClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
497
|
-
colSpan: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.number]),
|
|
498
|
-
computedWidth: _propTypes.default.number.isRequired,
|
|
499
|
-
description: _propTypes.default.string,
|
|
500
|
-
disableColumnMenu: _propTypes.default.bool,
|
|
501
|
-
disableExport: _propTypes.default.bool,
|
|
502
|
-
disableReorder: _propTypes.default.bool,
|
|
503
|
-
editable: _propTypes.default.bool,
|
|
504
|
-
field: _propTypes.default.string.isRequired,
|
|
505
|
-
filterable: _propTypes.default.bool,
|
|
506
|
-
filterOperators: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
507
|
-
getApplyFilterFn: _propTypes.default.func.isRequired,
|
|
508
|
-
getValueAsString: _propTypes.default.func,
|
|
509
|
-
headerLabel: _propTypes.default.string,
|
|
510
|
-
InputComponent: _propTypes.default.elementType,
|
|
511
|
-
InputComponentProps: _propTypes.default.object,
|
|
512
|
-
label: _propTypes.default.string,
|
|
513
|
-
requiresFilterValue: _propTypes.default.bool,
|
|
514
|
-
value: _propTypes.default.string.isRequired
|
|
515
|
-
})),
|
|
516
|
-
flex: _propTypes.default.number,
|
|
517
|
-
getApplyQuickFilterFn: _propTypes.default.func,
|
|
518
|
-
groupable: _propTypes.default.bool,
|
|
519
|
-
hasBeenResized: _propTypes.default.bool,
|
|
520
|
-
headerAlign: _propTypes.default.oneOf(['center', 'left', 'right']),
|
|
521
|
-
headerClassName: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
|
|
522
|
-
headerName: _propTypes.default.string,
|
|
523
|
-
hideable: _propTypes.default.bool,
|
|
524
|
-
hideSortIcons: _propTypes.default.bool,
|
|
525
|
-
maxWidth: _propTypes.default.number,
|
|
526
|
-
minWidth: _propTypes.default.number,
|
|
527
|
-
pinnable: _propTypes.default.bool,
|
|
528
|
-
preProcessEditCellProps: _propTypes.default.func,
|
|
529
|
-
renderCell: _propTypes.default.func,
|
|
530
|
-
renderEditCell: _propTypes.default.func,
|
|
531
|
-
renderHeader: _propTypes.default.func,
|
|
532
|
-
resizable: _propTypes.default.bool,
|
|
533
|
-
sortable: _propTypes.default.bool,
|
|
534
|
-
sortComparator: _propTypes.default.func,
|
|
535
|
-
sortingOrder: _propTypes.default.arrayOf(_propTypes.default.oneOf(['asc', 'desc'])),
|
|
536
|
-
type: _propTypes.default.oneOf(['actions', 'boolean', 'custom', 'date', 'dateTime', 'number', 'singleSelect', 'string']),
|
|
537
|
-
valueFormatter: _propTypes.default.func,
|
|
538
|
-
valueGetter: _propTypes.default.func,
|
|
539
|
-
valueParser: _propTypes.default.func,
|
|
540
|
-
valueSetter: _propTypes.default.func,
|
|
541
|
-
width: _propTypes.default.number
|
|
542
|
-
})).isRequired
|
|
543
|
-
}).isRequired,
|
|
444
|
+
pinnedColumns: _propTypes.default.object.isRequired,
|
|
544
445
|
renderedColumns: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
545
446
|
row: _propTypes.default.object,
|
|
546
447
|
rowHeight: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.number]).isRequired,
|
|
@@ -66,7 +66,7 @@ const GridEditInputCell = exports.GridEditInputCell = /*#__PURE__*/React.forward
|
|
|
66
66
|
const column = apiRef.current.getColumn(field);
|
|
67
67
|
let parsedValue = newValue;
|
|
68
68
|
if (column.valueParser) {
|
|
69
|
-
parsedValue = column.valueParser(newValue, apiRef.current.
|
|
69
|
+
parsedValue = column.valueParser(newValue, apiRef.current.getRow(id), column, apiRef);
|
|
70
70
|
}
|
|
71
71
|
setValueState(parsedValue);
|
|
72
72
|
apiRef.current.setEditCellValue({
|