@itwin/itwinui-react 2.4.1 → 2.4.2
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
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
28
|
+
var _a;
|
|
5
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
30
|
exports.useVirtualization = exports.VirtualScroll = void 0;
|
|
7
31
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -9,7 +33,9 @@ exports.useVirtualization = exports.VirtualScroll = void 0;
|
|
|
9
33
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
10
34
|
*--------------------------------------------------------------------------------------------*/
|
|
11
35
|
const react_1 = __importDefault(require("react"));
|
|
36
|
+
const ReactDOM = __importStar(require("react-dom"));
|
|
12
37
|
const hooks_1 = require("../hooks");
|
|
38
|
+
const unstable_batchedUpdates = (_a = ReactDOM.unstable_batchedUpdates) !== null && _a !== void 0 ? _a : ((cb) => void cb());
|
|
13
39
|
const getScrollableParent = (element, ownerDocument = document) => {
|
|
14
40
|
if (!element || element === ownerDocument.body) {
|
|
15
41
|
return ownerDocument.body;
|
|
@@ -145,8 +171,10 @@ const useVirtualization = (props) => {
|
|
|
145
171
|
if (height > 0) {
|
|
146
172
|
setIsMounted(true);
|
|
147
173
|
}
|
|
148
|
-
|
|
149
|
-
|
|
174
|
+
unstable_batchedUpdates(() => {
|
|
175
|
+
setScrollContainerHeight(height);
|
|
176
|
+
updateChildHeight();
|
|
177
|
+
});
|
|
150
178
|
}, [updateChildHeight]);
|
|
151
179
|
const [resizeRef, resizeObserver] = (0, hooks_1.useResizeObserver)(onResize);
|
|
152
180
|
// Find scrollable parent
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
var _a;
|
|
1
2
|
/*---------------------------------------------------------------------------------------------
|
|
2
3
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
4
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
5
|
*--------------------------------------------------------------------------------------------*/
|
|
5
6
|
import React from 'react';
|
|
7
|
+
import * as ReactDOM from 'react-dom';
|
|
6
8
|
import { mergeRefs, useResizeObserver, useIsomorphicLayoutEffect, } from '../hooks';
|
|
9
|
+
const unstable_batchedUpdates = (_a = ReactDOM.unstable_batchedUpdates) !== null && _a !== void 0 ? _a : ((cb) => void cb());
|
|
7
10
|
const getScrollableParent = (element, ownerDocument = document) => {
|
|
8
11
|
if (!element || element === ownerDocument.body) {
|
|
9
12
|
return ownerDocument.body;
|
|
@@ -139,8 +142,10 @@ export const useVirtualization = (props) => {
|
|
|
139
142
|
if (height > 0) {
|
|
140
143
|
setIsMounted(true);
|
|
141
144
|
}
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
unstable_batchedUpdates(() => {
|
|
146
|
+
setScrollContainerHeight(height);
|
|
147
|
+
updateChildHeight();
|
|
148
|
+
});
|
|
144
149
|
}, [updateChildHeight]);
|
|
145
150
|
const [resizeRef, resizeObserver] = useResizeObserver(onResize);
|
|
146
151
|
// Find scrollable parent
|