@mui/x-data-grid 7.17.0 → 7.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +208 -5
- package/DataGrid/DataGrid.js +16 -1
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +2 -1
- package/components/GridRow.js +1 -0
- package/components/cell/GridCell.js +33 -9
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/containers/GridRoot.js +1 -1
- package/components/containers/GridRootStyles.js +32 -23
- package/components/containers/GridToolbarContainer.js +1 -1
- package/components/menu/GridMenu.js +1 -1
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +1 -1
- package/components/panel/GridPanelContent.js +1 -1
- package/components/panel/GridPanelFooter.js +1 -1
- package/components/panel/GridPanelHeader.js +1 -1
- package/components/panel/GridPanelWrapper.js +1 -1
- package/components/panel/filterPanel/filterPanelUtils.d.ts +1 -1
- package/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/components/virtualization/GridBottomContainer.d.ts +1 -1
- package/components/virtualization/GridBottomContainer.js +18 -1
- package/components/virtualization/GridMainContainer.js +3 -1
- package/components/virtualization/GridTopContainer.d.ts +1 -1
- package/components/virtualization/GridTopContainer.js +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/components/virtualization/GridVirtualScroller.js +1 -0
- package/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/hooks/features/columnGrouping/gridColumnGroupsSelector.d.ts +4 -4
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +1 -2
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/hooks/features/columnResize/columnResizeSelector.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/hooks/features/columns/gridColumnsSelector.d.ts +12 -12
- package/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/hooks/features/density/densitySelector.d.ts +1 -1
- package/hooks/features/dimensions/gridDimensionsApi.d.ts +4 -0
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -19
- package/hooks/features/editing/useGridRowEditing.js +7 -2
- package/hooks/features/editing/utils.d.ts +2 -0
- package/hooks/features/editing/utils.js +15 -0
- package/hooks/features/export/useGridPrintExport.js +2 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +17 -17
- package/hooks/features/focus/gridFocusStateSelector.d.ts +8 -8
- package/hooks/features/focus/useGridFocus.js +2 -1
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +3 -3
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -46
- package/hooks/features/keyboardNavigation/utils.d.ts +17 -0
- package/hooks/features/keyboardNavigation/utils.js +58 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +9 -9
- package/hooks/features/rowSelection/gridRowSelectionSelector.d.ts +3 -3
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/hooks/features/rowSelection/utils.d.ts +10 -0
- package/hooks/features/rowSelection/utils.js +156 -1
- package/hooks/features/rows/gridRowSpanningSelectors.d.ts +4 -0
- package/hooks/features/rows/gridRowSpanningSelectors.js +5 -0
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +10 -0
- package/hooks/features/rows/gridRowSpanningUtils.js +42 -0
- package/hooks/features/rows/gridRowsSelector.d.ts +14 -14
- package/hooks/features/rows/useGridRowSpanning.d.ts +27 -0
- package/hooks/features/rows/useGridRowSpanning.js +257 -0
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +7 -1
- package/hooks/features/scroll/useGridScroll.js +19 -19
- package/hooks/features/sorting/gridSortingSelector.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +5 -5
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +1 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/hooks/utils/useGridApiEventHandler.js +0 -1
- package/hooks/utils/useGridVisibleRows.d.ts +2 -2
- package/index.js +1 -1
- package/internals/index.d.ts +2 -0
- package/internals/index.js +2 -0
- package/locales/bgBG.js +8 -9
- package/locales/deDE.js +4 -4
- package/locales/frFR.js +4 -4
- package/locales/hrHR.d.ts +1 -1
- package/locales/hrHR.js +69 -46
- package/locales/jaJP.js +1 -2
- package/locales/ptPT.d.ts +1 -1
- package/locales/ptPT.js +4 -4
- package/locales/viVN.js +20 -20
- package/locales/zhHK.d.ts +1 -1
- package/models/colDef/gridColDef.d.ts +4 -0
- package/models/gridRowSelectionModel.d.ts +4 -0
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/props/DataGridProps.d.ts +30 -1
- package/modern/DataGrid/DataGrid.js +16 -1
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +2 -1
- package/modern/components/GridRow.js +1 -0
- package/modern/components/cell/GridCell.js +33 -9
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/modern/components/containers/GridRoot.js +1 -1
- package/modern/components/containers/GridRootStyles.js +32 -23
- package/modern/components/containers/GridToolbarContainer.js +1 -1
- package/modern/components/menu/GridMenu.js +1 -1
- package/modern/components/panel/GridPanel.js +1 -1
- package/modern/components/panel/GridPanelContent.js +1 -1
- package/modern/components/panel/GridPanelFooter.js +1 -1
- package/modern/components/panel/GridPanelHeader.js +1 -1
- package/modern/components/panel/GridPanelWrapper.js +1 -1
- package/modern/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/modern/components/virtualization/GridBottomContainer.js +18 -1
- package/modern/components/virtualization/GridMainContainer.js +3 -1
- package/modern/components/virtualization/GridTopContainer.js +1 -1
- package/modern/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/modern/components/virtualization/GridVirtualScroller.js +1 -0
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/modern/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/modern/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -19
- package/modern/hooks/features/editing/useGridRowEditing.js +7 -2
- package/modern/hooks/features/editing/utils.js +15 -0
- package/modern/hooks/features/export/useGridPrintExport.js +2 -1
- package/modern/hooks/features/focus/useGridFocus.js +2 -1
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +10 -46
- package/modern/hooks/features/keyboardNavigation/utils.js +58 -0
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +105 -29
- package/modern/hooks/features/rowSelection/utils.js +156 -1
- package/modern/hooks/features/rows/gridRowSpanningSelectors.js +5 -0
- package/modern/hooks/features/rows/gridRowSpanningUtils.js +42 -0
- package/modern/hooks/features/rows/useGridRowSpanning.js +257 -0
- package/modern/hooks/features/rows/useGridRows.js +7 -1
- package/modern/hooks/features/scroll/useGridScroll.js +19 -19
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/modern/hooks/utils/useGridApiEventHandler.js +0 -1
- package/modern/index.js +1 -1
- package/modern/internals/index.js +2 -0
- package/modern/locales/bgBG.js +8 -9
- package/modern/locales/deDE.js +4 -4
- package/modern/locales/frFR.js +4 -4
- package/modern/locales/hrHR.js +69 -46
- package/modern/locales/jaJP.js +1 -2
- package/modern/locales/ptPT.js +4 -4
- package/modern/locales/viVN.js +20 -20
- package/modern/utils/createSelector.js +6 -0
- package/modern/utils/domUtils.js +12 -12
- package/node/DataGrid/DataGrid.js +16 -1
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +2 -1
- package/node/components/GridRow.js +1 -0
- package/node/components/cell/GridCell.js +33 -9
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -1
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +12 -4
- package/node/components/containers/GridRoot.js +1 -1
- package/node/components/containers/GridRootStyles.js +32 -23
- package/node/components/containers/GridToolbarContainer.js +1 -1
- package/node/components/menu/GridMenu.js +1 -1
- package/node/components/panel/GridPanel.js +1 -1
- package/node/components/panel/GridPanelContent.js +1 -1
- package/node/components/panel/GridPanelFooter.js +1 -1
- package/node/components/panel/GridPanelHeader.js +1 -1
- package/node/components/panel/GridPanelWrapper.js +1 -1
- package/node/components/toolbar/GridToolbarQuickFilter.js +1 -1
- package/node/components/virtualization/GridBottomContainer.js +18 -1
- package/node/components/virtualization/GridMainContainer.js +3 -1
- package/node/components/virtualization/GridTopContainer.js +1 -1
- package/node/components/virtualization/GridVirtualScrollbar.js +1 -7
- package/node/components/virtualization/GridVirtualScroller.js +1 -0
- package/node/components/virtualization/GridVirtualScrollerFiller.js +3 -4
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +11 -11
- package/node/hooks/features/columnResize/useGridColumnResize.js +6 -6
- package/node/hooks/features/columns/gridColumnsUtils.js +3 -2
- package/node/hooks/features/dimensions/useGridDimensions.js +4 -1
- package/node/hooks/features/editing/useGridCellEditing.js +3 -19
- package/node/hooks/features/editing/useGridRowEditing.js +7 -2
- package/node/hooks/features/editing/utils.js +22 -0
- package/node/hooks/features/export/useGridPrintExport.js +2 -1
- package/node/hooks/features/focus/useGridFocus.js +2 -1
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +16 -53
- package/node/hooks/features/keyboardNavigation/utils.js +68 -0
- package/node/hooks/features/rowSelection/useGridRowSelection.js +102 -26
- package/node/hooks/features/rowSelection/utils.js +160 -1
- package/node/hooks/features/rows/gridRowSpanningSelectors.js +11 -0
- package/node/hooks/features/rows/gridRowSpanningUtils.js +52 -0
- package/node/hooks/features/rows/useGridRowSpanning.js +267 -0
- package/node/hooks/features/rows/useGridRows.js +7 -1
- package/node/hooks/features/scroll/useGridScroll.js +19 -19
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +17 -7
- package/node/hooks/utils/useGridApiEventHandler.js +0 -1
- package/node/index.js +1 -1
- package/node/internals/index.js +38 -15
- package/node/locales/bgBG.js +8 -9
- package/node/locales/deDE.js +4 -4
- package/node/locales/frFR.js +4 -4
- package/node/locales/hrHR.js +69 -46
- package/node/locales/jaJP.js +1 -2
- package/node/locales/ptPT.js +4 -4
- package/node/locales/viVN.js +20 -20
- package/node/utils/createSelector.js +6 -0
- package/node/utils/domUtils.js +12 -12
- package/package.json +3 -3
- package/utils/createSelector.js +6 -0
- package/utils/domUtils.d.ts +4 -4
- package/utils/domUtils.js +12 -12
package/modern/locales/hrHR.js
CHANGED
|
@@ -7,50 +7,57 @@ const hrHRGrid = {
|
|
|
7
7
|
// Density selector toolbar button text
|
|
8
8
|
toolbarDensity: 'Gustoća',
|
|
9
9
|
toolbarDensityLabel: 'Gustoća',
|
|
10
|
-
toolbarDensityCompact: '
|
|
11
|
-
toolbarDensityStandard: '
|
|
10
|
+
toolbarDensityCompact: 'Kompaktno',
|
|
11
|
+
toolbarDensityStandard: 'Standardno',
|
|
12
12
|
toolbarDensityComfortable: 'Udobno',
|
|
13
13
|
// Columns selector toolbar button text
|
|
14
14
|
toolbarColumns: 'Stupci',
|
|
15
15
|
toolbarColumnsLabel: 'Odaberite stupce',
|
|
16
16
|
// Filters toolbar button text
|
|
17
17
|
toolbarFilters: 'Filteri',
|
|
18
|
-
toolbarFiltersLabel: 'Prikaži
|
|
19
|
-
toolbarFiltersTooltipHide: 'Sakrij
|
|
20
|
-
toolbarFiltersTooltipShow: 'Prikaži
|
|
21
|
-
toolbarFiltersTooltipActive: count =>
|
|
18
|
+
toolbarFiltersLabel: 'Prikaži filtere',
|
|
19
|
+
toolbarFiltersTooltipHide: 'Sakrij filtere',
|
|
20
|
+
toolbarFiltersTooltipShow: 'Prikaži filtere',
|
|
21
|
+
toolbarFiltersTooltipActive: count => {
|
|
22
|
+
if (count === 1) {
|
|
23
|
+
return `${count} aktivan filter`;
|
|
24
|
+
}
|
|
25
|
+
if (count < 5) {
|
|
26
|
+
return `${count} aktivna filtera`;
|
|
27
|
+
}
|
|
28
|
+
return `${count} aktivnih filtera`;
|
|
29
|
+
},
|
|
22
30
|
// Quick filter toolbar field
|
|
23
31
|
toolbarQuickFilterPlaceholder: 'Traži…',
|
|
24
32
|
toolbarQuickFilterLabel: 'traži',
|
|
25
|
-
toolbarQuickFilterDeleteIconLabel: '
|
|
33
|
+
toolbarQuickFilterDeleteIconLabel: 'Obriši',
|
|
26
34
|
// Export selector toolbar button text
|
|
27
35
|
toolbarExport: 'Izvoz',
|
|
28
36
|
toolbarExportLabel: 'Izvoz',
|
|
29
37
|
toolbarExportCSV: 'Preuzmi kao CSV',
|
|
30
|
-
toolbarExportPrint: '
|
|
31
|
-
toolbarExportExcel: '
|
|
38
|
+
toolbarExportPrint: 'Štampaj',
|
|
39
|
+
toolbarExportExcel: 'Preuzmi kao Excel',
|
|
32
40
|
// Columns management text
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
columnsManagementSearchTitle: 'Traži',
|
|
42
|
+
columnsManagementNoColumns: 'Nema stupaca',
|
|
43
|
+
columnsManagementShowHideAllText: 'Prikaži/Sakrij sve',
|
|
44
|
+
columnsManagementReset: 'Ponovno namjesti',
|
|
38
45
|
// Filter panel text
|
|
39
|
-
filterPanelAddFilter: '
|
|
40
|
-
filterPanelRemoveAll: '
|
|
41
|
-
filterPanelDeleteIconLabel: '
|
|
46
|
+
filterPanelAddFilter: 'Dodaj filter',
|
|
47
|
+
filterPanelRemoveAll: 'Ukloni sve',
|
|
48
|
+
filterPanelDeleteIconLabel: 'Obriši',
|
|
42
49
|
filterPanelLogicOperator: 'Logički operator',
|
|
43
|
-
filterPanelOperator: '
|
|
50
|
+
filterPanelOperator: 'Operator',
|
|
44
51
|
filterPanelOperatorAnd: 'I',
|
|
45
52
|
filterPanelOperatorOr: 'Ili',
|
|
46
|
-
filterPanelColumns: '
|
|
53
|
+
filterPanelColumns: 'Stupac',
|
|
47
54
|
filterPanelInputLabel: 'Vrijednost',
|
|
48
|
-
filterPanelInputPlaceholder: 'Vrijednost
|
|
55
|
+
filterPanelInputPlaceholder: 'Vrijednost filtera',
|
|
49
56
|
// Filter operators text
|
|
50
57
|
filterOperatorContains: 'sadrži',
|
|
51
|
-
|
|
52
|
-
filterOperatorEquals: '
|
|
53
|
-
|
|
58
|
+
filterOperatorDoesNotContain: 'ne sadrži',
|
|
59
|
+
filterOperatorEquals: 'je jednak',
|
|
60
|
+
filterOperatorDoesNotEqual: 'nije jednak',
|
|
54
61
|
filterOperatorStartsWith: 'počinje sa',
|
|
55
62
|
filterOperatorEndsWith: 'završava sa',
|
|
56
63
|
filterOperatorIs: 'je',
|
|
@@ -59,8 +66,8 @@ const hrHRGrid = {
|
|
|
59
66
|
filterOperatorOnOrAfter: 'je na ili poslije',
|
|
60
67
|
filterOperatorBefore: 'je prije',
|
|
61
68
|
filterOperatorOnOrBefore: 'je na ili prije',
|
|
62
|
-
filterOperatorIsEmpty: 'prazno
|
|
63
|
-
filterOperatorIsNotEmpty: 'nije
|
|
69
|
+
filterOperatorIsEmpty: 'je prazno',
|
|
70
|
+
filterOperatorIsNotEmpty: 'nije prazno',
|
|
64
71
|
filterOperatorIsAnyOf: 'je bilo koji od',
|
|
65
72
|
'filterOperator=': '=',
|
|
66
73
|
'filterOperator!=': '!=',
|
|
@@ -70,20 +77,20 @@ const hrHRGrid = {
|
|
|
70
77
|
'filterOperator<=': '<=',
|
|
71
78
|
// Header filter operators text
|
|
72
79
|
headerFilterOperatorContains: 'Sadrži',
|
|
73
|
-
|
|
80
|
+
headerFilterOperatorDoesNotContain: 'Ne sadrži',
|
|
74
81
|
headerFilterOperatorEquals: 'Jednako',
|
|
75
|
-
|
|
82
|
+
headerFilterOperatorDoesNotEqual: 'Nije jednako',
|
|
76
83
|
headerFilterOperatorStartsWith: 'Počinje sa',
|
|
77
|
-
headerFilterOperatorEndsWith: 'Završava
|
|
84
|
+
headerFilterOperatorEndsWith: 'Završava sa',
|
|
78
85
|
headerFilterOperatorIs: 'Je',
|
|
79
86
|
headerFilterOperatorNot: 'Nije',
|
|
80
87
|
headerFilterOperatorAfter: 'Je poslije',
|
|
81
88
|
headerFilterOperatorOnOrAfter: 'Je uključeno ili poslije',
|
|
82
|
-
headerFilterOperatorBefore: 'Je
|
|
83
|
-
headerFilterOperatorOnOrBefore: '
|
|
84
|
-
headerFilterOperatorIsEmpty: '
|
|
85
|
-
headerFilterOperatorIsNotEmpty: 'Nije
|
|
86
|
-
headerFilterOperatorIsAnyOf: 'Je
|
|
89
|
+
headerFilterOperatorBefore: 'Je prije',
|
|
90
|
+
headerFilterOperatorOnOrBefore: 'Je uključeno ili prije',
|
|
91
|
+
headerFilterOperatorIsEmpty: 'Je prazno',
|
|
92
|
+
headerFilterOperatorIsNotEmpty: 'Nije prazno',
|
|
93
|
+
headerFilterOperatorIsAnyOf: 'Je bilo koji od',
|
|
87
94
|
'headerFilterOperator=': 'Jednako',
|
|
88
95
|
'headerFilterOperator!=': 'Nije jednako',
|
|
89
96
|
'headerFilterOperator>': 'Veći od',
|
|
@@ -92,32 +99,48 @@ const hrHRGrid = {
|
|
|
92
99
|
'headerFilterOperator<=': 'Manje od ili jednako',
|
|
93
100
|
// Filter values text
|
|
94
101
|
filterValueAny: 'bilo koji',
|
|
95
|
-
filterValueTrue: '
|
|
96
|
-
filterValueFalse: '
|
|
102
|
+
filterValueTrue: 'tačno',
|
|
103
|
+
filterValueFalse: 'netačno',
|
|
97
104
|
// Column menu text
|
|
98
|
-
columnMenuLabel: '
|
|
105
|
+
columnMenuLabel: 'Izbornik',
|
|
99
106
|
columnMenuShowColumns: 'Prikaži stupce',
|
|
100
107
|
columnMenuManageColumns: 'Upravljanje stupcima',
|
|
101
|
-
columnMenuFilter: '
|
|
108
|
+
columnMenuFilter: 'Filter',
|
|
102
109
|
columnMenuHideColumn: 'Sakrij stupac',
|
|
103
110
|
columnMenuUnsort: 'Poništi sortiranje',
|
|
104
111
|
columnMenuSortAsc: 'Poredaj uzlazno',
|
|
105
|
-
columnMenuSortDesc: 'Poredaj
|
|
112
|
+
columnMenuSortDesc: 'Poredaj silazno',
|
|
106
113
|
// Column header text
|
|
107
|
-
columnHeaderFiltersTooltipActive: count =>
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
columnHeaderFiltersTooltipActive: count => {
|
|
115
|
+
if (count === 1) {
|
|
116
|
+
return `${count} aktivan filter`;
|
|
117
|
+
}
|
|
118
|
+
if (count < 5) {
|
|
119
|
+
return `${count} aktivna filtera`;
|
|
120
|
+
}
|
|
121
|
+
return `${count} aktivnih filtera`;
|
|
122
|
+
},
|
|
123
|
+
columnHeaderFiltersLabel: 'Prikaži filtere',
|
|
124
|
+
columnHeaderSortIconLabel: 'Poredaj',
|
|
110
125
|
// Rows selected footer text
|
|
111
|
-
footerRowSelected: count =>
|
|
126
|
+
footerRowSelected: count => {
|
|
127
|
+
if (count === 1) {
|
|
128
|
+
return `Odabran je ${count.toLocaleString()} redak`;
|
|
129
|
+
}
|
|
130
|
+
if (count < 5) {
|
|
131
|
+
return `Odabrana su ${count.toLocaleString()} retka`;
|
|
132
|
+
}
|
|
133
|
+
return `Odabrano je ${count.toLocaleString()} redaka`;
|
|
134
|
+
},
|
|
112
135
|
// Total row amount footer text
|
|
113
136
|
footerTotalRows: 'Ukupno redaka:',
|
|
114
137
|
// Total visible row amount footer text
|
|
115
138
|
footerTotalVisibleRows: (visibleCount, totalCount) => `${visibleCount.toLocaleString()} od ${totalCount.toLocaleString()}`,
|
|
116
139
|
// Checkbox selection text
|
|
117
|
-
checkboxSelectionHeaderName: 'Odabir
|
|
140
|
+
checkboxSelectionHeaderName: 'Odabir redaka',
|
|
118
141
|
checkboxSelectionSelectAllRows: 'Odaberite sve retke',
|
|
119
142
|
checkboxSelectionUnselectAllRows: 'Poništi odabir svih redaka',
|
|
120
|
-
checkboxSelectionSelectRow: 'Odaberite
|
|
143
|
+
checkboxSelectionSelectRow: 'Odaberite redak',
|
|
121
144
|
checkboxSelectionUnselectRow: 'Poništi odabir retka',
|
|
122
145
|
// Boolean cell text
|
|
123
146
|
booleanCellTrueLabel: 'Da',
|
|
@@ -129,7 +152,7 @@ const hrHRGrid = {
|
|
|
129
152
|
pinToRight: 'Prikvači desno',
|
|
130
153
|
unpin: 'Otkvači',
|
|
131
154
|
// Tree Data
|
|
132
|
-
treeDataGroupingHeaderName: '
|
|
155
|
+
treeDataGroupingHeaderName: 'Skupina',
|
|
133
156
|
treeDataExpand: 'vidjeti djecu',
|
|
134
157
|
treeDataCollapse: 'sakriti djecu',
|
|
135
158
|
// Grouping columns
|
|
@@ -139,7 +162,7 @@ const hrHRGrid = {
|
|
|
139
162
|
// Master/detail
|
|
140
163
|
detailPanelToggle: 'Prebacivanje ploče s detaljima',
|
|
141
164
|
expandDetailPanel: 'Proširiti',
|
|
142
|
-
collapseDetailPanel: '
|
|
165
|
+
collapseDetailPanel: 'Skupiti',
|
|
143
166
|
// Row reordering text
|
|
144
167
|
rowReorderingHeaderName: 'Promjena redoslijeda',
|
|
145
168
|
// Aggregation
|
package/modern/locales/jaJP.js
CHANGED
|
@@ -33,8 +33,7 @@ const jaJPGrid = {
|
|
|
33
33
|
columnsManagementSearchTitle: '検索',
|
|
34
34
|
columnsManagementNoColumns: 'カラムなし',
|
|
35
35
|
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
columnsManagementReset: 'リセット',
|
|
38
37
|
// Filter panel text
|
|
39
38
|
filterPanelAddFilter: 'フィルター追加',
|
|
40
39
|
filterPanelRemoveAll: 'すべて削除',
|
package/modern/locales/ptPT.js
CHANGED
|
@@ -47,9 +47,9 @@ const ptPTGrid = {
|
|
|
47
47
|
filterPanelInputPlaceholder: 'Valor do filtro',
|
|
48
48
|
// Filter operators text
|
|
49
49
|
filterOperatorContains: 'contém',
|
|
50
|
-
|
|
50
|
+
filterOperatorDoesNotContain: 'não contém',
|
|
51
51
|
filterOperatorEquals: 'é igual a',
|
|
52
|
-
|
|
52
|
+
filterOperatorDoesNotEqual: 'não é igual a',
|
|
53
53
|
filterOperatorStartsWith: 'começa com',
|
|
54
54
|
filterOperatorEndsWith: 'termina com',
|
|
55
55
|
filterOperatorIs: 'é',
|
|
@@ -69,9 +69,9 @@ const ptPTGrid = {
|
|
|
69
69
|
'filterOperator<=': '<=',
|
|
70
70
|
// Header filter operators text
|
|
71
71
|
headerFilterOperatorContains: 'Contém',
|
|
72
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Não contém',
|
|
73
73
|
headerFilterOperatorEquals: 'É igual a',
|
|
74
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Não é igual',
|
|
75
75
|
headerFilterOperatorStartsWith: 'Começa com',
|
|
76
76
|
headerFilterOperatorEndsWith: 'Termina com',
|
|
77
77
|
headerFilterOperatorIs: 'É',
|
package/modern/locales/viVN.js
CHANGED
|
@@ -46,21 +46,21 @@ const viVNGrid = {
|
|
|
46
46
|
filterPanelInputLabel: 'Giá trị',
|
|
47
47
|
filterPanelInputPlaceholder: 'Lọc giá trị',
|
|
48
48
|
// Filter operators text
|
|
49
|
-
filterOperatorContains: '
|
|
50
|
-
|
|
51
|
-
filterOperatorEquals: '
|
|
52
|
-
|
|
53
|
-
filterOperatorStartsWith: '
|
|
54
|
-
filterOperatorEndsWith: '
|
|
55
|
-
filterOperatorIs: '
|
|
56
|
-
filterOperatorNot: '
|
|
57
|
-
filterOperatorAfter: '
|
|
49
|
+
filterOperatorContains: 'chứa',
|
|
50
|
+
filterOperatorDoesNotContain: 'không chứa',
|
|
51
|
+
filterOperatorEquals: 'bằng',
|
|
52
|
+
filterOperatorDoesNotEqual: 'không bằng',
|
|
53
|
+
filterOperatorStartsWith: 'bắt đầu với',
|
|
54
|
+
filterOperatorEndsWith: 'kết thúc với',
|
|
55
|
+
filterOperatorIs: 'là',
|
|
56
|
+
filterOperatorNot: 'không phải là',
|
|
57
|
+
filterOperatorAfter: 'sau',
|
|
58
58
|
filterOperatorOnOrAfter: 'bằng hoặc sau',
|
|
59
|
-
filterOperatorBefore: '
|
|
59
|
+
filterOperatorBefore: 'trước',
|
|
60
60
|
filterOperatorOnOrBefore: 'bằng hoặc trước',
|
|
61
|
-
filterOperatorIsEmpty: '
|
|
62
|
-
filterOperatorIsNotEmpty: '
|
|
63
|
-
filterOperatorIsAnyOf: '
|
|
61
|
+
filterOperatorIsEmpty: 'rỗng',
|
|
62
|
+
filterOperatorIsNotEmpty: 'khác rỗng',
|
|
63
|
+
filterOperatorIsAnyOf: 'là một trong',
|
|
64
64
|
'filterOperator=': '=',
|
|
65
65
|
'filterOperator!=': '!=',
|
|
66
66
|
'filterOperator>': '>',
|
|
@@ -69,20 +69,20 @@ const viVNGrid = {
|
|
|
69
69
|
'filterOperator<=': '<=',
|
|
70
70
|
// Header filter operators text
|
|
71
71
|
headerFilterOperatorContains: 'Chứa',
|
|
72
|
-
|
|
72
|
+
headerFilterOperatorDoesNotContain: 'Không chứa',
|
|
73
73
|
headerFilterOperatorEquals: 'Bằng',
|
|
74
|
-
|
|
74
|
+
headerFilterOperatorDoesNotEqual: 'Không bằng',
|
|
75
75
|
headerFilterOperatorStartsWith: 'Bắt đầu với',
|
|
76
76
|
headerFilterOperatorEndsWith: 'Kết thúc với',
|
|
77
|
-
headerFilterOperatorIs: '
|
|
78
|
-
headerFilterOperatorNot: 'Không là',
|
|
77
|
+
headerFilterOperatorIs: 'Là',
|
|
78
|
+
headerFilterOperatorNot: 'Không phải là',
|
|
79
79
|
headerFilterOperatorAfter: 'Sau',
|
|
80
|
-
headerFilterOperatorOnOrAfter: '
|
|
80
|
+
headerFilterOperatorOnOrAfter: 'Bằng hoặc sau',
|
|
81
81
|
headerFilterOperatorBefore: 'Trước',
|
|
82
|
-
headerFilterOperatorOnOrBefore: '
|
|
82
|
+
headerFilterOperatorOnOrBefore: 'Bằng hoặc trước',
|
|
83
83
|
headerFilterOperatorIsEmpty: 'Rỗng',
|
|
84
84
|
headerFilterOperatorIsNotEmpty: 'Khác rỗng',
|
|
85
|
-
headerFilterOperatorIsAnyOf: '
|
|
85
|
+
headerFilterOperatorIsAnyOf: 'Là một trong',
|
|
86
86
|
'headerFilterOperator=': 'Bằng',
|
|
87
87
|
'headerFilterOperator!=': 'Khác',
|
|
88
88
|
'headerFilterOperator>': 'Lớn hơn',
|
|
@@ -34,6 +34,8 @@ export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
|
34
34
|
throw new Error('Unsupported number of selectors');
|
|
35
35
|
}
|
|
36
36
|
let selector;
|
|
37
|
+
|
|
38
|
+
// eslint-disable-next-line id-denylist
|
|
37
39
|
if (a && b && c && d && e && f) {
|
|
38
40
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
39
41
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
@@ -46,6 +48,7 @@ export const createSelector = (a, b, c, d, e, f, ...other) => {
|
|
|
46
48
|
const ve = e(state, instanceId);
|
|
47
49
|
return f(va, vb, vc, vd, ve);
|
|
48
50
|
};
|
|
51
|
+
// eslint-disable-next-line id-denylist
|
|
49
52
|
} else if (a && b && c && d && e) {
|
|
50
53
|
selector = (stateOrApiRef, instanceIdParam) => {
|
|
51
54
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
@@ -100,6 +103,8 @@ export const createSelectorV8 = (a, b, c, d, e, f, ...other) => {
|
|
|
100
103
|
throw new Error('Unsupported number of selectors');
|
|
101
104
|
}
|
|
102
105
|
let selector;
|
|
106
|
+
|
|
107
|
+
// eslint-disable-next-line id-denylist
|
|
103
108
|
if (a && b && c && d && e && f) {
|
|
104
109
|
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
105
110
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
|
@@ -112,6 +117,7 @@ export const createSelectorV8 = (a, b, c, d, e, f, ...other) => {
|
|
|
112
117
|
const ve = e(state, args, instanceId);
|
|
113
118
|
return f(va, vb, vc, vd, ve, args);
|
|
114
119
|
};
|
|
120
|
+
// eslint-disable-next-line id-denylist
|
|
115
121
|
} else if (a && b && c && d && e) {
|
|
116
122
|
selector = (stateOrApiRef, args, instanceIdParam) => {
|
|
117
123
|
const isAPIRef = checkIsAPIRef(stateOrApiRef);
|
package/modern/utils/domUtils.js
CHANGED
|
@@ -120,22 +120,22 @@ const findPinnedCells = ({
|
|
|
120
120
|
});
|
|
121
121
|
return cells;
|
|
122
122
|
};
|
|
123
|
-
export function findLeftPinnedCellsAfterCol(api, col) {
|
|
123
|
+
export function findLeftPinnedCellsAfterCol(api, col, isRtl) {
|
|
124
124
|
const colIndex = parseCellColIndex(col);
|
|
125
125
|
return findPinnedCells({
|
|
126
126
|
api,
|
|
127
127
|
colIndex,
|
|
128
|
-
position: 'left',
|
|
129
|
-
filterFn: index => index > colIndex
|
|
128
|
+
position: isRtl ? 'right' : 'left',
|
|
129
|
+
filterFn: index => isRtl ? index < colIndex : index > colIndex
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
|
-
export function findRightPinnedCellsBeforeCol(api, col) {
|
|
132
|
+
export function findRightPinnedCellsBeforeCol(api, col, isRtl) {
|
|
133
133
|
const colIndex = parseCellColIndex(col);
|
|
134
134
|
return findPinnedCells({
|
|
135
135
|
api,
|
|
136
136
|
colIndex,
|
|
137
|
-
position: 'right',
|
|
138
|
-
filterFn: index => index < colIndex
|
|
137
|
+
position: isRtl ? 'left' : 'right',
|
|
138
|
+
filterFn: index => isRtl ? index > colIndex : index < colIndex
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
const findPinnedHeaders = ({
|
|
@@ -159,22 +159,22 @@ const findPinnedHeaders = ({
|
|
|
159
159
|
});
|
|
160
160
|
return elements;
|
|
161
161
|
};
|
|
162
|
-
export function findLeftPinnedHeadersAfterCol(api, col) {
|
|
162
|
+
export function findLeftPinnedHeadersAfterCol(api, col, isRtl) {
|
|
163
163
|
const colIndex = parseCellColIndex(col);
|
|
164
164
|
return findPinnedHeaders({
|
|
165
165
|
api,
|
|
166
|
-
position: 'left',
|
|
166
|
+
position: isRtl ? 'right' : 'left',
|
|
167
167
|
colIndex,
|
|
168
|
-
filterFn: index => index > colIndex
|
|
168
|
+
filterFn: index => isRtl ? index < colIndex : index > colIndex
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
export function findRightPinnedHeadersBeforeCol(api, col) {
|
|
171
|
+
export function findRightPinnedHeadersBeforeCol(api, col, isRtl) {
|
|
172
172
|
const colIndex = parseCellColIndex(col);
|
|
173
173
|
return findPinnedHeaders({
|
|
174
174
|
api,
|
|
175
|
-
position: 'right',
|
|
175
|
+
position: isRtl ? 'left' : 'right',
|
|
176
176
|
colIndex,
|
|
177
|
-
filterFn: index => index < colIndex
|
|
177
|
+
filterFn: index => isRtl ? index > colIndex : index < colIndex
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
export function findGridHeader(api, field) {
|
|
@@ -80,6 +80,11 @@ DataGridRaw.propTypes = {
|
|
|
80
80
|
/**
|
|
81
81
|
* If `true`, the Data Grid height is dynamic and follows the number of rows in the Data Grid.
|
|
82
82
|
* @default false
|
|
83
|
+
* @deprecated Use flex parent container instead: https://mui.com/x/react-data-grid/layout/#flex-parent-container
|
|
84
|
+
* @example
|
|
85
|
+
* <div style={{ display: 'flex', flexDirection: 'column' }}>
|
|
86
|
+
* <DataGrid />
|
|
87
|
+
* </div>
|
|
83
88
|
*/
|
|
84
89
|
autoHeight: _propTypes.default.bool,
|
|
85
90
|
/**
|
|
@@ -125,6 +130,11 @@ DataGridRaw.propTypes = {
|
|
|
125
130
|
* @default 150
|
|
126
131
|
*/
|
|
127
132
|
columnBufferPx: _propTypes.default.number,
|
|
133
|
+
/**
|
|
134
|
+
* Sets the height in pixels of the column group headers in the Data Grid.
|
|
135
|
+
* Inherits the `columnHeaderHeight` value if not set.
|
|
136
|
+
*/
|
|
137
|
+
columnGroupHeaderHeight: _propTypes.default.number,
|
|
128
138
|
columnGroupingModel: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
129
139
|
/**
|
|
130
140
|
* Sets the height in pixel of the column headers in the Data Grid.
|
|
@@ -750,5 +760,10 @@ DataGridRaw.propTypes = {
|
|
|
750
760
|
/**
|
|
751
761
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
752
762
|
*/
|
|
753
|
-
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object])
|
|
763
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
764
|
+
/**
|
|
765
|
+
* If `true`, the Data Grid will auto span the cells over the rows having the same value.
|
|
766
|
+
* @default false
|
|
767
|
+
*/
|
|
768
|
+
unstable_rowSpanning: _propTypes.default.bool
|
|
754
769
|
};
|
|
@@ -33,6 +33,7 @@ var _useGridColumnSpanning = require("../hooks/features/columns/useGridColumnSpa
|
|
|
33
33
|
var _useGridColumnGrouping = require("../hooks/features/columnGrouping/useGridColumnGrouping");
|
|
34
34
|
var _virtualization = require("../hooks/features/virtualization");
|
|
35
35
|
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
|
|
36
|
+
var _useGridRowSpanning = require("../hooks/features/rows/useGridRowSpanning");
|
|
36
37
|
const useDataGridComponent = (inputApiRef, props) => {
|
|
37
38
|
const apiRef = (0, _useGridInitialization.useGridInitialization)(inputApiRef, props);
|
|
38
39
|
|
|
@@ -54,6 +55,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
54
55
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridSorting.sortingStateInitializer, apiRef, props);
|
|
55
56
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPreferencesPanel.preferencePanelStateInitializer, apiRef, props);
|
|
56
57
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridFilter.filterStateInitializer, apiRef, props);
|
|
58
|
+
(0, _useGridInitializeState.useGridInitializeState)(_useGridRowSpanning.rowSpanningStateInitializer, apiRef, props);
|
|
57
59
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridDensity.densityStateInitializer, apiRef, props);
|
|
58
60
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridColumnResize.columnResizeStateInitializer, apiRef, props);
|
|
59
61
|
(0, _useGridInitializeState.useGridInitializeState)(_useGridPagination.paginationStateInitializer, apiRef, props);
|
|
@@ -65,6 +67,7 @@ const useDataGridComponent = (inputApiRef, props) => {
|
|
|
65
67
|
(0, _useGridRowSelection.useGridRowSelection)(apiRef, props);
|
|
66
68
|
(0, _useGridColumns.useGridColumns)(apiRef, props);
|
|
67
69
|
(0, _useGridRows.useGridRows)(apiRef, props);
|
|
70
|
+
(0, _useGridRowSpanning.useGridRowSpanning)(apiRef, props);
|
|
68
71
|
(0, _useGridParamsApi.useGridParamsApi)(apiRef);
|
|
69
72
|
(0, _useGridColumnSpanning.useGridColumnSpanning)(apiRef);
|
|
70
73
|
(0, _useGridColumnGrouping.useGridColumnGrouping)(apiRef, props);
|
|
@@ -81,7 +81,8 @@ const DATA_GRID_PROPS_DEFAULT_VALUES = exports.DATA_GRID_PROPS_DEFAULT_VALUES =
|
|
|
81
81
|
showColumnVerticalBorder: false,
|
|
82
82
|
sortingMode: 'client',
|
|
83
83
|
sortingOrder: ['asc', 'desc', null],
|
|
84
|
-
throttleRowsMs: 0
|
|
84
|
+
throttleRowsMs: 0,
|
|
85
|
+
unstable_rowSpanning: false
|
|
85
86
|
};
|
|
86
87
|
const defaultSlots = _defaultGridSlotsComponents.DATA_GRID_DEFAULT_SLOTS_COMPONENTS;
|
|
87
88
|
const useDataGridProps = inProps => {
|
|
@@ -346,6 +346,7 @@ process.env.NODE_ENV !== "production" ? GridRow.propTypes = {
|
|
|
346
346
|
height: _propTypes.default.number.isRequired,
|
|
347
347
|
width: _propTypes.default.number.isRequired
|
|
348
348
|
}).isRequired,
|
|
349
|
+
groupHeaderHeight: _propTypes.default.number.isRequired,
|
|
349
350
|
hasScrollX: _propTypes.default.bool.isRequired,
|
|
350
351
|
hasScrollY: _propTypes.default.bool.isRequired,
|
|
351
352
|
headerFilterHeight: _propTypes.default.number.isRequired,
|
|
@@ -13,6 +13,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
15
|
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
16
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
16
17
|
var _doesSupportPreventScroll = require("../../utils/doesSupportPreventScroll");
|
|
17
18
|
var _gridClasses = require("../../constants/gridClasses");
|
|
18
19
|
var _models = require("../../models");
|
|
@@ -23,6 +24,7 @@ var _gridFocusStateSelector = require("../../hooks/features/focus/gridFocusState
|
|
|
23
24
|
var _useGridParamsApi = require("../../hooks/features/rows/useGridParamsApi");
|
|
24
25
|
var _cellBorderUtils = require("../../utils/cellBorderUtils");
|
|
25
26
|
var _gridColumnsInterfaces = require("../../hooks/features/columns/gridColumnsInterfaces");
|
|
27
|
+
var _gridRowSpanningSelectors = require("../../hooks/features/rows/gridRowSpanningSelectors");
|
|
26
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
29
|
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "gridHasScrollX", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "sectionIndex", "sectionLength", "gridHasFiller", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
28
30
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
@@ -114,6 +116,7 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
114
116
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
115
117
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
116
118
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
119
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
117
120
|
const field = column.field;
|
|
118
121
|
const cellParams = (0, _useGridSelector.useGridSelector)(apiRef, () => {
|
|
119
122
|
// This is required because `.getCellParams` tries to get the `state.rows.tree` entry
|
|
@@ -123,17 +126,19 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
123
126
|
const result = apiRef.current.getCellParams(rowId, field);
|
|
124
127
|
result.api = apiRef.current;
|
|
125
128
|
return result;
|
|
126
|
-
} catch (
|
|
127
|
-
if (
|
|
129
|
+
} catch (error) {
|
|
130
|
+
if (error instanceof _useGridParamsApi.MissingRowIdError) {
|
|
128
131
|
return EMPTY_CELL_PARAMS;
|
|
129
132
|
}
|
|
130
|
-
throw
|
|
133
|
+
throw error;
|
|
131
134
|
}
|
|
132
135
|
}, _useGridSelector.objectShallowCompare);
|
|
133
136
|
const isSelected = (0, _useGridSelector.useGridSelector)(apiRef, () => apiRef.current.unstable_applyPipeProcessors('isCellSelected', false, {
|
|
134
137
|
id: rowId,
|
|
135
138
|
field
|
|
136
139
|
}));
|
|
140
|
+
const hiddenCells = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSpanningSelectors.gridRowSpanningHiddenCellsSelector);
|
|
141
|
+
const spannedCells = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSpanningSelectors.gridRowSpanningSpannedCellsSelector);
|
|
137
142
|
const {
|
|
138
143
|
cellMode,
|
|
139
144
|
hasFocus,
|
|
@@ -206,6 +211,8 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
206
211
|
propHandler(event);
|
|
207
212
|
}
|
|
208
213
|
}, [apiRef, field, rowId]);
|
|
214
|
+
const isCellRowSpanned = hiddenCells[rowId]?.[field] ?? false;
|
|
215
|
+
const rowSpan = spannedCells[rowId]?.[field] ?? 1;
|
|
209
216
|
const style = React.useMemo(() => {
|
|
210
217
|
if (isNotVisible) {
|
|
211
218
|
return {
|
|
@@ -218,14 +225,21 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
218
225
|
const cellStyle = (0, _extends2.default)({
|
|
219
226
|
'--width': `${width}px`
|
|
220
227
|
}, styleProp);
|
|
221
|
-
|
|
222
|
-
|
|
228
|
+
const isLeftPinned = pinnedPosition === PinnedPosition.LEFT;
|
|
229
|
+
const isRightPinned = pinnedPosition === PinnedPosition.RIGHT;
|
|
230
|
+
if (isLeftPinned || isRightPinned) {
|
|
231
|
+
let side = isLeftPinned ? 'left' : 'right';
|
|
232
|
+
if (isRtl) {
|
|
233
|
+
side = isLeftPinned ? 'right' : 'left';
|
|
234
|
+
}
|
|
235
|
+
cellStyle[side] = pinnedOffset;
|
|
223
236
|
}
|
|
224
|
-
if (
|
|
225
|
-
cellStyle.
|
|
237
|
+
if (rowSpan > 1) {
|
|
238
|
+
cellStyle.height = `calc(var(--height) * ${rowSpan})`;
|
|
239
|
+
cellStyle.zIndex = 5;
|
|
226
240
|
}
|
|
227
241
|
return cellStyle;
|
|
228
|
-
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition]);
|
|
242
|
+
}, [width, isNotVisible, styleProp, pinnedOffset, pinnedPosition, isRtl, rowSpan]);
|
|
229
243
|
React.useEffect(() => {
|
|
230
244
|
if (!hasFocus || cellMode === _models.GridCellModes.Edit) {
|
|
231
245
|
return;
|
|
@@ -245,6 +259,15 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
245
259
|
}
|
|
246
260
|
}
|
|
247
261
|
}, [hasFocus, cellMode, apiRef]);
|
|
262
|
+
if (isCellRowSpanned) {
|
|
263
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
264
|
+
"data-colindex": colIndex,
|
|
265
|
+
role: "presentation",
|
|
266
|
+
style: (0, _extends2.default)({
|
|
267
|
+
width: 'var(--width)'
|
|
268
|
+
}, style)
|
|
269
|
+
});
|
|
270
|
+
}
|
|
248
271
|
if (cellParams === EMPTY_CELL_PARAMS) {
|
|
249
272
|
return null;
|
|
250
273
|
}
|
|
@@ -299,12 +322,13 @@ const GridCell = /*#__PURE__*/React.forwardRef(function GridCell(props, ref) {
|
|
|
299
322
|
};
|
|
300
323
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", (0, _extends2.default)({
|
|
301
324
|
ref: handleRef,
|
|
302
|
-
className: (0, _clsx.default)(
|
|
325
|
+
className: (0, _clsx.default)(classes.root, classNames, className),
|
|
303
326
|
role: "gridcell",
|
|
304
327
|
"data-field": field,
|
|
305
328
|
"data-colindex": colIndex,
|
|
306
329
|
"aria-colindex": colIndex + 1,
|
|
307
330
|
"aria-colspan": colSpan,
|
|
331
|
+
"aria-rowspan": rowSpan,
|
|
308
332
|
style: style,
|
|
309
333
|
title: title,
|
|
310
334
|
tabIndex: tabIndex,
|
|
@@ -44,7 +44,7 @@ const GridBaseColumnHeaders = exports.GridBaseColumnHeaders = /*#__PURE__*/React
|
|
|
44
44
|
const classes = useUtilityClasses(rootProps);
|
|
45
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(GridColumnHeadersRoot, (0, _extends2.default)({
|
|
46
46
|
ref: ref,
|
|
47
|
-
className: (0, _clsx.default)(
|
|
47
|
+
className: (0, _clsx.default)(classes.root, className),
|
|
48
48
|
ownerState: rootProps
|
|
49
49
|
}, other, {
|
|
50
50
|
role: "presentation"
|
|
@@ -14,8 +14,10 @@ var _utils = require("@mui/utils");
|
|
|
14
14
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
15
15
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _gridClasses = require("../../constants/gridClasses");
|
|
17
|
+
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
18
|
+
var _utils2 = require("../../hooks/features/rowSelection/utils");
|
|
17
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["field", "id", "
|
|
20
|
+
const _excluded = ["field", "id", "formattedValue", "row", "rowNode", "colDef", "isEditable", "cellMode", "hasFocus", "tabIndex", "api"];
|
|
19
21
|
const useUtilityClasses = ownerState => {
|
|
20
22
|
const {
|
|
21
23
|
classes
|
|
@@ -29,7 +31,6 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = /*#__PUR
|
|
|
29
31
|
const {
|
|
30
32
|
field,
|
|
31
33
|
id,
|
|
32
|
-
value: isChecked,
|
|
33
34
|
rowNode,
|
|
34
35
|
hasFocus,
|
|
35
36
|
tabIndex
|
|
@@ -77,21 +78,28 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = /*#__PUR
|
|
|
77
78
|
event.stopPropagation();
|
|
78
79
|
}
|
|
79
80
|
}, []);
|
|
81
|
+
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
82
|
+
const checkboxPropsSelector = (0, _utils2.getCheckboxPropsSelector)(id, rootProps.rowSelectionPropagation?.parents ?? false);
|
|
83
|
+
const {
|
|
84
|
+
isIndeterminate,
|
|
85
|
+
isChecked
|
|
86
|
+
} = (0, _useGridSelector.useGridSelector)(apiRef, checkboxPropsSelector);
|
|
80
87
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
81
88
|
return null;
|
|
82
89
|
}
|
|
83
|
-
const isSelectable = apiRef.current.isRowSelectable(id);
|
|
84
90
|
const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');
|
|
91
|
+
const checked = rootProps.indeterminateCheckboxAction === 'select' ? isChecked && !isIndeterminate : isChecked;
|
|
85
92
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseCheckbox, (0, _extends2.default)({
|
|
86
93
|
ref: handleRef,
|
|
87
94
|
tabIndex: tabIndex,
|
|
88
|
-
checked:
|
|
95
|
+
checked: checked,
|
|
89
96
|
onChange: handleChange,
|
|
90
97
|
className: classes.root,
|
|
91
98
|
inputProps: {
|
|
92
99
|
'aria-label': label
|
|
93
100
|
},
|
|
94
101
|
onKeyDown: handleKeyDown,
|
|
102
|
+
indeterminate: isIndeterminate,
|
|
95
103
|
disabled: !isSelectable,
|
|
96
104
|
touchRippleRef: rippleRef /* FIXME: typing error */
|
|
97
105
|
}, rootProps.slotProps?.baseCheckbox, other));
|