@mui/x-data-grid 8.0.0-alpha.4 → 8.0.0-alpha.6
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 +182 -0
- package/DataGrid/DataGrid.js +6 -9
- package/DataGrid/useDataGridProps.js +3 -3
- package/components/GridColumnHeaders.d.ts +1 -1
- package/components/GridColumnHeaders.js +4 -4
- package/components/GridFooter.d.ts +2 -1
- package/components/GridFooter.js +4 -4
- package/components/GridLoadingOverlay.d.ts +1 -1
- package/components/GridLoadingOverlay.js +10 -8
- package/components/GridNoResultsOverlay.d.ts +2 -1
- package/components/GridNoResultsOverlay.js +4 -4
- package/components/GridNoRowsOverlay.d.ts +2 -1
- package/components/GridNoRowsOverlay.js +4 -4
- package/components/GridPagination.d.ts +1 -1
- package/components/GridPagination.js +5 -3
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +15 -3
- package/components/GridRowCount.d.ts +1 -1
- package/components/GridRowCount.js +3 -2
- package/components/GridSelectedRowCount.d.ts +4 -1
- package/components/GridSelectedRowCount.js +3 -2
- package/components/GridSkeletonLoadingOverlay.d.ts +1 -1
- package/components/GridSkeletonLoadingOverlay.js +4 -3
- package/components/cell/GridActionsCellItem.d.ts +1 -1
- package/components/cell/GridActionsCellItem.js +7 -8
- package/components/cell/GridCell.d.ts +1 -1
- package/components/cell/GridCell.js +3 -2
- package/components/cell/GridEditInputCell.d.ts +1 -1
- package/components/cell/GridEditInputCell.js +72 -3
- package/components/cell/GridSkeletonCell.js +1 -2
- package/components/columnHeaders/GridBaseColumnHeaders.d.ts +1 -1
- package/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -1
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/components/columnHeaders/GridIconButtonContainer.d.ts +1 -1
- package/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/components/columnSelection/GridCellCheckboxRenderer.d.ts +2 -2
- package/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/components/columnSelection/GridHeaderCheckbox.d.ts +1 -1
- package/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/components/containers/GridFooterContainer.d.ts +1 -1
- package/components/containers/GridFooterContainer.js +5 -3
- package/components/containers/GridOverlay.d.ts +1 -1
- package/components/containers/GridOverlay.js +5 -3
- package/components/containers/GridRoot.d.ts +1 -1
- package/components/containers/GridRoot.js +5 -3
- package/components/containers/GridToolbarContainer.d.ts +1 -1
- package/components/containers/GridToolbarContainer.js +3 -2
- package/components/menu/columnMenu/GridColumnMenu.d.ts +2 -2
- package/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/components/menu/columnMenu/GridColumnMenuContainer.d.ts +1 -1
- package/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/components/panel/GridPanel.d.ts +1 -1
- package/components/panel/GridPanel.js +3 -2
- package/components/panel/GridPanelWrapper.d.ts +1 -1
- package/components/panel/GridPanelWrapper.js +5 -3
- package/components/panel/filterPanel/GridFilterForm.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/components/panel/filterPanel/GridFilterPanel.d.ts +1 -1
- package/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/components/panel/filterPanel/index.d.ts +2 -1
- package/components/panel/filterPanel/index.js +1 -1
- package/components/toolbar/GridToolbar.d.ts +1 -1
- package/components/toolbar/GridToolbar.js +4 -4
- package/components/toolbar/GridToolbarColumnsButton.d.ts +1 -1
- package/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/components/toolbar/GridToolbarDensitySelector.d.ts +1 -1
- package/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/components/toolbar/GridToolbarExport.d.ts +1 -1
- package/components/toolbar/GridToolbarExport.js +2 -1
- package/components/toolbar/GridToolbarExportContainer.d.ts +1 -1
- package/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/components/toolbar/GridToolbarFilterButton.d.ts +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/components/virtualization/GridMainContainer.d.ts +3 -1
- package/components/virtualization/GridMainContainer.js +4 -3
- package/components/virtualization/GridVirtualScrollbar.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/components/virtualization/GridVirtualScrollerContent.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/components/virtualization/GridVirtualScrollerRenderZone.d.ts +2 -0
- package/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +6 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/hooks/features/columnResize/useGridColumnResize.d.ts +1 -1
- package/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/hooks/features/columns/gridColumnsUtils.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/index.js +1 -1
- package/internals/utils/index.d.ts +0 -1
- package/internals/utils/index.js +0 -1
- package/locales/koKR.js +45 -49
- package/locales/nlNL.js +5 -6
- package/material/index.js +36 -4
- package/models/gridBaseSlots.d.ts +36 -0
- package/models/gridBaseSlots.js +1 -0
- package/models/gridSlotsComponent.d.ts +16 -1
- package/models/gridSlotsComponentsProps.d.ts +38 -5
- package/models/props/DataGridProps.d.ts +0 -5
- package/modern/DataGrid/DataGrid.js +6 -9
- package/modern/DataGrid/useDataGridProps.js +3 -3
- package/modern/components/GridColumnHeaders.js +4 -4
- package/modern/components/GridFooter.js +4 -4
- package/modern/components/GridLoadingOverlay.js +10 -8
- package/modern/components/GridNoResultsOverlay.js +4 -4
- package/modern/components/GridNoRowsOverlay.js +4 -4
- package/modern/components/GridPagination.js +5 -3
- package/modern/components/GridRow.js +15 -3
- package/modern/components/GridRowCount.js +3 -2
- package/modern/components/GridSelectedRowCount.js +3 -2
- package/modern/components/GridSkeletonLoadingOverlay.js +4 -3
- package/modern/components/cell/GridActionsCellItem.js +7 -8
- package/modern/components/cell/GridCell.js +3 -2
- package/modern/components/cell/GridEditInputCell.js +72 -3
- package/modern/components/cell/GridSkeletonCell.js +1 -2
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/modern/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/modern/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/modern/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/modern/components/containers/GridFooterContainer.js +5 -3
- package/modern/components/containers/GridOverlay.js +5 -3
- package/modern/components/containers/GridRoot.js +5 -3
- package/modern/components/containers/GridToolbarContainer.js +3 -2
- package/modern/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/modern/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +6 -11
- package/modern/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/modern/components/panel/GridPanel.js +3 -2
- package/modern/components/panel/GridPanelWrapper.js +5 -3
- package/modern/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +9 -9
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/modern/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/modern/components/panel/filterPanel/index.js +1 -1
- package/modern/components/toolbar/GridToolbar.js +4 -4
- package/modern/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/modern/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/modern/components/toolbar/GridToolbarExport.js +2 -1
- package/modern/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/modern/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/modern/components/virtualization/GridMainContainer.js +4 -3
- package/modern/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/modern/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/modern/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/modern/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/modern/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/modern/hooks/features/rows/useGridRowSpanning.js +76 -87
- package/modern/index.js +1 -1
- package/modern/internals/utils/index.js +0 -1
- package/modern/locales/koKR.js +45 -49
- package/modern/locales/nlNL.js +5 -6
- package/modern/material/index.js +36 -4
- package/modern/models/gridBaseSlots.js +1 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +6 -9
- package/node/DataGrid/useDataGridProps.js +2 -2
- package/node/components/GridColumnHeaders.js +4 -4
- package/node/components/GridFooter.js +4 -4
- package/node/components/GridLoadingOverlay.js +10 -8
- package/node/components/GridNoResultsOverlay.js +4 -4
- package/node/components/GridNoRowsOverlay.js +4 -4
- package/node/components/GridPagination.js +5 -3
- package/node/components/GridRow.js +15 -3
- package/node/components/GridRowCount.js +3 -2
- package/node/components/GridSelectedRowCount.js +3 -2
- package/node/components/GridSkeletonLoadingOverlay.js +4 -3
- package/node/components/cell/GridActionsCellItem.js +6 -7
- package/node/components/cell/GridCell.js +3 -2
- package/node/components/cell/GridEditInputCell.js +72 -3
- package/node/components/cell/GridSkeletonCell.js +1 -2
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +4 -3
- package/node/components/columnHeaders/GridColumnHeaderTitle.js +5 -3
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +3 -2
- package/node/components/columnHeaders/GridIconButtonContainer.js +5 -3
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +5 -3
- package/node/components/columnSelection/GridHeaderCheckbox.js +5 -3
- package/node/components/containers/GridFooterContainer.js +5 -3
- package/node/components/containers/GridOverlay.js +5 -3
- package/node/components/containers/GridRoot.js +5 -3
- package/node/components/containers/GridToolbarContainer.js +3 -2
- package/node/components/menu/columnMenu/GridColumnMenu.js +5 -5
- package/node/components/menu/columnMenu/GridColumnMenuContainer.js +3 -2
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuFilterItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuHideItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuManageItem.js +5 -10
- package/node/components/menu/columnMenu/menuItems/GridColumnMenuSortItem.js +13 -22
- package/node/components/panel/GridPanel.js +3 -2
- package/node/components/panel/GridPanelWrapper.js +5 -3
- package/node/components/panel/filterPanel/GridFilterForm.js +3 -2
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +10 -11
- package/node/components/panel/filterPanel/GridFilterInputValue.js +17 -10
- package/node/components/panel/filterPanel/GridFilterPanel.js +4 -4
- package/node/components/panel/filterPanel/index.js +7 -11
- package/node/components/toolbar/GridToolbar.js +4 -4
- package/node/components/toolbar/GridToolbarColumnsButton.js +3 -2
- package/node/components/toolbar/GridToolbarDensitySelector.js +6 -7
- package/node/components/toolbar/GridToolbarExport.js +2 -1
- package/node/components/toolbar/GridToolbarExportContainer.js +3 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +6 -2
- package/node/components/toolbar/GridToolbarQuickFilter.js +27 -23
- package/node/components/virtualization/GridMainContainer.js +4 -3
- package/node/components/virtualization/GridVirtualScrollbar.js +2 -1
- package/node/components/virtualization/GridVirtualScrollerContent.js +5 -5
- package/node/components/virtualization/GridVirtualScrollerRenderZone.js +5 -3
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +10 -3
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +2 -1
- package/node/hooks/features/columnResize/useGridColumnResize.js +9 -4
- package/node/hooks/features/columns/gridColumnsUtils.js +2 -1
- package/node/hooks/features/rows/useGridRowSpanning.js +74 -85
- package/node/index.js +1 -1
- package/node/internals/utils/index.js +0 -11
- package/node/locales/koKR.js +45 -49
- package/node/locales/nlNL.js +5 -6
- package/node/material/index.js +37 -4
- package/node/models/gridBaseSlots.js +5 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
- package/internals/utils/useProps.d.ts +0 -1
- package/internals/utils/useProps.js +0 -24
- package/joy/icons.d.ts +0 -32
- package/joy/icons.js +0 -431
- package/joy/index.d.ts +0 -2
- package/joy/index.js +0 -2
- package/joy/joySlots.d.ts +0 -3
- package/joy/joySlots.js +0 -389
- package/joy/package.json +0 -6
- package/modern/internals/utils/useProps.js +0 -24
- package/modern/joy/icons.js +0 -431
- package/modern/joy/index.js +0 -2
- package/modern/joy/joySlots.js +0 -389
- package/node/internals/utils/useProps.js +0 -30
- package/node/joy/icons.js +0 -439
- package/node/joy/index.js +0 -13
- package/node/joy/joySlots.js +0 -397
|
@@ -13,10 +13,10 @@ var _constants = require("../../../internals/constants");
|
|
|
13
13
|
var _gridColumnsSelector = require("../columns/gridColumnsSelector");
|
|
14
14
|
var _useGridVisibleRows = require("../../utils/useGridVisibleRows");
|
|
15
15
|
var _gridVirtualizationSelectors = require("../virtualization/gridVirtualizationSelectors");
|
|
16
|
-
var _useGridSelector = require("../../utils/useGridSelector");
|
|
17
|
-
var _gridRowsSelector = require("./gridRowsSelector");
|
|
18
16
|
var _gridRowSpanningUtils = require("./gridRowSpanningUtils");
|
|
19
17
|
var _gridCheckboxSelectionColDef = require("../../../colDef/gridCheckboxSelectionColDef");
|
|
18
|
+
var _useGridApiEventHandler = require("../../utils/useGridApiEventHandler");
|
|
19
|
+
var _utils = require("../../../utils/utils");
|
|
20
20
|
const EMPTY_STATE = {
|
|
21
21
|
spannedCells: {},
|
|
22
22
|
hiddenCells: {},
|
|
@@ -61,8 +61,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
61
61
|
const backwardsHiddenCells = [];
|
|
62
62
|
if (index === rangeToProcess.firstRowIndex) {
|
|
63
63
|
let prevIndex = index - 1;
|
|
64
|
-
|
|
65
|
-
while (prevIndex >= range.firstRowIndex && (0, _gridRowSpanningUtils.getCellValue)(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
64
|
+
let prevRowEntry = visibleRows[prevIndex];
|
|
65
|
+
while (prevIndex >= range.firstRowIndex && prevRowEntry && (0, _gridRowSpanningUtils.getCellValue)(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
66
66
|
const currentRow = visibleRows[prevIndex + 1];
|
|
67
67
|
if (hiddenCells[currentRow.id]) {
|
|
68
68
|
hiddenCells[currentRow.id][colDef.field] = true;
|
|
@@ -76,6 +76,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
76
76
|
spannedRowId = prevRowEntry.id;
|
|
77
77
|
spannedRowIndex = prevIndex;
|
|
78
78
|
prevIndex -= 1;
|
|
79
|
+
prevRowEntry = visibleRows[prevIndex];
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
backwardsHiddenCells.forEach(hiddenCellIndex => {
|
|
@@ -138,75 +139,59 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
138
139
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
139
140
|
*/
|
|
140
141
|
const rowSpanningStateInitializer = (state, props, apiRef) => {
|
|
141
|
-
if (props.rowSpanning) {
|
|
142
|
-
const rowIds = state.rows.dataRowIds || [];
|
|
143
|
-
const orderedFields = state.columns.orderedFields || [];
|
|
144
|
-
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
145
|
-
const columnsLookup = state.columns.lookup;
|
|
146
|
-
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
147
|
-
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
148
|
-
return (0, _extends2.default)({}, state, {
|
|
149
|
-
rowSpanning: EMPTY_STATE
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
const rangeToProcess = {
|
|
153
|
-
firstRowIndex: 0,
|
|
154
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
155
|
-
};
|
|
156
|
-
const rows = rowIds.map(id => ({
|
|
157
|
-
id,
|
|
158
|
-
model: dataRowIdToModelLookup[id]
|
|
159
|
-
}));
|
|
160
|
-
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
161
|
-
const {
|
|
162
|
-
spannedCells,
|
|
163
|
-
hiddenCells,
|
|
164
|
-
hiddenCellOriginMap
|
|
165
|
-
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
142
|
+
if (!props.rowSpanning) {
|
|
166
143
|
return (0, _extends2.default)({}, state, {
|
|
167
|
-
rowSpanning:
|
|
168
|
-
spannedCells,
|
|
169
|
-
hiddenCells,
|
|
170
|
-
hiddenCellOriginMap
|
|
171
|
-
}
|
|
144
|
+
rowSpanning: EMPTY_STATE
|
|
172
145
|
});
|
|
173
146
|
}
|
|
147
|
+
const rowIds = state.rows.dataRowIds || [];
|
|
148
|
+
const orderedFields = state.columns.orderedFields || [];
|
|
149
|
+
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
150
|
+
const columnsLookup = state.columns.lookup;
|
|
151
|
+
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
152
|
+
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
153
|
+
return (0, _extends2.default)({}, state, {
|
|
154
|
+
rowSpanning: EMPTY_STATE
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
const rangeToProcess = {
|
|
158
|
+
firstRowIndex: 0,
|
|
159
|
+
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
160
|
+
};
|
|
161
|
+
const rows = rowIds.map(id => ({
|
|
162
|
+
id,
|
|
163
|
+
model: dataRowIdToModelLookup[id]
|
|
164
|
+
}));
|
|
165
|
+
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
166
|
+
const {
|
|
167
|
+
spannedCells,
|
|
168
|
+
hiddenCells,
|
|
169
|
+
hiddenCellOriginMap
|
|
170
|
+
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
174
171
|
return (0, _extends2.default)({}, state, {
|
|
175
|
-
rowSpanning:
|
|
172
|
+
rowSpanning: {
|
|
173
|
+
spannedCells,
|
|
174
|
+
hiddenCells,
|
|
175
|
+
hiddenCellOriginMap
|
|
176
|
+
}
|
|
176
177
|
});
|
|
177
178
|
};
|
|
178
179
|
exports.rowSpanningStateInitializer = rowSpanningStateInitializer;
|
|
179
180
|
const useGridRowSpanning = (apiRef, props) => {
|
|
180
|
-
const {
|
|
181
|
-
range,
|
|
182
|
-
rows: visibleRows
|
|
183
|
-
} = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef, props);
|
|
184
|
-
const renderContext = (0, _useGridSelector.useGridSelector)(apiRef, _gridVirtualizationSelectors.gridRenderContextSelector);
|
|
185
|
-
const colDefs = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector);
|
|
186
|
-
const tree = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridRowTreeSelector);
|
|
187
181
|
const processedRange = (0, _useLazyRef.default)(() => {
|
|
188
182
|
return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
|
|
189
183
|
firstRowIndex: 0,
|
|
190
184
|
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(apiRef.current.state.rows.dataRowIds.length, 0))
|
|
191
185
|
} : EMPTY_RANGE;
|
|
192
186
|
});
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
(resetState = true) => {
|
|
202
|
-
if (!props.rowSpanning) {
|
|
203
|
-
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
204
|
-
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
205
|
-
rowSpanning: EMPTY_STATE
|
|
206
|
-
}));
|
|
207
|
-
}
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
187
|
+
const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
|
|
188
|
+
const {
|
|
189
|
+
range,
|
|
190
|
+
rows: visibleRows
|
|
191
|
+
} = (0, _useGridVisibleRows.getVisibleRows)(apiRef, {
|
|
192
|
+
pagination: props.pagination,
|
|
193
|
+
paginationMode: props.paginationMode
|
|
194
|
+
});
|
|
210
195
|
if (range === null || !(0, _gridRowSpanningUtils.isRowContextInitialized)(renderContext)) {
|
|
211
196
|
return;
|
|
212
197
|
}
|
|
@@ -220,6 +205,7 @@ const useGridRowSpanning = (apiRef, props) => {
|
|
|
220
205
|
if (rangeToProcess === null) {
|
|
221
206
|
return;
|
|
222
207
|
}
|
|
208
|
+
const colDefs = (0, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector)(apiRef);
|
|
223
209
|
const {
|
|
224
210
|
spannedCells,
|
|
225
211
|
hiddenCells,
|
|
@@ -232,7 +218,8 @@ const useGridRowSpanning = (apiRef, props) => {
|
|
|
232
218
|
const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
|
|
233
219
|
const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
|
|
234
220
|
const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
|
|
235
|
-
|
|
221
|
+
const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
|
|
222
|
+
if (!shouldUpdateState || hasNoSpannedCells) {
|
|
236
223
|
return;
|
|
237
224
|
}
|
|
238
225
|
apiRef.current.setState(state => {
|
|
@@ -244,34 +231,36 @@ const useGridRowSpanning = (apiRef, props) => {
|
|
|
244
231
|
}
|
|
245
232
|
});
|
|
246
233
|
});
|
|
247
|
-
}, [apiRef, props.
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
previousTree.current = tree;
|
|
259
|
-
updateRowSpanningState(true);
|
|
234
|
+
}, [apiRef, processedRange, props.pagination, props.paginationMode]);
|
|
235
|
+
|
|
236
|
+
// Reset events trigger a full re-computation of the row spanning state:
|
|
237
|
+
// - The `unstable_rowSpanning` prop is updated (feature flag)
|
|
238
|
+
// - The filtering is applied
|
|
239
|
+
// - The sorting is applied
|
|
240
|
+
// - The `paginationModel` is updated
|
|
241
|
+
// - The rows are updated
|
|
242
|
+
const resetRowSpanningState = React.useCallback(() => {
|
|
243
|
+
const renderContext = (0, _gridVirtualizationSelectors.gridRenderContextSelector)(apiRef);
|
|
244
|
+
if (!(0, _gridRowSpanningUtils.isRowContextInitialized)(renderContext)) {
|
|
260
245
|
return;
|
|
261
246
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
247
|
+
updateRowSpanningState(renderContext, true);
|
|
248
|
+
}, [apiRef, updateRowSpanningState]);
|
|
249
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'renderedRowsIntervalChange', (0, _utils.runIf)(props.rowSpanning, updateRowSpanningState));
|
|
250
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'sortedRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
251
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'paginationModelChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
252
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'filteredRowsSet', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
253
|
+
(0, _useGridApiEventHandler.useGridApiEventHandler)(apiRef, 'columnsChange', (0, _utils.runIf)(props.rowSpanning, resetRowSpanningState));
|
|
254
|
+
React.useEffect(() => {
|
|
255
|
+
if (!props.rowSpanning) {
|
|
256
|
+
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
257
|
+
apiRef.current.setState(state => (0, _extends2.default)({}, state, {
|
|
258
|
+
rowSpanning: EMPTY_STATE
|
|
259
|
+
}));
|
|
270
260
|
}
|
|
271
|
-
|
|
272
|
-
|
|
261
|
+
} else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
|
|
262
|
+
resetRowSpanningState();
|
|
273
263
|
}
|
|
274
|
-
|
|
275
|
-
}, [updateRowSpanningState, renderContext, range, lastRange, tree]);
|
|
264
|
+
}, [apiRef, resetRowSpanningState, props.rowSpanning]);
|
|
276
265
|
};
|
|
277
266
|
exports.useGridRowSpanning = useGridRowSpanning;
|
package/node/index.js
CHANGED
|
@@ -14,17 +14,6 @@ Object.keys(_computeSlots).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _useProps = require("./useProps");
|
|
18
|
-
Object.keys(_useProps).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _useProps[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _useProps[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _propValidation = require("./propValidation");
|
|
29
18
|
Object.keys(_propValidation).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
package/node/locales/koKR.js
CHANGED
|
@@ -30,16 +30,15 @@ const koKRGrid = {
|
|
|
30
30
|
toolbarQuickFilterLabel: '검색',
|
|
31
31
|
toolbarQuickFilterDeleteIconLabel: '초기화',
|
|
32
32
|
// Prompt toolbar field
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
toolbarPromptControlPlaceholder: '프롬프트 입력…',
|
|
34
|
+
toolbarPromptControlWithRecordingPlaceholder: '프롬프트 입력 또는 녹음…',
|
|
35
|
+
toolbarPromptControlRecordingPlaceholder: '녹음 중…',
|
|
36
|
+
toolbarPromptControlLabel: '프롬프트 입력',
|
|
37
|
+
toolbarPromptControlRecordButtonDefaultLabel: '녹음',
|
|
38
|
+
toolbarPromptControlRecordButtonActiveLabel: '녹음 정지',
|
|
39
|
+
toolbarPromptControlSendActionLabel: '전송',
|
|
40
|
+
toolbarPromptControlSendActionAriaLabel: '프롬프트 전송',
|
|
41
|
+
toolbarPromptControlErrorMessage: '요청을 처리하는 동안 오류가 발생했습니다. 다른 프롬프트로 다시 시도하십시오.',
|
|
43
42
|
// Export selector toolbar button text
|
|
44
43
|
toolbarExport: '내보내기',
|
|
45
44
|
toolbarExportLabel: '내보내기',
|
|
@@ -47,15 +46,14 @@ const koKRGrid = {
|
|
|
47
46
|
toolbarExportPrint: '프린트',
|
|
48
47
|
toolbarExportExcel: 'Excel로 내보내기',
|
|
49
48
|
// Columns management text
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
columnsManagementSearchTitle: '검색',
|
|
50
|
+
columnsManagementNoColumns: '열이 없습니다.',
|
|
51
|
+
columnsManagementShowHideAllText: '모두 보기/숨기기',
|
|
52
|
+
columnsManagementReset: '초기화',
|
|
53
|
+
columnsManagementDeleteIconLabel: '제거',
|
|
56
54
|
// Filter panel text
|
|
57
55
|
filterPanelAddFilter: '필터 추가',
|
|
58
|
-
|
|
56
|
+
filterPanelRemoveAll: '모두 삭제',
|
|
59
57
|
filterPanelDeleteIconLabel: '삭제',
|
|
60
58
|
filterPanelLogicOperator: '논리 연산자',
|
|
61
59
|
filterPanelOperator: '연산자',
|
|
@@ -66,9 +64,9 @@ const koKRGrid = {
|
|
|
66
64
|
filterPanelInputPlaceholder: '값 입력',
|
|
67
65
|
// Filter operators text
|
|
68
66
|
filterOperatorContains: '포함하는',
|
|
69
|
-
|
|
67
|
+
filterOperatorDoesNotContain: '포함하지 않는',
|
|
70
68
|
filterOperatorEquals: '값이 같은',
|
|
71
|
-
|
|
69
|
+
filterOperatorDoesNotEqual: '값이 다른',
|
|
72
70
|
filterOperatorStartsWith: '시작하는',
|
|
73
71
|
filterOperatorEndsWith: '끝나는',
|
|
74
72
|
filterOperatorIs: '~인',
|
|
@@ -80,36 +78,34 @@ const koKRGrid = {
|
|
|
80
78
|
filterOperatorIsEmpty: '값이 없는',
|
|
81
79
|
filterOperatorIsNotEmpty: '값이 있는',
|
|
82
80
|
filterOperatorIsAnyOf: '값 중 하나인',
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
81
|
+
'filterOperator=': '=',
|
|
82
|
+
'filterOperator!=': '!=',
|
|
83
|
+
'filterOperator>': '>',
|
|
84
|
+
'filterOperator>=': '>=',
|
|
85
|
+
'filterOperator<': '<',
|
|
86
|
+
'filterOperator<=': '<=',
|
|
90
87
|
// Header filter operators text
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
88
|
+
headerFilterOperatorContains: '포함하는',
|
|
89
|
+
headerFilterOperatorDoesNotContain: '포함하지 않는',
|
|
90
|
+
headerFilterOperatorEquals: '값이 같은',
|
|
91
|
+
headerFilterOperatorDoesNotEqual: '값이 다른',
|
|
92
|
+
headerFilterOperatorStartsWith: '시작하는',
|
|
93
|
+
headerFilterOperatorEndsWith: '끝나는',
|
|
94
|
+
headerFilterOperatorIs: '~인',
|
|
95
|
+
headerFilterOperatorNot: '~아닌',
|
|
96
|
+
headerFilterOperatorAfter: '더 이후',
|
|
97
|
+
headerFilterOperatorOnOrAfter: '이후',
|
|
98
|
+
headerFilterOperatorBefore: '더 이전',
|
|
99
|
+
headerFilterOperatorOnOrBefore: '이전',
|
|
100
|
+
headerFilterOperatorIsEmpty: '값이 없는',
|
|
101
|
+
headerFilterOperatorIsNotEmpty: '값이 있는',
|
|
102
|
+
headerFilterOperatorIsAnyOf: '값 중 하나인',
|
|
103
|
+
'headerFilterOperator=': '값이 같은',
|
|
104
|
+
'headerFilterOperator!=': '값이 다른',
|
|
105
|
+
'headerFilterOperator>': '더 큰',
|
|
106
|
+
'headerFilterOperator>=': '같거나 더 큰',
|
|
107
|
+
'headerFilterOperator<': '더 작은',
|
|
108
|
+
'headerFilterOperator<=': '같거나 더 작은',
|
|
113
109
|
// Filter values text
|
|
114
110
|
filterValueAny: '아무값',
|
|
115
111
|
filterValueTrue: '참',
|
|
@@ -117,7 +113,7 @@ const koKRGrid = {
|
|
|
117
113
|
// Column menu text
|
|
118
114
|
columnMenuLabel: '메뉴',
|
|
119
115
|
columnMenuShowColumns: '열 표시',
|
|
120
|
-
|
|
116
|
+
columnMenuManageColumns: '열 관리',
|
|
121
117
|
columnMenuFilter: '필터',
|
|
122
118
|
columnMenuHideColumn: '열 숨기기',
|
|
123
119
|
columnMenuUnsort: '정렬 해제',
|
package/node/locales/nlNL.js
CHANGED
|
@@ -51,8 +51,7 @@ const nlNLGrid = {
|
|
|
51
51
|
columnsManagementNoColumns: 'Geen kolommen',
|
|
52
52
|
columnsManagementShowHideAllText: 'Toon/Verberg Alle',
|
|
53
53
|
columnsManagementReset: 'Reset',
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
columnsManagementDeleteIconLabel: 'Verwijderen',
|
|
56
55
|
// Filter panel text
|
|
57
56
|
filterPanelAddFilter: 'Filter toevoegen',
|
|
58
57
|
filterPanelRemoveAll: 'Alles verwijderen',
|
|
@@ -66,9 +65,9 @@ const nlNLGrid = {
|
|
|
66
65
|
filterPanelInputPlaceholder: 'Filter waarde',
|
|
67
66
|
// Filter operators text
|
|
68
67
|
filterOperatorContains: 'bevat',
|
|
69
|
-
|
|
68
|
+
filterOperatorDoesNotContain: 'bevat niet',
|
|
70
69
|
filterOperatorEquals: 'gelijk aan',
|
|
71
|
-
|
|
70
|
+
filterOperatorDoesNotEqual: 'niet gelijk aan',
|
|
72
71
|
filterOperatorStartsWith: 'begint met',
|
|
73
72
|
filterOperatorEndsWith: 'eindigt met',
|
|
74
73
|
filterOperatorIs: 'is',
|
|
@@ -88,9 +87,9 @@ const nlNLGrid = {
|
|
|
88
87
|
'filterOperator<=': '<=',
|
|
89
88
|
// Header filter operators text
|
|
90
89
|
headerFilterOperatorContains: 'Bevat',
|
|
91
|
-
|
|
90
|
+
headerFilterOperatorDoesNotContain: 'Bevat niet',
|
|
92
91
|
headerFilterOperatorEquals: 'Gelijk aan',
|
|
93
|
-
|
|
92
|
+
headerFilterOperatorDoesNotEqual: 'Niet gelijk aan',
|
|
94
93
|
headerFilterOperatorStartsWith: 'Begint met',
|
|
95
94
|
headerFilterOperatorEndsWith: 'Eindigt met',
|
|
96
95
|
headerFilterOperatorIs: 'Is',
|
package/node/material/index.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.default = void 0;
|
|
9
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
8
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
12
|
var _Badge = _interopRequireDefault(require("@mui/material/Badge"));
|
|
10
13
|
var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
14
|
+
var _CircularProgress = _interopRequireDefault(require("@mui/material/CircularProgress"));
|
|
11
15
|
var _Divider = _interopRequireDefault(require("@mui/material/Divider"));
|
|
16
|
+
var _LinearProgress = _interopRequireDefault(require("@mui/material/LinearProgress"));
|
|
17
|
+
var _ListItemIcon = _interopRequireDefault(require("@mui/material/ListItemIcon"));
|
|
18
|
+
var _ListItemText = _interopRequireDefault(require("@mui/material/ListItemText"));
|
|
12
19
|
var _MenuList = _interopRequireDefault(require("@mui/material/MenuList"));
|
|
13
20
|
var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
|
|
14
21
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
@@ -21,9 +28,12 @@ var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
|
21
28
|
var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
|
|
22
29
|
var _InputLabel = _interopRequireDefault(require("@mui/material/InputLabel"));
|
|
23
30
|
var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
|
|
31
|
+
var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
|
|
24
32
|
var _GridColumnUnsortedIcon = require("./icons/GridColumnUnsortedIcon");
|
|
25
33
|
var _icons = require("./icons");
|
|
26
34
|
var _MUISelectOption = _interopRequireDefault(require("./components/MUISelectOption"));
|
|
35
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
36
|
+
const _excluded = ["inert", "iconStart", "iconEnd", "children"];
|
|
27
37
|
const iconSlots = {
|
|
28
38
|
booleanCellTrueIcon: _icons.GridCheckIcon,
|
|
29
39
|
booleanCellFalseIcon: _icons.GridCloseIcon,
|
|
@@ -61,12 +71,14 @@ const iconSlots = {
|
|
|
61
71
|
filterPanelRemoveAllIcon: _icons.GridDeleteForeverIcon,
|
|
62
72
|
columnReorderIcon: _icons.GridDragIcon
|
|
63
73
|
};
|
|
64
|
-
const
|
|
74
|
+
const baseSlots = {
|
|
65
75
|
baseBadge: _Badge.default,
|
|
66
76
|
baseCheckbox: _Checkbox.default,
|
|
77
|
+
baseCircularProgress: _CircularProgress.default,
|
|
67
78
|
baseDivider: _Divider.default,
|
|
79
|
+
baseLinearProgress: _LinearProgress.default,
|
|
68
80
|
baseMenuList: _MenuList.default,
|
|
69
|
-
baseMenuItem:
|
|
81
|
+
baseMenuItem: BaseMenuItem,
|
|
70
82
|
baseTextField: _TextField.default,
|
|
71
83
|
baseFormControl: _FormControl.default,
|
|
72
84
|
baseSelect: _Select.default,
|
|
@@ -77,6 +89,27 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
|
77
89
|
basePopper: _Popper.default,
|
|
78
90
|
baseInputLabel: _InputLabel.default,
|
|
79
91
|
baseSelectOption: _MUISelectOption.default,
|
|
92
|
+
baseSkeleton: _Skeleton.default,
|
|
80
93
|
baseChip: _Chip.default
|
|
81
|
-
}
|
|
82
|
-
|
|
94
|
+
};
|
|
95
|
+
const materialSlots = (0, _extends2.default)({}, baseSlots, iconSlots);
|
|
96
|
+
var _default = exports.default = materialSlots;
|
|
97
|
+
function BaseMenuItem(props) {
|
|
98
|
+
const {
|
|
99
|
+
inert,
|
|
100
|
+
iconStart,
|
|
101
|
+
iconEnd,
|
|
102
|
+
children
|
|
103
|
+
} = props,
|
|
104
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
105
|
+
if (inert) {
|
|
106
|
+
other.disableRipple = true;
|
|
107
|
+
}
|
|
108
|
+
return /*#__PURE__*/React.createElement(_MenuItem.default, other, [iconStart && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemIcon.default, {
|
|
109
|
+
children: iconStart
|
|
110
|
+
}, "1"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemText.default, {
|
|
111
|
+
children: children
|
|
112
|
+
}, "2"), iconEnd && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemIcon.default, {
|
|
113
|
+
children: iconEnd
|
|
114
|
+
}, "3")]);
|
|
115
|
+
}
|
package/node/utils/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.isNumber = isNumber;
|
|
|
14
14
|
exports.isObject = isObject;
|
|
15
15
|
exports.localStorageAvailable = localStorageAvailable;
|
|
16
16
|
exports.range = range;
|
|
17
|
+
exports.runIf = void 0;
|
|
17
18
|
function isNumber(value) {
|
|
18
19
|
return typeof value === 'number' && !Number.isNaN(value);
|
|
19
20
|
}
|
|
@@ -213,4 +214,10 @@ function deepClone(obj) {
|
|
|
213
214
|
* of a `eslint-disable-next-line react-hooks/exhaustive-deps` because
|
|
214
215
|
* that hint disables checks on all values instead of just one.
|
|
215
216
|
*/
|
|
216
|
-
function eslintUseValue(_) {}
|
|
217
|
+
function eslintUseValue(_) {}
|
|
218
|
+
const runIf = (condition, fn) => params => {
|
|
219
|
+
if (condition) {
|
|
220
|
+
fn(params);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
exports.runIf = runIf;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.6",
|
|
4
4
|
"description": "The Community plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^5.1.1",
|
|
45
|
-
"@mui/x-internals": "8.0.0-alpha.
|
|
45
|
+
"@mui/x-internals": "8.0.0-alpha.6"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
package/utils/utils.d.ts
CHANGED
|
@@ -54,3 +54,4 @@ export declare function deepClone(obj: Record<string, any>): any;
|
|
|
54
54
|
* that hint disables checks on all values instead of just one.
|
|
55
55
|
*/
|
|
56
56
|
export declare function eslintUseValue(_: any): void;
|
|
57
|
+
export declare const runIf: (condition: boolean, fn: Function) => (params: unknown) => void;
|
package/utils/utils.js
CHANGED
|
@@ -196,4 +196,9 @@ export function deepClone(obj) {
|
|
|
196
196
|
* of a `eslint-disable-next-line react-hooks/exhaustive-deps` because
|
|
197
197
|
* that hint disables checks on all values instead of just one.
|
|
198
198
|
*/
|
|
199
|
-
export function eslintUseValue(_) {}
|
|
199
|
+
export function eslintUseValue(_) {}
|
|
200
|
+
export const runIf = (condition, fn) => params => {
|
|
201
|
+
if (condition) {
|
|
202
|
+
fn(params);
|
|
203
|
+
}
|
|
204
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useProps<T extends Record<string, any>>(allProps: T): T;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
/** Gathers props for the root element into a single `.forwardedProps` field */
|
|
4
|
-
function groupForwardedProps(props) {
|
|
5
|
-
const keys = Object.keys(props);
|
|
6
|
-
if (!keys.some(key => key.startsWith('aria-') || key.startsWith('data-'))) {
|
|
7
|
-
return props;
|
|
8
|
-
}
|
|
9
|
-
const newProps = {};
|
|
10
|
-
const forwardedProps = props.forwardedProps ?? {};
|
|
11
|
-
for (let i = 0; i < keys.length; i += 1) {
|
|
12
|
-
const key = keys[i];
|
|
13
|
-
if (key.startsWith('aria-') || key.startsWith('data-')) {
|
|
14
|
-
forwardedProps[key] = props[key];
|
|
15
|
-
} else {
|
|
16
|
-
newProps[key] = props[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
newProps.forwardedProps = forwardedProps;
|
|
20
|
-
return newProps;
|
|
21
|
-
}
|
|
22
|
-
export function useProps(allProps) {
|
|
23
|
-
return React.useMemo(() => groupForwardedProps(allProps), [allProps]);
|
|
24
|
-
}
|
package/joy/icons.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { GridIconSlotsComponent } from '../models/gridIconSlotsComponent';
|
|
2
|
-
export declare const GridArrowUpwardIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
3
|
-
export declare const GridArrowDownwardIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
4
|
-
export declare const GridKeyboardArrowLeft: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
5
|
-
export declare const GridKeyboardArrowRight: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
6
|
-
export declare const GridExpandMoreIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
7
|
-
export declare const GridFilterListIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
8
|
-
export declare const GridFilterAltIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
9
|
-
export declare const GridSearchIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
10
|
-
export declare const GridMenuIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
11
|
-
export declare const GridCheckCircleIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
12
|
-
export declare const GridColumnIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
13
|
-
export declare const GridSeparatorIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
14
|
-
export declare const GridViewHeadlineIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
15
|
-
export declare const GridTableRowsIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
16
|
-
export declare const GridViewStreamIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
17
|
-
export declare const GridTripleDotsVerticalIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
18
|
-
export declare const GridCloseIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
19
|
-
export declare const GridAddIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
20
|
-
export declare const GridRemoveIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
21
|
-
export declare const GridLoadIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
22
|
-
export declare const GridDragIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
23
|
-
export declare const GridSaveAltIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
24
|
-
export declare const GridCheckIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
25
|
-
export declare const GridMoreVertIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
26
|
-
export declare const GridVisibilityOffIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
27
|
-
export declare const GridViewColumnIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
28
|
-
export declare const GridClearIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
29
|
-
export declare const GridDeleteIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
30
|
-
export declare const GridDeleteForeverIcon: import("@mui/types").OverridableComponent<import("@mui/joy/SvgIcon").SvgIconTypeMap<{}, "svg">>;
|
|
31
|
-
declare const joyIconSlots: GridIconSlotsComponent;
|
|
32
|
-
export default joyIconSlots;
|