@dtjoy/dt-design 1.0.8 → 1.0.9

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.
@@ -45,6 +45,10 @@ export interface IBlockHeaderProps {
45
45
  onExpand?: (expand: boolean) => void;
46
46
  /** 标题的样式 */
47
47
  titleStyle?: React.CSSProperties;
48
+ /** 是否保留 DOM 结构, 默认 false */
49
+ keepDOM?: boolean;
50
+ /** 是否懒加载, 默认 false */
51
+ lazy?: boolean;
48
52
  }
49
53
  declare const BlockHeader: React.FC<IBlockHeaderProps>;
50
54
  export default BlockHeader;
@@ -54,7 +54,9 @@ var BlockHeader = function BlockHeader(props) {
54
54
  className: "addon-before--default"
55
55
  }) : _props$addonBefore,
56
56
  onExpand = props.onExpand,
57
- titleStyle = props.titleStyle;
57
+ titleStyle = props.titleStyle,
58
+ keepDOM = props.keepDOM,
59
+ lazy = props.lazy;
58
60
  var _useState = useState(defaultExpand),
59
61
  _useState2 = _slicedToArray(_useState, 2),
60
62
  internalExpand = _useState2[0],
@@ -109,7 +111,9 @@ var BlockHeader = function BlockHeader(props) {
109
111
  'collapse__icon--down': !currentExpand
110
112
  })
111
113
  }))), /*#__PURE__*/React.createElement(Collapsible, {
112
- isOpen: !currentExpand
114
+ isOpen: !currentExpand,
115
+ keepDOM: keepDOM,
116
+ lazyRender: lazy
113
117
  }, /*#__PURE__*/React.createElement("div", {
114
118
  className: clsx("".concat(prefixCls, "__content"), contentClassName, _defineProperty({}, "".concat(prefixCls, "__content--active"), currentExpand || !showCollapse)),
115
119
  style: contentStyle
@@ -45,6 +45,10 @@ export interface IBlockHeaderProps {
45
45
  onExpand?: (expand: boolean) => void;
46
46
  /** 标题的样式 */
47
47
  titleStyle?: React.CSSProperties;
48
+ /** 是否保留 DOM 结构, 默认 false */
49
+ keepDOM?: boolean;
50
+ /** 是否懒加载, 默认 false */
51
+ lazy?: boolean;
48
52
  }
49
53
  declare const BlockHeader: React.FC<IBlockHeaderProps>;
50
54
  export default BlockHeader;
@@ -42,7 +42,9 @@ const BlockHeader = props => {
42
42
  className: "addon-before--default"
43
43
  }),
44
44
  onExpand,
45
- titleStyle
45
+ titleStyle,
46
+ keepDOM,
47
+ lazy
46
48
  } = props;
47
49
  const [internalExpand, setInternalExpand] = (0, _react.useState)(defaultExpand);
48
50
  const currentExpand = isControlled(props) ? expand : internalExpand;
@@ -99,7 +101,9 @@ const BlockHeader = props => {
99
101
  'collapse__icon--down': !currentExpand
100
102
  })
101
103
  }))), /*#__PURE__*/_react.default.createElement(_collapsible.default, {
102
- isOpen: !currentExpand
104
+ isOpen: !currentExpand,
105
+ keepDOM: keepDOM,
106
+ lazyRender: lazy
103
107
  }, /*#__PURE__*/_react.default.createElement("div", {
104
108
  className: (0, _clsx.default)(`${prefixCls}__content`, contentClassName, {
105
109
  [`${prefixCls}__content--active`]: currentExpand || !showCollapse
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dtjoy/dt-design",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "react-component",
5
5
  "author": {
6
6
  "name": "夕颜",