@aptre/flex-layout 0.5.9 → 0.5.10
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 +12 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6009,10 +6009,11 @@ var TabPanel = memo2(function TabPanel2({
|
|
|
6009
6009
|
element.removeEventListener("pointerdown", onPointerDown, true);
|
|
6010
6010
|
};
|
|
6011
6011
|
}, [node, model, nodeId]);
|
|
6012
|
-
|
|
6012
|
+
const isSelected = visible || node.isSelected();
|
|
6013
|
+
let isHidden = !isSelected;
|
|
6013
6014
|
let zIndex;
|
|
6014
6015
|
if (hasMaximizedTabset) {
|
|
6015
|
-
if (isMaximized &&
|
|
6016
|
+
if (isMaximized && isSelected) {
|
|
6016
6017
|
zIndex = 11;
|
|
6017
6018
|
isHidden = false;
|
|
6018
6019
|
} else {
|
|
@@ -6047,12 +6048,15 @@ function TabContainer({
|
|
|
6047
6048
|
renderTab,
|
|
6048
6049
|
isDragging,
|
|
6049
6050
|
classNameMapper,
|
|
6050
|
-
model
|
|
6051
|
+
model,
|
|
6052
|
+
maximizedTabsetId
|
|
6051
6053
|
}) {
|
|
6054
|
+
void maximizedTabsetId;
|
|
6052
6055
|
const className = classNameMapper ? classNameMapper("flexlayout__tab") : "flexlayout__tab";
|
|
6053
6056
|
const maximizedTabset = model.getMaximizedTabset(Model.MAIN_WINDOW_ID);
|
|
6054
6057
|
const hasMaximizedTabset = maximizedTabset !== void 0;
|
|
6055
|
-
|
|
6058
|
+
const containerStyle = hasMaximizedTabset ? { zIndex: 10 } : {};
|
|
6059
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "flexlayout__optimized_layout_tab_container", "data-layout-path": "/tab-container", style: containerStyle }, Array.from(tabs.entries()).map(([nodeId, tabInfo]) => {
|
|
6056
6060
|
const parent = tabInfo.node.getParent();
|
|
6057
6061
|
const isMaximized = parent instanceof TabSetNode && parent.isMaximized();
|
|
6058
6062
|
return /* @__PURE__ */ React20.createElement(
|
|
@@ -6077,6 +6081,7 @@ function TabContainer({
|
|
|
6077
6081
|
function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange, onModelChange: userOnModelChange, ...layoutProps }) {
|
|
6078
6082
|
const [isDragging, setIsDragging] = useState4(false);
|
|
6079
6083
|
const [tabs, setTabs] = useState4(() => /* @__PURE__ */ new Map());
|
|
6084
|
+
const [maximizedTabsetId, setMaximizedTabsetId] = useState4(() => model.getMaximizedTabset(Model.MAIN_WINDOW_ID)?.getId());
|
|
6080
6085
|
const syncTabsWithModel = useCallback(
|
|
6081
6086
|
(prevTabs) => {
|
|
6082
6087
|
const modelTabNodes = /* @__PURE__ */ new Map();
|
|
@@ -6152,6 +6157,8 @@ function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange,
|
|
|
6152
6157
|
);
|
|
6153
6158
|
const handleModelChange = useCallback(
|
|
6154
6159
|
(changedModel, action) => {
|
|
6160
|
+
const newMaximizedId = changedModel.getMaximizedTabset(Model.MAIN_WINDOW_ID)?.getId();
|
|
6161
|
+
setMaximizedTabsetId(newMaximizedId);
|
|
6155
6162
|
setTabs((prevTabs) => {
|
|
6156
6163
|
const synced = syncTabsWithModel(prevTabs);
|
|
6157
6164
|
let hasVisibilityChange = false;
|
|
@@ -6177,7 +6184,7 @@ function OptimizedLayout({ model, renderTab, classNameMapper, onDragStateChange,
|
|
|
6177
6184
|
},
|
|
6178
6185
|
[handleTabMount, handleRectChange, handleVisibilityChange]
|
|
6179
6186
|
);
|
|
6180
|
-
return /* @__PURE__ */ React20.createElement("div", { className: "flexlayout__optimized_layout" }, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, onModelChange: handleModelChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs, renderTab, isDragging, classNameMapper, model }));
|
|
6187
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "flexlayout__optimized_layout" }, /* @__PURE__ */ React20.createElement(Layout, { model, factory, classNameMapper, onDragStateChange: handleDragStateChange, onModelChange: handleModelChange, ...layoutProps }), /* @__PURE__ */ React20.createElement(TabContainer, { tabs, renderTab, isDragging, classNameMapper, model, maximizedTabsetId }));
|
|
6181
6188
|
}
|
|
6182
6189
|
|
|
6183
6190
|
// src/model/walk.ts
|