Comparing version 3.0.1 to 3.0.2
# History | ||
---- | ||
## 3.0.2 / 2021-02-06 | ||
- fix serialization of popup window | ||
## 3.0.0 / 2020-12-05 | ||
@@ -5,0 +8,0 @@ - switch to rc-tabs 11.x, internal component structure changed |
@@ -600,19 +600,19 @@ "use strict"; | ||
} | ||
if (!('floatbox' in layout)) { | ||
layout.floatbox = { mode: 'float', children: [], size: 1 }; | ||
if (layout.floatbox) { | ||
layout.floatbox.mode = 'float'; | ||
} | ||
else { | ||
layout.floatbox.mode = 'float'; | ||
layout.floatbox = { mode: 'float', children: [], size: 1 }; | ||
} | ||
if (!('windowbox' in layout)) { | ||
layout.windowbox = { mode: 'window', children: [], size: 1 }; | ||
if (layout.windowbox) { | ||
layout.windowbox.mode = 'window'; | ||
} | ||
else { | ||
layout.windowbox.mode = 'window'; | ||
layout.windowbox = { mode: 'window', children: [], size: 1 }; | ||
} | ||
if (!('maxbox' in layout)) { | ||
layout.maxbox = { mode: 'maximize', children: [], size: 1 }; | ||
if (layout.maxbox) { | ||
layout.maxbox.mode = 'maximize'; | ||
} | ||
else { | ||
layout.maxbox.mode = 'maximize'; | ||
layout.maxbox = { mode: 'maximize', children: [], size: 1 }; | ||
} | ||
@@ -619,0 +619,0 @@ fixBoxData(layout.dockbox); |
@@ -61,3 +61,3 @@ "use strict"; | ||
let savedPanel; | ||
if (panelData.parent.mode === 'float') { | ||
if (panelData.parent.mode === 'float' || panelData.parent.mode === 'window') { | ||
let { x, y, z, w, h } = panelData; | ||
@@ -90,2 +90,3 @@ savedPanel = { id, size, tabs, activeId, x, y, z, w, h }; | ||
floatbox: saveBoxData(layout.floatbox), | ||
windowbox: saveBoxData(layout.windowbox), | ||
maxbox: saveBoxData(layout.maxbox), | ||
@@ -141,2 +142,5 @@ }; | ||
function loadBoxData(savedBox) { | ||
if (!savedBox) { | ||
return null; | ||
} | ||
let children = []; | ||
@@ -157,2 +161,3 @@ for (let child of savedBox.children) { | ||
floatbox: loadBoxData(savedLayout.floatbox), | ||
windowbox: loadBoxData(savedLayout.windowbox), | ||
maxbox: loadBoxData(savedLayout.maxbox), | ||
@@ -159,0 +164,0 @@ }; |
{ | ||
"name": "rc-dock", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "dock layout for react component", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -624,18 +624,18 @@ import { | ||
if (!('floatbox' in layout)) { | ||
if (layout.floatbox) { | ||
layout.floatbox.mode = 'float'; | ||
} else { | ||
layout.floatbox = {mode: 'float', children: [], size: 1}; | ||
} else { | ||
layout.floatbox.mode = 'float'; | ||
} | ||
if (!('windowbox' in layout)) { | ||
if (layout.windowbox) { | ||
layout.windowbox.mode = 'window'; | ||
} else { | ||
layout.windowbox = {mode: 'window', children: [], size: 1}; | ||
} else { | ||
layout.windowbox.mode = 'window'; | ||
} | ||
if (!('maxbox' in layout)) { | ||
if (layout.maxbox) { | ||
layout.maxbox.mode = 'maximize'; | ||
} else { | ||
layout.maxbox = {mode: 'maximize', children: [], size: 1}; | ||
} else { | ||
layout.maxbox.mode = 'maximize'; | ||
} | ||
@@ -642,0 +642,0 @@ |
@@ -80,3 +80,3 @@ import { | ||
let savedPanel: PanelBase; | ||
if (panelData.parent.mode === 'float') { | ||
if (panelData.parent.mode === 'float' || panelData.parent.mode === 'window') { | ||
let {x, y, z, w, h} = panelData; | ||
@@ -109,2 +109,3 @@ savedPanel = {id, size, tabs, activeId, x, y, z, w, h}; | ||
floatbox: saveBoxData(layout.floatbox), | ||
windowbox: saveBoxData(layout.windowbox), | ||
maxbox: saveBoxData(layout.maxbox), | ||
@@ -167,2 +168,5 @@ }; | ||
function loadBoxData(savedBox: BoxBase): BoxData { | ||
if (!savedBox) { | ||
return null; | ||
} | ||
let children: (BoxData | PanelData)[] = []; | ||
@@ -183,4 +187,5 @@ for (let child of savedBox.children) { | ||
floatbox: loadBoxData(savedLayout.floatbox), | ||
windowbox: loadBoxData(savedLayout.windowbox), | ||
maxbox: loadBoxData(savedLayout.maxbox), | ||
}; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
342649
80
9186