@aptre/flex-layout 0.4.1 → 0.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/dist/index.mjs +5 -2
- package/dist/test/setup.d.ts +1 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4515,9 +4515,12 @@ var TabSet = (props) => {
|
|
|
4515
4515
|
node.setTabStripRect(layout.getBoundingClientRect(tabStripRef.current));
|
|
4516
4516
|
}
|
|
4517
4517
|
const newContentRect = Rect.getContentRect(contentRef.current).relativeTo(layout.getDomRect());
|
|
4518
|
-
|
|
4518
|
+
const oldContentRect = node.getContentRect();
|
|
4519
|
+
if (!oldContentRect.equals(newContentRect)) {
|
|
4519
4520
|
node.setContentRect(newContentRect);
|
|
4520
|
-
|
|
4521
|
+
const oldWasEmpty = oldContentRect.width === 0 && oldContentRect.height === 0;
|
|
4522
|
+
const shouldRedraw = !isFirstRender.current || oldWasEmpty;
|
|
4523
|
+
if (shouldRedraw) {
|
|
4521
4524
|
layout.redrawInternal("tabset content rect " + newContentRect);
|
|
4522
4525
|
}
|
|
4523
4526
|
}
|
package/dist/test/setup.d.ts
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
getItem: (key: string) => string;
|
|
3
|
-
setItem: (key: string, value: string) => void;
|
|
4
|
-
removeItem: (key: string) => void;
|
|
5
|
-
clear: () => void;
|
|
6
|
-
readonly length: number;
|
|
7
|
-
key: (index: number) => string;
|
|
8
|
-
};
|
|
1
|
+
import "../../style/light.css";
|