react-resizable-panels 0.0.49 → 0.0.50
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/CHANGELOG.md +3 -0
- package/dist/react-resizable-panels.cjs.js +4 -2
- package/dist/react-resizable-panels.development.cjs.js +4 -2
- package/dist/react-resizable-panels.development.esm.js +4 -2
- package/dist/react-resizable-panels.esm.js +4 -2
- package/package.json +1 -1
- package/src/PanelGroup.ts +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -951,10 +951,12 @@ function PanelGroupWithForwardedRef({
|
|
|
951
951
|
totalDefaultSize += panel.current.defaultSize;
|
|
952
952
|
}
|
|
953
953
|
});
|
|
954
|
-
if (totalDefaultSize > 100
|
|
954
|
+
if (totalDefaultSize > 100) {
|
|
955
|
+
throw new Error(`Default panel sizes cannot exceed 100%`);
|
|
956
|
+
} else if (panelsArray.length > 1 && panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100) {
|
|
955
957
|
throw new Error(`Invalid default sizes specified for panels`);
|
|
956
958
|
} else if (totalMinSize > 100) {
|
|
957
|
-
throw new Error(`
|
|
959
|
+
throw new Error(`Minimum panel sizes cannot exceed 100%`);
|
|
958
960
|
}
|
|
959
961
|
setSizes(panelsArray.map(panel => {
|
|
960
962
|
if (panel.current.defaultSize === null) {
|
|
@@ -958,10 +958,12 @@ function PanelGroupWithForwardedRef({
|
|
|
958
958
|
totalDefaultSize += panel.current.defaultSize;
|
|
959
959
|
}
|
|
960
960
|
});
|
|
961
|
-
if (totalDefaultSize > 100
|
|
961
|
+
if (totalDefaultSize > 100) {
|
|
962
|
+
throw new Error(`Default panel sizes cannot exceed 100%`);
|
|
963
|
+
} else if (panelsArray.length > 1 && panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100) {
|
|
962
964
|
throw new Error(`Invalid default sizes specified for panels`);
|
|
963
965
|
} else if (totalMinSize > 100) {
|
|
964
|
-
throw new Error(`
|
|
966
|
+
throw new Error(`Minimum panel sizes cannot exceed 100%`);
|
|
965
967
|
}
|
|
966
968
|
setSizes(panelsArray.map(panel => {
|
|
967
969
|
if (panel.current.defaultSize === null) {
|
|
@@ -934,10 +934,12 @@ function PanelGroupWithForwardedRef({
|
|
|
934
934
|
totalDefaultSize += panel.current.defaultSize;
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
|
-
if (totalDefaultSize > 100
|
|
937
|
+
if (totalDefaultSize > 100) {
|
|
938
|
+
throw new Error(`Default panel sizes cannot exceed 100%`);
|
|
939
|
+
} else if (panelsArray.length > 1 && panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100) {
|
|
938
940
|
throw new Error(`Invalid default sizes specified for panels`);
|
|
939
941
|
} else if (totalMinSize > 100) {
|
|
940
|
-
throw new Error(`
|
|
942
|
+
throw new Error(`Minimum panel sizes cannot exceed 100%`);
|
|
941
943
|
}
|
|
942
944
|
setSizes(panelsArray.map(panel => {
|
|
943
945
|
if (panel.current.defaultSize === null) {
|
|
@@ -927,10 +927,12 @@ function PanelGroupWithForwardedRef({
|
|
|
927
927
|
totalDefaultSize += panel.current.defaultSize;
|
|
928
928
|
}
|
|
929
929
|
});
|
|
930
|
-
if (totalDefaultSize > 100
|
|
930
|
+
if (totalDefaultSize > 100) {
|
|
931
|
+
throw new Error(`Default panel sizes cannot exceed 100%`);
|
|
932
|
+
} else if (panelsArray.length > 1 && panelsWithNullDefaultSize === 0 && totalDefaultSize !== 100) {
|
|
931
933
|
throw new Error(`Invalid default sizes specified for panels`);
|
|
932
934
|
} else if (totalMinSize > 100) {
|
|
933
|
-
throw new Error(`
|
|
935
|
+
throw new Error(`Minimum panel sizes cannot exceed 100%`);
|
|
934
936
|
}
|
|
935
937
|
setSizes(panelsArray.map(panel => {
|
|
936
938
|
if (panel.current.defaultSize === null) {
|
package/package.json
CHANGED
package/src/PanelGroup.ts
CHANGED
|
@@ -292,13 +292,16 @@ function PanelGroupWithForwardedRef({
|
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
294
|
|
|
295
|
-
if (
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
if (totalDefaultSize > 100) {
|
|
296
|
+
throw new Error(`Default panel sizes cannot exceed 100%`);
|
|
297
|
+
} else if (
|
|
298
|
+
panelsArray.length > 1 &&
|
|
299
|
+
panelsWithNullDefaultSize === 0 &&
|
|
300
|
+
totalDefaultSize !== 100
|
|
298
301
|
) {
|
|
299
302
|
throw new Error(`Invalid default sizes specified for panels`);
|
|
300
303
|
} else if (totalMinSize > 100) {
|
|
301
|
-
throw new Error(`
|
|
304
|
+
throw new Error(`Minimum panel sizes cannot exceed 100%`);
|
|
302
305
|
}
|
|
303
306
|
|
|
304
307
|
setSizes(
|