import React__default, { useRef, useState } from 'react';
import 'antd';
import Title from '../Title/index.js';
import IconFont from '../IconFont/index.js';
import '../BetweenBox/index.js';
import '../_rollupPluginBabelHelpers-736b301a.js';
import '@zenview/micro-utils';

// showMore 显示更多 收起时只展示3行
const FormCollapsedLayout = ({
  className = '',
  icon,
  title,
  children,
  titleExt,
  visibleCollapsed
}) => {
  const domRef = useRef(null);
  const [isCollapsed, setIsCollapsed] = useState(visibleCollapsed);
  return /*#__PURE__*/React__default.createElement("div", {
    className: `lm-form-collapsed-layout ${className}`,
    ref: domRef
  }, title && /*#__PURE__*/React__default.createElement(Title, {
    icon: icon,
    title: title
  }, titleExt), /*#__PURE__*/React__default.cloneElement(children, {
    isCollapsed
  }), visibleCollapsed && /*#__PURE__*/React__default.createElement("div", {
    className: "toggle-btn-box",
    onClick: () => setIsCollapsed(!isCollapsed)
  }, /*#__PURE__*/React__default.createElement("a", {
    type: "link",
    className: "toggle-btn"
  }, /*#__PURE__*/React__default.createElement(IconFont, {
    type: 'icon-M_Bar_Plus'
  }), isCollapsed ? '展开' : '收起')));
};

export { FormCollapsedLayout as default };
//# sourceMappingURL=index.js.map
