@aptre/flex-layout 0.4.0 → 0.4.1
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 +31 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1671,7 +1671,15 @@ var TabSetNode = class _TabSetNode extends Node {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
/** @internal */
|
|
1673
1673
|
setContentRect(rect) {
|
|
1674
|
+
const changed = !this.contentRect.equals(rect);
|
|
1674
1675
|
this.contentRect = rect;
|
|
1676
|
+
if (changed && rect.width > 0 && rect.height > 0) {
|
|
1677
|
+
for (const child of this.children) {
|
|
1678
|
+
if (child instanceof TabNode) {
|
|
1679
|
+
child.setRect(rect);
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1675
1683
|
}
|
|
1676
1684
|
/** @internal */
|
|
1677
1685
|
getContentRect() {
|
|
@@ -3177,7 +3185,15 @@ var BorderNode = class _BorderNode extends Node {
|
|
|
3177
3185
|
}
|
|
3178
3186
|
/** @internal */
|
|
3179
3187
|
setContentRect(r) {
|
|
3188
|
+
const changed = !this.contentRect.equals(r);
|
|
3180
3189
|
this.contentRect = r;
|
|
3190
|
+
if (changed && r.width > 0 && r.height > 0) {
|
|
3191
|
+
for (const child of this.children) {
|
|
3192
|
+
if (child instanceof TabNode) {
|
|
3193
|
+
child.setRect(r);
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
}
|
|
3181
3197
|
}
|
|
3182
3198
|
/** @internal */
|
|
3183
3199
|
isEnableDrop() {
|
|
@@ -5922,11 +5938,13 @@ function TabContainer({
|
|
|
5922
5938
|
style: {
|
|
5923
5939
|
position: "absolute",
|
|
5924
5940
|
inset: 0,
|
|
5925
|
-
// CRITICAL:
|
|
5926
|
-
//
|
|
5927
|
-
//
|
|
5928
|
-
|
|
5929
|
-
//
|
|
5941
|
+
// CRITICAL: The container itself always has pointer-events: none
|
|
5942
|
+
// so it doesn't block clicks on elements beneath it (like FlexLayout's tab bar).
|
|
5943
|
+
// Individual tab panels have pointer-events: auto to receive clicks.
|
|
5944
|
+
// During drag, we also disable pointer events on the children to prevent
|
|
5945
|
+
// dragleave events on the Layout element.
|
|
5946
|
+
pointerEvents: "none",
|
|
5947
|
+
// Ensure tab container doesn't block FlexLayout's tab bar interactions
|
|
5930
5948
|
zIndex: 0
|
|
5931
5949
|
},
|
|
5932
5950
|
"data-layout-path": "/tab-container"
|
|
@@ -5934,6 +5952,7 @@ function TabContainer({
|
|
|
5934
5952
|
Array.from(tabs.entries()).map(([nodeId, tabInfo]) => {
|
|
5935
5953
|
const { node, rect, visible } = tabInfo;
|
|
5936
5954
|
const contentClassName = node.getContentClassName();
|
|
5955
|
+
const hasValidDimensions = rect.width > 0 && rect.height > 0;
|
|
5937
5956
|
return /* @__PURE__ */ React20.createElement(
|
|
5938
5957
|
"div",
|
|
5939
5958
|
{
|
|
@@ -5944,11 +5963,13 @@ function TabContainer({
|
|
|
5944
5963
|
style: {
|
|
5945
5964
|
position: "absolute",
|
|
5946
5965
|
display: visible ? "flex" : "none",
|
|
5947
|
-
left: rect.x,
|
|
5948
|
-
top: rect.y,
|
|
5949
|
-
width: rect.width,
|
|
5950
|
-
height: rect.height,
|
|
5951
|
-
overflow: "auto"
|
|
5966
|
+
left: hasValidDimensions ? rect.x : 0,
|
|
5967
|
+
top: hasValidDimensions ? rect.y : 0,
|
|
5968
|
+
width: hasValidDimensions ? rect.width : "100%",
|
|
5969
|
+
height: hasValidDimensions ? rect.height : "100%",
|
|
5970
|
+
overflow: "auto",
|
|
5971
|
+
// Tab panels receive pointer events when visible and not dragging
|
|
5972
|
+
pointerEvents: visible && !isDragging ? "auto" : "none"
|
|
5952
5973
|
}
|
|
5953
5974
|
},
|
|
5954
5975
|
renderTab(node)
|