@mui/x-data-grid 7.0.0-beta.6 → 7.0.0-beta.7
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 +117 -1
- package/DataGrid/DataGrid.js +44 -0
- package/DataGrid/useDataGridComponent.js +3 -0
- package/DataGrid/useDataGridProps.js +3 -2
- package/components/GridColumnHeaders.d.ts +1 -2
- package/components/GridColumnHeaders.js +6 -17
- package/components/GridHeaders.js +1 -4
- package/components/GridPagination.js +2 -7
- package/components/GridRow.d.ts +1 -1
- package/components/GridRow.js +4 -19
- package/components/GridScrollArea.d.ts +10 -0
- package/components/GridScrollArea.js +150 -0
- package/components/cell/GridCell.d.ts +7 -0
- package/components/cell/GridCell.js +11 -3
- package/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/components/columnHeaders/GridColumnGroupHeader.d.ts +5 -0
- package/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/components/columnHeaders/GridColumnHeaderItem.d.ts +5 -0
- package/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/components/columnHeaders/GridGenericColumnHeaderItem.d.ts +1 -0
- package/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/components/containers/GridRootStyles.js +12 -20
- package/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/components/virtualization/GridVirtualScroller.js +6 -1
- package/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/constants/gridClasses.d.ts +6 -32
- package/constants/gridClasses.js +1 -1
- package/hooks/core/pipeProcessing/gridPipeProcessingApi.d.ts +5 -1
- package/hooks/features/columnHeaders/useGridColumnHeaders.d.ts +23 -7
- package/hooks/features/columnHeaders/useGridColumnHeaders.js +186 -99
- package/hooks/features/columnResize/columnResizeSelector.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/hooks/features/columnResize/columnResizeState.d.ts +3 -0
- package/hooks/features/columnResize/columnResizeState.js +1 -0
- package/hooks/features/columnResize/gridColumnResizeApi.d.ts +44 -0
- package/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/hooks/features/columnResize/index.d.ts +3 -0
- package/hooks/features/columnResize/index.js +3 -0
- package/hooks/features/columnResize/useGridColumnResize.d.ts +10 -0
- package/hooks/features/columnResize/useGridColumnResize.js +563 -0
- package/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/hooks/features/editing/useGridCellEditing.js +21 -2
- package/hooks/features/export/useGridPrintExport.js +8 -7
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.d.ts +1 -0
- package/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +6 -0
- package/hooks/features/headerFiltering/useGridHeaderFiltering.js +30 -7
- package/hooks/features/index.d.ts +1 -0
- package/hooks/features/index.js +1 -0
- package/hooks/features/pagination/gridPaginationInterfaces.d.ts +19 -2
- package/hooks/features/pagination/gridPaginationSelector.d.ts +5 -0
- package/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/hooks/features/pagination/useGridPagination.d.ts +1 -6
- package/hooks/features/pagination/useGridPagination.js +9 -157
- package/hooks/features/pagination/useGridPaginationModel.d.ts +11 -0
- package/hooks/features/pagination/useGridPaginationModel.js +170 -0
- package/hooks/features/pagination/useGridRowCount.d.ts +8 -0
- package/hooks/features/pagination/useGridRowCount.js +97 -0
- package/hooks/features/scroll/useGridScroll.js +1 -1
- package/hooks/features/virtualization/gridVirtualizationSelectors.d.ts +4 -4
- package/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +2 -2
- package/hooks/utils/useLazyRef.d.ts +1 -2
- package/hooks/utils/useLazyRef.js +1 -11
- package/hooks/utils/useOnMount.d.ts +1 -2
- package/hooks/utils/useOnMount.js +1 -7
- package/hooks/utils/useTimeout.d.ts +1 -11
- package/hooks/utils/useTimeout.js +1 -36
- package/index.js +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +1 -1
- package/internals/utils/getPinnedCellOffset.d.ts +3 -0
- package/internals/utils/getPinnedCellOffset.js +17 -0
- package/joy/joySlots.js +13 -52
- package/locales/jaJP.js +3 -4
- package/material/index.js +0 -2
- package/models/api/gridApiCommon.d.ts +3 -3
- package/models/api/gridCoreApi.d.ts +1 -5
- package/models/events/gridEventLookup.d.ts +6 -0
- package/models/gridHeaderFilteringModel.d.ts +1 -0
- package/models/gridSlotsComponent.d.ts +0 -5
- package/models/gridStateCommunity.d.ts +2 -0
- package/models/params/gridScrollParams.d.ts +5 -3
- package/models/props/DataGridProps.d.ts +35 -1
- package/modern/DataGrid/DataGrid.js +44 -0
- package/modern/DataGrid/useDataGridComponent.js +3 -0
- package/modern/DataGrid/useDataGridProps.js +3 -2
- package/modern/components/GridColumnHeaders.js +6 -17
- package/modern/components/GridHeaders.js +1 -4
- package/modern/components/GridPagination.js +2 -4
- package/modern/components/GridRow.js +4 -19
- package/modern/components/GridScrollArea.js +150 -0
- package/modern/components/cell/GridCell.js +11 -3
- package/modern/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/modern/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/modern/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/modern/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/modern/components/containers/GridRootStyles.js +12 -20
- package/modern/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/modern/components/virtualization/GridVirtualScroller.js +6 -1
- package/modern/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/modern/constants/gridClasses.js +1 -1
- package/modern/hooks/features/columnHeaders/useGridColumnHeaders.js +184 -97
- package/modern/hooks/features/columnResize/columnResizeSelector.js +3 -0
- package/modern/hooks/features/columnResize/columnResizeState.js +1 -0
- package/modern/hooks/features/columnResize/gridColumnResizeApi.js +10 -0
- package/modern/hooks/features/columnResize/index.js +3 -0
- package/modern/hooks/features/columnResize/useGridColumnResize.js +553 -0
- package/modern/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/modern/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/modern/hooks/features/editing/useGridCellEditing.js +21 -2
- package/modern/hooks/features/export/useGridPrintExport.js +8 -7
- package/modern/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +3 -0
- package/modern/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/modern/hooks/features/index.js +1 -0
- package/modern/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/modern/hooks/features/pagination/useGridPagination.js +8 -149
- package/modern/hooks/features/pagination/useGridPaginationModel.js +165 -0
- package/modern/hooks/features/pagination/useGridRowCount.js +94 -0
- package/modern/hooks/features/scroll/useGridScroll.js +1 -1
- package/modern/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/modern/hooks/utils/useLazyRef.js +1 -11
- package/modern/hooks/utils/useOnMount.js +1 -7
- package/modern/hooks/utils/useTimeout.js +1 -36
- package/modern/index.js +1 -1
- package/modern/internals/index.js +1 -1
- package/modern/internals/utils/getPinnedCellOffset.js +17 -0
- package/modern/joy/joySlots.js +11 -50
- package/modern/locales/jaJP.js +3 -4
- package/modern/material/index.js +0 -2
- package/modern/utils/cellBorderUtils.js +8 -0
- package/modern/utils/domUtils.js +144 -0
- package/node/DataGrid/DataGrid.js +44 -0
- package/node/DataGrid/useDataGridComponent.js +3 -0
- package/node/DataGrid/useDataGridProps.js +3 -2
- package/node/components/GridColumnHeaders.js +6 -16
- package/node/components/GridHeaders.js +1 -4
- package/node/components/GridPagination.js +1 -3
- package/node/components/GridRow.js +3 -18
- package/node/components/GridScrollArea.js +158 -0
- package/node/components/cell/GridCell.js +12 -4
- package/node/components/columnHeaders/GridBaseColumnHeaders.js +1 -0
- package/node/components/columnHeaders/GridColumnGroupHeader.js +18 -8
- package/node/components/columnHeaders/GridColumnHeaderItem.js +21 -6
- package/node/components/columnHeaders/GridGenericColumnHeaderItem.js +6 -5
- package/node/components/containers/GridRootStyles.js +12 -20
- package/node/components/virtualization/GridVirtualScrollbar.js +4 -0
- package/node/components/virtualization/GridVirtualScroller.js +6 -1
- package/node/components/virtualization/GridVirtualScrollerFiller.js +2 -1
- package/node/constants/gridClasses.js +1 -1
- package/node/hooks/features/columnHeaders/useGridColumnHeaders.js +190 -103
- package/node/hooks/features/columnResize/columnResizeSelector.js +10 -0
- package/node/hooks/features/columnResize/columnResizeState.js +5 -0
- package/node/hooks/features/columnResize/gridColumnResizeApi.js +16 -0
- package/node/hooks/features/columnResize/index.js +38 -0
- package/node/hooks/features/columnResize/useGridColumnResize.js +564 -0
- package/node/hooks/features/columns/gridColumnsUtils.js +4 -1
- package/node/hooks/features/dimensions/useGridDimensions.js +4 -5
- package/node/hooks/features/editing/useGridCellEditing.js +21 -2
- package/node/hooks/features/export/useGridPrintExport.js +8 -7
- package/node/hooks/features/headerFiltering/gridHeaderFilteringSelectors.js +4 -1
- package/node/hooks/features/headerFiltering/useGridHeaderFiltering.js +21 -2
- package/node/hooks/features/index.js +11 -0
- package/node/hooks/features/pagination/gridPaginationSelector.js +8 -2
- package/node/hooks/features/pagination/useGridPagination.js +9 -153
- package/node/hooks/features/pagination/useGridPaginationModel.js +176 -0
- package/node/hooks/features/pagination/useGridRowCount.js +103 -0
- package/node/hooks/features/scroll/useGridScroll.js +1 -1
- package/node/hooks/features/virtualization/gridVirtualizationSelectors.js +0 -2
- package/node/hooks/utils/useLazyRef.js +7 -13
- package/node/hooks/utils/useOnMount.js +8 -10
- package/node/hooks/utils/useTimeout.js +7 -37
- package/node/index.js +1 -1
- package/node/internals/index.js +15 -8
- package/node/internals/utils/getPinnedCellOffset.js +24 -0
- package/node/joy/joySlots.js +11 -50
- package/node/locales/jaJP.js +3 -4
- package/node/material/index.js +0 -2
- package/node/utils/cellBorderUtils.js +16 -0
- package/node/utils/domUtils.js +155 -0
- package/package.json +1 -1
- package/utils/cellBorderUtils.d.ts +3 -0
- package/utils/cellBorderUtils.js +8 -0
- package/utils/domUtils.d.ts +14 -1
- package/utils/domUtils.js +147 -0
- package/components/columnHeaders/GridColumnHeadersInner.d.ts +0 -8
- package/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/modern/components/columnHeaders/GridColumnHeadersInner.js +0 -58
- package/node/components/columnHeaders/GridColumnHeadersInner.js +0 -67
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
React.useEffect(fn, EMPTY);
|
|
14
|
-
/* eslint-enable react-hooks/exhaustive-deps */
|
|
15
|
-
}
|
|
7
|
+
Object.defineProperty(exports, "useOnMount", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _useOnMount.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _useOnMount = _interopRequireDefault(require("@mui/utils/useOnMount"));
|
|
@@ -1,43 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
'use client';
|
|
3
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Timeout {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.currentId = null;
|
|
14
|
-
this.clear = () => {
|
|
15
|
-
if (this.currentId !== null) {
|
|
16
|
-
clearTimeout(this.currentId);
|
|
17
|
-
this.currentId = null;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
this.disposeEffect = () => {
|
|
21
|
-
return this.clear;
|
|
22
|
-
};
|
|
7
|
+
Object.defineProperty(exports, "useTimeout", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _useTimeout.default;
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
29
|
-
*/
|
|
30
|
-
start(delay, fn) {
|
|
31
|
-
this.clear();
|
|
32
|
-
this.currentId = setTimeout(() => {
|
|
33
|
-
this.currentId = null;
|
|
34
|
-
fn();
|
|
35
|
-
}, delay);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.Timeout = Timeout;
|
|
39
|
-
function useTimeout() {
|
|
40
|
-
const timeout = (0, _useLazyRef.useLazyRef)(Timeout.create).current;
|
|
41
|
-
(0, _useOnMount.useOnMount)(timeout.disposeEffect);
|
|
42
|
-
return timeout;
|
|
43
|
-
}
|
|
12
|
+
});
|
|
13
|
+
var _useTimeout = _interopRequireDefault(require("@mui/utils/useTimeout"));
|
package/node/index.js
CHANGED
package/node/internals/index.js
CHANGED
|
@@ -9,7 +9,6 @@ var _exportNames = {
|
|
|
9
9
|
GridVirtualScrollerRenderZone: true,
|
|
10
10
|
GridHeaders: true,
|
|
11
11
|
GridBaseColumnHeaders: true,
|
|
12
|
-
GridColumnHeadersInner: true,
|
|
13
12
|
DATA_GRID_DEFAULT_SLOTS_COMPONENTS: true,
|
|
14
13
|
getGridFilter: true,
|
|
15
14
|
useGridRegisterPipeProcessor: true,
|
|
@@ -72,6 +71,8 @@ var _exportNames = {
|
|
|
72
71
|
useGridStatePersistence: true,
|
|
73
72
|
useGridVirtualScroller: true,
|
|
74
73
|
EMPTY_DETAIL_PANELS: true,
|
|
74
|
+
useGridColumnResize: true,
|
|
75
|
+
columnResizeStateInitializer: true,
|
|
75
76
|
useTimeout: true,
|
|
76
77
|
useGridVisibleRows: true,
|
|
77
78
|
getVisibleRows: true,
|
|
@@ -120,12 +121,6 @@ Object.defineProperty(exports, "GridBaseColumnHeaders", {
|
|
|
120
121
|
return _GridBaseColumnHeaders.GridBaseColumnHeaders;
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
|
-
Object.defineProperty(exports, "GridColumnHeadersInner", {
|
|
124
|
-
enumerable: true,
|
|
125
|
-
get: function () {
|
|
126
|
-
return _GridColumnHeadersInner.GridColumnHeadersInner;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
124
|
Object.defineProperty(exports, "GridHeaders", {
|
|
130
125
|
enumerable: true,
|
|
131
126
|
get: function () {
|
|
@@ -180,6 +175,12 @@ Object.defineProperty(exports, "columnMenuStateInitializer", {
|
|
|
180
175
|
return _useGridColumnMenu.columnMenuStateInitializer;
|
|
181
176
|
}
|
|
182
177
|
});
|
|
178
|
+
Object.defineProperty(exports, "columnResizeStateInitializer", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () {
|
|
181
|
+
return _useGridColumnResize.columnResizeStateInitializer;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
183
184
|
Object.defineProperty(exports, "columnsStateInitializer", {
|
|
184
185
|
enumerable: true,
|
|
185
186
|
get: function () {
|
|
@@ -414,6 +415,12 @@ Object.defineProperty(exports, "useGridColumnMenu", {
|
|
|
414
415
|
return _useGridColumnMenu.useGridColumnMenu;
|
|
415
416
|
}
|
|
416
417
|
});
|
|
418
|
+
Object.defineProperty(exports, "useGridColumnResize", {
|
|
419
|
+
enumerable: true,
|
|
420
|
+
get: function () {
|
|
421
|
+
return _useGridColumnResize.useGridColumnResize;
|
|
422
|
+
}
|
|
423
|
+
});
|
|
417
424
|
Object.defineProperty(exports, "useGridColumnSpanning", {
|
|
418
425
|
enumerable: true,
|
|
419
426
|
get: function () {
|
|
@@ -605,7 +612,6 @@ var _GridVirtualScrollerContent = require("../components/virtualization/GridVirt
|
|
|
605
612
|
var _GridVirtualScrollerRenderZone = require("../components/virtualization/GridVirtualScrollerRenderZone");
|
|
606
613
|
var _GridHeaders = require("../components/GridHeaders");
|
|
607
614
|
var _GridBaseColumnHeaders = require("../components/columnHeaders/GridBaseColumnHeaders");
|
|
608
|
-
var _GridColumnHeadersInner = require("../components/columnHeaders/GridColumnHeadersInner");
|
|
609
615
|
var _defaultGridSlotsComponents = require("../constants/defaultGridSlotsComponents");
|
|
610
616
|
var _GridFilterPanel = require("../components/panel/filterPanel/GridFilterPanel");
|
|
611
617
|
var _pipeProcessing = require("../hooks/core/pipeProcessing");
|
|
@@ -693,6 +699,7 @@ Object.keys(_virtualization).forEach(function (key) {
|
|
|
693
699
|
}
|
|
694
700
|
});
|
|
695
701
|
});
|
|
702
|
+
var _useGridColumnResize = require("../hooks/features/columnResize/useGridColumnResize");
|
|
696
703
|
var _useTimeout = require("../hooks/utils/useTimeout");
|
|
697
704
|
var _useGridVisibleRows = require("../hooks/utils/useGridVisibleRows");
|
|
698
705
|
var _useGridInitializeState = require("../hooks/utils/useGridInitializeState");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPinnedCellOffset = void 0;
|
|
7
|
+
var _columns = require("../../hooks/features/columns");
|
|
8
|
+
const getPinnedCellOffset = (pinnedPosition, computedWidth, columnIndex, columnPositions, dimensions) => {
|
|
9
|
+
const scrollbarWidth = dimensions.hasScrollY ? dimensions.scrollbarSize : 0;
|
|
10
|
+
let pinnedOffset;
|
|
11
|
+
switch (pinnedPosition) {
|
|
12
|
+
case _columns.GridPinnedColumnPosition.LEFT:
|
|
13
|
+
pinnedOffset = columnPositions[columnIndex];
|
|
14
|
+
break;
|
|
15
|
+
case _columns.GridPinnedColumnPosition.RIGHT:
|
|
16
|
+
pinnedOffset = dimensions.columnsTotalWidth - columnPositions[columnIndex] - computedWidth + scrollbarWidth;
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
pinnedOffset = 0;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
return pinnedOffset;
|
|
23
|
+
};
|
|
24
|
+
exports.getPinnedCellOffset = getPinnedCellOffset;
|
package/node/joy/joySlots.js
CHANGED
|
@@ -14,7 +14,6 @@ var _FormControl = _interopRequireDefault(require("@mui/joy/FormControl"));
|
|
|
14
14
|
var _FormLabel = _interopRequireDefault(require("@mui/joy/FormLabel"));
|
|
15
15
|
var _Button = _interopRequireDefault(require("@mui/joy/Button"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("@mui/joy/IconButton"));
|
|
17
|
-
var _Switch = _interopRequireDefault(require("@mui/joy/Switch"));
|
|
18
17
|
var _Select = _interopRequireDefault(require("@mui/joy/Select"));
|
|
19
18
|
var _Option = _interopRequireDefault(require("@mui/joy/Option"));
|
|
20
19
|
var _Box = _interopRequireDefault(require("@mui/joy/Box"));
|
|
@@ -32,10 +31,9 @@ const _excluded = ["touchRippleRef", "inputProps", "onChange", "color", "size",
|
|
|
32
31
|
_excluded2 = ["onChange", "label", "placeholder", "value", "inputRef", "type", "size", "variant"],
|
|
33
32
|
_excluded3 = ["startIcon", "color", "endIcon", "size", "sx", "variant"],
|
|
34
33
|
_excluded4 = ["color", "size", "sx", "touchRippleRef"],
|
|
35
|
-
_excluded5 = ["
|
|
36
|
-
_excluded6 = ["
|
|
37
|
-
_excluded7 = ["
|
|
38
|
-
_excluded8 = ["shrink", "variant", "sx"];
|
|
34
|
+
_excluded5 = ["open", "onOpen", "value", "onChange", "size", "color", "variant", "inputProps", "MenuProps", "inputRef", "error", "native", "fullWidth", "labelId"],
|
|
35
|
+
_excluded6 = ["native"],
|
|
36
|
+
_excluded7 = ["shrink", "variant", "sx"];
|
|
39
37
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
40
38
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
41
39
|
function convertColor(color) {
|
|
@@ -162,43 +160,7 @@ const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref4, ref)
|
|
|
162
160
|
sx: sx
|
|
163
161
|
}));
|
|
164
162
|
});
|
|
165
|
-
const
|
|
166
|
-
let {
|
|
167
|
-
name,
|
|
168
|
-
color: colorProp,
|
|
169
|
-
edge,
|
|
170
|
-
icon,
|
|
171
|
-
inputProps,
|
|
172
|
-
inputRef,
|
|
173
|
-
size,
|
|
174
|
-
sx,
|
|
175
|
-
onChange,
|
|
176
|
-
onClick
|
|
177
|
-
} = _ref5,
|
|
178
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
|
|
179
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.default, (0, _extends2.default)({}, props, {
|
|
180
|
-
onChange: onChange,
|
|
181
|
-
size: convertSize(size),
|
|
182
|
-
color: convertColor(colorProp),
|
|
183
|
-
ref: ref,
|
|
184
|
-
slotProps: {
|
|
185
|
-
input: (0, _extends2.default)({}, inputProps, {
|
|
186
|
-
name,
|
|
187
|
-
onClick: onClick,
|
|
188
|
-
ref: inputRef
|
|
189
|
-
}),
|
|
190
|
-
thumb: {
|
|
191
|
-
children: icon
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
sx: [(0, _extends2.default)({}, edge === 'start' && {
|
|
195
|
-
ml: '-8px'
|
|
196
|
-
}, edge === 'end' && {
|
|
197
|
-
mr: '-8px'
|
|
198
|
-
}), ...(Array.isArray(sx) ? sx : [sx])]
|
|
199
|
-
}));
|
|
200
|
-
});
|
|
201
|
-
const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
163
|
+
const Select = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
202
164
|
let {
|
|
203
165
|
open,
|
|
204
166
|
onOpen,
|
|
@@ -210,8 +172,8 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
210
172
|
MenuProps,
|
|
211
173
|
inputRef,
|
|
212
174
|
labelId
|
|
213
|
-
} =
|
|
214
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
175
|
+
} = _ref5,
|
|
176
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref5, _excluded5);
|
|
215
177
|
const handleChange = (event, newValue) => {
|
|
216
178
|
if (event && onChange) {
|
|
217
179
|
// Same as in https://github.com/mui/material-ui/blob/e5558282a8f36856aef1299f3a36f3235e92e770/packages/mui-material/src/Select/SelectInput.js#L288-L300
|
|
@@ -262,17 +224,17 @@ const Select = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
262
224
|
}
|
|
263
225
|
}));
|
|
264
226
|
});
|
|
265
|
-
const Option = /*#__PURE__*/React.forwardRef((
|
|
266
|
-
let props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
227
|
+
const Option = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
228
|
+
let props = (0, _objectWithoutPropertiesLoose2.default)(_ref6, _excluded6);
|
|
267
229
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Option.default, (0, _extends2.default)({}, props, {
|
|
268
230
|
ref: ref
|
|
269
231
|
}));
|
|
270
232
|
});
|
|
271
|
-
const InputLabel = /*#__PURE__*/React.forwardRef((
|
|
233
|
+
const InputLabel = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
272
234
|
let {
|
|
273
235
|
sx
|
|
274
|
-
} =
|
|
275
|
-
props = (0, _objectWithoutPropertiesLoose2.default)(
|
|
236
|
+
} = _ref7,
|
|
237
|
+
props = (0, _objectWithoutPropertiesLoose2.default)(_ref7, _excluded7);
|
|
276
238
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_FormLabel.default, (0, _extends2.default)({}, props, {
|
|
277
239
|
ref: ref,
|
|
278
240
|
sx: sx
|
|
@@ -402,7 +364,6 @@ const joySlots = (0, _extends2.default)({}, _icons.default, {
|
|
|
402
364
|
baseTextField: TextField,
|
|
403
365
|
baseButton: Button,
|
|
404
366
|
baseIconButton: IconButton,
|
|
405
|
-
baseSwitch: Switch,
|
|
406
367
|
baseSelect: Select,
|
|
407
368
|
baseSelectOption: Option,
|
|
408
369
|
baseInputLabel: InputLabel,
|
package/node/locales/jaJP.js
CHANGED
|
@@ -36,10 +36,9 @@ const jaJPGrid = {
|
|
|
36
36
|
toolbarExportPrint: '印刷',
|
|
37
37
|
toolbarExportExcel: 'Excelダウンロード',
|
|
38
38
|
// Columns management text
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
columnsManagementSearchTitle: '検索',
|
|
40
|
+
columnsManagementNoColumns: 'カラムなし',
|
|
41
|
+
columnsManagementShowHideAllText: 'すべて表示/非表示',
|
|
43
42
|
// Filter panel text
|
|
44
43
|
filterPanelAddFilter: 'フィルター追加',
|
|
45
44
|
filterPanelRemoveAll: 'すべて削除',
|
package/node/material/index.js
CHANGED
|
@@ -10,7 +10,6 @@ var _Checkbox = _interopRequireDefault(require("@mui/material/Checkbox"));
|
|
|
10
10
|
var _TextField = _interopRequireDefault(require("@mui/material/TextField"));
|
|
11
11
|
var _FormControl = _interopRequireDefault(require("@mui/material/FormControl"));
|
|
12
12
|
var _Select = _interopRequireDefault(require("@mui/material/Select"));
|
|
13
|
-
var _Switch = _interopRequireDefault(require("@mui/material/Switch"));
|
|
14
13
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
15
14
|
var _IconButton = _interopRequireDefault(require("@mui/material/IconButton"));
|
|
16
15
|
var _InputAdornment = _interopRequireDefault(require("@mui/material/InputAdornment"));
|
|
@@ -63,7 +62,6 @@ const materialSlots = (0, _extends2.default)({}, iconSlots, {
|
|
|
63
62
|
baseTextField: _TextField.default,
|
|
64
63
|
baseFormControl: _FormControl.default,
|
|
65
64
|
baseSelect: _Select.default,
|
|
66
|
-
baseSwitch: _Switch.default,
|
|
67
65
|
baseButton: _Button.default,
|
|
68
66
|
baseIconButton: _IconButton.default,
|
|
69
67
|
baseInputAdornment: _InputAdornment.default,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldCellShowRightBorder = exports.shouldCellShowLeftBorder = void 0;
|
|
7
|
+
var _gridColumnsInterfaces = require("../hooks/features/columns/gridColumnsInterfaces");
|
|
8
|
+
const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
9
|
+
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
10
|
+
return showCellVerticalBorderRootProp && (pinnedPosition !== _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.LEFT && isSectionLastCell;
|
|
11
|
+
};
|
|
12
|
+
exports.shouldCellShowRightBorder = shouldCellShowRightBorder;
|
|
13
|
+
const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
14
|
+
return pinnedPosition === _gridColumnsInterfaces.GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
15
|
+
};
|
|
16
|
+
exports.shouldCellShowLeftBorder = shouldCellShowLeftBorder;
|
package/node/utils/domUtils.js
CHANGED
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.findGridCellElementsFromCol = findGridCellElementsFromCol;
|
|
7
|
+
exports.findGridCells = findGridCells;
|
|
8
|
+
exports.findGridElement = findGridElement;
|
|
9
|
+
exports.findGridHeader = findGridHeader;
|
|
10
|
+
exports.findGroupHeaderElementsFromField = findGroupHeaderElementsFromField;
|
|
11
|
+
exports.findHeaderElementFromField = findHeaderElementFromField;
|
|
12
|
+
exports.findLeftPinnedCellsAfterCol = findLeftPinnedCellsAfterCol;
|
|
13
|
+
exports.findLeftPinnedHeadersAfterCol = findLeftPinnedHeadersAfterCol;
|
|
6
14
|
exports.findParentElementFromClassName = findParentElementFromClassName;
|
|
15
|
+
exports.findRightPinnedCellsBeforeCol = findRightPinnedCellsBeforeCol;
|
|
16
|
+
exports.findRightPinnedHeadersBeforeCol = findRightPinnedHeadersBeforeCol;
|
|
7
17
|
exports.getActiveElement = void 0;
|
|
18
|
+
exports.getFieldFromHeaderElem = getFieldFromHeaderElem;
|
|
8
19
|
exports.getGridCellElement = getGridCellElement;
|
|
9
20
|
exports.getGridColumnHeaderElement = getGridColumnHeaderElement;
|
|
10
21
|
exports.getGridRowElement = getGridRowElement;
|
|
@@ -59,4 +70,148 @@ function isEventTargetInPortal(event) {
|
|
|
59
70
|
return true;
|
|
60
71
|
}
|
|
61
72
|
return false;
|
|
73
|
+
}
|
|
74
|
+
function getFieldFromHeaderElem(colCellEl) {
|
|
75
|
+
return colCellEl.getAttribute('data-field');
|
|
76
|
+
}
|
|
77
|
+
function findHeaderElementFromField(elem, field) {
|
|
78
|
+
return elem.querySelector(`[data-field="${field}"]`);
|
|
79
|
+
}
|
|
80
|
+
function findGroupHeaderElementsFromField(elem, field) {
|
|
81
|
+
return Array.from(elem.querySelectorAll(`[data-fields*="|-${field}-|"]`) ?? []);
|
|
82
|
+
}
|
|
83
|
+
function findGridCellElementsFromCol(col, api) {
|
|
84
|
+
const root = findParentElementFromClassName(col, _gridClasses.gridClasses.root);
|
|
85
|
+
if (!root) {
|
|
86
|
+
throw new Error('MUI X: The root element is not found.');
|
|
87
|
+
}
|
|
88
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
89
|
+
if (!ariaColIndex) {
|
|
90
|
+
return [];
|
|
91
|
+
}
|
|
92
|
+
const colIndex = Number(ariaColIndex) - 1;
|
|
93
|
+
const cells = [];
|
|
94
|
+
if (!api.virtualScrollerRef?.current) {
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
queryRows(api).forEach(rowElement => {
|
|
98
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
99
|
+
if (!rowId) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
let columnIndex = colIndex;
|
|
103
|
+
const cellColSpanInfo = api.unstable_getCellColSpanInfo(rowId, colIndex);
|
|
104
|
+
if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {
|
|
105
|
+
columnIndex = cellColSpanInfo.leftVisibleCellIndex;
|
|
106
|
+
}
|
|
107
|
+
const cell = rowElement.querySelector(`[data-colindex="${columnIndex}"]`);
|
|
108
|
+
if (cell) {
|
|
109
|
+
cells.push(cell);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return cells;
|
|
113
|
+
}
|
|
114
|
+
function findGridElement(api, klass) {
|
|
115
|
+
return api.rootElementRef.current.querySelector(`.${_gridClasses.gridClasses[klass]}`);
|
|
116
|
+
}
|
|
117
|
+
const findPinnedCells = ({
|
|
118
|
+
api,
|
|
119
|
+
colIndex,
|
|
120
|
+
position,
|
|
121
|
+
filterFn
|
|
122
|
+
}) => {
|
|
123
|
+
if (colIndex === null) {
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
const cells = [];
|
|
127
|
+
queryRows(api).forEach(rowElement => {
|
|
128
|
+
const rowId = rowElement.getAttribute('data-id');
|
|
129
|
+
if (!rowId) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
rowElement.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'cell--pinnedLeft' : 'cell--pinnedRight']}`).forEach(cell => {
|
|
133
|
+
const currentColIndex = parseCellColIndex(cell);
|
|
134
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
135
|
+
cells.push(cell);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
return cells;
|
|
140
|
+
};
|
|
141
|
+
function findLeftPinnedCellsAfterCol(api, col) {
|
|
142
|
+
const colIndex = parseCellColIndex(col);
|
|
143
|
+
return findPinnedCells({
|
|
144
|
+
api,
|
|
145
|
+
colIndex,
|
|
146
|
+
position: 'left',
|
|
147
|
+
filterFn: index => index > colIndex
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function findRightPinnedCellsBeforeCol(api, col) {
|
|
151
|
+
const colIndex = parseCellColIndex(col);
|
|
152
|
+
return findPinnedCells({
|
|
153
|
+
api,
|
|
154
|
+
colIndex,
|
|
155
|
+
position: 'right',
|
|
156
|
+
filterFn: index => index < colIndex
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const findPinnedHeaders = ({
|
|
160
|
+
api,
|
|
161
|
+
colIndex,
|
|
162
|
+
position,
|
|
163
|
+
filterFn
|
|
164
|
+
}) => {
|
|
165
|
+
if (!api.columnHeadersContainerRef?.current) {
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
if (colIndex === null) {
|
|
169
|
+
return [];
|
|
170
|
+
}
|
|
171
|
+
const elements = [];
|
|
172
|
+
api.columnHeadersContainerRef.current.querySelectorAll(`.${_gridClasses.gridClasses[position === 'left' ? 'columnHeader--pinnedLeft' : 'columnHeader--pinnedRight']}`).forEach(element => {
|
|
173
|
+
const currentColIndex = parseCellColIndex(element);
|
|
174
|
+
if (currentColIndex !== null && filterFn(currentColIndex)) {
|
|
175
|
+
elements.push(element);
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return elements;
|
|
179
|
+
};
|
|
180
|
+
function findLeftPinnedHeadersAfterCol(api, col) {
|
|
181
|
+
const colIndex = parseCellColIndex(col);
|
|
182
|
+
return findPinnedHeaders({
|
|
183
|
+
api,
|
|
184
|
+
position: 'left',
|
|
185
|
+
colIndex,
|
|
186
|
+
filterFn: index => index > colIndex
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function findRightPinnedHeadersBeforeCol(api, col) {
|
|
190
|
+
const colIndex = parseCellColIndex(col);
|
|
191
|
+
return findPinnedHeaders({
|
|
192
|
+
api,
|
|
193
|
+
position: 'right',
|
|
194
|
+
colIndex,
|
|
195
|
+
filterFn: index => index < colIndex
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
function findGridHeader(api, field) {
|
|
199
|
+
const headers = api.columnHeadersContainerRef.current;
|
|
200
|
+
return headers.querySelector(`:scope > div > [data-field="${field}"][role="columnheader"]`);
|
|
201
|
+
}
|
|
202
|
+
function findGridCells(api, field) {
|
|
203
|
+
const container = api.virtualScrollerRef.current;
|
|
204
|
+
return Array.from(container.querySelectorAll(`:scope > div > div > div > [data-field="${field}"][role="gridcell"]`));
|
|
205
|
+
}
|
|
206
|
+
function queryRows(api) {
|
|
207
|
+
return api.virtualScrollerRef.current.querySelectorAll(
|
|
208
|
+
// Use > to ignore rows from nested data grids (e.g. in detail panel)
|
|
209
|
+
`:scope > div > div > .${_gridClasses.gridClasses.row}`);
|
|
210
|
+
}
|
|
211
|
+
function parseCellColIndex(col) {
|
|
212
|
+
const ariaColIndex = col.getAttribute('aria-colindex');
|
|
213
|
+
if (!ariaColIndex) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
return Number(ariaColIndex) - 1;
|
|
62
217
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
+
export declare const shouldCellShowRightBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number, sectionLength: number, showCellVerticalBorderRootProp: boolean) => boolean;
|
|
3
|
+
export declare const shouldCellShowLeftBorder: (pinnedPosition: GridPinnedColumnPosition | undefined, indexInSection: number) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GridPinnedColumnPosition } from '../hooks/features/columns/gridColumnsInterfaces';
|
|
2
|
+
export const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp) => {
|
|
3
|
+
const isSectionLastCell = indexInSection === sectionLength - 1;
|
|
4
|
+
return showCellVerticalBorderRootProp && (pinnedPosition !== GridPinnedColumnPosition.LEFT ? !isSectionLastCell : true) || pinnedPosition === GridPinnedColumnPosition.LEFT && isSectionLastCell;
|
|
5
|
+
};
|
|
6
|
+
export const shouldCellShowLeftBorder = (pinnedPosition, indexInSection) => {
|
|
7
|
+
return pinnedPosition === GridPinnedColumnPosition.RIGHT && indexInSection === 0;
|
|
8
|
+
};
|
package/utils/domUtils.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { gridClasses } from '../constants/gridClasses';
|
|
3
|
+
import type { GridPrivateApiCommunity } from '../models/api/gridApiCommunity';
|
|
4
|
+
import type { GridRowId } from '../models/gridRows';
|
|
3
5
|
export declare function isOverflown(element: Element): boolean;
|
|
4
6
|
export declare function findParentElementFromClassName(elem: Element, className: string): Element | null;
|
|
5
7
|
export declare function getGridColumnHeaderElement(root: Element, field: string): HTMLDivElement | null;
|
|
@@ -10,3 +12,14 @@ export declare function getGridCellElement(root: Element, { id, field }: {
|
|
|
10
12
|
}): HTMLDivElement | null;
|
|
11
13
|
export declare const getActiveElement: (root?: Document | ShadowRoot) => Element | null;
|
|
12
14
|
export declare function isEventTargetInPortal(event: React.SyntheticEvent): boolean;
|
|
15
|
+
export declare function getFieldFromHeaderElem(colCellEl: Element): string;
|
|
16
|
+
export declare function findHeaderElementFromField(elem: Element, field: string): HTMLDivElement;
|
|
17
|
+
export declare function findGroupHeaderElementsFromField(elem: Element, field: string): Element[];
|
|
18
|
+
export declare function findGridCellElementsFromCol(col: HTMLElement, api: GridPrivateApiCommunity): Element[];
|
|
19
|
+
export declare function findGridElement(api: GridPrivateApiCommunity, klass: keyof typeof gridClasses): HTMLElement;
|
|
20
|
+
export declare function findLeftPinnedCellsAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
21
|
+
export declare function findRightPinnedCellsBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
22
|
+
export declare function findLeftPinnedHeadersAfterCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
23
|
+
export declare function findRightPinnedHeadersBeforeCol(api: GridPrivateApiCommunity, col: HTMLElement): HTMLElement[];
|
|
24
|
+
export declare function findGridHeader(api: GridPrivateApiCommunity, field: string): Element | null;
|
|
25
|
+
export declare function findGridCells(api: GridPrivateApiCommunity, field: string): Element[];
|