@aptre/flex-layout 0.4.1 → 0.4.3
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 +6 -3
- 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
|
}
|
|
@@ -6044,7 +6047,7 @@ function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange,
|
|
|
6044
6047
|
[handleRectChange, handleVisibilityChange]
|
|
6045
6048
|
);
|
|
6046
6049
|
const tabsForContainer = useMemo(() => tabs, [tabs]);
|
|
6047
|
-
return /* @__PURE__ */ React20.createElement(
|
|
6050
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs: tabsForContainer, renderTab, isDragging, classNameMapper }));
|
|
6048
6051
|
}
|
|
6049
6052
|
|
|
6050
6053
|
// src/model/walk.ts
|
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";
|