@huibo-ui/react-antd 1.0.12 → 1.0.13

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.
@@ -32,12 +32,17 @@ Layout.Sider = function Sider({ children, style, className, collapsed, theme, wi
32
32
  /**
33
33
  * Content —— 主内容区。flex:1 撑满剩余空间。
34
34
  *
35
- * 对齐 antd .ant-layout-content(flex: auto + min-height: 0):
36
- * 当消费方传入 height:'auto'(常见脆弱写法)时,flex 容器仍会基于剩余
37
- * 空间分配高度,避免子元素 height:100% 因父级塌缩而失效(如全屏背景图)。
35
+ * 对齐 antd .ant-layout-content(flex: auto + min-height: 0)。
36
+ *
37
+ * 过滤消费方传入的 height:'auto':这是常见脆弱写法,会让 flex item 的
38
+ * height 指定值变成 auto,导致子元素 height:100% 解析失败(如全屏背景图
39
+ * 容器)。去掉它让 flex 算法自然分配高度,子元素 height:100% 才能生效。
38
40
  */
39
41
  Layout.Content = function Content({ children, style, className }) {
40
- return (_jsx("div", { style: { flex: '1 1 auto', minWidth: 0, minHeight: 0, ...style }, className: className, children: children }));
42
+ const { height, ...restStyle } = style || {};
43
+ // 仅过滤无效的 height:'auto';显式数值/百分比仍保留
44
+ const filteredStyle = height === 'auto' ? restStyle : style;
45
+ return (_jsx("div", { style: { flex: '1 1 auto', minWidth: 0, minHeight: 0, ...filteredStyle }, className: className, children: children }));
41
46
  };
42
47
  /**
43
48
  * Footer —— 页脚。固定高度。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huibo-ui/react-antd",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "antd 兼容层 — 接收 antd 原生 props,内部转换为 huibo-ui,实现丝滑平替",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",