@mui/x-data-grid 8.0.0-alpha.7 → 8.0.0-alpha.8
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 +115 -0
- package/DataGrid/DataGrid.js +4 -5
- package/DataGrid/useDataGridComponent.js +1 -1
- package/components/GridHeaders.js +2 -2
- package/components/GridRow.d.ts +5 -9
- package/components/GridRow.js +26 -78
- package/components/GridSkeletonLoadingOverlay.js +18 -18
- package/components/cell/GridCell.d.ts +9 -16
- package/components/cell/GridCell.js +17 -35
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -5
- package/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -5
- package/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/components/containers/GridRoot.d.ts +2 -2
- package/components/containers/GridRoot.js +14 -6
- package/components/containers/GridRootStyles.js +7 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/components/panel/filterPanel/GridFilterInputDate.d.ts +2 -1
- package/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/components/panel/filterPanel/GridFilterInputSingleSelect.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/components/panel/filterPanel/GridFilterInputValue.d.ts +1 -0
- package/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/components/panel/filterPanel/GridFilterInputValueProps.d.ts +1 -1
- package/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/components/virtualization/GridVirtualScroller.js +4 -4
- package/constants/gridClasses.d.ts +12 -0
- package/constants/gridClasses.js +1 -1
- package/constants/localeTextConstants.js +1 -0
- package/context/GridContextProvider.d.ts +1 -1
- package/hooks/features/clipboard/useGridClipboard.d.ts +1 -1
- package/hooks/features/columnGrouping/useGridColumnGrouping.d.ts +1 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +5 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/hooks/features/columnMenu/useGridColumnMenu.d.ts +1 -1
- package/hooks/features/columns/gridColumnsUtils.d.ts +3 -3
- package/hooks/features/columns/useGridColumnSpanning.d.ts +1 -1
- package/hooks/features/columns/useGridColumns.d.ts +1 -1
- package/hooks/features/density/useGridDensity.d.ts +1 -1
- package/hooks/features/dimensions/useGridDimensions.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.d.ts +1 -1
- package/hooks/features/editing/useGridCellEditing.js +1 -1
- package/hooks/features/editing/useGridEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.d.ts +1 -1
- package/hooks/features/editing/useGridRowEditing.js +1 -1
- package/hooks/features/events/useGridEvents.d.ts +1 -1
- package/hooks/features/export/serializers/csvSerializer.d.ts +1 -1
- package/hooks/features/export/useGridCsvExport.d.ts +1 -1
- package/hooks/features/export/useGridPrintExport.d.ts +1 -1
- package/hooks/features/export/utils.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.d.ts +1 -1
- package/hooks/features/filter/gridFilterSelector.js +6 -1
- package/hooks/features/filter/gridFilterUtils.d.ts +6 -6
- package/hooks/features/filter/gridFilterUtils.js +3 -3
- package/hooks/features/filter/useGridFilter.d.ts +1 -1
- package/hooks/features/focus/useGridFocus.d.ts +1 -1
- package/hooks/features/headerFiltering/useGridHeaderFiltering.d.ts +1 -1
- package/hooks/features/keyboardNavigation/utils.d.ts +2 -2
- package/hooks/features/listView/useGridListView.d.ts +1 -1
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +3 -0
- package/hooks/features/pagination/gridPaginationSelector.d.ts +21 -2
- package/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/hooks/features/pagination/useGridPagination.d.ts +2 -2
- package/hooks/features/pagination/useGridPagination.js +5 -3
- package/hooks/features/pagination/useGridPaginationMeta.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.d.ts +1 -1
- package/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/hooks/features/pagination/useGridRowCount.d.ts +1 -1
- package/hooks/features/preferencesPanel/useGridPreferencesPanel.d.ts +1 -1
- package/hooks/features/rowSelection/useGridRowSelection.d.ts +1 -1
- package/hooks/features/rowSelection/utils.d.ts +2 -2
- package/hooks/features/rows/gridRowSpanningUtils.d.ts +1 -1
- package/hooks/features/rows/gridRowsSelector.js +1 -1
- package/hooks/features/rows/gridRowsUtils.d.ts +3 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
- package/hooks/features/rows/useGridRowSpanning.d.ts +1 -1
- package/hooks/features/rows/useGridRows.d.ts +1 -1
- package/hooks/features/rows/useGridRows.js +2 -2
- package/hooks/features/rows/useGridRowsMeta.d.ts +1 -1
- package/hooks/features/scroll/useGridScroll.d.ts +1 -1
- package/hooks/features/sorting/gridSortingUtils.d.ts +2 -2
- package/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/hooks/features/sorting/useGridSorting.d.ts +1 -1
- package/hooks/features/statePersistence/useGridStatePersistence.d.ts +1 -1
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.d.ts +6 -0
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +91 -42
- package/hooks/features/virtualization/useGridVirtualization.d.ts +1 -1
- package/hooks/utils/useGridApiContext.d.ts +1 -1
- package/hooks/utils/useGridApiEventHandler.d.ts +3 -3
- package/hooks/utils/useGridNativeEventListener.d.ts +1 -1
- package/hooks/utils/useGridPrivateApiContext.d.ts +1 -1
- package/hooks/utils/useGridSelector.d.ts +1 -1
- package/hooks/utils/useGridVisibleRows.d.ts +7 -5
- package/hooks/utils/useGridVisibleRows.js +5 -28
- package/index.js +1 -1
- package/internals/constants.d.ts +6 -0
- package/internals/constants.js +8 -1
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/utils/attachPinnedStyle.d.ts +2 -0
- package/internals/utils/attachPinnedStyle.js +9 -0
- package/internals/utils/getPinnedCellOffset.d.ts +3 -3
- package/internals/utils/getPinnedCellOffset.js +6 -7
- package/internals/utils/index.d.ts +1 -0
- package/internals/utils/index.js +2 -1
- package/locales/arSD.js +2 -0
- package/locales/beBY.js +1 -0
- package/locales/bgBG.js +2 -0
- package/locales/csCZ.js +2 -0
- package/locales/daDK.js +2 -0
- package/locales/deDE.js +2 -0
- package/locales/elGR.js +2 -0
- package/locales/esES.js +2 -0
- package/locales/faIR.js +2 -0
- package/locales/fiFI.js +2 -0
- package/locales/frFR.js +2 -0
- package/locales/heIL.js +2 -0
- package/locales/hrHR.js +2 -0
- package/locales/huHU.js +2 -0
- package/locales/isIS.js +2 -0
- package/locales/itIT.js +2 -0
- package/locales/jaJP.js +2 -0
- package/locales/koKR.js +2 -0
- package/locales/nbNO.js +2 -0
- package/locales/nlNL.js +2 -0
- package/locales/nnNO.js +2 -0
- package/locales/plPL.js +2 -0
- package/locales/ptBR.js +2 -0
- package/locales/ptPT.js +2 -0
- package/locales/roRO.js +2 -0
- package/locales/ruRU.js +2 -0
- package/locales/skSK.js +2 -0
- package/locales/svSE.js +2 -0
- package/locales/trTR.js +2 -0
- package/locales/ukUA.js +2 -0
- package/locales/urPK.js +2 -0
- package/locales/viVN.js +2 -0
- package/locales/zhCN.js +2 -0
- package/locales/zhHK.js +2 -0
- package/locales/zhTW.js +2 -0
- package/material/index.js +2 -1
- package/models/api/gridLocaleTextApi.d.ts +1 -0
- package/models/colDef/gridColDef.d.ts +8 -8
- package/models/events/gridEventLookup.d.ts +6 -1
- package/models/gridExport.d.ts +1 -1
- package/models/gridFilterOperator.d.ts +1 -1
- package/models/gridIconSlotsComponent.d.ts +5 -0
- package/models/gridStateCommunity.d.ts +4 -0
- package/modern/DataGrid/DataGrid.js +4 -5
- package/modern/DataGrid/useDataGridComponent.js +1 -1
- package/modern/components/GridHeaders.js +2 -2
- package/modern/components/GridRow.js +26 -78
- package/modern/components/GridSkeletonLoadingOverlay.js +18 -18
- package/modern/components/cell/GridCell.js +17 -35
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/modern/components/columnSelection/GridCellCheckboxRenderer.js +2 -2
- package/modern/components/containers/GridRoot.js +14 -6
- package/modern/components/containers/GridRootStyles.js +7 -0
- package/modern/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/modern/components/panel/filterPanel/GridFilterInputDate.js +32 -29
- package/modern/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/modern/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/modern/components/panel/filterPanel/GridFilterInputValue.js +34 -28
- package/modern/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/modern/components/virtualization/GridVirtualScroller.js +4 -4
- package/modern/constants/gridClasses.js +1 -1
- package/modern/constants/localeTextConstants.js +1 -0
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +34 -76
- package/modern/hooks/features/editing/useGridCellEditing.js +1 -1
- package/modern/hooks/features/editing/useGridRowEditing.js +1 -1
- package/modern/hooks/features/filter/gridFilterSelector.js +6 -1
- package/modern/hooks/features/filter/gridFilterUtils.js +3 -3
- package/modern/hooks/features/pagination/gridPaginationSelector.js +39 -1
- package/modern/hooks/features/pagination/useGridPagination.js +5 -3
- package/modern/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/modern/hooks/features/rows/gridRowsSelector.js +1 -1
- package/modern/hooks/features/rows/useGridRows.js +2 -2
- package/modern/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +42 -0
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +91 -42
- package/modern/hooks/utils/useGridVisibleRows.js +5 -28
- package/modern/index.js +1 -1
- package/modern/internals/constants.js +8 -1
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/attachPinnedStyle.js +9 -0
- package/modern/internals/utils/getPinnedCellOffset.js +6 -7
- package/modern/internals/utils/index.js +2 -1
- package/modern/locales/arSD.js +2 -0
- package/modern/locales/beBY.js +1 -0
- package/modern/locales/bgBG.js +2 -0
- package/modern/locales/csCZ.js +2 -0
- package/modern/locales/daDK.js +2 -0
- package/modern/locales/deDE.js +2 -0
- package/modern/locales/elGR.js +2 -0
- package/modern/locales/esES.js +2 -0
- package/modern/locales/faIR.js +2 -0
- package/modern/locales/fiFI.js +2 -0
- package/modern/locales/frFR.js +2 -0
- package/modern/locales/heIL.js +2 -0
- package/modern/locales/hrHR.js +2 -0
- package/modern/locales/huHU.js +2 -0
- package/modern/locales/isIS.js +2 -0
- package/modern/locales/itIT.js +2 -0
- package/modern/locales/jaJP.js +2 -0
- package/modern/locales/koKR.js +2 -0
- package/modern/locales/nbNO.js +2 -0
- package/modern/locales/nlNL.js +2 -0
- package/modern/locales/nnNO.js +2 -0
- package/modern/locales/plPL.js +2 -0
- package/modern/locales/ptBR.js +2 -0
- package/modern/locales/ptPT.js +2 -0
- package/modern/locales/roRO.js +2 -0
- package/modern/locales/ruRU.js +2 -0
- package/modern/locales/skSK.js +2 -0
- package/modern/locales/svSE.js +2 -0
- package/modern/locales/trTR.js +2 -0
- package/modern/locales/ukUA.js +2 -0
- package/modern/locales/urPK.js +2 -0
- package/modern/locales/viVN.js +2 -0
- package/modern/locales/zhCN.js +2 -0
- package/modern/locales/zhHK.js +2 -0
- package/modern/locales/zhTW.js +2 -0
- package/modern/material/index.js +2 -1
- package/modern/utils/cellBorderUtils.js +5 -5
- package/modern/utils/domUtils.js +7 -2
- package/modern/utils/rtlFlipSide.js +22 -0
- package/node/DataGrid/DataGrid.js +2 -3
- package/node/DataGrid/useDataGridComponent.js +1 -1
- package/node/components/GridHeaders.js +2 -2
- package/node/components/GridRow.js +25 -77
- package/node/components/GridSkeletonLoadingOverlay.js +17 -17
- package/node/components/cell/GridCell.js +18 -36
- package/node/components/columnHeaders/GridColumnGroupHeader.js +7 -10
- package/node/components/columnHeaders/GridColumnHeaderItem.js +13 -12
- package/node/components/columnSelection/GridCellCheckboxRenderer.js +1 -1
- package/node/components/containers/GridRoot.js +14 -6
- package/node/components/containers/GridRootStyles.js +7 -0
- package/node/components/panel/filterPanel/GridFilterInputBoolean.js +12 -16
- package/node/components/panel/filterPanel/GridFilterInputDate.js +31 -28
- package/node/components/panel/filterPanel/GridFilterInputMultipleSingleSelect.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputMultipleValue.js +1 -1
- package/node/components/panel/filterPanel/GridFilterInputSingleSelect.js +13 -17
- package/node/components/panel/filterPanel/GridFilterInputValue.js +33 -27
- package/node/components/virtualization/GridVirtualScrollbar.js +11 -12
- package/node/components/virtualization/GridVirtualScroller.js +4 -4
- package/node/constants/gridClasses.js +1 -1
- package/node/constants/localeTextConstants.js +1 -0
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +32 -74
- package/node/hooks/features/editing/useGridCellEditing.js +1 -1
- package/node/hooks/features/editing/useGridRowEditing.js +1 -1
- package/node/hooks/features/filter/gridFilterSelector.js +6 -1
- package/node/hooks/features/filter/gridFilterUtils.js +3 -3
- package/node/hooks/features/pagination/gridPaginationSelector.js +41 -3
- package/node/hooks/features/pagination/useGridPagination.js +5 -3
- package/node/hooks/features/pagination/useGridPaginationModel.js +23 -1
- package/node/hooks/features/rows/gridRowsSelector.js +1 -1
- package/node/hooks/features/rows/useGridRows.js +1 -1
- package/node/hooks/features/sorting/gridSortingUtils.js +2 -2
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +49 -0
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +91 -42
- package/node/hooks/utils/useGridVisibleRows.js +3 -28
- package/node/index.js +1 -1
- package/node/internals/constants.js +9 -2
- package/node/internals/index.js +12 -0
- package/node/internals/utils/attachPinnedStyle.js +15 -0
- package/node/internals/utils/getPinnedCellOffset.js +6 -7
- package/node/internals/utils/index.js +11 -0
- package/node/locales/arSD.js +2 -0
- package/node/locales/beBY.js +1 -0
- package/node/locales/bgBG.js +2 -0
- package/node/locales/csCZ.js +2 -0
- package/node/locales/daDK.js +2 -0
- package/node/locales/deDE.js +2 -0
- package/node/locales/elGR.js +2 -0
- package/node/locales/esES.js +2 -0
- package/node/locales/faIR.js +2 -0
- package/node/locales/fiFI.js +2 -0
- package/node/locales/frFR.js +2 -0
- package/node/locales/heIL.js +2 -0
- package/node/locales/hrHR.js +2 -0
- package/node/locales/huHU.js +2 -0
- package/node/locales/isIS.js +2 -0
- package/node/locales/itIT.js +2 -0
- package/node/locales/jaJP.js +2 -0
- package/node/locales/koKR.js +2 -0
- package/node/locales/nbNO.js +2 -0
- package/node/locales/nlNL.js +2 -0
- package/node/locales/nnNO.js +2 -0
- package/node/locales/plPL.js +2 -0
- package/node/locales/ptBR.js +2 -0
- package/node/locales/ptPT.js +2 -0
- package/node/locales/roRO.js +2 -0
- package/node/locales/ruRU.js +2 -0
- package/node/locales/skSK.js +2 -0
- package/node/locales/svSE.js +2 -0
- package/node/locales/trTR.js +2 -0
- package/node/locales/ukUA.js +2 -0
- package/node/locales/urPK.js +2 -0
- package/node/locales/viVN.js +2 -0
- package/node/locales/zhCN.js +2 -0
- package/node/locales/zhHK.js +2 -0
- package/node/locales/zhTW.js +2 -0
- package/node/material/index.js +2 -1
- package/node/utils/cellBorderUtils.js +5 -5
- package/node/utils/domUtils.js +7 -2
- package/node/utils/rtlFlipSide.js +29 -0
- package/package.json +2 -2
- package/utils/cellBorderUtils.d.ts +3 -3
- package/utils/cellBorderUtils.js +5 -5
- package/utils/createSelector.d.ts +1 -1
- package/utils/domUtils.js +7 -2
- package/utils/getPublicApiRef.d.ts +1 -1
- package/utils/rtlFlipSide.d.ts +2 -0
- package/utils/rtlFlipSide.js +22 -0
|
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.gridPinnedColumnPositionLookup = exports.
|
|
8
|
+
exports.gridPinnedColumnPositionLookup = exports.GridCell = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -22,24 +22,18 @@ var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
|
22
22
|
var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
23
23
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
24
24
|
var _gridFocusStateSelector = require("../../hooks/features/focus/gridFocusStateSelector");
|
|
25
|
-
var _cellBorderUtils = require("../../utils/cellBorderUtils");
|
|
26
25
|
var _gridColumnsInterfaces = require("../../hooks/features/columns/gridColumnsInterfaces");
|
|
26
|
+
var _constants = require("../../internals/constants");
|
|
27
27
|
var _gridRowSpanningSelectors = require("../../hooks/features/rows/gridRowSpanningSelectors");
|
|
28
|
+
var _utils2 = require("../../internals/utils");
|
|
28
29
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
29
|
-
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "
|
|
30
|
+
const _excluded = ["column", "rowId", "editCellState", "align", "children", "colIndex", "width", "className", "style", "colSpan", "disableDragEvents", "isNotVisible", "pinnedOffset", "pinnedPosition", "showRightBorder", "showLeftBorder", "onClick", "onDoubleClick", "onMouseDown", "onMouseUp", "onMouseOver", "onKeyDown", "onKeyUp", "onDragEnter", "onDragOver"],
|
|
30
31
|
_excluded2 = ["changeReason", "unstable_updateValueOnRender"];
|
|
31
|
-
let PinnedPosition = exports.PinnedPosition = /*#__PURE__*/function (PinnedPosition) {
|
|
32
|
-
PinnedPosition[PinnedPosition["NONE"] = 0] = "NONE";
|
|
33
|
-
PinnedPosition[PinnedPosition["LEFT"] = 1] = "LEFT";
|
|
34
|
-
PinnedPosition[PinnedPosition["RIGHT"] = 2] = "RIGHT";
|
|
35
|
-
PinnedPosition[PinnedPosition["VIRTUAL"] = 3] = "VIRTUAL";
|
|
36
|
-
return PinnedPosition;
|
|
37
|
-
}({});
|
|
38
32
|
const gridPinnedColumnPositionLookup = exports.gridPinnedColumnPositionLookup = {
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
33
|
+
[_constants.PinnedColumnPosition.LEFT]: _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT,
|
|
34
|
+
[_constants.PinnedColumnPosition.RIGHT]: _gridColumnsInterfaces.GridPinnedColumnPosition.RIGHT,
|
|
35
|
+
[_constants.PinnedColumnPosition.NONE]: undefined,
|
|
36
|
+
[_constants.PinnedColumnPosition.VIRTUAL]: undefined
|
|
43
37
|
};
|
|
44
38
|
const EMPTY_CELL_PARAMS = {
|
|
45
39
|
id: -1,
|
|
@@ -77,7 +71,7 @@ const useUtilityClasses = ownerState => {
|
|
|
77
71
|
classes
|
|
78
72
|
} = ownerState;
|
|
79
73
|
const slots = {
|
|
80
|
-
root: ['cell', `cell--text${(0, _utils.unstable_capitalize)(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition ===
|
|
74
|
+
root: ['cell', `cell--text${(0, _utils.unstable_capitalize)(align)}`, isSelected && 'selected', isEditable && 'cell--editable', showLeftBorder && 'cell--withLeftBorder', showRightBorder && 'cell--withRightBorder', pinnedPosition === _constants.PinnedColumnPosition.LEFT && 'cell--pinnedLeft', pinnedPosition === _constants.PinnedColumnPosition.RIGHT && 'cell--pinnedRight', isSelectionMode && !isEditable && 'cell--selectionMode']
|
|
81
75
|
};
|
|
82
76
|
return (0, _utils.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
83
77
|
};
|
|
@@ -100,9 +94,8 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
100
94
|
isNotVisible,
|
|
101
95
|
pinnedOffset,
|
|
102
96
|
pinnedPosition,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
gridHasFiller,
|
|
97
|
+
showRightBorder,
|
|
98
|
+
showLeftBorder,
|
|
106
99
|
onClick,
|
|
107
100
|
onDoubleClick,
|
|
108
101
|
onMouseDown,
|
|
@@ -169,9 +162,6 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
169
162
|
const handleRef = (0, _utils.unstable_useForkRef)(ref, cellRef);
|
|
170
163
|
const focusElementRef = React.useRef(null);
|
|
171
164
|
const isSelectionMode = rootProps.cellSelection ?? false;
|
|
172
|
-
const position = gridPinnedColumnPositionLookup[pinnedPosition];
|
|
173
|
-
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(position, sectionIndex);
|
|
174
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(position, sectionIndex, sectionLength, rootProps.showCellVerticalBorder, gridHasFiller);
|
|
175
165
|
const ownerState = {
|
|
176
166
|
align,
|
|
177
167
|
showLeftBorder,
|
|
@@ -220,18 +210,11 @@ const GridCell = (0, _forwardRef.forwardRef)(function GridCell(props, ref) {
|
|
|
220
210
|
border: 0
|
|
221
211
|
};
|
|
222
212
|
}
|
|
223
|
-
const cellStyle = (0, _extends2.default)({
|
|
213
|
+
const cellStyle = (0, _utils2.attachPinnedStyle)((0, _extends2.default)({
|
|
224
214
|
'--width': `${width}px`
|
|
225
|
-
}, styleProp);
|
|
226
|
-
const isLeftPinned = pinnedPosition ===
|
|
227
|
-
const isRightPinned = pinnedPosition ===
|
|
228
|
-
if (isLeftPinned || isRightPinned) {
|
|
229
|
-
let side = isLeftPinned ? 'left' : 'right';
|
|
230
|
-
if (isRtl) {
|
|
231
|
-
side = isLeftPinned ? 'right' : 'left';
|
|
232
|
-
}
|
|
233
|
-
cellStyle[side] = pinnedOffset;
|
|
234
|
-
}
|
|
215
|
+
}, styleProp), isRtl, pinnedPosition, pinnedOffset);
|
|
216
|
+
const isLeftPinned = pinnedPosition === _constants.PinnedColumnPosition.LEFT;
|
|
217
|
+
const isRightPinned = pinnedPosition === _constants.PinnedColumnPosition.RIGHT;
|
|
235
218
|
if (rowSpan > 1) {
|
|
236
219
|
cellStyle.height = `calc(var(--height) * ${rowSpan})`;
|
|
237
220
|
cellStyle.zIndex = 5;
|
|
@@ -361,13 +344,12 @@ process.env.NODE_ENV !== "production" ? GridCell.propTypes = {
|
|
|
361
344
|
isValidating: _propTypes.default.bool,
|
|
362
345
|
value: _propTypes.default.any
|
|
363
346
|
}),
|
|
364
|
-
gridHasFiller: _propTypes.default.bool.isRequired,
|
|
365
347
|
isNotVisible: _propTypes.default.bool.isRequired,
|
|
366
|
-
pinnedOffset: _propTypes.default.number
|
|
348
|
+
pinnedOffset: _propTypes.default.number,
|
|
367
349
|
pinnedPosition: _propTypes.default.oneOf([0, 1, 2, 3]).isRequired,
|
|
368
350
|
rowId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
369
|
-
|
|
370
|
-
|
|
351
|
+
showLeftBorder: _propTypes.default.bool.isRequired,
|
|
352
|
+
showRightBorder: _propTypes.default.bool.isRequired,
|
|
371
353
|
width: _propTypes.default.number.isRequired
|
|
372
354
|
} : void 0;
|
|
373
355
|
const MemoizedGridCell = exports.GridCell = (0, _fastMemo.fastMemo)(GridCell);
|
|
@@ -9,6 +9,7 @@ exports.GridColumnGroupHeader = GridColumnGroupHeader;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _utils = require("@mui/utils");
|
|
12
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
12
13
|
var _gridClasses = require("../../constants/gridClasses");
|
|
13
14
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
14
15
|
var _gridColumnGroupsSelector = require("../../hooks/features/columnGrouping/gridColumnGroupsSelector");
|
|
@@ -16,7 +17,8 @@ var _useGridApiContext = require("../../hooks/utils/useGridApiContext");
|
|
|
16
17
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
17
18
|
var _GridGenericColumnHeaderItem = require("./GridGenericColumnHeaderItem");
|
|
18
19
|
var _domUtils = require("../../utils/domUtils");
|
|
19
|
-
var
|
|
20
|
+
var _constants = require("../../internals/constants");
|
|
21
|
+
var _utils2 = require("../../internals/utils");
|
|
20
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
23
|
const useUtilityClasses = ownerState => {
|
|
22
24
|
const {
|
|
@@ -30,7 +32,7 @@ const useUtilityClasses = ownerState => {
|
|
|
30
32
|
pinnedPosition
|
|
31
33
|
} = ownerState;
|
|
32
34
|
const slots = {
|
|
33
|
-
root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition ===
|
|
35
|
+
root: ['columnHeader', headerAlign === 'left' && 'columnHeader--alignLeft', headerAlign === 'center' && 'columnHeader--alignCenter', headerAlign === 'right' && 'columnHeader--alignRight', isDragging && 'columnHeader--moving', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', 'withBorderColor', groupId === null ? 'columnHeader--emptyGroup' : 'columnHeader--filledGroup', pinnedPosition === _constants.PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === _constants.PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight', isLastColumn && 'columnHeader--last'],
|
|
34
36
|
draggableContainer: ['columnHeaderDraggableContainer'],
|
|
35
37
|
titleContainer: ['columnHeaderTitleContainer', 'withBorderColor'],
|
|
36
38
|
titleContainerContent: ['columnHeaderTitleContainerContent']
|
|
@@ -50,12 +52,10 @@ function GridColumnGroupHeader(props) {
|
|
|
50
52
|
tabIndex,
|
|
51
53
|
isLastColumn,
|
|
52
54
|
pinnedPosition,
|
|
53
|
-
|
|
54
|
-
indexInSection,
|
|
55
|
-
sectionLength,
|
|
56
|
-
gridHasFiller
|
|
55
|
+
pinnedOffset
|
|
57
56
|
} = props;
|
|
58
57
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
58
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
59
59
|
const headerCellRef = React.useRef(null);
|
|
60
60
|
const apiRef = (0, _useGridApiContext.useGridApiContext)();
|
|
61
61
|
const columnGroupsLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridColumnGroupsSelector.gridColumnGroupsLookupSelector);
|
|
@@ -80,12 +80,8 @@ function GridColumnGroupHeader(props) {
|
|
|
80
80
|
if (groupId && render) {
|
|
81
81
|
headerComponent = render(renderParams);
|
|
82
82
|
}
|
|
83
|
-
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
84
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
85
83
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
86
84
|
classes: rootProps.classes,
|
|
87
|
-
showLeftBorder,
|
|
88
|
-
showRightBorder,
|
|
89
85
|
headerAlign,
|
|
90
86
|
depth,
|
|
91
87
|
isDragging: false
|
|
@@ -118,6 +114,7 @@ function GridColumnGroupHeader(props) {
|
|
|
118
114
|
onBlur: publish('columnGroupHeaderBlur')
|
|
119
115
|
}), [publish]);
|
|
120
116
|
const headerClassName = typeof group.headerClassName === 'function' ? group.headerClassName(renderParams) : group.headerClassName;
|
|
117
|
+
const style = React.useMemo(() => (0, _utils2.attachPinnedStyle)((0, _extends2.default)({}, props.style), isRtl, pinnedPosition, pinnedOffset), [pinnedPosition, pinnedOffset, props.style, isRtl]);
|
|
121
118
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridGenericColumnHeaderItem.GridGenericColumnHeaderItem, (0, _extends2.default)({
|
|
122
119
|
ref: headerCellRef,
|
|
123
120
|
classes: classes,
|
|
@@ -12,6 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
12
12
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
13
13
|
var _utils = require("@mui/utils");
|
|
14
14
|
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
15
|
+
var _RtlProvider = require("@mui/system/RtlProvider");
|
|
15
16
|
var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiContext");
|
|
16
17
|
var _ColumnHeaderMenuIcon = require("./ColumnHeaderMenuIcon");
|
|
17
18
|
var _GridColumnHeaderMenu = require("../menu/columnMenu/GridColumnHeaderMenu");
|
|
@@ -19,7 +20,8 @@ var _gridClasses = require("../../constants/gridClasses");
|
|
|
19
20
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
20
21
|
var _GridGenericColumnHeaderItem = require("./GridGenericColumnHeaderItem");
|
|
21
22
|
var _domUtils = require("../../utils/domUtils");
|
|
22
|
-
var
|
|
23
|
+
var _constants = require("../../internals/constants");
|
|
24
|
+
var _utils2 = require("../../internals/utils");
|
|
23
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
26
|
const useUtilityClasses = ownerState => {
|
|
25
27
|
const {
|
|
@@ -39,7 +41,7 @@ const useUtilityClasses = ownerState => {
|
|
|
39
41
|
// todo refactor to a prop on col isNumeric or ?? ie: coltype===price wont work
|
|
40
42
|
const isColumnNumeric = colDef.type === 'number';
|
|
41
43
|
const slots = {
|
|
42
|
-
root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition ===
|
|
44
|
+
root: ['columnHeader', colDef.headerAlign === 'left' && 'columnHeader--alignLeft', colDef.headerAlign === 'center' && 'columnHeader--alignCenter', colDef.headerAlign === 'right' && 'columnHeader--alignRight', colDef.sortable && 'columnHeader--sortable', isDragging && 'columnHeader--moving', isColumnSorted && 'columnHeader--sorted', isColumnFiltered && 'columnHeader--filtered', isColumnNumeric && 'columnHeader--numeric', 'withBorderColor', showRightBorder && 'columnHeader--withRightBorder', showLeftBorder && 'columnHeader--withLeftBorder', pinnedPosition === _constants.PinnedColumnPosition.LEFT && 'columnHeader--pinnedLeft', pinnedPosition === _constants.PinnedColumnPosition.RIGHT && 'columnHeader--pinnedRight',
|
|
43
45
|
// TODO: Remove classes below and restore `:has` selectors when they are supported in jsdom
|
|
44
46
|
// See https://github.com/mui/mui-x/pull/14559
|
|
45
47
|
isLastUnpinned && 'columnHeader--lastUnpinned', isSiblingFocused && 'columnHeader--siblingFocused'],
|
|
@@ -64,14 +66,14 @@ function GridColumnHeaderItem(props) {
|
|
|
64
66
|
tabIndex,
|
|
65
67
|
disableReorder,
|
|
66
68
|
separatorSide,
|
|
67
|
-
|
|
69
|
+
showLeftBorder,
|
|
70
|
+
showRightBorder,
|
|
68
71
|
pinnedPosition,
|
|
69
|
-
|
|
70
|
-
sectionLength,
|
|
71
|
-
gridHasFiller
|
|
72
|
+
pinnedOffset
|
|
72
73
|
} = props;
|
|
73
74
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
74
75
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
76
|
+
const isRtl = (0, _RtlProvider.useRtl)();
|
|
75
77
|
const headerCellRef = React.useRef(null);
|
|
76
78
|
const columnMenuId = (0, _utils.unstable_useId)();
|
|
77
79
|
const columnMenuButtonId = (0, _utils.unstable_useId)();
|
|
@@ -82,8 +84,6 @@ function GridColumnHeaderItem(props) {
|
|
|
82
84
|
if (colDef.renderHeader) {
|
|
83
85
|
headerComponent = colDef.renderHeader(apiRef.current.getColumnHeaderParams(colDef.field));
|
|
84
86
|
}
|
|
85
|
-
const showLeftBorder = (0, _cellBorderUtils.shouldCellShowLeftBorder)(pinnedPosition, indexInSection);
|
|
86
|
-
const showRightBorder = (0, _cellBorderUtils.shouldCellShowRightBorder)(pinnedPosition, indexInSection, sectionLength, rootProps.showColumnVerticalBorder, gridHasFiller);
|
|
87
87
|
const ownerState = (0, _extends2.default)({}, props, {
|
|
88
88
|
classes: rootProps.classes,
|
|
89
89
|
showRightBorder,
|
|
@@ -179,6 +179,7 @@ function GridColumnHeaderItem(props) {
|
|
|
179
179
|
colDef
|
|
180
180
|
}) : colDef.headerClassName;
|
|
181
181
|
const label = colDef.headerName ?? colDef.field;
|
|
182
|
+
const style = React.useMemo(() => (0, _utils2.attachPinnedStyle)((0, _extends2.default)({}, props.style), isRtl, pinnedPosition, pinnedOffset), [pinnedPosition, pinnedOffset, props.style, isRtl]);
|
|
182
183
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_GridGenericColumnHeaderItem.GridGenericColumnHeaderItem, (0, _extends2.default)({
|
|
183
184
|
ref: headerCellRef,
|
|
184
185
|
classes: classes,
|
|
@@ -217,18 +218,18 @@ process.env.NODE_ENV !== "production" ? GridColumnHeaderItem.propTypes = {
|
|
|
217
218
|
columnMenuOpen: _propTypes.default.bool.isRequired,
|
|
218
219
|
disableReorder: _propTypes.default.bool,
|
|
219
220
|
filterItemsCounter: _propTypes.default.number,
|
|
220
|
-
gridHasFiller: _propTypes.default.bool.isRequired,
|
|
221
221
|
hasFocus: _propTypes.default.bool,
|
|
222
222
|
headerHeight: _propTypes.default.number.isRequired,
|
|
223
|
-
indexInSection: _propTypes.default.number.isRequired,
|
|
224
223
|
isDragging: _propTypes.default.bool.isRequired,
|
|
225
224
|
isLast: _propTypes.default.bool.isRequired,
|
|
226
225
|
isLastUnpinned: _propTypes.default.bool.isRequired,
|
|
227
226
|
isResizing: _propTypes.default.bool.isRequired,
|
|
228
227
|
isSiblingFocused: _propTypes.default.bool.isRequired,
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
pinnedOffset: _propTypes.default.number,
|
|
229
|
+
pinnedPosition: _propTypes.default.oneOf([0, 1, 2, 3]),
|
|
231
230
|
separatorSide: _propTypes.default.oneOf(['left', 'right']),
|
|
231
|
+
showLeftBorder: _propTypes.default.bool.isRequired,
|
|
232
|
+
showRightBorder: _propTypes.default.bool.isRequired,
|
|
232
233
|
sortDirection: _propTypes.default.oneOf(['asc', 'desc']),
|
|
233
234
|
sortIndex: _propTypes.default.number,
|
|
234
235
|
style: _propTypes.default.object,
|
|
@@ -84,7 +84,7 @@ const GridCellCheckboxForwardRef = exports.GridCellCheckboxForwardRef = (0, _for
|
|
|
84
84
|
const {
|
|
85
85
|
isIndeterminate,
|
|
86
86
|
isChecked
|
|
87
|
-
} = (0, _useGridSelector.useGridSelector)(apiRef, checkboxPropsSelector);
|
|
87
|
+
} = (0, _useGridSelector.useGridSelector)(apiRef, checkboxPropsSelector, undefined, _useGridSelector.objectShallowCompare);
|
|
88
88
|
if (rowNode.type === 'footer' || rowNode.type === 'pinnedRow') {
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
@@ -12,6 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
|
+
var _fastMemo = require("@mui/x-internals/fastMemo");
|
|
15
16
|
var _forwardRef = require("@mui/x-internals/forwardRef");
|
|
16
17
|
var _GridRootStyles = require("./GridRootStyles");
|
|
17
18
|
var _useGridSelector = require("../../hooks/utils/useGridSelector");
|
|
@@ -19,8 +20,10 @@ var _useGridPrivateApiContext = require("../../hooks/utils/useGridPrivateApiCont
|
|
|
19
20
|
var _useGridRootProps = require("../../hooks/utils/useGridRootProps");
|
|
20
21
|
var _gridClasses = require("../../constants/gridClasses");
|
|
21
22
|
var _densitySelector = require("../../hooks/features/density/densitySelector");
|
|
23
|
+
var _GridHeader = require("../GridHeader");
|
|
24
|
+
var _base = require("../base");
|
|
22
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["className"];
|
|
26
|
+
const _excluded = ["className", "children"];
|
|
24
27
|
const useUtilityClasses = (ownerState, density) => {
|
|
25
28
|
const {
|
|
26
29
|
autoHeight,
|
|
@@ -32,10 +35,11 @@ const useUtilityClasses = (ownerState, density) => {
|
|
|
32
35
|
};
|
|
33
36
|
return (0, _utils.unstable_composeClasses)(slots, _gridClasses.getDataGridUtilityClass, classes);
|
|
34
37
|
};
|
|
35
|
-
const GridRoot =
|
|
38
|
+
const GridRoot = (0, _forwardRef.forwardRef)(function GridRoot(props, ref) {
|
|
36
39
|
const rootProps = (0, _useGridRootProps.useGridRootProps)();
|
|
37
40
|
const {
|
|
38
|
-
className
|
|
41
|
+
className,
|
|
42
|
+
children
|
|
39
43
|
} = props,
|
|
40
44
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
41
45
|
const apiRef = (0, _useGridPrivateApiContext.useGridPrivateApiContext)();
|
|
@@ -53,11 +57,14 @@ const GridRoot = exports.GridRoot = (0, _forwardRef.forwardRef)(function GridRoo
|
|
|
53
57
|
if (!mountedState) {
|
|
54
58
|
return null;
|
|
55
59
|
}
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_GridRootStyles.GridRootStyles, (0, _extends2.default)({
|
|
57
61
|
className: (0, _clsx.default)(classes.root, className),
|
|
58
62
|
ownerState: ownerState
|
|
59
63
|
}, other, {
|
|
60
|
-
ref: handleRef
|
|
64
|
+
ref: handleRef,
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_GridHeader.GridHeader, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.GridBody, {
|
|
66
|
+
children: children
|
|
67
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.GridFooterPlaceholder, {})]
|
|
61
68
|
}));
|
|
62
69
|
});
|
|
63
70
|
process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
|
|
@@ -69,4 +76,5 @@ process.env.NODE_ENV !== "production" ? GridRoot.propTypes = {
|
|
|
69
76
|
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
70
77
|
*/
|
|
71
78
|
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])
|
|
72
|
-
} : void 0;
|
|
79
|
+
} : void 0;
|
|
80
|
+
const MemoizedGridRoot = exports.GridRoot = (0, _fastMemo.fastMemo)(GridRoot);
|
|
@@ -338,6 +338,13 @@ const GridRootStyles = exports.GridRootStyles = (0, _styles.styled)('div', {
|
|
|
338
338
|
display: 'flex',
|
|
339
339
|
alignItems: 'center'
|
|
340
340
|
},
|
|
341
|
+
[`& .${_gridClasses.gridClasses['columnHeader--filter']}`]: {
|
|
342
|
+
paddingTop: 8,
|
|
343
|
+
paddingBottom: 8,
|
|
344
|
+
paddingRight: 5,
|
|
345
|
+
minHeight: 'min-content',
|
|
346
|
+
overflow: 'hidden'
|
|
347
|
+
},
|
|
341
348
|
[`& .${_gridClasses.gridClasses['virtualScroller--hasScrollX']} .${_gridClasses.gridClasses['columnHeader--last']}`]: {
|
|
342
349
|
overflow: 'hidden'
|
|
343
350
|
},
|
|
@@ -12,28 +12,22 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
|
-
var _styles = require("@mui/material/styles");
|
|
16
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
17
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "clearButton", "tabIndex", "label", "variant", "InputLabelProps"];
|
|
19
|
-
const BooleanOperatorContainer = (0, _styles.styled)('div')({
|
|
20
|
-
display: 'flex',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
width: '100%',
|
|
23
|
-
[`& button`]: {
|
|
24
|
-
margin: 'auto 0px 5px 5px'
|
|
25
|
-
}
|
|
26
|
-
});
|
|
17
|
+
const _excluded = ["item", "applyValue", "apiRef", "focusElementRef", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "label", "variant", "InputProps", "InputLabelProps", "sx"];
|
|
27
18
|
function GridFilterInputBoolean(props) {
|
|
28
19
|
const {
|
|
29
20
|
item,
|
|
30
21
|
applyValue,
|
|
31
22
|
apiRef,
|
|
32
23
|
focusElementRef,
|
|
24
|
+
headerFilterMenu,
|
|
33
25
|
clearButton,
|
|
34
26
|
tabIndex,
|
|
35
27
|
label: labelProp,
|
|
36
|
-
variant = '
|
|
28
|
+
variant = 'outlined',
|
|
29
|
+
InputProps,
|
|
30
|
+
sx
|
|
37
31
|
} = props,
|
|
38
32
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
39
33
|
const [filterValueState, setFilterValueState] = React.useState(sanitizeFilterItemValue(item.value));
|
|
@@ -54,9 +48,10 @@ function GridFilterInputBoolean(props) {
|
|
|
54
48
|
setFilterValueState(sanitizeFilterItemValue(item.value));
|
|
55
49
|
}, [item.value]);
|
|
56
50
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
58
52
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseFormControl, {
|
|
59
53
|
fullWidth: true,
|
|
54
|
+
sx: sx,
|
|
60
55
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
|
|
61
56
|
id: labelId,
|
|
62
57
|
shrink: true,
|
|
@@ -72,11 +67,11 @@ function GridFilterInputBoolean(props) {
|
|
|
72
67
|
notched: variant === 'outlined' ? true : undefined,
|
|
73
68
|
native: isSelectNative,
|
|
74
69
|
displayEmpty: true,
|
|
75
|
-
inputProps: {
|
|
70
|
+
inputProps: (0, _extends2.default)({
|
|
76
71
|
ref: focusElementRef,
|
|
77
72
|
tabIndex
|
|
78
|
-
}
|
|
79
|
-
}, others /* FIXME: typing error */,
|
|
73
|
+
}, InputProps?.inputProps)
|
|
74
|
+
}, baseSelectProps, others /* FIXME: typing error */, {
|
|
80
75
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseSelectOption, (0, _extends2.default)({}, baseSelectOptionProps, {
|
|
81
76
|
native: isSelectNative,
|
|
82
77
|
value: "",
|
|
@@ -91,7 +86,7 @@ function GridFilterInputBoolean(props) {
|
|
|
91
86
|
children: apiRef.current.getLocaleText('filterValueFalse')
|
|
92
87
|
}))]
|
|
93
88
|
}))]
|
|
94
|
-
}), clearButton]
|
|
89
|
+
}), headerFilterMenu, clearButton]
|
|
95
90
|
});
|
|
96
91
|
}
|
|
97
92
|
function sanitizeFilterItemValue(value) {
|
|
@@ -114,6 +109,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputBoolean.propTypes = {
|
|
|
114
109
|
applyValue: _propTypes.default.func.isRequired,
|
|
115
110
|
clearButton: _propTypes.default.node,
|
|
116
111
|
focusElementRef: _utils.refType,
|
|
112
|
+
headerFilterMenu: _propTypes.default.node,
|
|
117
113
|
/**
|
|
118
114
|
* It is `true` if the filter either has a value or an operator with no value
|
|
119
115
|
* required is selected (for example `isEmpty`)
|
|
@@ -14,7 +14,7 @@ var _utils = require("@mui/utils");
|
|
|
14
14
|
var _useTimeout = require("../../../hooks/utils/useTimeout");
|
|
15
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "clearButton", "tabIndex", "disabled"];
|
|
17
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "InputProps", "isFilterActive", "headerFilterMenu", "clearButton", "tabIndex", "disabled"];
|
|
18
18
|
function convertFilterItemValueToInputValue(itemValue, inputType) {
|
|
19
19
|
if (itemValue == null) {
|
|
20
20
|
return '';
|
|
@@ -43,6 +43,7 @@ function GridFilterInputDate(props) {
|
|
|
43
43
|
apiRef,
|
|
44
44
|
focusElementRef,
|
|
45
45
|
InputProps,
|
|
46
|
+
headerFilterMenu,
|
|
46
47
|
clearButton,
|
|
47
48
|
tabIndex,
|
|
48
49
|
disabled
|
|
@@ -70,33 +71,34 @@ function GridFilterInputDate(props) {
|
|
|
70
71
|
const value = convertFilterItemValueToInputValue(item.value, type);
|
|
71
72
|
setFilterValueState(value);
|
|
72
73
|
}, [item.value, type]);
|
|
73
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
75
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseTextField, (0, _extends2.default)({
|
|
76
|
+
fullWidth: true,
|
|
77
|
+
id: id,
|
|
78
|
+
label: apiRef.current.getLocaleText('filterPanelInputLabel'),
|
|
79
|
+
placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),
|
|
80
|
+
value: filterValueState,
|
|
81
|
+
onChange: onFilterChange,
|
|
82
|
+
variant: "standard",
|
|
83
|
+
type: type || 'text',
|
|
84
|
+
disabled: disabled,
|
|
85
|
+
InputLabelProps: {
|
|
86
|
+
shrink: true
|
|
87
|
+
},
|
|
88
|
+
inputRef: focusElementRef,
|
|
89
|
+
InputProps: (0, _extends2.default)({
|
|
90
|
+
endAdornment: applying ? /*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.loadIcon, {
|
|
91
|
+
fontSize: "small",
|
|
92
|
+
color: "action"
|
|
93
|
+
}) : null
|
|
94
|
+
}, InputProps, {
|
|
95
|
+
inputProps: (0, _extends2.default)({
|
|
96
|
+
max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31',
|
|
97
|
+
tabIndex
|
|
98
|
+
}, InputProps?.inputProps)
|
|
99
|
+
})
|
|
100
|
+
}, rootProps.slotProps?.baseTextField, other)), headerFilterMenu, clearButton]
|
|
101
|
+
});
|
|
100
102
|
}
|
|
101
103
|
process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
102
104
|
// ----------------------------- Warning --------------------------------
|
|
@@ -109,6 +111,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputDate.propTypes = {
|
|
|
109
111
|
applyValue: _propTypes.default.func.isRequired,
|
|
110
112
|
clearButton: _propTypes.default.node,
|
|
111
113
|
focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
114
|
+
headerFilterMenu: _propTypes.default.node,
|
|
112
115
|
/**
|
|
113
116
|
* It is `true` if the filter either has a value or an operator with no value
|
|
114
117
|
* required is selected (for example `isEmpty`)
|
|
@@ -12,11 +12,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _utils = require("@mui/utils");
|
|
15
|
-
var _styles = require("@mui/material/styles");
|
|
16
15
|
var _useGridRootProps = require("../../../hooks/utils/useGridRootProps");
|
|
17
16
|
var _filterPanelUtils = require("./filterPanelUtils");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "InputLabelProps"];
|
|
18
|
+
const _excluded = ["item", "applyValue", "type", "apiRef", "focusElementRef", "placeholder", "tabIndex", "label", "variant", "isFilterActive", "clearButton", "headerFilterMenu", "InputProps", "InputLabelProps", "sx"];
|
|
20
19
|
const renderSingleSelectOptions = ({
|
|
21
20
|
column,
|
|
22
21
|
OptionComponent,
|
|
@@ -39,14 +38,6 @@ const renderSingleSelectOptions = ({
|
|
|
39
38
|
}), label);
|
|
40
39
|
});
|
|
41
40
|
};
|
|
42
|
-
const SingleSelectOperatorContainer = (0, _styles.styled)('div')({
|
|
43
|
-
display: 'flex',
|
|
44
|
-
alignItems: 'flex-end',
|
|
45
|
-
width: '100%',
|
|
46
|
-
[`& button`]: {
|
|
47
|
-
margin: 'auto 0px 5px 5px'
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
41
|
function GridFilterInputSingleSelect(props) {
|
|
51
42
|
const {
|
|
52
43
|
item,
|
|
@@ -57,8 +48,11 @@ function GridFilterInputSingleSelect(props) {
|
|
|
57
48
|
placeholder,
|
|
58
49
|
tabIndex,
|
|
59
50
|
label: labelProp,
|
|
60
|
-
variant = '
|
|
61
|
-
clearButton
|
|
51
|
+
variant = 'outlined',
|
|
52
|
+
clearButton,
|
|
53
|
+
headerFilterMenu,
|
|
54
|
+
InputProps,
|
|
55
|
+
sx
|
|
62
56
|
} = props,
|
|
63
57
|
others = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
64
58
|
const filterValue = item.value ?? '';
|
|
@@ -91,9 +85,10 @@ function GridFilterInputSingleSelect(props) {
|
|
|
91
85
|
return null;
|
|
92
86
|
}
|
|
93
87
|
const label = labelProp ?? apiRef.current.getLocaleText('filterPanelInputLabel');
|
|
94
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
88
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
95
89
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(rootProps.slots.baseFormControl, {
|
|
96
90
|
fullWidth: true,
|
|
91
|
+
sx: sx,
|
|
97
92
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(rootProps.slots.baseInputLabel, (0, _extends2.default)({}, rootProps.slotProps?.baseInputLabel, {
|
|
98
93
|
id: labelId,
|
|
99
94
|
htmlFor: id,
|
|
@@ -108,14 +103,14 @@ function GridFilterInputSingleSelect(props) {
|
|
|
108
103
|
onChange: onFilterChange,
|
|
109
104
|
variant: variant,
|
|
110
105
|
type: type || 'text',
|
|
111
|
-
inputProps: {
|
|
106
|
+
inputProps: (0, _extends2.default)({
|
|
112
107
|
tabIndex,
|
|
113
108
|
ref: focusElementRef,
|
|
114
109
|
placeholder: placeholder ?? apiRef.current.getLocaleText('filterPanelInputPlaceholder')
|
|
115
|
-
},
|
|
110
|
+
}, InputProps?.inputProps),
|
|
116
111
|
native: isSelectNative,
|
|
117
112
|
notched: variant === 'outlined' ? true : undefined
|
|
118
|
-
}, others /* FIXME: typing error */,
|
|
113
|
+
}, rootProps.slotProps?.baseSelect, others /* FIXME: typing error */, {
|
|
119
114
|
children: renderSingleSelectOptions({
|
|
120
115
|
column: resolvedColumn,
|
|
121
116
|
OptionComponent: rootProps.slots.baseSelectOption,
|
|
@@ -125,7 +120,7 @@ function GridFilterInputSingleSelect(props) {
|
|
|
125
120
|
baseSelectOptionProps: rootProps.slotProps?.baseSelectOption
|
|
126
121
|
})
|
|
127
122
|
}))]
|
|
128
|
-
}), clearButton]
|
|
123
|
+
}), headerFilterMenu, clearButton]
|
|
129
124
|
});
|
|
130
125
|
}
|
|
131
126
|
process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes = {
|
|
@@ -139,6 +134,7 @@ process.env.NODE_ENV !== "production" ? GridFilterInputSingleSelect.propTypes =
|
|
|
139
134
|
applyValue: _propTypes.default.func.isRequired,
|
|
140
135
|
clearButton: _propTypes.default.node,
|
|
141
136
|
focusElementRef: _propTypes.default /* @typescript-to-proptypes-ignore */.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
|
137
|
+
headerFilterMenu: _propTypes.default.node,
|
|
142
138
|
/**
|
|
143
139
|
* It is `true` if the filter either has a value or an operator with no value
|
|
144
140
|
* required is selected (for example `isEmpty`)
|