@mui/x-data-grid 7.24.1 → 7.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -0
- package/DataGrid/DataGrid.js +1 -7
- package/components/GridRow.d.ts +0 -1
- package/components/GridRow.js +25 -19
- package/components/cell/GridCell.d.ts +9 -6
- package/components/cell/GridCell.js +29 -52
- package/components/containers/GridRootStyles.js +135 -37
- package/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/components/virtualization/GridMainContainer.d.ts +10 -0
- package/components/virtualization/GridMainContainer.js +10 -2
- package/components/virtualization/GridVirtualScrollbar.d.ts +4 -0
- package/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/components/virtualization/GridVirtualScroller.js +18 -5
- package/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/hooks/features/columns/useGridColumns.js +7 -3
- package/hooks/features/dimensions/useGridDimensions.js +6 -8
- package/hooks/features/editing/gridEditingSelectors.d.ts +6 -0
- package/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/hooks/features/editing/index.d.ts +1 -1
- package/hooks/features/editing/index.js +1 -1
- package/hooks/features/editing/useGridCellEditing.js +3 -3
- package/hooks/features/editing/useGridRowEditing.js +5 -6
- package/hooks/features/focus/useGridFocus.js +3 -2
- package/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/hooks/features/keyboardNavigation/utils.d.ts +1 -2
- package/hooks/features/keyboardNavigation/utils.js +0 -5
- package/hooks/features/listView/useGridListView.js +2 -1
- package/hooks/features/rowSelection/useGridRowSelection.js +3 -3
- package/hooks/features/rows/useGridParamsApi.d.ts +1 -1
- package/hooks/features/rows/useGridParamsApi.js +33 -14
- package/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/hooks/features/rows/useGridRows.js +7 -8
- package/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/hooks/features/virtualization/useGridVirtualScroller.d.ts +9 -1
- package/hooks/features/virtualization/useGridVirtualScroller.js +31 -45
- package/index.js +1 -1
- package/models/api/gridApiCommon.d.ts +2 -2
- package/models/api/gridParamsApi.d.ts +29 -2
- package/models/api/index.d.ts +1 -1
- package/models/api/index.js +0 -1
- package/modern/DataGrid/DataGrid.js +1 -7
- package/modern/components/GridRow.js +25 -19
- package/modern/components/cell/GridCell.js +29 -52
- package/modern/components/containers/GridRootStyles.js +135 -37
- package/modern/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/modern/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/modern/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/modern/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/modern/components/virtualization/GridMainContainer.js +10 -2
- package/modern/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/modern/components/virtualization/GridVirtualScroller.js +18 -5
- package/modern/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/modern/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/modern/hooks/features/columns/useGridColumns.js +7 -3
- package/modern/hooks/features/dimensions/useGridDimensions.js +6 -8
- package/modern/hooks/features/editing/gridEditingSelectors.js +7 -1
- package/modern/hooks/features/editing/index.js +1 -1
- package/modern/hooks/features/editing/useGridCellEditing.js +3 -3
- package/modern/hooks/features/editing/useGridRowEditing.js +5 -6
- package/modern/hooks/features/focus/useGridFocus.js +3 -2
- package/modern/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -16
- package/modern/hooks/features/keyboardNavigation/utils.js +0 -5
- package/modern/hooks/features/listView/useGridListView.js +2 -1
- package/modern/hooks/features/rowSelection/useGridRowSelection.js +3 -3
- package/modern/hooks/features/rows/useGridParamsApi.js +33 -14
- package/modern/hooks/features/rows/useGridRowSpanning.js +94 -91
- package/modern/hooks/features/rows/useGridRows.js +7 -8
- package/modern/hooks/features/rows/useGridRowsMeta.js +3 -2
- package/modern/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/modern/hooks/features/virtualization/useGridVirtualScroller.js +31 -45
- package/modern/index.js +1 -1
- package/modern/models/api/index.js +0 -1
- package/modern/utils/roundToDecimalPlaces.js +3 -0
- package/modern/utils/utils.js +6 -1
- package/node/DataGrid/DataGrid.js +1 -7
- package/node/components/GridRow.js +22 -16
- package/node/components/cell/GridCell.js +27 -50
- package/node/components/containers/GridRootStyles.js +135 -37
- package/node/components/toolbar/GridToolbarColumnsButton.js +5 -4
- package/node/components/toolbar/GridToolbarDensitySelector.js +2 -2
- package/node/components/toolbar/GridToolbarExportContainer.js +2 -2
- package/node/components/toolbar/GridToolbarFilterButton.js +4 -3
- package/node/components/virtualization/GridMainContainer.js +10 -2
- package/node/components/virtualization/GridVirtualScrollbar.js +5 -5
- package/node/components/virtualization/GridVirtualScroller.js +18 -5
- package/node/components/virtualization/GridVirtualScrollerContent.js +11 -2
- package/node/hooks/features/columnResize/useGridColumnResize.js +2 -1
- package/node/hooks/features/columns/useGridColumns.js +7 -3
- package/node/hooks/features/dimensions/useGridDimensions.js +6 -8
- package/node/hooks/features/editing/gridEditingSelectors.js +8 -2
- package/node/hooks/features/editing/index.js +7 -11
- package/node/hooks/features/editing/useGridCellEditing.js +2 -2
- package/node/hooks/features/editing/useGridRowEditing.js +3 -4
- package/node/hooks/features/focus/useGridFocus.js +3 -2
- package/node/hooks/features/keyboardNavigation/useGridKeyboardNavigation.js +24 -15
- package/node/hooks/features/keyboardNavigation/utils.js +0 -6
- package/node/hooks/features/listView/useGridListView.js +2 -1
- package/node/hooks/features/rowSelection/useGridRowSelection.js +2 -2
- package/node/hooks/features/rows/useGridParamsApi.js +33 -14
- package/node/hooks/features/rows/useGridRowSpanning.js +92 -89
- package/node/hooks/features/rows/useGridRows.js +7 -8
- package/node/hooks/features/rows/useGridRowsMeta.js +5 -4
- package/node/hooks/features/virtualization/gridFocusedVirtualCellSelector.js +2 -2
- package/node/hooks/features/virtualization/useGridVirtualScroller.js +31 -45
- package/node/index.js +1 -1
- package/node/models/api/index.js +0 -11
- package/node/utils/roundToDecimalPlaces.js +9 -0
- package/node/utils/utils.js +8 -1
- package/package.json +2 -2
- package/utils/roundToDecimalPlaces.d.ts +1 -0
- package/utils/roundToDecimalPlaces.js +3 -0
- package/utils/utils.d.ts +1 -0
- package/utils/utils.js +6 -1
|
@@ -13,7 +13,7 @@ var _gridVirtualizationSelectors = require("./gridVirtualizationSelectors");
|
|
|
13
13
|
var _focus = require("../focus");
|
|
14
14
|
var _pagination = require("../pagination");
|
|
15
15
|
var _rows = require("../rows");
|
|
16
|
-
const
|
|
16
|
+
const gridIsFocusedCellOutOfContext = (0, _reselect.createSelector)(_focus.gridFocusCellSelector, _gridVirtualizationSelectors.gridRenderContextSelector, _pagination.gridVisibleRowsSelector, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector, _rows.gridRowsLookupSelector, (focusedCell, renderContext, currentPage, visibleColumns, rows) => {
|
|
17
17
|
if (!focusedCell) {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
@@ -26,7 +26,7 @@ const gridIsFocusedCellOutOfContex = (0, _reselect.createSelector)(_focus.gridFo
|
|
|
26
26
|
const isInRenderContext = rowIndex !== undefined && columnIndex !== -1 && rowIndex >= renderContext.firstRowIndex && rowIndex <= renderContext.lastRowIndex;
|
|
27
27
|
return !isInRenderContext;
|
|
28
28
|
});
|
|
29
|
-
const gridFocusedVirtualCellSelector = exports.gridFocusedVirtualCellSelector = (0, _createSelector.createSelectorMemoized)(
|
|
29
|
+
const gridFocusedVirtualCellSelector = exports.gridFocusedVirtualCellSelector = (0, _createSelector.createSelectorMemoized)(gridIsFocusedCellOutOfContext, _gridColumnsSelector.gridVisibleColumnDefinitionsSelector, _pagination.gridVisibleRowsSelector, _rows.gridRowsLookupSelector, _focus.gridFocusCellSelector, (isFocusedCellOutOfRenderContext, visibleColumns, currentPage, rows, focusedCell) => {
|
|
30
30
|
if (!isFocusedCellOutOfRenderContext) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
@@ -36,7 +36,9 @@ var _useGridVirtualization = require("./useGridVirtualization");
|
|
|
36
36
|
var _gridRowSpanningSelectors = require("../rows/gridRowSpanningSelectors");
|
|
37
37
|
var _gridListViewSelectors = require("../listView/gridListViewSelectors");
|
|
38
38
|
var _gridRowsUtils = require("../rows/gridRowsUtils");
|
|
39
|
+
var _columns = require("../columns");
|
|
39
40
|
var _gridFocusedVirtualCellSelector = require("./gridFocusedVirtualCellSelector");
|
|
41
|
+
var _roundToDecimalPlaces = require("../../../utils/roundToDecimalPlaces");
|
|
40
42
|
var _isJSDOM = require("../../../utils/isJSDOM");
|
|
41
43
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
42
44
|
const MINIMUM_COLUMN_WIDTH = 50;
|
|
@@ -69,17 +71,13 @@ const useGridVirtualScroller = () => {
|
|
|
69
71
|
const dimensions = (0, _useGridSelector.useGridSelector)(apiRef, _gridDimensionsSelectors.gridDimensionsSelector);
|
|
70
72
|
const outerSize = dimensions.viewportOuterSize;
|
|
71
73
|
const pinnedRows = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsSelector.gridPinnedRowsSelector);
|
|
72
|
-
const pinnedColumnDefinitions = (0,
|
|
73
|
-
const pinnedColumns = listView ?
|
|
74
|
-
left: [],
|
|
75
|
-
right: []
|
|
76
|
-
} : pinnedColumnDefinitions;
|
|
74
|
+
const pinnedColumnDefinitions = (0, _gridColumnsSelector.gridVisiblePinnedColumnDefinitionsSelector)(apiRef);
|
|
75
|
+
const pinnedColumns = listView ? _columns.EMPTY_PINNED_COLUMN_FIELDS : pinnedColumnDefinitions;
|
|
77
76
|
const hasBottomPinnedRows = pinnedRows.bottom.length > 0;
|
|
78
77
|
const [panels, setPanels] = React.useState(EMPTY_DETAIL_PANELS);
|
|
79
78
|
const isRtl = (0, _RtlProvider.useRtl)();
|
|
80
|
-
const rowsMeta = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowsMetaSelector.gridRowsMetaSelector);
|
|
81
79
|
const selectedRowsLookup = (0, _useGridSelector.useGridSelector)(apiRef, _gridRowSelectionSelector.selectedIdsLookupSelector);
|
|
82
|
-
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef
|
|
80
|
+
const currentPage = (0, _useGridVisibleRows.useGridVisibleRows)(apiRef);
|
|
83
81
|
const mainRef = apiRef.current.mainElementRef;
|
|
84
82
|
const scrollerRef = apiRef.current.virtualScrollerRef;
|
|
85
83
|
const scrollbarVerticalRef = apiRef.current.virtualScrollbarVerticalRef;
|
|
@@ -95,7 +93,10 @@ const useGridVirtualScroller = () => {
|
|
|
95
93
|
return undefined;
|
|
96
94
|
}
|
|
97
95
|
const initialRect = node.getBoundingClientRect();
|
|
98
|
-
let lastSize =
|
|
96
|
+
let lastSize = {
|
|
97
|
+
width: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(initialRect.width, 1),
|
|
98
|
+
height: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(initialRect.height, 1)
|
|
99
|
+
};
|
|
99
100
|
if (!previousSize.current || lastSize.width !== previousSize.current.width && lastSize.height !== previousSize.current.height) {
|
|
100
101
|
previousSize.current = lastSize;
|
|
101
102
|
apiRef.current.publishEvent('resize', lastSize);
|
|
@@ -108,7 +109,10 @@ const useGridVirtualScroller = () => {
|
|
|
108
109
|
if (!entry) {
|
|
109
110
|
return;
|
|
110
111
|
}
|
|
111
|
-
const newSize =
|
|
112
|
+
const newSize = {
|
|
113
|
+
width: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(entry.contentRect.width, 1),
|
|
114
|
+
height: (0, _roundToDecimalPlaces.roundToDecimalPlaces)(entry.contentRect.height, 1)
|
|
115
|
+
};
|
|
112
116
|
if (newSize.width === lastSize.width && newSize.height === lastSize.height) {
|
|
113
117
|
return;
|
|
114
118
|
}
|
|
@@ -176,9 +180,13 @@ const useGridVirtualScroller = () => {
|
|
|
176
180
|
if (!scroller) {
|
|
177
181
|
return undefined;
|
|
178
182
|
}
|
|
183
|
+
const maxScrollTop = Math.ceil(dimensions.minimumSize.height - dimensions.viewportOuterSize.height);
|
|
184
|
+
const maxScrollLeft = Math.ceil(dimensions.minimumSize.width - dimensions.viewportInnerSize.width);
|
|
185
|
+
|
|
186
|
+
// Clamp the scroll position to the viewport to avoid re-calculating the render context for scroll bounce
|
|
179
187
|
const newScroll = {
|
|
180
|
-
top: scroller.scrollTop,
|
|
181
|
-
left: scroller.scrollLeft
|
|
188
|
+
top: (0, _utils3.clamp)(scroller.scrollTop, 0, maxScrollTop),
|
|
189
|
+
left: isRtl ? (0, _utils3.clamp)(scroller.scrollLeft, -maxScrollLeft, 0) : (0, _utils3.clamp)(scroller.scrollLeft, 0, maxScrollLeft)
|
|
182
190
|
};
|
|
183
191
|
const dx = newScroll.left - scrollPosition.current.left;
|
|
184
192
|
const dy = newScroll.top - scrollPosition.current.top;
|
|
@@ -231,34 +239,15 @@ const useGridVirtualScroller = () => {
|
|
|
231
239
|
frozenContext.current = undefined;
|
|
232
240
|
updateRenderContext(nextRenderContext);
|
|
233
241
|
};
|
|
234
|
-
const handleScroll = (0, _utils.unstable_useEventCallback)(
|
|
242
|
+
const handleScroll = (0, _utils.unstable_useEventCallback)(() => {
|
|
235
243
|
if (ignoreNextScrollEvent.current) {
|
|
236
244
|
ignoreNextScrollEvent.current = false;
|
|
237
245
|
return;
|
|
238
246
|
}
|
|
239
|
-
const {
|
|
240
|
-
scrollTop,
|
|
241
|
-
scrollLeft
|
|
242
|
-
} = event.currentTarget;
|
|
243
|
-
|
|
244
|
-
// On iOS and macOS, negative offsets are possible when swiping past the start
|
|
245
|
-
if (scrollTop < 0) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if (!isRtl) {
|
|
249
|
-
if (scrollLeft < 0) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (isRtl) {
|
|
254
|
-
if (scrollLeft > 0) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
247
|
const nextRenderContext = triggerUpdateRenderContext();
|
|
259
248
|
apiRef.current.publishEvent('scrollPositionChange', {
|
|
260
|
-
top:
|
|
261
|
-
left:
|
|
249
|
+
top: scrollPosition.current.top,
|
|
250
|
+
left: scrollPosition.current.left,
|
|
262
251
|
renderContext: nextRenderContext
|
|
263
252
|
});
|
|
264
253
|
});
|
|
@@ -380,7 +369,6 @@ const useGridVirtualScroller = () => {
|
|
|
380
369
|
rowId: id,
|
|
381
370
|
index: rowIndex,
|
|
382
371
|
selected: isSelected,
|
|
383
|
-
offsetTop: params.rows ? undefined : rowsMeta.positions[rowIndexInPage],
|
|
384
372
|
offsetLeft: offsetLeft,
|
|
385
373
|
columnsTotalWidth: dimensions.columnsTotalWidth,
|
|
386
374
|
rowHeight: baseRowHeight,
|
|
@@ -538,11 +526,13 @@ const useGridVirtualScroller = () => {
|
|
|
538
526
|
}),
|
|
539
527
|
getScrollbarVerticalProps: () => ({
|
|
540
528
|
ref: scrollbarVerticalRef,
|
|
541
|
-
role: 'presentation'
|
|
529
|
+
role: 'presentation',
|
|
530
|
+
scrollPosition
|
|
542
531
|
}),
|
|
543
532
|
getScrollbarHorizontalProps: () => ({
|
|
544
533
|
ref: scrollbarHorizontalRef,
|
|
545
|
-
role: 'presentation'
|
|
534
|
+
role: 'presentation',
|
|
535
|
+
scrollPosition
|
|
546
536
|
})
|
|
547
537
|
};
|
|
548
538
|
};
|
|
@@ -585,6 +575,11 @@ function computeRenderContext(inputs, scrollPosition, scrollCache) {
|
|
|
585
575
|
firstColumnIndex: 0,
|
|
586
576
|
lastColumnIndex: inputs.visibleColumns.length
|
|
587
577
|
};
|
|
578
|
+
if (inputs.listView) {
|
|
579
|
+
return (0, _extends2.default)({}, renderContext, {
|
|
580
|
+
lastColumnIndex: 1
|
|
581
|
+
});
|
|
582
|
+
}
|
|
588
583
|
const {
|
|
589
584
|
top,
|
|
590
585
|
left
|
|
@@ -836,13 +831,4 @@ function bufferForDirection(isRtl, direction, rowBufferPx, columnBufferPx, verti
|
|
|
836
831
|
// eslint unable to figure out enum exhaustiveness
|
|
837
832
|
throw new Error('unreachable');
|
|
838
833
|
}
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
// Round to avoid issues with subpixel rendering
|
|
842
|
-
// https://github.com/mui/mui-x/issues/15721
|
|
843
|
-
function roundDimensions(dimensions) {
|
|
844
|
-
return {
|
|
845
|
-
width: Math.round(dimensions.width * 10) / 10,
|
|
846
|
-
height: Math.round(dimensions.height * 10) / 10
|
|
847
|
-
};
|
|
848
834
|
}
|
package/node/index.js
CHANGED
package/node/models/api/index.js
CHANGED
|
@@ -3,17 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var _gridParamsApi = require("./gridParamsApi");
|
|
7
|
-
Object.keys(_gridParamsApi).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _gridParamsApi[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _gridParamsApi[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
6
|
var _gridColumnApi = require("./gridColumnApi");
|
|
18
7
|
Object.keys(_gridColumnApi).forEach(function (key) {
|
|
19
8
|
if (key === "default" || key === "__esModule") return;
|
package/node/utils/utils.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.isNumber = isNumber;
|
|
|
14
14
|
exports.isObject = isObject;
|
|
15
15
|
exports.localStorageAvailable = localStorageAvailable;
|
|
16
16
|
exports.range = range;
|
|
17
|
+
exports.runIf = void 0;
|
|
17
18
|
function isNumber(value) {
|
|
18
19
|
return typeof value === 'number' && !Number.isNaN(value);
|
|
19
20
|
}
|
|
@@ -213,4 +214,10 @@ function deepClone(obj) {
|
|
|
213
214
|
* of a `eslint-disable-next-line react-hooks/exhaustive-deps` because
|
|
214
215
|
* that hint disables checks on all values instead of just one.
|
|
215
216
|
*/
|
|
216
|
-
function eslintUseValue(_) {}
|
|
217
|
+
function eslintUseValue(_) {}
|
|
218
|
+
const runIf = (condition, fn) => params => {
|
|
219
|
+
if (condition) {
|
|
220
|
+
fn(params);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
exports.runIf = runIf;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-data-grid",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.25.0",
|
|
4
4
|
"description": "The Community plan edition of the Data Grid components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"clsx": "^2.1.1",
|
|
43
43
|
"prop-types": "^15.8.1",
|
|
44
44
|
"reselect": "^5.1.1",
|
|
45
|
-
"@mui/x-internals": "7.
|
|
45
|
+
"@mui/x-internals": "7.25.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@emotion/react": "^11.9.0",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function roundToDecimalPlaces(value: number, decimals: number): number;
|
package/utils/utils.d.ts
CHANGED
|
@@ -54,3 +54,4 @@ export declare function deepClone(obj: Record<string, any>): any;
|
|
|
54
54
|
* that hint disables checks on all values instead of just one.
|
|
55
55
|
*/
|
|
56
56
|
export declare function eslintUseValue(_: any): void;
|
|
57
|
+
export declare const runIf: (condition: boolean, fn: Function) => (params: unknown) => void;
|
package/utils/utils.js
CHANGED
|
@@ -196,4 +196,9 @@ export function deepClone(obj) {
|
|
|
196
196
|
* of a `eslint-disable-next-line react-hooks/exhaustive-deps` because
|
|
197
197
|
* that hint disables checks on all values instead of just one.
|
|
198
198
|
*/
|
|
199
|
-
export function eslintUseValue(_) {}
|
|
199
|
+
export function eslintUseValue(_) {}
|
|
200
|
+
export const runIf = (condition, fn) => params => {
|
|
201
|
+
if (condition) {
|
|
202
|
+
fn(params);
|
|
203
|
+
}
|
|
204
|
+
};
|