@aptre/flex-layout 0.1.3 → 0.1.4
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/dist/index.mjs +28 -21
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3153,15 +3153,17 @@ var BorderButton = (props) => {
|
|
|
3153
3153
|
});
|
|
3154
3154
|
const updateRect = () => {
|
|
3155
3155
|
const layoutRect = layout.getDomRect();
|
|
3156
|
-
const r = selfRef.current
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3156
|
+
const r = selfRef.current?.getBoundingClientRect();
|
|
3157
|
+
if (r) {
|
|
3158
|
+
node._setTabRect(
|
|
3159
|
+
new Rect(
|
|
3160
|
+
r.left - layoutRect.left,
|
|
3161
|
+
r.top - layoutRect.top,
|
|
3162
|
+
r.width,
|
|
3163
|
+
r.height
|
|
3164
|
+
)
|
|
3165
|
+
);
|
|
3166
|
+
}
|
|
3165
3167
|
};
|
|
3166
3168
|
const onTextBoxMouseDown = (event) => {
|
|
3167
3169
|
event.stopPropagation();
|
|
@@ -3399,13 +3401,16 @@ var useTabOverflow = (node, orientation, toolbarRef, stickyButtonsRef) => {
|
|
|
3399
3401
|
React5.useLayoutEffect(() => {
|
|
3400
3402
|
updateVisibleTabs();
|
|
3401
3403
|
});
|
|
3404
|
+
const instance = selfRef.current;
|
|
3402
3405
|
React5.useEffect(() => {
|
|
3403
|
-
|
|
3406
|
+
if (!instance) {
|
|
3407
|
+
return;
|
|
3408
|
+
}
|
|
3404
3409
|
instance.addEventListener("wheel", onWheel, { passive: false });
|
|
3405
3410
|
return () => {
|
|
3406
3411
|
instance.removeEventListener("wheel", onWheel);
|
|
3407
3412
|
};
|
|
3408
|
-
}, []);
|
|
3413
|
+
}, [instance]);
|
|
3409
3414
|
const onWheel = (event) => {
|
|
3410
3415
|
event.preventDefault();
|
|
3411
3416
|
};
|
|
@@ -4110,15 +4115,17 @@ var TabButton = (props) => {
|
|
|
4110
4115
|
});
|
|
4111
4116
|
const updateRect = () => {
|
|
4112
4117
|
const layoutRect = layout.getDomRect();
|
|
4113
|
-
const r = selfRef.current
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4118
|
+
const r = selfRef.current?.getBoundingClientRect();
|
|
4119
|
+
if (r) {
|
|
4120
|
+
node._setTabRect(
|
|
4121
|
+
new Rect(
|
|
4122
|
+
r.left - layoutRect.left,
|
|
4123
|
+
r.top - layoutRect.top,
|
|
4124
|
+
r.width,
|
|
4125
|
+
r.height
|
|
4126
|
+
)
|
|
4127
|
+
);
|
|
4128
|
+
}
|
|
4122
4129
|
};
|
|
4123
4130
|
const onTextBoxMouseDown = (event) => {
|
|
4124
4131
|
event.stopPropagation();
|
|
@@ -5838,7 +5845,7 @@ var Layout = class extends React16.Component {
|
|
|
5838
5845
|
/** @internal */
|
|
5839
5846
|
_getScreenRect(node) {
|
|
5840
5847
|
const rect = node.getRect().clone();
|
|
5841
|
-
const bodyRect = this.selfRef.current
|
|
5848
|
+
const bodyRect = this.selfRef.current?.getBoundingClientRect();
|
|
5842
5849
|
if (!bodyRect) {
|
|
5843
5850
|
return null;
|
|
5844
5851
|
}
|