@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
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { styled } from '@mui/system';
|
|
7
7
|
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
+
import { forwardRef } from '@mui/x-internals/forwardRef';
|
|
8
9
|
import { useGridApiContext } from "../../hooks/utils/useGridApiContext.js";
|
|
9
10
|
import { useGridSelector } from "../../hooks/utils/useGridSelector.js";
|
|
10
11
|
import { gridRowsMetaSelector } from "../../hooks/features/rows/index.js";
|
|
@@ -31,7 +32,7 @@ const VirtualScrollerRenderZoneRoot = styled('div', {
|
|
|
31
32
|
// Prevents margin collapsing when using `getRowSpacing`
|
|
32
33
|
flexDirection: 'column'
|
|
33
34
|
});
|
|
34
|
-
const GridVirtualScrollerRenderZone =
|
|
35
|
+
const GridVirtualScrollerRenderZone = forwardRef(function GridVirtualScrollerRenderZone(props, ref) {
|
|
35
36
|
const {
|
|
36
37
|
className
|
|
37
38
|
} = props,
|
|
@@ -45,12 +46,13 @@ const GridVirtualScrollerRenderZone = /*#__PURE__*/React.forwardRef(function Gri
|
|
|
45
46
|
return rowsMeta.positions[renderContext.firstRowIndex] ?? 0;
|
|
46
47
|
});
|
|
47
48
|
return /*#__PURE__*/_jsx(VirtualScrollerRenderZoneRoot, _extends({
|
|
48
|
-
ref: ref,
|
|
49
49
|
className: clsx(classes.root, className),
|
|
50
50
|
ownerState: rootProps,
|
|
51
51
|
style: {
|
|
52
52
|
transform: `translate3d(0, ${offsetTop}px, 0)`
|
|
53
53
|
}
|
|
54
|
-
}, other
|
|
54
|
+
}, other, {
|
|
55
|
+
ref: ref
|
|
56
|
+
}));
|
|
55
57
|
});
|
|
56
58
|
export { GridVirtualScrollerRenderZone };
|
|
@@ -47,7 +47,7 @@ export const useGridColumnHeaders = props => {
|
|
|
47
47
|
const isRtl = useRtl();
|
|
48
48
|
const rootProps = useGridRootProps();
|
|
49
49
|
const dimensions = useGridSelector(apiRef, gridDimensionsSelector);
|
|
50
|
-
const
|
|
50
|
+
const hasColumnVirtualization = useGridSelector(apiRef, gridVirtualizationColumnEnabledSelector);
|
|
51
51
|
const columnGroupsModel = useGridSelector(apiRef, gridColumnGroupsUnwrappedModelSelector);
|
|
52
52
|
const columnPositions = useGridSelector(apiRef, gridColumnPositionsSelector);
|
|
53
53
|
const renderContext = useGridSelector(apiRef, gridRenderContextColumnsSelector);
|
|
@@ -87,8 +87,15 @@ export const useGridColumnHeaders = props => {
|
|
|
87
87
|
renderContext: currentContext = renderContext,
|
|
88
88
|
maxLastColumn = visibleColumns.length
|
|
89
89
|
} = params || {};
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
let firstColumnToRender;
|
|
91
|
+
let lastColumnToRender;
|
|
92
|
+
if (!rootProps.disableVirtualization && !hasColumnVirtualization) {
|
|
93
|
+
firstColumnToRender = 0;
|
|
94
|
+
lastColumnToRender = maxLastColumn;
|
|
95
|
+
} else {
|
|
96
|
+
firstColumnToRender = currentContext.firstColumnIndex;
|
|
97
|
+
lastColumnToRender = currentContext.lastColumnIndex;
|
|
98
|
+
}
|
|
92
99
|
const renderedColumns = visibleColumns.slice(firstColumnToRender, lastColumnToRender);
|
|
93
100
|
return {
|
|
94
101
|
renderedColumns,
|
|
@@ -460,6 +460,7 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
460
460
|
return;
|
|
461
461
|
}
|
|
462
462
|
apiRef.current.autosizeColumns(_extends({}, props.autosizeOptions, {
|
|
463
|
+
disableColumnVirtualization: false,
|
|
463
464
|
columns: [column.field]
|
|
464
465
|
}));
|
|
465
466
|
});
|
|
@@ -486,8 +487,10 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
486
487
|
options.columns = options.columns.filter(c => state.columnVisibilityModel[c] !== false);
|
|
487
488
|
const columns = options.columns.map(c => apiRef.current.state.columns.lookup[c]);
|
|
488
489
|
try {
|
|
489
|
-
|
|
490
|
-
|
|
490
|
+
if (!props.disableVirtualization && options.disableColumnVirtualization) {
|
|
491
|
+
apiRef.current.unstable_setColumnVirtualization(false);
|
|
492
|
+
await columnVirtualizationDisabled();
|
|
493
|
+
}
|
|
491
494
|
const widthByField = extractColumnWidths(apiRef, options, columns);
|
|
492
495
|
const newColumns = columns.map(column => _extends({}, column, {
|
|
493
496
|
width: widthByField[column.field],
|
|
@@ -519,10 +522,12 @@ export const useGridColumnResize = (apiRef, props) => {
|
|
|
519
522
|
}
|
|
520
523
|
});
|
|
521
524
|
} finally {
|
|
522
|
-
|
|
525
|
+
if (!props.disableVirtualization) {
|
|
526
|
+
apiRef.current.unstable_setColumnVirtualization(true);
|
|
527
|
+
}
|
|
523
528
|
isAutosizingRef.current = false;
|
|
524
529
|
}
|
|
525
|
-
}, [apiRef, columnVirtualizationDisabled]);
|
|
530
|
+
}, [apiRef, columnVirtualizationDisabled, props.disableVirtualization]);
|
|
526
531
|
|
|
527
532
|
/**
|
|
528
533
|
* EFFECTS
|
|
@@ -319,6 +319,7 @@ export function getTotalHeaderHeight(apiRef, props) {
|
|
|
319
319
|
const maxDepth = gridColumnGroupsHeaderMaxDepthSelector(apiRef);
|
|
320
320
|
const isHeaderFilteringEnabled = gridHeaderFilteringEnabledSelector(apiRef);
|
|
321
321
|
const columnHeadersHeight = Math.floor(props.columnHeaderHeight * densityFactor);
|
|
322
|
+
const columnGroupHeadersHeight = Math.floor((props.columnGroupHeaderHeight ?? props.columnHeaderHeight) * densityFactor);
|
|
322
323
|
const filterHeadersHeight = isHeaderFilteringEnabled ? Math.floor((props.headerFilterHeight ?? props.columnHeaderHeight) * densityFactor) : 0;
|
|
323
|
-
return columnHeadersHeight
|
|
324
|
+
return columnHeadersHeight + columnGroupHeadersHeight * maxDepth + filterHeadersHeight;
|
|
324
325
|
}
|
|
@@ -3,12 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
4
4
|
import { GRID_DETAIL_PANEL_TOGGLE_FIELD } from "../../../internals/constants.js";
|
|
5
5
|
import { gridVisibleColumnDefinitionsSelector } from "../columns/gridColumnsSelector.js";
|
|
6
|
-
import {
|
|
6
|
+
import { getVisibleRows } from "../../utils/useGridVisibleRows.js";
|
|
7
7
|
import { gridRenderContextSelector } from "../virtualization/gridVirtualizationSelectors.js";
|
|
8
|
-
import {
|
|
9
|
-
import { gridRowTreeSelector } from "./gridRowsSelector.js";
|
|
10
|
-
import { getUnprocessedRange, isRowRangeUpdated, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
8
|
+
import { getUnprocessedRange, isRowContextInitialized, getCellValue } from "./gridRowSpanningUtils.js";
|
|
11
9
|
import { GRID_CHECKBOX_SELECTION_FIELD } from "../../../colDef/gridCheckboxSelectionColDef.js";
|
|
10
|
+
import { useGridApiEventHandler } from "../../utils/useGridApiEventHandler.js";
|
|
11
|
+
import { runIf } from "../../../utils/utils.js";
|
|
12
12
|
const EMPTY_STATE = {
|
|
13
13
|
spannedCells: {},
|
|
14
14
|
hiddenCells: {},
|
|
@@ -53,8 +53,8 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
53
53
|
const backwardsHiddenCells = [];
|
|
54
54
|
if (index === rangeToProcess.firstRowIndex) {
|
|
55
55
|
let prevIndex = index - 1;
|
|
56
|
-
|
|
57
|
-
while (prevIndex >= range.firstRowIndex && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
56
|
+
let prevRowEntry = visibleRows[prevIndex];
|
|
57
|
+
while (prevIndex >= range.firstRowIndex && prevRowEntry && getCellValue(prevRowEntry.model, colDef, apiRef) === cellValue) {
|
|
58
58
|
const currentRow = visibleRows[prevIndex + 1];
|
|
59
59
|
if (hiddenCells[currentRow.id]) {
|
|
60
60
|
hiddenCells[currentRow.id][colDef.field] = true;
|
|
@@ -68,6 +68,7 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
68
68
|
spannedRowId = prevRowEntry.id;
|
|
69
69
|
spannedRowIndex = prevIndex;
|
|
70
70
|
prevIndex -= 1;
|
|
71
|
+
prevRowEntry = visibleRows[prevIndex];
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
backwardsHiddenCells.forEach(hiddenCellIndex => {
|
|
@@ -130,74 +131,58 @@ const computeRowSpanningState = (apiRef, colDefs, visibleRows, range, rangeToPro
|
|
|
130
131
|
* @requires filterStateInitializer (method) - should be initialized before
|
|
131
132
|
*/
|
|
132
133
|
export const rowSpanningStateInitializer = (state, props, apiRef) => {
|
|
133
|
-
if (props.rowSpanning) {
|
|
134
|
-
const rowIds = state.rows.dataRowIds || [];
|
|
135
|
-
const orderedFields = state.columns.orderedFields || [];
|
|
136
|
-
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
137
|
-
const columnsLookup = state.columns.lookup;
|
|
138
|
-
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
139
|
-
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
140
|
-
return _extends({}, state, {
|
|
141
|
-
rowSpanning: EMPTY_STATE
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const rangeToProcess = {
|
|
145
|
-
firstRowIndex: 0,
|
|
146
|
-
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
147
|
-
};
|
|
148
|
-
const rows = rowIds.map(id => ({
|
|
149
|
-
id,
|
|
150
|
-
model: dataRowIdToModelLookup[id]
|
|
151
|
-
}));
|
|
152
|
-
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
153
|
-
const {
|
|
154
|
-
spannedCells,
|
|
155
|
-
hiddenCells,
|
|
156
|
-
hiddenCellOriginMap
|
|
157
|
-
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
134
|
+
if (!props.rowSpanning) {
|
|
158
135
|
return _extends({}, state, {
|
|
159
|
-
rowSpanning:
|
|
160
|
-
spannedCells,
|
|
161
|
-
hiddenCells,
|
|
162
|
-
hiddenCellOriginMap
|
|
163
|
-
}
|
|
136
|
+
rowSpanning: EMPTY_STATE
|
|
164
137
|
});
|
|
165
138
|
}
|
|
139
|
+
const rowIds = state.rows.dataRowIds || [];
|
|
140
|
+
const orderedFields = state.columns.orderedFields || [];
|
|
141
|
+
const dataRowIdToModelLookup = state.rows.dataRowIdToModelLookup;
|
|
142
|
+
const columnsLookup = state.columns.lookup;
|
|
143
|
+
const isFilteringPending = Boolean(state.filter.filterModel.items.length) || Boolean(state.filter.filterModel.quickFilterValues?.length);
|
|
144
|
+
if (!rowIds.length || !orderedFields.length || !dataRowIdToModelLookup || !columnsLookup || isFilteringPending) {
|
|
145
|
+
return _extends({}, state, {
|
|
146
|
+
rowSpanning: EMPTY_STATE
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const rangeToProcess = {
|
|
150
|
+
firstRowIndex: 0,
|
|
151
|
+
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(rowIds.length, 0))
|
|
152
|
+
};
|
|
153
|
+
const rows = rowIds.map(id => ({
|
|
154
|
+
id,
|
|
155
|
+
model: dataRowIdToModelLookup[id]
|
|
156
|
+
}));
|
|
157
|
+
const colDefs = orderedFields.map(field => columnsLookup[field]);
|
|
158
|
+
const {
|
|
159
|
+
spannedCells,
|
|
160
|
+
hiddenCells,
|
|
161
|
+
hiddenCellOriginMap
|
|
162
|
+
} = computeRowSpanningState(apiRef, colDefs, rows, rangeToProcess, rangeToProcess, true, EMPTY_RANGE);
|
|
166
163
|
return _extends({}, state, {
|
|
167
|
-
rowSpanning:
|
|
164
|
+
rowSpanning: {
|
|
165
|
+
spannedCells,
|
|
166
|
+
hiddenCells,
|
|
167
|
+
hiddenCellOriginMap
|
|
168
|
+
}
|
|
168
169
|
});
|
|
169
170
|
};
|
|
170
171
|
export const useGridRowSpanning = (apiRef, props) => {
|
|
171
|
-
const {
|
|
172
|
-
range,
|
|
173
|
-
rows: visibleRows
|
|
174
|
-
} = useGridVisibleRows(apiRef, props);
|
|
175
|
-
const renderContext = useGridSelector(apiRef, gridRenderContextSelector);
|
|
176
|
-
const colDefs = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);
|
|
177
|
-
const tree = useGridSelector(apiRef, gridRowTreeSelector);
|
|
178
172
|
const processedRange = useLazyRef(() => {
|
|
179
173
|
return Object.keys(apiRef.current.state.rowSpanning.spannedCells).length > 0 ? {
|
|
180
174
|
firstRowIndex: 0,
|
|
181
175
|
lastRowIndex: Math.min(DEFAULT_ROWS_TO_PROCESS, Math.max(apiRef.current.state.rows.dataRowIds.length, 0))
|
|
182
176
|
} : EMPTY_RANGE;
|
|
183
177
|
});
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
(resetState = true) => {
|
|
193
|
-
if (!props.rowSpanning) {
|
|
194
|
-
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
195
|
-
apiRef.current.setState(state => _extends({}, state, {
|
|
196
|
-
rowSpanning: EMPTY_STATE
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
178
|
+
const updateRowSpanningState = React.useCallback((renderContext, resetState = false) => {
|
|
179
|
+
const {
|
|
180
|
+
range,
|
|
181
|
+
rows: visibleRows
|
|
182
|
+
} = getVisibleRows(apiRef, {
|
|
183
|
+
pagination: props.pagination,
|
|
184
|
+
paginationMode: props.paginationMode
|
|
185
|
+
});
|
|
201
186
|
if (range === null || !isRowContextInitialized(renderContext)) {
|
|
202
187
|
return;
|
|
203
188
|
}
|
|
@@ -211,6 +196,7 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
211
196
|
if (rangeToProcess === null) {
|
|
212
197
|
return;
|
|
213
198
|
}
|
|
199
|
+
const colDefs = gridVisibleColumnDefinitionsSelector(apiRef);
|
|
214
200
|
const {
|
|
215
201
|
spannedCells,
|
|
216
202
|
hiddenCells,
|
|
@@ -223,7 +209,8 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
223
209
|
const currentSpannedCellsCount = Object.keys(apiRef.current.state.rowSpanning.spannedCells).length;
|
|
224
210
|
const currentHiddenCellsCount = Object.keys(apiRef.current.state.rowSpanning.hiddenCells).length;
|
|
225
211
|
const shouldUpdateState = resetState || newSpannedCellsCount !== currentSpannedCellsCount || newHiddenCellsCount !== currentHiddenCellsCount;
|
|
226
|
-
|
|
212
|
+
const hasNoSpannedCells = newSpannedCellsCount === 0 && currentSpannedCellsCount === 0;
|
|
213
|
+
if (!shouldUpdateState || hasNoSpannedCells) {
|
|
227
214
|
return;
|
|
228
215
|
}
|
|
229
216
|
apiRef.current.setState(state => {
|
|
@@ -235,33 +222,35 @@ export const useGridRowSpanning = (apiRef, props) => {
|
|
|
235
222
|
}
|
|
236
223
|
});
|
|
237
224
|
});
|
|
238
|
-
}, [apiRef, props.
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (
|
|
249
|
-
previousTree.current = tree;
|
|
250
|
-
updateRowSpanningState(true);
|
|
225
|
+
}, [apiRef, processedRange, props.pagination, props.paginationMode]);
|
|
226
|
+
|
|
227
|
+
// Reset events trigger a full re-computation of the row spanning state:
|
|
228
|
+
// - The `unstable_rowSpanning` prop is updated (feature flag)
|
|
229
|
+
// - The filtering is applied
|
|
230
|
+
// - The sorting is applied
|
|
231
|
+
// - The `paginationModel` is updated
|
|
232
|
+
// - The rows are updated
|
|
233
|
+
const resetRowSpanningState = React.useCallback(() => {
|
|
234
|
+
const renderContext = gridRenderContextSelector(apiRef);
|
|
235
|
+
if (!isRowContextInitialized(renderContext)) {
|
|
251
236
|
return;
|
|
252
237
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
238
|
+
updateRowSpanningState(renderContext, true);
|
|
239
|
+
}, [apiRef, updateRowSpanningState]);
|
|
240
|
+
useGridApiEventHandler(apiRef, 'renderedRowsIntervalChange', runIf(props.rowSpanning, updateRowSpanningState));
|
|
241
|
+
useGridApiEventHandler(apiRef, 'sortedRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
242
|
+
useGridApiEventHandler(apiRef, 'paginationModelChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
243
|
+
useGridApiEventHandler(apiRef, 'filteredRowsSet', runIf(props.rowSpanning, resetRowSpanningState));
|
|
244
|
+
useGridApiEventHandler(apiRef, 'columnsChange', runIf(props.rowSpanning, resetRowSpanningState));
|
|
245
|
+
React.useEffect(() => {
|
|
246
|
+
if (!props.rowSpanning) {
|
|
247
|
+
if (apiRef.current.state.rowSpanning !== EMPTY_STATE) {
|
|
248
|
+
apiRef.current.setState(state => _extends({}, state, {
|
|
249
|
+
rowSpanning: EMPTY_STATE
|
|
250
|
+
}));
|
|
261
251
|
}
|
|
262
|
-
|
|
263
|
-
|
|
252
|
+
} else if (apiRef.current.state.rowSpanning === EMPTY_STATE) {
|
|
253
|
+
resetRowSpanningState();
|
|
264
254
|
}
|
|
265
|
-
|
|
266
|
-
}, [updateRowSpanningState, renderContext, range, lastRange, tree]);
|
|
255
|
+
}, [apiRef, resetRowSpanningState, props.rowSpanning]);
|
|
267
256
|
};
|
package/modern/index.js
CHANGED
package/modern/locales/koKR.js
CHANGED
|
@@ -24,16 +24,15 @@ const koKRGrid = {
|
|
|
24
24
|
toolbarQuickFilterLabel: '검색',
|
|
25
25
|
toolbarQuickFilterDeleteIconLabel: '초기화',
|
|
26
26
|
// Prompt toolbar field
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
toolbarPromptControlPlaceholder: '프롬프트 입력…',
|
|
28
|
+
toolbarPromptControlWithRecordingPlaceholder: '프롬프트 입력 또는 녹음…',
|
|
29
|
+
toolbarPromptControlRecordingPlaceholder: '녹음 중…',
|
|
30
|
+
toolbarPromptControlLabel: '프롬프트 입력',
|
|
31
|
+
toolbarPromptControlRecordButtonDefaultLabel: '녹음',
|
|
32
|
+
toolbarPromptControlRecordButtonActiveLabel: '녹음 정지',
|
|
33
|
+
toolbarPromptControlSendActionLabel: '전송',
|
|
34
|
+
toolbarPromptControlSendActionAriaLabel: '프롬프트 전송',
|
|
35
|
+
toolbarPromptControlErrorMessage: '요청을 처리하는 동안 오류가 발생했습니다. 다른 프롬프트로 다시 시도하십시오.',
|
|
37
36
|
// Export selector toolbar button text
|
|
38
37
|
toolbarExport: '내보내기',
|
|
39
38
|
toolbarExportLabel: '내보내기',
|
|
@@ -41,15 +40,14 @@ const koKRGrid = {
|
|
|
41
40
|
toolbarExportPrint: '프린트',
|
|
42
41
|
toolbarExportExcel: 'Excel로 내보내기',
|
|
43
42
|
// Columns management text
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
columnsManagementSearchTitle: '검색',
|
|
44
|
+
columnsManagementNoColumns: '열이 없습니다.',
|
|
45
|
+
columnsManagementShowHideAllText: '모두 보기/숨기기',
|
|
46
|
+
columnsManagementReset: '초기화',
|
|
47
|
+
columnsManagementDeleteIconLabel: '제거',
|
|
50
48
|
// Filter panel text
|
|
51
49
|
filterPanelAddFilter: '필터 추가',
|
|
52
|
-
|
|
50
|
+
filterPanelRemoveAll: '모두 삭제',
|
|
53
51
|
filterPanelDeleteIconLabel: '삭제',
|
|
54
52
|
filterPanelLogicOperator: '논리 연산자',
|
|
55
53
|
filterPanelOperator: '연산자',
|
|
@@ -60,9 +58,9 @@ const koKRGrid = {
|
|
|
60
58
|
filterPanelInputPlaceholder: '값 입력',
|
|
61
59
|
// Filter operators text
|
|
62
60
|
filterOperatorContains: '포함하는',
|
|
63
|
-
|
|
61
|
+
filterOperatorDoesNotContain: '포함하지 않는',
|
|
64
62
|
filterOperatorEquals: '값이 같은',
|
|
65
|
-
|
|
63
|
+
filterOperatorDoesNotEqual: '값이 다른',
|
|
66
64
|
filterOperatorStartsWith: '시작하는',
|
|
67
65
|
filterOperatorEndsWith: '끝나는',
|
|
68
66
|
filterOperatorIs: '~인',
|
|
@@ -74,36 +72,34 @@ const koKRGrid = {
|
|
|
74
72
|
filterOperatorIsEmpty: '값이 없는',
|
|
75
73
|
filterOperatorIsNotEmpty: '값이 있는',
|
|
76
74
|
filterOperatorIsAnyOf: '값 중 하나인',
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
'filterOperator=': '=',
|
|
76
|
+
'filterOperator!=': '!=',
|
|
77
|
+
'filterOperator>': '>',
|
|
78
|
+
'filterOperator>=': '>=',
|
|
79
|
+
'filterOperator<': '<',
|
|
80
|
+
'filterOperator<=': '<=',
|
|
84
81
|
// Header filter operators text
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
82
|
+
headerFilterOperatorContains: '포함하는',
|
|
83
|
+
headerFilterOperatorDoesNotContain: '포함하지 않는',
|
|
84
|
+
headerFilterOperatorEquals: '값이 같은',
|
|
85
|
+
headerFilterOperatorDoesNotEqual: '값이 다른',
|
|
86
|
+
headerFilterOperatorStartsWith: '시작하는',
|
|
87
|
+
headerFilterOperatorEndsWith: '끝나는',
|
|
88
|
+
headerFilterOperatorIs: '~인',
|
|
89
|
+
headerFilterOperatorNot: '~아닌',
|
|
90
|
+
headerFilterOperatorAfter: '더 이후',
|
|
91
|
+
headerFilterOperatorOnOrAfter: '이후',
|
|
92
|
+
headerFilterOperatorBefore: '더 이전',
|
|
93
|
+
headerFilterOperatorOnOrBefore: '이전',
|
|
94
|
+
headerFilterOperatorIsEmpty: '값이 없는',
|
|
95
|
+
headerFilterOperatorIsNotEmpty: '값이 있는',
|
|
96
|
+
headerFilterOperatorIsAnyOf: '값 중 하나인',
|
|
97
|
+
'headerFilterOperator=': '값이 같은',
|
|
98
|
+
'headerFilterOperator!=': '값이 다른',
|
|
99
|
+
'headerFilterOperator>': '더 큰',
|
|
100
|
+
'headerFilterOperator>=': '같거나 더 큰',
|
|
101
|
+
'headerFilterOperator<': '더 작은',
|
|
102
|
+
'headerFilterOperator<=': '같거나 더 작은',
|
|
107
103
|
// Filter values text
|
|
108
104
|
filterValueAny: '아무값',
|
|
109
105
|
filterValueTrue: '참',
|
|
@@ -111,7 +107,7 @@ const koKRGrid = {
|
|
|
111
107
|
// Column menu text
|
|
112
108
|
columnMenuLabel: '메뉴',
|
|
113
109
|
columnMenuShowColumns: '열 표시',
|
|
114
|
-
|
|
110
|
+
columnMenuManageColumns: '열 관리',
|
|
115
111
|
columnMenuFilter: '필터',
|
|
116
112
|
columnMenuHideColumn: '열 숨기기',
|
|
117
113
|
columnMenuUnsort: '정렬 해제',
|
package/modern/locales/nlNL.js
CHANGED
|
@@ -45,8 +45,7 @@ const nlNLGrid = {
|
|
|
45
45
|
columnsManagementNoColumns: 'Geen kolommen',
|
|
46
46
|
columnsManagementShowHideAllText: 'Toon/Verberg Alle',
|
|
47
47
|
columnsManagementReset: 'Reset',
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
columnsManagementDeleteIconLabel: 'Verwijderen',
|
|
50
49
|
// Filter panel text
|
|
51
50
|
filterPanelAddFilter: 'Filter toevoegen',
|
|
52
51
|
filterPanelRemoveAll: 'Alles verwijderen',
|
|
@@ -60,9 +59,9 @@ const nlNLGrid = {
|
|
|
60
59
|
filterPanelInputPlaceholder: 'Filter waarde',
|
|
61
60
|
// Filter operators text
|
|
62
61
|
filterOperatorContains: 'bevat',
|
|
63
|
-
|
|
62
|
+
filterOperatorDoesNotContain: 'bevat niet',
|
|
64
63
|
filterOperatorEquals: 'gelijk aan',
|
|
65
|
-
|
|
64
|
+
filterOperatorDoesNotEqual: 'niet gelijk aan',
|
|
66
65
|
filterOperatorStartsWith: 'begint met',
|
|
67
66
|
filterOperatorEndsWith: 'eindigt met',
|
|
68
67
|
filterOperatorIs: 'is',
|
|
@@ -82,9 +81,9 @@ const nlNLGrid = {
|
|
|
82
81
|
'filterOperator<=': '<=',
|
|
83
82
|
// Header filter operators text
|
|
84
83
|
headerFilterOperatorContains: 'Bevat',
|
|
85
|
-
|
|
84
|
+
headerFilterOperatorDoesNotContain: 'Bevat niet',
|
|
86
85
|
headerFilterOperatorEquals: 'Gelijk aan',
|
|
87
|
-
|
|
86
|
+
headerFilterOperatorDoesNotEqual: 'Niet gelijk aan',
|
|
88
87
|
headerFilterOperatorStartsWith: 'Begint met',
|
|
89
88
|
headerFilterOperatorEndsWith: 'Eindigt met',
|
|
90
89
|
headerFilterOperatorIs: 'Is',
|
package/modern/material/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
const _excluded = ["inert", "iconStart", "iconEnd", "children"];
|
|
4
|
+
import * as React from 'react';
|
|
2
5
|
import MUIBadge from '@mui/material/Badge';
|
|
3
6
|
import MUICheckbox from '@mui/material/Checkbox';
|
|
7
|
+
import MUICircularProgress from '@mui/material/CircularProgress';
|
|
4
8
|
import MUIDivider from '@mui/material/Divider';
|
|
9
|
+
import MUILinearProgress from '@mui/material/LinearProgress';
|
|
10
|
+
import MUIListItemIcon from '@mui/material/ListItemIcon';
|
|
11
|
+
import MUIListItemText from '@mui/material/ListItemText';
|
|
5
12
|
import MUIMenuList from '@mui/material/MenuList';
|
|
6
13
|
import MUIMenuItem from '@mui/material/MenuItem';
|
|
7
14
|
import MUITextField from '@mui/material/TextField';
|
|
@@ -14,9 +21,11 @@ import MUITooltip from '@mui/material/Tooltip';
|
|
|
14
21
|
import MUIPopper from '@mui/material/Popper';
|
|
15
22
|
import MUIInputLabel from '@mui/material/InputLabel';
|
|
16
23
|
import MUIChip from '@mui/material/Chip';
|
|
24
|
+
import MUISkeleton from '@mui/material/Skeleton';
|
|
17
25
|
import { GridColumnUnsortedIcon } from "./icons/GridColumnUnsortedIcon.js";
|
|
18
26
|
import { GridAddIcon, GridArrowDownwardIcon, GridArrowUpwardIcon, GridCheckIcon, GridCloseIcon, GridColumnIcon, GridDragIcon, GridExpandMoreIcon, GridFilterAltIcon, GridFilterListIcon, GridKeyboardArrowRight, GridMoreVertIcon, GridRemoveIcon, GridSaveAltIcon, GridSearchIcon, GridSeparatorIcon, GridTableRowsIcon, GridTripleDotsVerticalIcon, GridViewHeadlineIcon, GridViewStreamIcon, GridVisibilityOffIcon, GridViewColumnIcon, GridClearIcon, GridLoadIcon, GridDeleteForeverIcon } from "./icons/index.js";
|
|
19
27
|
import MUISelectOption from "./components/MUISelectOption.js";
|
|
28
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
29
|
const iconSlots = {
|
|
21
30
|
booleanCellTrueIcon: GridCheckIcon,
|
|
22
31
|
booleanCellFalseIcon: GridCloseIcon,
|
|
@@ -54,12 +63,14 @@ const iconSlots = {
|
|
|
54
63
|
filterPanelRemoveAllIcon: GridDeleteForeverIcon,
|
|
55
64
|
columnReorderIcon: GridDragIcon
|
|
56
65
|
};
|
|
57
|
-
const
|
|
66
|
+
const baseSlots = {
|
|
58
67
|
baseBadge: MUIBadge,
|
|
59
68
|
baseCheckbox: MUICheckbox,
|
|
69
|
+
baseCircularProgress: MUICircularProgress,
|
|
60
70
|
baseDivider: MUIDivider,
|
|
71
|
+
baseLinearProgress: MUILinearProgress,
|
|
61
72
|
baseMenuList: MUIMenuList,
|
|
62
|
-
baseMenuItem:
|
|
73
|
+
baseMenuItem: BaseMenuItem,
|
|
63
74
|
baseTextField: MUITextField,
|
|
64
75
|
baseFormControl: MUIFormControl,
|
|
65
76
|
baseSelect: MUISelect,
|
|
@@ -70,6 +81,27 @@ const materialSlots = _extends({}, iconSlots, {
|
|
|
70
81
|
basePopper: MUIPopper,
|
|
71
82
|
baseInputLabel: MUIInputLabel,
|
|
72
83
|
baseSelectOption: MUISelectOption,
|
|
84
|
+
baseSkeleton: MUISkeleton,
|
|
73
85
|
baseChip: MUIChip
|
|
74
|
-
}
|
|
75
|
-
|
|
86
|
+
};
|
|
87
|
+
const materialSlots = _extends({}, baseSlots, iconSlots);
|
|
88
|
+
export default materialSlots;
|
|
89
|
+
function BaseMenuItem(props) {
|
|
90
|
+
const {
|
|
91
|
+
inert,
|
|
92
|
+
iconStart,
|
|
93
|
+
iconEnd,
|
|
94
|
+
children
|
|
95
|
+
} = props,
|
|
96
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
97
|
+
if (inert) {
|
|
98
|
+
other.disableRipple = true;
|
|
99
|
+
}
|
|
100
|
+
return /*#__PURE__*/React.createElement(MUIMenuItem, other, [iconStart && /*#__PURE__*/_jsx(MUIListItemIcon, {
|
|
101
|
+
children: iconStart
|
|
102
|
+
}, "1"), /*#__PURE__*/_jsx(MUIListItemText, {
|
|
103
|
+
children: children
|
|
104
|
+
}, "2"), iconEnd && /*#__PURE__*/_jsx(MUIListItemIcon, {
|
|
105
|
+
children: iconEnd
|
|
106
|
+
}, "3")]);
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/modern/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
|
+
};
|